@@ -7,9 +7,10 @@ typically remain mostly the same over time for the same vendor, because change
77would mean cost.
88This initial code is designed to load the changeable application code from
99rewritable storages, such as SPI flash parts, SD cards, or eMMC, or possibly an
10- internal reprogrammable memory part.
10+ internal reprogrammable memory part. Those stages are also referred to as
11+ [ platform initialization] ( platform-initialization.md ) .
1112
12- Those loaders may fall back to a mechanism allowing for talking to the SoC
13+ Mask ROM loaders may fall back to a mechanism allowing for talking to the SoC
1314directly, e.g. via USB or UART. Because each vendor has their own implementation
1415of such a mechanism, they also have their own software utilities that understand
1516the respective protocol. With that software, one may read out chip information,
@@ -47,59 +48,3 @@ perform MMIO access, transfer data into memory and execute it, set fuses, etc.
4748 - [ ` sg_boot ` ] ( https://github.com/platform-system-interface/sg_boot )
4849- StarFive JingHong (JH)
4950 - [ ` jh_boot ` ] ( https://github.com/platform-system-interface/jh_boot )
50-
51- ### Boot Flows
52-
53- Since memory and storage parts can be complex, additional firmware and loaders
54- are implemented in software. They would initialize the platform step by step,
55- phase by phase, or stage by stage; projects differ in naming.
56-
57- | Project/Vendor | mask ROM | ................ | ..... | .................. | ................... | .......... |
58- | ----------------- | -------- | ---------------- | ----- | ------------------ | ------------------- | ---------- |
59- | U-Boot | (N/A) | TPL | SPL | platform-dependent | U-Boot proper | OS |
60- | EDK2 | (N/A) | SEC | PEI | DXE | BDS | payload/OS |
61- | Oxide | (N/A) | phbl | X | (-) | (-) | OS |
62- | coreboot | (N/A) | boot block / CAR | ROM | RAM stage | payload | OS |
63- | sunxi (Allwinner) | FEL | (-) | boot0 | maybe intermediate | maybe U-Boot proper | OS |
64- | RISC-V | ZSBL | (-) | FSBL | SBI | boot loader | OS |
65- | oreboot | mask ROM | boot block | bt0 | main | LinuxBoot | OS |
66-
67- ** Note** :
68- [ oreboot
69- ] ( https://github.com/oreboot/oreboot/tree/main/Documentation/boot-flow.md ) and
70- [ coreboot] ( https://doc.coreboot.org/getting_started/architecture.html ) do not
71- implement boot loaders to access external storage themselves. Instead, they
72- provide options for payloads that could load a final OS or stand for themselves;
73- it is up to the vendor designing a system with it. A _ boot block_ is only
74- necessary for some specific platforms, and possibly _ CAR_ (cache-as-RAM).
75- RISC-V does not have a term for this, since it is conceptually not necessary.
76- Generic naming does not make much sense either, since different hardware
77- platforms require some stages or not depending on their constraints. Nor does
78- counting, due to different points of view: U-Boot, for example, starts counting
79- [ backwards from its proper environment (the one offering a shell)] (
80- https://u-boot.readthedocs.io/en/latest/develop/spl.html#u-boot-boot-phases ), to
81- secondary and (rarely) tertiary program loader (SPL/TPL), while
82- [ RISC-V starts counting forward, the mask ROM being the Zero Stage Boot Loader
83- (ZSBL)] ( https://riscv.org/wp-content/uploads/2019/12/Summit_bootflow.pdf ) .
84-
85- ** Note** :
86- Vendors may define additional constraints in addition to their hardware
87- limitiations. For example, AMD implements DRAM initialization in signed code
88- that runs on a coprocessor before the main x86 cores come out of reset.
89- Because the signatures of the binaries involved are verified, they cannot be
90- customized by anyone but those who hold the signing keys, i.e., the vendor,
91- unless ways to circumvent the verification are found. This is also true for many
92- OEM products in general, where custom firmware is not part of the product
93- design. I.e., it is [ protected against modification] ( platform-security.md ) .
94-
95- ### References
96-
97- #### Arm platforms
98-
99- - [ How Arm systems are booted] ( https://youtu.be/GXFw8SV-51g )
100- - [ U-Boot / Amlogic] ( https://youtu.be/u0-swEMDFp0 )
101- - Arm secure boot chain on Ampere Altra
102- * [ Armed to boot talk] ( https://youtu.be/i2IG6Au34xM )
103- * [ Armed to boot blog post] ( https://blog.cloudflare.com/armed-to-boot/ )
104-
105- #### RISC-V platforms
0 commit comments