
Recall first from Loading U-Boot and the environment
- SPL reads an image from a storage location and transfers control to an entry point in memory.
- Full U-Boot imports the persistent environment through its configured backend and can use compiled defaults when no valid saved copy is available.
- Linux environment tools need the same device, offset, size, and redundancy layout as U-Boot.
Handing Linux a kernel, a device tree, and arguments
5 min readU-Boot exists to hand off to Linux, and first you must get U-Boot itself onto the hardware. This lesson answers the FIT image and distro boot flow, and the JTAG, SD and USB paths for the very first install.
On a BeagleBone Black, a kernel can start and still fail to mount its root filesystem. The Linux kernel parameter documentation defines root= as the root filesystem selector. If it points to the wrong partition, replacing the bootloader can leave the failure exactly where it was. During bring-up, pin down which stage produced the last evidence you saw. A U-Boot prompt proves the bootloader is running. A Linux boot message proves execution reached the kernel. A running userspace confirms that the boot progressed through root filesystem setup and startup of the init program.
As you saw in M4, the bootloader supplies more than kernel code. In the device-tree boot path, Linux receives a pointer to the DTB that describes the running board. U-Boot can supply an initramfs as well. When present, it gives the kernel an initial filesystem in memory and can run early userspace before the system switches to a persistent root filesystem. For a direct boot without an initramfs, the kernel itself needs the built-in support required to reach and mount the specified root filesystem.
A Flattened Image Tree, an image format that describes payloads and the configurations that select them, can put the kernel, board DTB, and optional initramfs in one file. A FIT can hold multiple configurations. For example, configurations can share a kernel and each select a different DTB. The configuration name matters because it selects a set of payloads that U-Boot will use together.
The source is an image tree source file, conventionally named with an .its suffix. Its images node describes the payloads. Each payload entry can use /incbin/ to include a binary and record properties such as image type, architecture, and compression. A configurations node refers to those entries by name. The following complete ITS defines two payloads and one configuration for a BeagleBone Black. The address 0x80008000 is an example for a zImage, so use your board's verified values. Keep the kernel's load range away from the RAM address where you load the FIT itself. On the AM335x EVM U-Boot environment, loadaddr defaults to 0x82000000.
/dts-v1/;
/ {
description = "BeagleBone Black kernel and device tree";
#address-cells = <1>;
images {
kernel {
description = "Linux kernel";
data = /incbin/("zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x80008000>;
entry = <0x80008000>;
};
fdt-bbb {
description = "am335x-boneblack";
data = /incbin/("am335x-boneblack.dtb");
type = "flat_dt";
arch = "arm";
compression = "none";
};
};
configurations {
default = "conf-bbb";
conf-bbb {
description = "BeagleBone Black";
kernel = "kernel";
fdt = "fdt-bbb";
};
};
};
For this example, the kernel entry includes the ARM zImage and the FDT entry includes am335x-boneblack.dtb. A zImage can contain its own compressed kernel. The FIT property compression = "none" describes the absence of an additional compression layer applied to that payload. Use your board's verified kernel load and entry settings in the complete ITS, and check that the loaded FIT, its destination payloads, and the space needed by the kernel cannot overlap in a way that corrupts them. A FIT address at the U-Boot prompt identifies the container in RAM. The kernel load and entry settings describe where the kernel goes and where execution begins.
On Ubuntu, mkimage is supplied by u-boot-tools, and the FIT creation flow uses dtc from device-tree-compiler. With a complete board.its and its referenced binaries in place, build and list the image on the host.
mkimage -f board.its board.itb
mkimage -l board.itb
Check the listing for the expected kernel, DTB and configuration names and their associations. That inspection can catch a packaging mistake before you copy anything to the board. Successful packaging still leaves the board-specific load addresses, device tree, and root filesystem to be validated during boot.
For a manual boot, suppose you have put board.itb at the root of the boot filesystem. The following commands run at the U-Boot prompt. They assume mmc 0:1 is the boot partition for this run and loadaddr is already set to an appropriate RAM address. Check both on the target before using them. The sample root= value assumes Linux sees the intended root filesystem as /dev/mmcblk0p2.
load mmc 0:1 ${loadaddr} /board.itb
setenv bootargs 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait'
bootm ${loadaddr}#conf-bbb
Run each command after the preceding command succeeds. A failed load can leave older data at the same RAM address. bootm selects conf-bbb, prepares its payloads and transfers control to Linux. The example bootargs requests a serial console and tells Linux which root device to use. rootwait tells Linux to wait for that device to appear. U-Boot's MMC device number and Linux's block device number are assigned by their respective software, so verify the Linux root device independently. A root partition identified by PARTUUID can avoid relying on Linux's MMC enumeration order when the partition identifier is known.
For this device-tree handoff, U-Boot can put the command line in /chosen/bootargs in the DTB passed to Linux. Once the system reaches a shell, /proc/cmdline shows the command line the running kernel received. If early output is missing, check the selected console and the DTB before drawing a conclusion about whether the kernel ran.
Finding a boot entry automatically
3 min readbootcmd is the U-Boot environment variable that holds the command sequence for autoboot. If autoboot proceeds, U-Boot executes that sequence. A board can define it to load and boot a particular FIT, or to invoke a discovery flow. bootargs holds Linux arguments during the handoff. At the U-Boot prompt, printenv bootcmd shows the automatic command, and printenv bootargs shows the current argument value. The automatic command or a boot method may set bootargs later, so inspect the selected boot entry if the value at the prompt is empty or differs from /proc/cmdline.
In M4 you saw distro boot as a way for a distribution to place a boot description on disk. In the older environment-script implementation, bootcmd commonly runs distro_bootcmd, which walks boot_targets and searches for boot descriptions. Standard Boot, also called bootstd, implements discovery with U-Boot's boot device and boot method infrastructure. The board build and its environment determine which implementation runs. Inspect bootcmd on the particular board rather than inferring the flow from the existence of extlinux.conf.
In Standard Boot, a boot device exposes a candidate source such as an MMC device. A boot method, which knows how to discover and boot a particular kind of boot description, examines the candidate. The extlinux method looks for extlinux/extlinux.conf under the configured search prefixes. Common paths on the candidate filesystem are /extlinux/extlinux.conf and /boot/extlinux/extlinux.conf. A discovered boot flow represents an instance that can be booted from that source using that method. On a build with Standard Boot and its scan command, bootflow scan -b scans and attempts to boot discovered flows.
Here is an entry using separate kernel and DTB files. Its paths are relative to the root of the filesystem containing the boot description. This example assumes the kernel and DTB are both in that filesystem's root directory and the Linux root filesystem is on the device named by APPEND.
DEFAULT bbb
LABEL bbb
MENU LABEL BeagleBone Black Linux
LINUX /zImage
FDT /am335x-boneblack.dtb
APPEND console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait
DEFAULT selects a label from the file. LINUX identifies the kernel file, FDT selects the DTB, and APPEND supplies the Linux command line for this entry. An entry can also name an initial RAM filesystem using INITRD. This extlinux example and the manual FIT example both supply Linux with a kernel and a board description. The image selection lives in the FIT configuration in one case and in a filesystem boot description in the other.
When automatic boot fails, locate the first failed operation. If the scan never finds an entry, check whether it can read the intended device and partition, then check the search paths. If it finds the entry but cannot load a file, check the entry's path against the root of that filesystem. If Linux prints messages and waits for its root device, examine APPEND or the manually supplied bootargs, along with the kernel's ability to access the selected device. The same SD card can contain a ROM-readable bootloader, a filesystem with extlinux.conf, and a root filesystem. Each reader uses its own rules to find what it needs.
Starting U-Boot on a blank board
4 min readA blank BeagleBone Black in this lesson means its onboard eMMC lacks a bootable installation. The AM335x still has its factory-programmed boot ROM. The practical first-install sequence from M4 is to get a working loader into execution, use a supported writer to program persistent storage, then boot again from that storage. The first successful prompt may come from removable media or a debugger session. Its source determines what will happen when you remove the media or cut power.
- SD boot. Prepare a microSD card using the BeagleBone Black boot layout for your build. In the FAT-file boot layout, the ROM loads the SPL file named
MLO. SPL then loadsu-boot.imgfrom the card in this layout. Use a matched pair from the same board build. On the BeagleBone Black, hold the boot button during power-on to select the alternate boot order with microSD ahead of onboard eMMC. Watch the serial console to confirm that the card started U-Boot. This gives you an independent way to bring up a board whose eMMC is empty. - USB ROM boot. The AM335x ROM supports a USB peripheral boot path. With that mode selected and a suitable host connected to the board's USB client port, the ROM presents a USB Ethernet interface using RNDIS. The host supplies boot information using BOOTP and transfers the initial image using TFTP. Use the board's ROM-boot procedure for the image format, USB connection, and host setup, and ensure the first-stage loader has a supported way to obtain its next stage. This USB connection is between the ROM and a host. A USB flash drive plugged into the BeagleBone Black's host port serves a different purpose.
- JTAG into RAM. A debugger can halt the processor and write an executable into accessible memory when debug access is available. Right after reset, external DRAM may require initialization before it can accept a full U-Boot image. One route is to download an appropriate SPL to on-chip SRAM and run it. Another uses a board-specific debugger initialization sequence to bring up DRAM before downloading a suitable full U-Boot image there. Use the load location, entry point, and initial CPU state required by the chosen image. This route is useful when proving that a new build can run even though the board's usual boot source is unavailable.
Once you have a loader running, use the board's documented installation procedure to put the boot artifacts where its persistent boot path expects them. For example, an SD-booted Linux installer can write a BeagleBone Black eMMC image containing both boot stages and a bootable Linux installation. From a running U-Boot, the available programming commands depend on the build and storage layout. Identify the intended destination and the required layout before any write. The files used by the first-stage loader and the kernel FIT are separate artifacts with different readers. A board.itb created for bootm cannot by itself replace the eMMC boot stages.
Verify the installation with a cold boot using the intended eMMC boot order, with the microSD removed and any debugger or USB boot host disconnected as appropriate. Record what appears on serial. If you see the expected U-Boot build, the persistent bootloader path worked. If Linux then reports a failure to mount its root filesystem, you can continue debugging from the kernel handoff with that bootloader result established.
Going deeperExplore the mechanism
In Falcon mode, SPL loads and boots Linux directly, skipping full U-Boot. A board and its SPL build need support for that route, including a supported way to load the kernel and provide the boot parameters and device tree. The direct boot path skips the normal full U-Boot bootcmd and extlinux scan. Trace the regular boot first so you have a reference for the work moved into SPL or prepared in advance. The time saved is a measurement question covered in the lesson M14-S07A, Measuring boot time.
The next lesson, Early UART and earlycon, covers what to do when this flow produces no output: how to get console messages out of the board from the first instructions of the boot.
Key takeaways
- An ITS describes the payloads and configurations that mkimage packages in an ITB.
- bootcmd controls U-Boot autoboot, while bootargs carries the Linux command line.
- The extlinux boot method reads kernel paths and command-line arguments from extlinux.conf.
- A first boot through JTAG, SD, or USB can provide a running loader for writing onboard storage.
Reflect
- Explain to a colleague, in two sentences: identify the FIT source, payloads, and selected configuration
- Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
- What surprised you when you ran the commands yourself?
On a real board
Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.
References and further reading
Official documentation first. Links checked when the lesson was published.