Skip to content
Libre Computer
Platform

Module 3 ยท Lab 3

The boot ROM

When reset is released, the CPU starts at a fixed address inside the system-on-chip, in code written at the factory. That code cannot be changed or erased, which is why a board with broken firmware or boot media can always be brought back.

Where this stage sits

The boot chain: each stage loads the nextBoot ROMfixed in the chipmodule 3First stageclocks, consolemodule 4Memory bring-uptimings, trainingmodule 5Secure monitorTF-A, stays residentmodule 6U-Bootstorage, USB, networkmodule 6UEFIstandard interfacemodule 7Linux kerneldrivers, rootmodule 8initsystemd, servicesmodule 8runs from On-chip ROMruns from On-chip SRAMruns from DRAMPower and reset come first (module 2); I/O, drivers and your project run on the finished system (modules 9 to 12).
Where this module sits in the boot chain.

Key ideas

  • The boot ROM (also called the mask ROM) is part of the silicon. Its whole job is to find the first stage of the bootloader and start it.
  • It tries boot sources in a fixed order, such as SPI flash, eMMC and the SD card. Both course boards have a boot select switch that changes which source is tried first; the schematic's boot page shows how.
  • From the first source that holds a valid image, it reads a small first stage, checks its header (and on a secured device, its signature, against keys held in fuses), copies it into on-chip SRAM and jumps to it.
  • If no source holds a valid image, or the USB boot button is held at power-on, it waits in USB boot mode for a computer to send the first stage over USB. The Libre Computer app and the recovery tools use this.

On the bench

In short, what you do in lab 3, where the steps are given in full:

  1. In the Lab 1 log, mark the lines printed before any code from the SPI flash or the boot media ran.
  2. Flip the boot select switch and power on: watch the boot ROM try its sources in a different order, and write down what you observe.
  3. Hold the USB boot button at power-on and connect the phone running the app, or a PC running the Amlogic USB boot tool, to the USB Type-C port; let it send the first stage, and see the board start without its own firmware.

Resources

ResourceUse in this module
Troubleshooting boot issues on Amlogic boardsWhat an Amlogic board prints, and where boots stop
boot.libre.computerThe published boot files the app sends to a board in USB boot mode
eMMC flashing steps from Linux with pyamlbootUSB boot from a PC instead of a phone, with the Amlogic USB boot tool