linux-boot-arm · m00 · Orientation
The boot chain at a glance
When you power on an ARM board, the first code that runs is not yours. It is a small program inside the chip: the boot ROM. Its job is to find the next program and run it. That program finds the next one, and so on, until the Linux kernel starts the first user process, PID 1. This sequence is the boot chain.
Each stage does a little, then hands over
The boot ROM can’t start Linux directly. When it runs, the board’s main memory (DRAM) is not set up yet, so only a small on-chip memory is usable. The first loader has to fit there, and its main job is to bring up DRAM so the next, larger stage has room.
Boot starts on the VideoCore GPU; the Arm cores wait in reset until the firmware releases them.
Stage 1 of 6
Boot ROM
(mask ROM) · loaded from inside the SoC
- The GPU-side VPU executes first. The Arm cores are still held in reset.
- Looks for the second-stage bootloader in the SPI EEPROM.
- If that image is corrupt, loads recovery.bin from the SD card to reflash it.
Sources: Raspberry Pi documentation: Raspberry Pi hardware, boot sequence and boot EEPROM
Where it runs
Serial · 115200 8N1 · illustrative
Play the chain on each board and watch three things:
- Where code runs moves from ROM, to on-chip memory, to DRAM.
- Who runs first differs. On the Raspberry Pi 4 the VideoCore GPU starts before the Arm cores. On the BeagleBone Black and the STM32MP157, an Arm core runs the boot ROM.
- The world changes. On the STM32MP157 the early stages run in the secure world, and U-Boot and Linux run in the normal world.
Memory decides the order
The BeagleBone Black’s ROM copies the first loader, U-Boot SPL, into internal SRAM, because DDR is not ready yet. SPL sets up DDR, then loads the full U-Boot into it. You will see the same pattern on every board, with different names.
The console tells you where you are
Each stage prints its own banner on the serial console. Reading those banners is the fastest way to find which stage failed when a board does not boot.
What comes next
Module 01 covers the ARM architecture you need to follow these stages: exception levels and processor modes, and how the CPU moves from one stage to the next.