[Reprint] - Arm Trusted Firmware overview
Arm Trusted Firmware overview
https://developer.arm.com/documentation/110431/0100/Debugging-Arm-Trusted-Firmware/Arm-Trusted-Firmware-overview?lang=en
The ATF cold boot flow comprises up to five individual boot stages running at different exception levels:
|
Boot stage |
Exception level |
Description |
|---|---|---|
|
BL1 |
EL3 |
Trusted bootstrap; cold/warm boot detection |
|
BL2 |
EL1S |
Trusted bootloader |
|
BL31 |
EL3 |
Resident runtime firmware |
|
BL32 |
EL1S |
[Optional] Trusted operating system |
|
BL33 |
EL2 |
Normal world bootloader |
With these stages run in the following order:
BL1 --> BL2 --> BL1 --> BL31 --> BL32 --> BL31 --> BL33
We recommend reading the Arm Trusted Firmware Design document for more information (can also be found in <workspace>/).
This article outlines how to debug ATF:
- From the BL1 entrypoint through to the BL33 entrypoint i.e. “normal world handover”
- In a system without a trusted operating system i.e. no BL32 present
- Using the official reference implementation sources of BL1, BL2, and BL31 (*)
(*) The bl1/, bl2/, and bl31/ directories in <workspace>/.
When debugging ATF it is important to know which boot stage(s) contain the functionality that you are interested in; this way the correct symbols and debug information can be loaded, allowing us to set breakpoints on textual symbol names rather than raw addresses, see function call target names rather than PC relative offsets, and so on. It also means we can skip unnecessary parts of the boot flow.
To this end we have generated the following table of “interesting” functionality with corresponding boot stage and symbol name(s):
|
Functionality |
Boot stage |
Symbols |
|---|---|---|
|
Cold/warm boot detection |
BL1 |
|
|
CPU-specific reset handlers |
BL1 |
|
|
Bootstrap (BL1) entrypoint and early setup |
BL1 |
|
|
Bootstrap (BL1) main |
BL1 |
|
|
Load Bootloader (BL2) from FIP |
BL1 |
|
|
Bootstrap (BL1) –> Bootloader (BL2) handover |
BL1 |
|
|
Bootstrap (BL1) –> Bootloader (BL2) handover |
BL1 |
|
|
Bootloader (BL2) entrypoint and early setup |
BL2 |
|
|
Bootloader (BL2) main |
BL2 |
|
|
Load images from FIP |
BL2 |
|
|
Bootloader (BL2) –> Bootstrap (BL1) handover |
BL2 |
|
|
Bootstrap (BL1) –> Firmware (BL31) handover |
BL1 |
|
|
Firmware (BL31) cold boot entrypoint and early setup |
BL31 |
|
|
Firmware (BL31) warm boot entrypoint |
BL31 |
|
|
Firmware (BL31) main |
BL31 |
|
|
Initialise CPU operations |
BL31 |
|
|
Power management setup |
BL31 |
|
|
Power management setup |
BL31 |
|
|
Power management setup |
BL31 |
|
|
CPU power down sequence |
BL31 |
|
|
Firmware BL31 –> BL33 normal world handover |
BL31 |
|
|
Firmware BL31 –> BL33 normal world handover |
BL31 |
|
Make a note of any of these that interest you.
posted on 2025-10-23 10:20 ENGINEER-F 阅读(4) 评论(0) 收藏 举报
浙公网安备 33010602011771号