u-boot 的中machine id 可能和kernel 中的 machine id不同
可以从 include/asm-arm/mach-types.h 中看到machine id 的定义,这个文件是自动生成的
通过 arch/arm/tool 下面的awk 脚步以及输入文件生成的。
可以从 “Error: unrecognized/unsupported machine ID (r = 0x0000147C)” 从 r 的数字得到 u-boot 传递给kernel 的 machine-id 。
可以根据自己编译kernel 的时候,指定的machine type 来修改 u-boot 传递上来的 machine id
在文件 arch/arm/kernel/head.S 中,搜索 .section ".text.head" ,
在代码
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode @ and irqs disabled
后面加入:
mov r1, #0xc1 @modify the machine id from u-boot 修改 u-boot 上次的machine id
重新编译 make uImage 即可