u-boot 的machine id 定义和kernel 中的 machine id 不同

来源:互联网 发布:nginx 设置密码 编辑:程序博客网 时间:2024/06/04 19:18

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 即可

 

原创粉丝点击