U-Boot Development
Iterate on the bootloader, the DTS and the environment
U-Boot Development
The bootloader uses U-Boot 2026.04 with a custom defconfig and devicetree. All the moving parts live under mds_external/board/mds_network_player/.
Rebuild
make build-uboot-rebuild
Produced artifacts (build/output/<machine>/images/):
u-boot-sunxi-with-spl.bin— SPL + U-Boot, raw imagespi-nand.bin— same, post-processed bymknandboot.shfor SPI NAND boot
Edit the configuration
make build-uboot-menuconfig
make build-uboot-savedefconfig
cp build/output/network_player/build/uboot-*/defconfig \
mds_external/board/mds_network_player/u-boot_defconfig
Devicetree and patches
u-boot_devicetree.dts— board DTS injected into U-Boot at configure time.uboot-patches/— patches applied on top of upstream U-Boot, in lexicographic order.
After editing either, force a clean rebuild:
make build-uboot-dirclean
make build-uboot
U-Boot environment
uboot.env (regular) and uboot.bootstrap.env (bootstrap image) describe the script U-Boot evaluates at boot.
Common things you may want to add there:
- Probe
/run.otafrom thefotapartition to trigger a recovery path. - Adjust the kernel command line (
ubi.mtd=,console=,rootfstype=). - Pick
uImagefromfotavsrootfs.
Heads up: today the environment is loaded from "nowhere" (boot log:
Loading Environment from nowhere... OK). Persisting the env back to a dedicated MTD region is on the TODO list — until then the script must be baked at build time.
SPI NAND boot machinery
Two scripts handle the SPL/U-Boot relocation needed for SPI NAND boot on the f1c200s:
mknandboot.sh— splits and re-packsu-boot-with-spl.binso the BootROM can load the SPL and the SPL can find U-Boot at the right offset.f1c100_uboot_spinand.sh— older companion script kept for reference.
Background and references:
- OpenWrt SPI NAND image generator (DolphinPi)
- TiNredmc u-boot SPI NAND fork
- Lichee Pi Nano + W25N01GV SPI NAND guide
- Mailing list patch series — SPI NAND boot for sunxi
FIT image
A FIT image (image.its) is used because plain legacy bootm was failing with Wrong Image Type for bootm command. The FIT bundles the kernel, the DTB and (for the FOTA flow) the initramfs.