Home / Learn Chip Programming / Embedded Linux Boot: ROM, SPL, U-Boot, Kernel, Init

Embedded Linux Boot: ROM, SPL, U-Boot, Kernel, Init

Every stage from power on to a shell prompt.

In shortEvery stage from power on to a shell prompt.

Theory in plain words

Boot chainBoot ROM (in the SoC)SPL: init DRAMU-Boot: load kernel + dtbLinux kernel startsmount rootfs, run init
Boot chain

What it is

Boot ROM loads a first stage (SPL), which sets up DRAM, loads U-Boot, which loads the kernel, device tree and optional initramfs. The kernel mounts the root file system and starts init (systemd, BusyBox).

Why we use it

Boot problems are the most common first obstacle in Linux boards. Knowing each stage tells you where to look.

How it works

Serial console is the key tool: you see messages from each stage. Set boot arguments (bootargs) to choose root device and console.

Where it is used

  • Custom boards
  • Fast boot optimisation
  • Recovering bricked boards

Boot step walkthrough

Follow the boot logTry it Yourself

No serial output at all usually means the boot ROM cannot find a valid first stage (wrong SD card layout or boot pins).

U-Boot environment
setenv bootargs "console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw"
setenv bootcmd  "fatload mmc 0:1 0x82000000 zImage; fatload mmc 0:1 0x88000000 board.dtb; bootz 0x82000000 - 0x88000000"
saveenv
boot
Tip:Always connect a 3.3 V USB-serial adapter to the debug UART (TX to RX, RX to TX, GND). Without a console, boot problems are almost impossible to debug.

Quick quiz

1. Who initialises DRAM?

2. First user-space process?

Common questions

Who initialises DRAM?

SPL or U-Boot. DRAM must work before bigger code loads.

First user-space process?

init (PID 1). The kernel starts init.