U Boot jump to kernel

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

U Boot jump to kernel

跳至解决方案
3,371 次查看
bharatkumarbach
Contributor III

Does the kernel expect the hardware to be initialized by U-Boot except for disabling interrupts, caches, and MMU?

I see the following error after kernel starts executing

I see following error
"Synchronous Abort" handler, esr 0x86000000
ELR: ffff00000893017c
LR: 40aa825c
x0 : 0000000040400000 x1 : 0000000040e7a000
x2 : 0000000040e7d000 x3 : 000000000000003f
x4 : 0000000000000001 x5 : 00000000fcffffff
x6 : 0000000034d5d91d x7 : 0000000000000711
x8 : ffff00000893017c x9 : 0000000000000000
x10: 00000032b5103510 x11: 0000000000000002
x12: 00000000ffffffff x13: 00000000ffffffff
x14: 000000000000006a x15: 0000000000000790
x16: 00000000000000b7 x17: 0000000000000108
x18: 0000000000185e40 x19: 0000000040480000
x20: 0000000043000000 x21: 0000000000000000
x22: 0000000000185df0 x23: 0000000000000000
x24: 00000000007f2000 x25: 00000000007f2fa0
x26: 00000000deadbeef x27: 0000000000000000
x28: 0000000040d30018 x29: 0000000000185d70

Seems like control gets passed onto kernel. Kernel runs fine until it enables MMU and swicthes to virtual addresses. Once it jumps to VA, exception is raised which means MMU is not initialized properly.

Note: I am skipping filesystem to locate kernel and device tree. These are located at hardcoded sector address which U-Boot is aware of.

Thanks,

Bharat Kumar Bacha.

标记 (2)
0 项奖励
回复
1 解答
2,918 次查看
bharatkumarbach
Contributor III

It's not the U-Boot its the Arm Trusted Firmware(ATF) which switches to EL2 from EL3. Can anyone explain how the ATF know about the U-Boot? This would help me to replace the U-Boot code with custom stub function to boot kernel.

Thanks.

Regards,

Bharat

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,919 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Bharat

yes uboot configures some peripherals and clocks (in dcd), one can check

uboot/board/freescale/mx6sabresd/mx6sabresd.c

mx6sabresd.c\mx6sabresd\freescale\board - uboot-imx - i.MX U-Boot 

mx6q_4x_mt41j128.cfg\mx6sabresd\freescale\board - uboot-imx - i.MX U-Boot 

May be useful to look at Chapter 3 Porting U-Boot attached Porting Guide and

AN4553 Using Open Source Debugging Tools for Linux on i.MX Processors
https://www.nxp.com/docs/en/application-note/AN4553.pdf 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,919 次查看
bharatkumarbach
Contributor III

It's not the U-Boot its the Arm Trusted Firmware(ATF) which switches to EL2 from EL3. Can anyone explain how the ATF know about the U-Boot? This would help me to replace the U-Boot code with custom stub function to boot kernel.

Thanks.

Regards,

Bharat

0 项奖励
回复
2,919 次查看
igorpadykov
NXP Employee
NXP Employee

you can check imx-atf sources

imx-atf

GitHub - ARM-software/arm-trusted-firmware: Trusted Firmware-A 

since this is arm (www.arm.com) software suggest to post it to arm

forums

Support | Arm Trusted Firmware – Arm Developer 

Best regards
igor

0 项奖励
回复