Skip to content

U Boot Bootflow

Justin Hammond edited this page Mar 6, 2023 · 2 revisions

uboot bootflow

u-boot is configured with the Generic Distro Configuration Feature that determines how it loads the kernel/dtb/dt-overlays from the SD card. By default, uboot on the BL808 will search for /extlinux/extlinux.conf for the boot configuration, and if that is missing, then /boot.scr (these files are located in the "boot" partition, which will be mounted at /boot/ on the rootfs of these images).

Both the BL808 and Yocto images provide both a extlinux.conf and boot(-*).scr files on the boot partition.

The Default extlinux.conf file is:

# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
TIMEOUT 30
DEFAULT Pine64 OX64 Kernel
LABEL Pine64 0X64 Kernel
	KERNEL ../Image
	FDT ../bl808-pine64-ox64.dtb
	APPEND root=PARTLABEL=rootfs rootwait rw rootfstype=ext4 console=ttyS0,2000000 loglevel=8 earlycon=sbi
LABEL Sipeed M1SDock Kernel
	KERNEL ../Image
	FDT ../bl808-sipeed-m1s.dtb
	APPEND root=PARTLABEL=rootfs rootwait rw rootfstype=ext4 console=ttyS0,2000000 loglevel=8 earlycon=sbi

Changing the Default Kernel/DTB configuration for your board

By default, buildroot/yocto images are configured to boot a kernel with the Pine64 Ox64 DTS configuration. If you have the M1SDock and wish to enable things like LED trigger support etc you can update the extlinux.conf file to boot that image instead by changing the following entry:

DEFAULT Pine64 OX64 Kernel

to

DEFAULT Sipeed M1SDock Kernel

and restarting your board.

Adding additional Kernels

Simply copy your kernel/dtb files to the boot partition on the SD card, and add a new entry to the extlinux.conf file for your custom kernel and DTB files

DT Overlay Support

both the extlinux.conf and boot.scr files support loading DTOverlays from the SD Card. To add a DTOverlay to extlinux.conf entry:

LABEL Pine64 0X64 Kernel
	KERNEL ../Image
	FDT ../bl808-pine64-ox64.dtb
        FDTOVERLAYS <path to overlay file>
	APPEND root=PARTLABEL=rootfs rootwait rw rootfstype=ext4 console=ttyS0,2000000 loglevel=8 earlycon=sbi

Remember the path is relative to extlinux.conf, so if the dtbo file was in the root directory of the boot partition, the path will be "../" Multiple DTBO files may be specified on the same line enclosed in "

boot.scr support

If extlinux.conf is missing, u-boot will attempt to load boot.scr from the boot partition of the SDCard. boot.scr allows you to "script" u-boot and accepts standard u-boot commands. remember you need to "compile" your boot.scr before uploading to the SD card. Please consult the u-boot documentation for more details.