|
| 1 | +--- |
| 2 | +title: Understanding the CSS V3 Boot Flow and Firmware Stack |
| 3 | +weight: 3 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## Firmware Stack Overview and Boot Sequence Coordination |
| 10 | + |
| 11 | +To ensure the platform transitions securely and reliably from power-on to operating system launch, this module introduces the roles and interactions of each firmware component within the RD‑V3 boot process. |
| 12 | +You’ll learn how each module contributes to system initialization and how control is systematically handed off across the boot chain. |
| 13 | + |
| 14 | + |
| 15 | +## How the System Wakes Up |
| 16 | + |
| 17 | +In the RD‑V3 platform, each subsystem—such as TF‑A, RSE, SCP, LCP, and UEFI—operates independently but cooperates through a well-defined sequence. |
| 18 | +Each module is delivered as a separate firmware image, yet they coordinate tightly through a structured boot flow and inter-processor signaling. |
| 19 | + |
| 20 | +The following diagram from the [Neoverse Reference Design Documentation](https://neoverse-reference-design.docs.arm.com/en/latest/shared/boot_flow/rdv3_single_chip.html?highlight=boot) illustrates the progression of component activation from initial reset to OS handoff: |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +### Stage 1. Security Validation Starts First (RSE) |
| 25 | + |
| 26 | +The first firmware module triggered after BL2 is the Runtime Security Engine (RSE), executing on Cortex‑M55. RSE authenticates all critical firmware components—including SCP, UEFI, and kernel images—using secure boot mechanisms. It performs cryptographic measurements and builds a Root of Trust before allowing any other processors to start. |
| 27 | + |
| 28 | +***RSE acts as the platform’s security gatekeeper.*** |
| 29 | + |
| 30 | +### Stage 2. Early Hardware Initialization (SCP / MCP) |
| 31 | + |
| 32 | +Once RSE completes verification, the System Control Processor (SCP) and Management Control Processor (MCP) are released from reset. |
| 33 | + |
| 34 | +These controllers perform essential platform bring-up: |
| 35 | +* Initialize clocks, reset lines, and power domains |
| 36 | +* Prepare DRAM and interconnect |
| 37 | +* Enable the application cores and signal readiness to TF‑A |
| 38 | + |
| 39 | +***SCP/MCP are the ground crew bringing hardware systems online.*** |
| 40 | + |
| 41 | +### Stage 3. Secure Execution Setup (TF‑A) |
| 42 | + |
| 43 | +Once the AP is released, it begins executing Trusted Firmware‑A (TF‑A) at EL3, starting from the reset vector address programmed during boot image layout. |
| 44 | +TF‑A configures the secure world, sets up exception levels, and prepares for handoff to UEFI. |
| 45 | + |
| 46 | +***TF‑A is the ignition controller, launching the next stages securely.*** |
| 47 | + |
| 48 | +### Stage 4. Firmware and Bootloader (EDK2 / GRUB) |
| 49 | + |
| 50 | +TF‑A hands off control to UEFI firmware (EDK2), which performs device discovery and launches GRUB. |
| 51 | + |
| 52 | +Responsibilities: |
| 53 | +* Detect and initialize memory, PCIe, and boot devices |
| 54 | +* Generate ACPI and platform configuration tables |
| 55 | +* Locate and launch GRUB from storage or flash |
| 56 | + |
| 57 | +***EDK2 and GRUB are like the first- and second-stage rockets launching the payload.*** |
| 58 | + |
| 59 | +### Stage 5. Linux Kernel Boot |
| 60 | + |
| 61 | +GRUB loads the Linux kernel and passes full control to the OS. |
| 62 | + |
| 63 | +Responsibilities: |
| 64 | +* Initialize device drivers and kernel subsystems |
| 65 | +* Mount the root filesystem |
| 66 | +* Start user-space processes (e.g., BusyBox) |
| 67 | + |
| 68 | +***The Linux kernel is the spacecraft—it takes over and begins its mission.*** |
| 69 | + |
| 70 | +## Firmware Module Responsibilities in Detail |
| 71 | + |
| 72 | +Now that we’ve examined the high-level boot stages, let’s break down each firmware module’s role in more detail. |
| 73 | + |
| 74 | +Each stage of the boot chain is backed by a dedicated component—either a secure bootloader, platform controller, or operating system manager—working together to ensure a reliable system bring-up. |
| 75 | + |
| 76 | +### RSE: Runtime Security Engine (Cortex‑M55) (Stage 1: Security Validation) |
| 77 | + |
| 78 | +RSE firmware runs on the Cortex‑M55 and plays a critical role in platform attestation and integrity enforcement. |
| 79 | +* Authenticates BL2, SCP, and UEFI firmware images (Secure Boot) |
| 80 | +* Records boot-time measurements (e.g., PCRs, ROT) |
| 81 | +* Releases boot authorization only after successful validation |
| 82 | + |
| 83 | +RSE acts as the second layer of the chain of trust, maintaining a monitored and secure environment throughout early boot. |
| 84 | + |
| 85 | + |
| 86 | +### SCP: System Control Processor (Cortex‑M7) (Stage 2: Early Hardware Bring-up) |
| 87 | + |
| 88 | +SCP firmware runs on the Cortex‑M7 core and performs early hardware initialization and power domain control. |
| 89 | +* Initializes clocks, reset controllers, and system interconnect |
| 90 | +* Manages DRAM setup and enables power for the application processor |
| 91 | +* Coordinates boot readiness with RSE via MHU (Message Handling Unit) |
| 92 | + |
| 93 | +SCP is central to bring-up operations and ensures the AP starts in a stable hardware environment. |
| 94 | + |
| 95 | +### TF-A: Trusted Firmware-A (BL1 / BL2) (Stage 3: Secure Execution Setup) |
| 96 | + |
| 97 | +TF‑A is the entry point of the boot chain and is responsible for establishing the system’s root of trust. |
| 98 | +* BL1 (Boot Loader Stage 1): Executes from ROM, initializing minimal hardware such as clocks and serial interfaces, and loads BL2. |
| 99 | +* BL2 (Boot Loader Stage 2): Validates and loads SCP, RSE, and UEFI images, setting up secure handover to later stages. |
| 100 | + |
| 101 | +TF‑A ensures all downstream components are authenticated and loaded from trusted sources, laying the foundation for a secure boot. |
| 102 | + |
| 103 | + |
| 104 | +### UEFI / GRUB / Linux Kernel (Stage 4–5: Bootloader and OS Handoff) |
| 105 | + |
| 106 | +After SCP powers on the application processor, control passes to the main bootloader and operating system: |
| 107 | +* UEFI (EDK2): Provides firmware abstraction, hardware discovery, and ACPI table generation |
| 108 | +* GRUB: Selects and loads the Linux kernel image |
| 109 | +* Linux Kernel: Initializes the OS, drivers, and launches the userland (e.g., BusyBox) |
| 110 | + |
| 111 | +On the FVP, you can observe this process via UART logs, helping validate each stage’s success. |
| 112 | + |
| 113 | + |
| 114 | +### LCP: Low Power Controller (Optional Component) |
| 115 | + |
| 116 | +If present in the configuration, LCP handles platform power management at a finer granularity: |
| 117 | +* Implements sleep/wake transitions |
| 118 | +* Controls per-core power gating |
| 119 | +* Manages transitions to ACPI power states (e.g., S3, S5) |
| 120 | + |
| 121 | +LCP support depends on the FVP model and may be omitted in simplified virtual setups. |
| 122 | + |
| 123 | + |
| 124 | +### Coordination and Handoff Logic |
| 125 | + |
| 126 | +The RD‑V3 boot sequence follows a multi-stage, dependency-driven handshake model, where each firmware module validates, powers, or authorizes the next. |
| 127 | + |
| 128 | +| Stage | Dependency Chain | Description | |
| 129 | +|-------|----------------------|-------------------------------------------------------------------------| |
| 130 | +| 1 | RSE ← BL2 | RSE is loaded and triggered by BL2 to begin security validation | |
| 131 | +| 2 | SCP ← BL2 + RSE | SCP initialization requires both BL2 and authorization from RSE | |
| 132 | +| 3 | AP ← SCP + RSE | The application processor starts only after SCP sets power and RSE permits | |
| 133 | +| 4 | UEFI → GRUB → Linux | UEFI launches GRUB, which loads the kernel and enters the OS | |
| 134 | + |
| 135 | +This handshake model ensures that no firmware stage proceeds unless its dependencies have securely initialized and authorized the next step. |
| 136 | + |
| 137 | +{{% notice Note %}} |
| 138 | +In the table above, arrows (←) represent **dependency relationships**—the component on the left **depends on** the component(s) on the right to be triggered or authorized. |
| 139 | +For example, `RSE ← BL2` means that RSE is loaded and triggered by BL2; |
| 140 | +`AP ← SCP + RSE` means the application processor can only start after SCP has initialized the hardware and RSE has granted secure boot authorization. |
| 141 | +These arrows do not represent execution order but indicate **which component must be ready for another to begin**. |
| 142 | +{{% /notice %}} |
| 143 | + |
| 144 | +{{% notice Note %}} |
| 145 | +Once the firmware stack reaches UEFI, it performs hardware discovery and launches GRUB. |
| 146 | +GRUB then selects and boots the Linux kernel. Unlike the previous dependency arrows (←), this is a **direct execution path**—each stage passes control directly to the next. |
| 147 | +{{% /notice %}} |
| 148 | + |
| 149 | +This layered approach supports modular testing, independent debugging, and early-stage simulation—all essential for secure and robust platform bring-up. |
| 150 | + |
| 151 | + |
| 152 | +In this module, you have: |
| 153 | + |
| 154 | +* Explored the full boot sequence of the RD‑V3 platform, from power-on to Linux login |
| 155 | +* Understood the responsibilities of key firmware components such as TF‑A, RSE, SCP, LCP, and UEFI |
| 156 | +* Learned how secure boot is enforced and how each module hands off control to the next |
| 157 | +* Interpreted boot dependencies using FVP simulation and UART logs |
| 158 | + |
| 159 | +With the full boot flow and firmware responsibilities now clear, you're ready to apply these insights. |
| 160 | +In the next module, you'll fetch the RD‑V3 codebase, configure your workspace, and begin building your own firmware stack for simulation. |
0 commit comments