## Booting kernel from Legacy Image at 32000000 ... Starting kernel ... |
1> U-boot中的参数(console)没有传到内核。
2> U-boot的时钟设置不在405MHz,与Kernel的不一致。
3> U-boot中的Machine ID设置的与Kernel不一致。
逐个检查,其中第一项参数传递要求U-boot中有如下宏即可,该情况排除。
#define CONFIG_SETUP_MEMORY_TAGS |
第二项时钟设置查看U-boot中的配置,也没有问题。
#if defined(CONFIG_S3C2440) |
再查下 Machine ID 。zwolf 提到方法,打开内核的Debug选项
make menuconfig |
编译运行得到如下提示:
Starting kernel ... UncompressingLinux................................................................................................................................... done, booting the kernel. Error: unrecognized/unsupported machine ID(r1 = 0x0000016a). Available machine support: ID (hex) NAME 000007cfFriendlyARM Mini2440 development board Please check your kernel configand/or bootloader. |
用bdinfo命令查看u-boot端的ID :
arch_number = 0x0000016A
env_t = 0x00000000
boot_params = 0x30000100
DRAM bank = 0x00000000
-> start = 0x30000000
-> size = 0x04000000
ethaddr = 08:08:11:18:12:27
ip_addr = 192.168.10.172
baudrate = 115200 bps
基本上可以确定从U-boot得到的ID为 362 (0x0000016a), 而内核中的ID为 1999 (000007cf)。分别查找。
内核中的 Machine ID 为:
U-boot中对应也有该定义:
二者是一致的,再查找一下ID为362的Machine是 MACH_TYPE_S3C2440,看来是u-boot没有传递正确的ID。grep一下MACH_TYPE_S3C2440,在如下位置找到原因:
/* arch number of S3C2440-Board */
gd->bd->bi_arch_number = MACH_TYPE_S3C2440 ;
#endif
另外如果不动U-boot端,在Linux端临时试验的话,可以在Linux启动代码中手动加入该参数,使其与mach-types.h中的值统一起来,方法参考 这个帖子,注意mov指令操作数的要求。
/*---------add begin----------/
mov r0, #0
mov r1, #0xc1
ldr r2, =0x30000100
/*---------add end-----------*/