GV9531---CK810 移植过程

1:项目需求

GV9531 有两颗CPU 分别是CK810CK860,异构CPU启动时必须有一个Core作为Master ,一个作为Slave。用Master 启动Slave才能完成整个芯片的启动。

2:初识Image

Linux Image作为Kernel编译出来的第二级镜像(第一级镜像为vmLinux 文件),Image 镜像是Kernel文件 Binary file.在外网上查到这么一句话:Image: The generic Linux kernel binary image file.其加载地址与链接地址应该相同,因为Image是二进制文件,CPU可以直接执行的文件,所以加载地址应该核链接地址相同,PC 指针直接跳转到加载地址直接执行。此文件由编译器的Objdump工具产生,本质上此文件包含符号表,删除无用信息之后的重定向信息二进制数。
参考资料: https://programmersought.com/article/54203146457/#kernel_Image_24

3:Master加载Slave

CK810 SlaveCK860 Master 共用BootroomuBootBootrom加载uBoot,然后开始运行uBootuBoot从存储介质(如SD卡或者Flash) 加载CK860CK810的镜像,最后设置CK810PC 运行的地址开始run
polaris.h 文件定义了uBoot的配置信息,包括**CK810** 的Image的存放地址,DTB的存放地址。CONFIG_BOOTCOMMAND 配置信息如下:

#define CONFIG_BOOTCOMMAND \
    "mmc rescan;" \
    "if mmc dev ${sddev}; then " \
        "if test ${boot_810} = yes || test ${boot_810} = try; then " \
            "if run sd_load810img; then " \
                "run sd_load810fdt; " \
            "fi; " \
        "else " \
            "echo no csky 810 boot; " \
        "fi;" \
        "if run sd0_loadimg; then " \
            "run sd0boot; " \
        "fi; " \
    "elif mmc dev ${emmcdev}; then " \
        "echo Booting from eMMC ...; " \
        "mmc read ${dtb_load_addr_phys} ${dtb_start_sector} ${dtb_size_sectors} ; " \
        "mmc read ${linux_load_addr_phys} ${linux_start_sector} ${linux_size_sectors} ; " \
        "bootm ${linux_load_addr_virt} - ${dtb_load_addr_virt}; \n" \
    "elif nand info; then " \
        "if run nand_loadimg; then " \
             "run nandboot; " \
        "fi; " \
    "else echo No available boot device ...; fi"

环境变量初始化宏CONFIG_EXTRA_ENV_SETTINGS定义如下:

/* Initial environment variables */
#define CONFIG_EXTRA_ENV_SETTINGS   \
    "kernel_img=uImage\0"    \
    "dtb_start_sector=0x1000\0"   /* DTB start sector in eMMC -> 2MB */ \
    "dtb_size_sectors=0x400\0"    /* DTB size in sectors in eMMC -> 512K */ \
    "linux_start_sector=0x2000\0" /* Linux start sector in eMMC-> 4MB */  \
    "linux_size_sectors=0xA000\0" /* Linux size in sectors in eMMC -> 20MB */ \
    "linux_load_addr_phys=0x10000000\0" \
    "linux_load_addr_virt=0x90000000\0"  \
    "fdt_file=boya_ck860.dtb\0" \
    "dtb_load_addr_phys=0x05000000\0"  \
    "dtb_load_addr_virt=0x85000000\0" \
    "dtb_load_addr_phys_810=0x25000000\0" \
    "linux_load_addr_phys_810=0x20000000\0" \
    "boot_810=try\0" \
    "boot_fdt=try\0" \
    "sddev=0\0" \
    "sdpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
    "mmcautodetect=yes\0" \
    "mtdparts=" MTDPARTS_DEFAULT "\0" \
    "nand_loadimg=nand read ${linux_load_addr_virt} kernel 0xf00000\0" \
    "nand_loadfdt=nand read ${dtb_load_addr_virt} dtb 0x8000\0" \
    "sd0_loadimg=fatload mmc 0:${sdpart} ${linux_load_addr_phys} ${kernel_img}\0" \
    "sd0_loadfdt=fatload mmc 0:${sdpart} ${dtb_load_addr_phys} ${fdt_file}\0" \
    "sd1_loadimg=fatload mmc 1:${sdpart} ${linux_load_addr_phys} ${kernel_img}\0" \
    "sd1_loadfdt=fatload mmc 1:${sdpart} ${dtb_load_addr_phys} ${fdt_file}\0" \
    "sf_loadimg=sf read 0x10000000 0xa0000 0xf60000\0" \
    "sf_loadfdt=sf read 0x05000000 0x60000 0x40000\0" \
    "sd_load810img=fatload mmc ${sddev}:${sdpart} ${linux_load_addr_phys_810} gv9531_CK810_Image\0" \
    "sd_load810fdt=fatload mmc ${sddev}:${sdpart} ${dtb_load_addr_phys_810} gv9531_CK810.dtb\0" \
    "sd0boot=echo Booting from SD0 ...; " \
        "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
            "if run sd0_loadfdt; then " \
                "bootm ${linux_load_addr_virt} - ${dtb_load_addr_virt}; \n" \
            "else " \
                "echo WARN: Cannot load the DTB; " \
            "fi; " \
        "else " \
            "echo wait for boot; " \
        "fi;\0" \
    "sd1boot=echo Booting from SD1 ...; " \
        "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
            "if run sd1_loadfdt; then " \
                "bootm ${linux_load_addr_virt} - ${dtb_load_addr_virt}; \n" \
            "else " \
                "echo WARN: Cannot load the DTB; " \
            "fi; " \
        "else " \
            "echo wait for boot; " \
        "fi;\0" \
    "sfboot=echo Booting from SPI Nor by boya ...; " \
            "if run sf_loadfdt; then " \
                "bootm 0x90000000; \n" \
            "else " \
                "echo WARN: Cannot load the DTB; " \
            "fi;\0" \
    "nandboot=echo Booting from SPI NAND ...; " \
        "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
            "if run nand_loadfdt; then " \
                "bootm ${linux_load_addr_virt} - ${dtb_load_addr_virt}; \n" \
            "else " \
                "echo WARN: Cannot load the DTB; " \
            "fi; " \
        "else " \
            "echo wait for boot; " \
        "fi;\0" \

从配置文件看出来CK810 ImageDTB分别被uBoot加载到了物理地址:0x200000000x25000000的地方;配置项如下:

    "dtb_load_addr_phys_810=0x25000000\0" \
    "linux_load_addr_phys_810=0x20000000\0" \

这个加载地址必须与Linux Kernel的配置DRAM Start address 相同,否则会有问题;

image.png

因为加载的是Image 所以加载的地址和运行地址必须一样,目前Image没有压缩比较大,以后要经过压缩后的文件,比较小点。

  • 疑惑点:
    为什么这个配置地址是物理地址而不是虚拟地址,理论上CPU MMU开启之后这个地址应该是虚拟地址,这边配置成物理地址竟然可以正常搬运,比较奇怪,后面研究。

4:Image---head.S 文件的更改

由于CK810CK860是两个不同的CPU,两者无法相互配置,所以配置CK810 CPU的任务需要CK810 Kernel自行配置,故需要更改CK810 head.S 文件完成CK810 CPU的配置,具体配置项有:

  • 配置MMU

  • 配置Cache

  • 配置Prefetch

  • 配置Kernel DTB entry

更改后的对比如下图所示:

image.png

这段代码必须要加否则CPU无法得到正确的配置,不会工作在正常的模式下。

5:曲折的过程

以上所有的配置完成之后,uBoot启动CK810CK860Mirro Image但是只有一个核能正常启动,另外一个核启动到一半就挂死,如果uBoot单独启动CK810 或者CK860 是没有任何问题的。 启动Log 信息如下:

[11-02-14:10:29][ 0.000000] Linux version 4.9.56 (yanyh@hwlnx01) (gcc version 6.3.0 (Buildroot 2019.08-git-g9028bb4-dirty) ) #12 Mon Nov 2 13:59:40 CST 2020
[11-02-14:10:29][ 0.000000] Phys. mem: 512MB
[11-02-14:10:29][ 0.000000] On node 0 totalpages: 131072
[11-02-14:10:29][ 0.000000] free_area_init_node: node 0, pgdat 8151e7f0, node_mem_map 9fc00000
[11-02-14:10:29][ 0.000000] Normal zone: 1024 pages used for memmap
[11-02-14:10:29][ 0.000000] Normal zone: 0 pages reserved

[11-02-14:10:29][ 0.000000] Normal zone: 131072 pages, LIFO batch:31
[11-02-14:10:29][ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[11-02-14:10:29][ 0.000000] pcpu-alloc: [0] 0
[11-02-14:10:29][ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[11-02-14:10:29][ 0.000000] Kernel command line: console=ttyS0,115200 rdinit=/sbin/init root=/dev/ram0
[11-02-14:10:29][ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[11-02-14:10:29][ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[11-02-14:10:29][ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[11-02-14:10:29][ 0.000000] Sorting __ex_table...
[11-02-14:10:29][ 0.000000] initrd not found or empty
[11-02-14:10:29][ 0.000000] - disabling initrd
[11-02-14:10:29][ 0.000000] Memory: 497820K/524288K available (19308K kernel code, 203K rwdata, 1984K rodata, 14304K init, 287K bss, 26468K reserved, 0K cma-reserved, 0K highmem)
[11-02-14:10:29][ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[11-02-14:10:29][ 0.000000] NR_IRQS:128
[11-02-14:10:29][ 0.000000] sched_clock: 32 bits at 250 Hz, resolution 4000000ns, wraps every 8589934590000000ns
[11-02-14:10:29][ 0.000000] Console: colour dummy device 80x25
[11-02-14:10:29][ 0.024000] Calibrating delay loop... 505.34 BogoMIPS (lpj=1010688)
[11-02-14:10:29][ 0.028000] pid_max: default: 32768 minimum: 301
[11-02-14:10:29][ 0.028000] Security Framework initialized
[11-02-14:10:29][ 0.028000] Yama: becoming mindful.
[11-02-14:10:29][ 0.028000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[11-02-14:10:29][ 0.028000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[11-02-14:10:29][ 0.028000] ASID allocator initialised with 256 entries
[11-02-14:10:29][ 0.028000] devtmpfs: initialized
[11-02-14:10:29][ 0.032000] evm: security.ima
[11-02-14:10:29][ 0.032000] evm: security.capability
[11-02-14:10:29][ 0.032000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[11-02-14:10:29][ 0.032000] futex hash table entries: 256 (order: -1, 3072 bytes)
[11-02-14:10:29][ 0.032000] NET: Registered protocol family 16
[11-02-14:10:29][ 0.032000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[11-02-14:10:29][ 0.032000] DMA: vaddr: 0xc000e000 phy: 0x3f480000,
[11-02-14:10:29][ 0.044000] vgaarb: loaded
[11-02-14:10:29][ 0.044000] SCSI subsystem initialized
[11-02-14:10:29][ 0.044000] usbcore: registered new interface driver usbfs
[11-02-14:10:29][ 0.044000] usbcore: registered new interface driver hub
[11-02-14:10:29][ 0.044000] usbcore: registered new device driver usb
[11-02-14:10:29][ 0.044000] Linux video capture interface: v2.00
[11-02-14:10:29][ 0.044000] pps_core: LinuxPPS API ver. 1 registered
[11-02-14:10:29][ 0.044000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[11-02-14:10:29][ 0.044000] PTP clock support registered
[11-02-14:10:29][ 0.048000] VFS: Disk quotas dquot_6.6.0
[11-02-14:10:29][ 0.048000] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[11-02-14:10:29][ 0.068000] NET: Registered protocol family 2
[11-02-14:10:29][ 0.068000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[11-02-14:10:30][ 0.068000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[11-02-14:10:30][ 0.068000] TCP: Hash tables configured (established 4096 bind 4096)
[11-02-14:10:30][ 0.068000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[11-02-14:10:30][ 0.068000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[11-02-14:10:30][ 0.068000] NET: Registered protocol family 1
[11-02-14:10:30][ 0.072000] RPC: Registered named UNIX socket transport module.
[11-02-14:10:30][ 0.072000] RPC: Registered udp transport module.
[11-02-14:10:30][ 0.072000] RPC: Registered tcp transport module.
[11-02-14:10:30][ 0.072000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[11-02-14:10:30][ 0.072000] PCI: CLS 0 bytes, default 32
[11-02-14:10:30][ 1.024000] random: fast init done
[11-02-14:10:30][ 1.956000] audit: initializing netlink subsys (disabled)
[11-02-14:10:30][ 1.956000] audit: type=2000 audit(1.956:1): initialized
[11-02-14:10:30][ 1.956000] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[11-02-14:10:30][ 1.968000] NFS: Registering the id_resolver key type
[11-02-14:10:30][ 1.968000] Key type id_resolver registered
[11-02-14:10:30][ 1.968000] Key type id_legacy registered
[11-02-14:10:30][ 1.968000] ntfs: driver 2.1.32 [Flags: R/O].
[11-02-14:10:30][ 1.968000] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
[11-02-14:10:30][ 1.968000] fuse init (API version 7.26)
[11-02-14:10:30][ 1.968000] 9p: Installing v9fs 9p2000 file system support
[11-02-14:10:30][ 1.972000] Key type asymmetric registered
[11-02-14:10:30][ 1.972000] Asymmetric key parser 'x509' registered
[11-02-14:10:30][ 1.972000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[11-02-14:10:30][ 1.972000] io scheduler noop registered
[11-02-14:10:30][ 1.972000] io scheduler deadline registered (default)
[11-02-14:10:30][ 1.976000] io scheduler cfq registered
[11-02-14:10:30][ 1.976000] ipmi message handler version 39.2
[11-02-14:10:30][ 2.108000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[11-02-14:10:30][ 2.112000] console [ttyS0] disabled
[11-02-14:10:30][ 2.112000] f8007000.serial: ttyS0 at MMIO 0xf8007000 (irq = 48, base_baud = 1500000) is a 16550A
[11-02-14:10:30][ 2.428000] console [ttyS0] enabled
[11-02-14:10:30][ 2.432000] [drm] Initialized
[11-02-14:10:30][ 2.464000] brd: module loaded
[11-02-14:10:30][ 2.476000] loop: module loaded
[11-02-14:10:30][ 2.480000] libphy: Fixed MDIO Bus: probed
[11-02-14:10:30][ 2.484000] usbcore: registered new interface driver r8152
[11-02-14:10:30][ 2.488000] usbcore: registered new interface driver asix
[11-02-14:10:30][ 2.492000] usbcore: registered new interface driver ax88179_178a
[11-02-14:10:30][ 2.496000] usbcore: registered new interface driver cdc_ether
[11-02-14:10:30][ 2.500000] usbcore: registered new interface driver net1080
[11-02-14:10:30][ 2.504000] usbcore: registered new interface driver cdc_subset
[11-02-14:10:30][ 2.508000] usbcore: registered new interface driver zaurus
[11-02-14:10:30][ 2.512000] usbcore: registered new interface driver cdc_ncm
[11-02-14:10:30][ 2.548000] dwc2 f6000000.usb_otg: DWC OTG Controller
[11-02-14:10:30][ 2.552000] dwc2 f6000000.usb_otg: new USB bus registered, assigned bus number 1
[11-02-14:10:30][ 2.556000] dwc2 f6000000.usb_otg: irq 15, io mem 0x00000000
[11-02-14:10:30][ 2.560000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[11-02-14:10:30][ 2.564000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[11-02-14:10:30][ 2.568000] usb usb1: Product: DWC OTG Controller
[11-02-14:10:30][ 2.572000] usb usb1: Manufacturer: Linux 4.9.56 dwc2_hsotg
[11-02-14:10:30][ 2.576000] usb usb1: SerialNumber: f6000000.usb_otg
[11-02-14:10:30][ 2.580000] hub 1-0:1.0: USB hub found
[11-02-14:10:30][ 2.584000] hub 1-0:1.0: 1 port detected
[11-02-14:10:30][ 2.588000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[11-02-14:10:30][ 2.592000] ehci-pci: EHCI PCI platform driver
[11-02-14:10:30][ 2.596000] ehci-platform: EHCI generic platform driver
[11-02-14:10:30][ 2.600000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[11-02-14:10:30][ 2.604000] ohci-pci: OHCI PCI platform driver
[11-02-14:10:30][ 2.608000] usbcore: registered new interface driver usb-storage
[11-02-14:10:30][ 2.612000] mousedev: PS/2 mouse device common for all mice
[11-02-14:10:30][ 2.616000] usbcore: registered new interface driver uvcvideo
[11-02-14:10:30][ 2.620000] USB Video Class driver (1.1.1)
[11-02-14:10:30][ 2.624000] ledtrig-cpu: registered to indicate activity on CPUs
[11-02-14:10:30][ 2.632000] usbcore: registered new interface driver usbhid
[11-02-14:10:30][ 2.636000] usbhid: USB HID core driver
[11-02-14:10:30][ 2.640000] NET: Registered protocol family 17
[11-02-14:10:30][ 2.644000] 9pnet: Installing 9P2000 support
[11-02-14:10:30][ 2.648000] Key type dns_resolver registered
[11-02-14:10:30][ 2.712000] Key type trusted registered
[11-02-14:10:30][ 2.824000] Key type encrypted registered
[11-02-14:10:30][ 2.828000] ima: No TPM chip found, activating TPM-bypass!
[11-02-14:10:30][ 2.832000] evm: HMAC attrs: 0x1
[11-02-14:10:30][ 2.836000] ttyS0 - failed to request DMA
[11-02-14:10:30][ 2.844000] Freeing unused kernel memory: 14304k freed
[11-02-14:10:30][ 2.848000] This architecture does not have kernel memory protection.
[11-02-14:10:30][ 2.972000] usb 1-1: new high-speed USB device number 2 using dwc2
[11-02-14:10:30]Starting syslogd: OK
[11-02-14:10:30]Starting klogd: OK
[11-02-14:10:30][ 3.188000] usb 1-1: New USB device found, idVendor=0b95, idProduct=772b
[11-02-14:10:30][ 3.192000] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11-02-14:10:30][ 3.196000] usb 1-1: Product: AX88772C
[11-02-14:10:30][ 3.200000] usb 1-1: Manufacturer: ASIX Elec. Corp.
[11-02-14:10:30][ 3.204000] usb 1-1: SerialNumber: 53A82D
[11-02-14:10:31]Starting mdev... OK
[11-02-14:10:31][ 3.376000] Unable to handle kernel paging request at virtual address 0x00000000, pc: 0x80ebd734
[11-02-14:10:31][ 3.380000] Oops: 00000000
[11-02-14:10:31][ 3.384000]
[11-02-14:10:31][ 3.384000] CURRENT PROCESS:
[11-02-14:10:31][ 3.384000]
[11-02-14:10:31][ 3.388000] COMM=find PID=99
[11-02-14:10:31][ 3.392000] TEXT=00008000-000e9c6c DATA=000eaf14-000eb165 BSS=000eb165-0010d000
[11-02-14:10:31][ 3.396000] USER-STACK=7f827e90 KERNEL-STACK=9c8703e0
[11-02-14:10:31][ 3.396000]
[11-02-14:10:31][ 3.400000] PC: 0x80ebd734 (find_inode_fast+0x28/0x84)
[11-02-14:10:31][ 3.404000] LR: 0x80ebe5ba (iget_locked+0x62/0x16c)
[11-02-14:10:31][ 3.408000] SP: 0x9c8b9ca4
[11-02-14:10:31][ 3.412000] orig_a0: 0x00000684
[11-02-14:10:31][ 3.416000] PSR: 0x80140340
[11-02-14:10:31][ 3.416000] a0: 0x00000684 a1: 0x9fb95df8 a2: 0x000007fb a3: 0x9fb91000
[11-02-14:10:31][ 3.420000] r4: 0x000007fb r5: 0x9c863c00 r6: 0x9fb95df8 r7: 0x9c863c00
[11-02-14:10:31][ 3.424000] r8: 0x9c8b9d3c r9: 0x00000003 r10: 0x812f9c78 r11: 0x00000002
[11-02-14:10:31][ 3.428000] r12: 0x0000006e r13: 0x0000006e r15: 0x80ebe5ba
[11-02-14:10:31][ 3.432000] r16: 0xfffff000 r17: 0x9f0c8850 r18: 0x00000000 r19: 0x00000004
[11-02-14:10:31][ 3.436000] r20: 0x000006e0 r21: 0xffffffff r22: 0xfffffff3 r23: 0x0010436f
[11-02-14:10:31][ 3.440000] r24: 0x7f827904 r25: 0x00000020 r26: 0x2ab456c0 r27: 0x00000000
[11-02-14:10:31][ 3.444000] r28: 0x000eb000 r29: 0x00000000 r30: 0x00000000 tls: 0x00000004
[11-02-14:10:31][ 3.448000] hi: 0x00000000 lo: 0x00000000
[11-02-14:10:31][ 3.452000]
[11-02-14:10:31]CODE:
[11-02-14:10:31]80ebd714: ddee6e3b 6d872001 96006d43 e9206d0b
[11-02-14:10:31]80ebd724: 04190006 e900901f 287b0017 0014e900
[11-02-14:10:31]80ebd734: 650e906a 90670bf8 0bf5654e e4639079
[11-02-14:10:31]80ebd744: e9032030 e3ff0010 c400ff01 96004820
[11-02-14:10:31][ 3.468000]
[11-02-14:10:31]KERNEL STACK:
[11-02-14:10:31]9c8b9c64: 80df97cc 00000000 9c8b9c7c 80dfbeee
[11-02-14:10:31]9c8b9c74: 00000000 9c84dda8 9c8b9d3c 80df8ad8
[11-02-14:10:31]9c8b9c84: 000007fb 9c863c00 9fb95df8 9c863c00
[11-02-14:10:31]9c8b9c94: 00000003 812f9c78 00000002 fffff000
[11-02-14:10:31]9c8b9ca4: 00000004 80ebe5ba 80ebd734 80140340
[11-02-14:10:31]9c8b9cb4: 9c8b9d3c 00000684 00000684 9fb95df8
[11-02-14:10:31]9c8b9cc4: 000007fb 9fb91000 000007fb 9c863c00
[11-02-14:10:31]9c8b9cd4: 9fb95df8 9c863c00 9c8b9d3c 00000003
[11-02-14:10:31]9c8b9ce4: 812f9c78 00000002 0000006e 0000006e
[11-02-14:10:31]9c8b9cf4: fffff000 9f0c8850 00000000 00000004
[11-02-14:10:31]9c8b9d04: 000006e0 ffffffff fffffff3 0010436f
[11-02-14:10:31]9c8b9d14: 7f827904 00000020 2ab456c0 00000000
[11-02-14:10:31][ 3.524000] Call Trace:
[11-02-14:10:31][<80dfa8a8>] walk_stackframe+0x0/0xc4
[11-02-14:10:31][ 3.532000] [<80dfaa0a>] show_stack+0x26/0x50
[11-02-14:10:31][ 3.536000] [<80dfa762>] show_regs+0x1e6/0x32c
[11-02-14:10:31][ 3.540000] [<80dfaf6e>] die_if_kernel.part.0+0x2e/0x68
[11-02-14:10:31][ 3.544000] [<80df97cc>] die_if_kernel+0x24/0x34
[11-02-14:10:31][ 3.548000] [<80dfbeee>] do_page_fault+0x1fe/0x364
[11-02-14:10:31][ 3.552000] [<80df8ad8>] tlbinvalidl+0x82/0xaa
[11-02-14:10:31][ 3.556000] [<80ebe5ba>] iget_locked+0x62/0x16c
[11-02-14:10:31][ 3.560000] [<80f09b72>] kernfs_get_inode+0x16/0x104
[11-02-14:10:31][ 3.564000] [<80f0a98c>] kernfs_iop_lookup+0x5c/0xb8
[11-02-14:10:31][ 3.568000] [<80eadc86>] lookup_slow+0x9e/0x174
[11-02-14:10:31][ 3.572000] [<80eb07e2>] walk_component+0x1d2/0x2b0
[11-02-14:10:31][ 3.576000] [<80eb0e66>] path_lookupat+0x66/0x134
[11-02-14:10:31][ 3.580000] [<80eb300a>] filename_lookup+0x82/0x11c
[11-02-14:10:31][ 3.584000] [<80eb3196>] user_path_at_empty+0x3e/0x60
[11-02-14:10:31][ 3.588000] [<80ea8c18>] vfs_fstatat+0x60/0xdc
[11-02-14:10:31][ 3.592000] [<80ea92d6>] SyS_fstatat64+0x1a/0x48
[11-02-14:10:31][ 3.596000] [<80df8e02>] csky_systemcall+0xa2/0xaa
[11-02-14:10:31][ 3.600000] Disabling lock debugging due to kernel taint
[11-02-14:10:31]Segmentation fault
[11-02-14:11:20]Starting network: [ 53.004000] random: crng init done

从上面的Log中可以看出来,Kernel启动完毕之后,start mdev的之后出现了问题,说明整个Kernel 已经启动完毕,挂载rootfs的时候出现了问题。根据以上的信息说明了什么问题?
说明发生了内存覆盖,而且只是部分覆盖,不是全部覆盖,所以才会出现上面的现象。
那哪里初问题了呢?
Polaris.h 配置文件经过多次检查,发现PHYS_SDRAM_1_SIZE的大小配置错误导致的,这个宏定义了uBoot能操作的最大DDR,之前配置的是:0x40000000,1GB大小的空间,这种配置已经不适合当前的需求,当前的环境是CK860DDR的活动区间是:0x20000000 512M,所以如果这个值配置的太大的话就会出现部分内存覆盖的情况,但是代码中体现在什么地方需要进一步的研究。

6:写在最后

百果必有因,任何事情的发生总有原因,而要找到原因必须了解整个事情的经过和来龙去脉,光靠试是试不出来的。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,817评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,329评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,354评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,498评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,600评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,829评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,979评论 3 408
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,722评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,189评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,519评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,654评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,329评论 4 330
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,940评论 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,762评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,993评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,382评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,543评论 2 349