1. 程式人生 > >u-boot 的machine id 定義和kernel 中的 machine id 不同

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

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