Skip to content

Lesson 2 of 9 · 27m

Boot Chains and Device Trees: Describing Hardware Without Lying

Follow ROM to bootloader to kernel, learn what a device tree really describes, and debug pin, clock, memory, and peripheral mismatches.

A board that does not boot rarely owes you an explanation. The boot ROM prints nothing, the bootloader may print one line, and the kernel either speaks or does not. Treat boot as a chain of custody: every stage loads the next, passes state, and makes assumptions that must match the hardware exactly.

Follow the chain before changing anything

A typical ARM embedded sequence is:

Boot ROM -> SPL/U-Boot -> kernel Image/zImage -> rootfs
                     +-> device tree blob (.dtb)

The ROM loads the first-stage bootloader from a fuse-selected device. SPL initializes enough memory and storage to load U-Boot. U-Boot loads the kernel and device tree, chooses boot arguments, and jumps. If the kernel never starts, your problem is before Starting kernel. If it starts and stops early, suspect memory layout, console settings, or device tree contents before userspace.

A device tree is a description, not a driver

The device tree tells the kernel what hardware exists and how it is wired. It does not implement behavior:

&i2c1 {
    status = "okay";
    clock-frequency = <400000>;

    temperature-sensor@48 {
        compatible = "ti,tmp102";
        reg = <0x48>;
    };
};

This says: enable the first I2C controller, run it at 400 kHz, and expect a TMP102-compatible sensor at address 0x48. It becomes useful only when a driver matches compatible and every required resource — power, reset, clock, pinmux, interrupt — is valid.

Inspect what you actually boot

Device tree sources compile into blobs. Do not inspect only the source you think is booting when you can inspect the artifact:

dtc -I dts -O dtb -o board.dtb board.dts
dtc -I dtb -O dts /run/boot/board.dtb | less
tr -d '```

Production images routinely contain stale or alternate `.dtb` files selected through `fdtfile`, FIT images, or board-specific U-Boot logic. `dmesg | grep -Ei 'i2c|mmc|pinctrl'` often reveals whether the node even reached driver probe.

## Pinmux, clocks, and power are the usual lies

Declaring an I2C device does not connect physical pins to the controller. The same omission applies to regulators, reset GPIOs, PHY timing, memory chip selects, and bus widths. Compare the schematic and board revision, not a similar device tree copied from the internet. Endless probe deferral usually means a provider is missing; complete silence often means the node and driver never matched.

## Field notes

- Included `.dtsi` files can override or be overridden depending on ordering; inspect the final flattened tree.
- Device tree addresses are bus addresses in context, not universal magic numbers. Read the binding under `Documentation/devicetree/bindings`.
- Freeze bootloader, kernel, and device tree versions while debugging; change one input per experiment.
- A correct-looking node can describe the wrong physical part variant. Verify markings and schematic revision.

Was this lesson helpful?

Sign in to rate