各位好:
现在碰到u-boot启动内核在“Starting kernel …”,跳到内核就没有打印信息输出了。请各位帮忙分析下。
环境如下:
1、SDK版本:ti-processor-sdk-linux-am335x-evm-01.00.00.03-Linux-x86-Install.bin
2、交叉编译环境宿主机器:Ubuntu LTS Server 14.04.2 32位
3、内核使用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage命令编译,.config文件参考附件
4、u-boot使用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm am335x_evm_config all编译,把我司的板子环境变量当作AM335X_SK,即在read_eeprom中直接给am335x_baseboard_id结构赋值成AM35X的参数
5、我的板通过UART0串口输出
6、TI Demo板内存256M,我司板内存1G
操作步骤:
1、使用SDK自带的制作SD卡脚本,制作SD卡启动
2、修改u-boot/kernel
a)根据我司板的具体硬件环境,修改内存初始化部分,屏蔽暂时没有的硬件初始化代码
b)u-boot的MACH_TYPE_TIAM335EVM修改成和内核一致(4116)
c)确定启动cmdline:console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait (UART0输出调试)
d)编译内核menuconfig,选择“Kernel hacking”中选择“Kernel low-level debugging message via AM33XX UART1)”–选项中没有UART0,但是根据dts文件uart0设备的名字是UART1,不知道这样理解是否正确。
2、将编译好的内核和MLO/u-boot.img分别放入到SD卡的文件系统分区(/dev/mmcblk0p1)和启动分区中(/dev/mmcblk0p2 )
3、插入SD卡,启动
同一个内核文件,在TI Demo板上启动信息截取如下:
### main_loop: bootcmd="run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;"
Hit any key to stop autoboot: 0test(4): 'A335X_SK' '=' 'A335BONE': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A335BNLT': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A33515BB': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A335X_SK': returns 0
Initial value for argc=3
Final value for argc=3
test(4): 'am335x-evmsk.dtb' '=' 'undefined': returns 1
Command failed, result=1Command failed, result=1mmc_init: 0, time 81
switch to partitions #0, OK
mmc0 is current device
mmc_init: 0, time 81
SD/MMC found on device 0
reading uEnv.txt
VFAT Support enabled
FAT32, fat_sect: 32, fatlength: 1112
Rootdir begins at cluster: 2, sector: 2256, offset: 11a000
Data begins at: 2254
Sector size: 512, cluster size: 1
FAT read sect=2256, clust_size=1, DIRENTSPERBLOCK=16
Rootvfatname: |pointercal|
RootMismatch: |pointe~1|pointercal|
RootMismatch: |pointe~1||
Rootvfatname: |000000000000u-boot.img|
RootMismatch: |000000~1.img|000000000000u-boot.img|
RootMismatch: |000000~1.img||
RootMismatch: |mlo||
Rootvfatname: |000000000000mlo|
RootMismatch: |000000~1|000000000000mlo|
RootMismatch: |000000~1||
Rootvfatname: |.ipaddr|
RootMismatch: |ipaddr~1|.ipaddr|
RootMismatch: |ipaddr~1||
Rootvfatname: |111u-boot.img|
RootMismatch: |111u-b~1.img|111u-boot.img|
RootMismatch: |111u-b~1.img||
END LOOP: j=0 clust_size=1
FAT read sect=2265, clust_size=1, DIRENTSPERBLOCK=16
Rootvfatname: |u-boot.img|
RootMismatch: |u-boot.img|u-boot.img|
RootMismatch: |u-boot.img||
END LOOP: j=0 clust_size=1
** Unable to read file uEnv.txt **
Command failed, result=1Command failed, result=1Command failed, result=1EXT2 rev 1, inode_size 256
ext4fs read 0 group descriptor (blkno 1 blkoff 0)
Iterate dir boot
iterate >.<
iterate >..<
iterate >bin<
iterate >boot<
Iterate dir zImage
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
iterate >.<
iterate >..<
iterate >zImage<
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
Got symlink >zImage-3.14.43-g875c69b<
Iterate dir zImage-3.14.43-g875c69b
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
iterate >.<
iterate >..<
iterate >zImage<
iterate >am335x-evm.dtb<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
4157920 bytes read in 300 ms (13.2 MiB/s)
Initial value for argc=3
Final value for argc=3
Initial value for argc=7
Final value for argc=7
test(4): 'try' '=' 'yes': returns 1
Command failed, result=1test(4): 'try' '=' 'try': returns 0
EXT2 rev 1, inode_size 256
ext4fs read 0 group descriptor (blkno 1 blkoff 0)
Iterate dir boot
iterate >.<
iterate >..<
iterate >bin<
iterate >boot<
Iterate dir am335x-evmsk.dtb
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
iterate >.<
iterate >..<
iterate >zImage<
iterate >am335x-evm.dtb<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
iterate >devicetree-zImage-am335x-evm.dtb<
iterate >am335x-evmsk.dtb<
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
Got symlink >devicetree-zImage-am335x-evmsk.dtb<
Iterate dir devicetree-zImage-am335x-evmsk.dtb
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
iterate >.<
iterate >..<
iterate >zImage<
iterate >am335x-evm.dtb<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
iterate >devicetree-zImage-am335x-evm.dtb<
iterate >am335x-evmsk.dtb<
iterate >devicetree-zImage-am335x-boneblack.dtb<
iterate >devicetree-zImage-am335x-bone.dtb<
iterate >devicetree-zImage-am335x-evmsk.dtb<
ext4fs read 5 group descriptor (blkno 1 blkoff 160)
36445 bytes read in 120 ms (295.9 KiB/s)
Initial value for argc=3
Final value for argc=3
entry >>> bootz_start argv[1]=->>>
Image Name: Created: 1970-01-01 0:00:00 UTC
Image Type: Invalid ARCH Invalid OS Invalid Image (uncompressed)
Data Size: 0 Bytes = 0 Bytes
Load Address: 00000000
Entry Point: 00000000
entry >>> bootm_start >>>
## Current stack ends at 0x8e715890 * kernel: cmdline image address = 0x82000000
Kernel image @ 0x82000000 [ 0x000000 – 0x3f71e0 ]
entry >>> bootm_find_ramdisk >>>entry >>> boot_get_ramdisk >>>## Skipping init Ramdisk
## No init Ramdisk
ramdisk start = 0x00000000, ramdisk end = 0x00000000
* fdt: cmdline image address = 0x88000000
## Checking for 'FDT'/'FDT Image' at 88000000
Wrong FIT format: no description
* fdt: raw FDT blob
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
of_flat_tree at 0x88000000 size 0x00008e5d
Initial value for argc=3
Final value for argc=3
using: FDT
## initrd_high = 0xffffffff, copy_to_ram = 1
ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
## device tree at 88000000 … 88008e5c (len=48733 [0xBE5D])
Loading Device Tree to 8e708000, end 8e713e5c … OK
Initial value for argc=3
Final value for argc=3
Updating property '/ocp/ethernet@4a100000/slave@4a100200/mac-address' = c4 ed ba 8b 33 fd
Updating property '/ocp/ethernet@4a100000/slave@4a100200/local-mac-address' = c4 ed ba 8b 33 fd
Updating property '/ocp/ethernet@4a100000/slave@4a100300/mac-address' = c4 ed ba 8b 33 ff
Updating property '/ocp/ethernet@4a100000/slave@4a100300/local-mac-address' = c4 ed ba 8b 33 ff
entry >>> boot_jump_linux >>>
flag=0x00000400,fake=0
Image Name: Created: 1970-01-01 0:00:00 UTC
Image Type: Invalid ARCH Invalid OS Invalid Image (uncompressed)
Data Size: 0 Bytes = 0 Bytes
Load Address: 00000000
Entry Point: 00000000
##3 Transferring control to Linux (at address 82000000)…
Starting kernel …
in boot_jump_linux addr=0x82000000
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.14.43-g875c69b (root@mark) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 – Linaro GCC 2013.03) ) #2 Sat Nov 14 18:04:41 CST 2015
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: TI AM335x EVM-SK
[ 0.000000] cma: CMA: reserved 24 MiB at 8c800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
在我司板启动信息如下:
### main_loop: bootcmd="run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;"
Hit any key to stop autoboot: 0test(4): 'A335X_SK' '=' 'A335BONE': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A335BNLT': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A33515BB': returns 1
Command failed, result=1test(4): 'A335X_SK' '=' 'A335X_SK': returns 0
test(4): 'am335x-evmsk.dtb' '=' 'undefined': returns 1
Command failed, result=1Command failed, result=1mmc_init: 0, time 77
switch to partitions #0, OK
mmc0 is current device
mmc_init: 0, time 77
SD/MMC found on device 0
reading uEnv.txt
VFAT Support enabled
FAT32, fat_sect: 32, fatlength: 1112
Rootdir begins at cluster: 2, sector: 2256, offset: 11a000
Data begins at: 2254
Sector size: 512, cluster size: 1
FAT read sect=2256, clust_size=1, DIRENTSPERBLOCK=16
RootMismatch: |mlo||
Rootvfatname: |u-boot.img|
RootMismatch: |u-boot.img|u-boot.img|
RootMismatch: |u-boot.img||
END LOOP: j=0 clust_size=1
** Unable to read file uEnv.txt **
Command failed, result=1Command failed, result=1Command failed, result=1EXT2 rev 1, inode_size 256
ext4fs read 0 group descriptor (blkno 1 blkoff 0)
Iterate dir boot
iterate >.<
iterate >..<
iterate >bin<
iterate >dev<
iterate >sys<
iterate >lib<
iterate >srv<
iterate >mnt<
iterate >proc<
iterate >boot<
Iterate dir zImage
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
iterate >.<
iterate >..<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
iterate >am335x-evmsk.dtb<
iterate >zImage<
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
Got symlink >zImage-3.14.43-g875c69b<
Iterate dir zImage-3.14.43-g875c69b
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
iterate >.<
iterate >..<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
4157920 bytes read in 463 ms (8.6 MiB/s)
test(4): 'try' '=' 'yes': returns 1
Command failed, result=1test(4): 'try' '=' 'try': returns 0
EXT2 rev 1, inode_size 256
ext4fs read 0 group descriptor (blkno 1 blkoff 0)
Iterate dir boot
iterate >.<
iterate >..<
iterate >bin<
iterate >dev<
iterate >sys<
iterate >lib<
iterate >srv<
iterate >mnt<
iterate >proc<
iterate >boot<
Iterate dir am335x-evmsk.dtb
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
iterate >.<
iterate >..<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
iterate >am335x-evmsk.dtb<
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
Got symlink >devicetree-zImage-am335x-evmsk.dtb<
Iterate dir devicetree-zImage-am335x-evmsk.dtb
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
iterate >.<
iterate >..<
iterate >am335x-bone.dtb<
iterate >zImage-3.14.43-g875c69b<
iterate >am335x-evmsk.dtb<
iterate >zImage<
iterate >am335x-evm.dtb<
iterate >devicetree-zImage-am335x-evm.dtb<
iterate >devicetree-zImage-am335x-boneblack.dtb<
iterate >am335x-boneblack.dtb<
iterate >devicetree-zImage-am335x-bone.dtb<
iterate >devicetree-zImage-am335x-evmsk.dtb<
ext4fs read 10 group descriptor (blkno 1 blkoff 320)
36445 bytes read in 138 ms (257.8 KiB/s)
entry >>> bootz_start argv[1]=->>>
Image Name: Created: 1970-01-01 0:00:00 UTC
Image Type: Invalid ARCH Invalid OS Invalid Image (uncompressed)
Data Size: 0 Bytes = 0 Bytes
Load Address: 00000000
Entry Point: 00000000
entry >>> bootm_start >>>
## Current stack ends at 0xbe714890 * kernel: cmdline image address = 0x82000000
Kernel image @ 0x82000000 [ 0x000000 – 0x3f71e0 ]
entry >>> bootm_find_ramdisk >>>entry >>> boot_get_ramdisk >>>## Skipping init Ramdisk
## No init Ramdisk
ramdisk start = 0x00000000, ramdisk end = 0x00000000
* fdt: cmdline image address = 0x88000000
## Checking for 'FDT'/'FDT Image' at 88000000
Wrong FIT format: no description
* fdt: raw FDT blob
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
of_flat_tree at 0x88000000 size 0x00008e5d
using: FDT
## initrd_high = 0xffffffff, copy_to_ram = 1
ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
## device tree at 88000000 … 88008e5c (len=48733 [0xBE5D])
Loading Device Tree to 8fff4000, end 8ffffe5c … OK
Updating property '/ocp/ethernet@4a100000/slave@4a100200/mac-address' = 00 84 00 16 05 05
Updating property '/ocp/ethernet@4a100000/slave@4a100200/local-mac-address' = 00 84 00 16 05 05
Updating property '/ocp/ethernet@4a100000/slave@4a100300/mac-address' = 00 16 84 00 05 02
Updating property '/ocp/ethernet@4a100000/slave@4a100300/local-mac-address' = 00 16 84 00 05 02
entry >>> boot_jump_linux >>>
flag=0x00000400,fake=0
##3 Transferring control to Linux (machid=0x00001014(4116) at address 82000000)…
Starting kernel …
console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
in boot_jump_linux addr=0x82000000 r2=0x8fff4000
后面就没有信息了。在TI Demo板和我司板的u-boot中,在boot_jump_linux 函数中,将起始地址为0x82000000开始,64K长度的内存数据都打印出来,两个板的一样。
Jian Zhou:
有没有用SDK自带的prebuid image在TI 板子上试过?
Mark Liao:
回复 Jian Zhou:
试过,可以跑起来,我自己编的内核也可以在TI的开发板上跑起来。
此问题已解决,就是我司的板没有RTC时钟,在编译内核的时候,去掉“RTC”时钟即可进入内核。
目前在探测SD卡设备失败,没能进入文件系统的分区sdb2,即mmcblk02,“Waiting for root device /dev/mmcblk0p2.”
Jian Zhou:
回复 Mark Liao:
同样的代码在TI的demo板上能跑起来么?你可以多启东试几次,有时候和板子以及卡槽都有关系