The Allwinner boot process
Most Allwinner systems use U-Boot as the boot program. This page documents that process.
U-Boot layout
Recent versions of U-Boot are split into a small first-stage loader called SPL and a main boot program. The following table shows SD Card layout expected by system ROM:
| SD Card layout | ||
| start | size | usage |
| 0 | 8KB | Partition table |
| 8KB | 32KB | Initial SPL loader |
| 40KB | 512KB | U-Boot |
| 552KB | 472KB | Reserved |
| 1024KB | - | Free for partitions |
To write the u-boot files to an SD Card:
# dd if=/usr/local/share/u-boot/u-boot-<portname>/u-boot-sunxi-with-spl.bin conv=notrunc,sync of=/dev/sd_card_device bs=1k seek=8
Alternatively on 64 bits SoCs you can put u-boot in an alternate location that doesn't conflict with GPT table
# dd if=/usr/local/share/u-boot/u-boot-<portname>/u-boot-sunxi-with-spl.bin conv=sync of=/dev/sd_card_device bs=128k seek=1
U-boot ports
The main U-Boot program can be configured with many different options for loading a kernel from SD card, USB drives, SATA drives, or the network. When booting FreeBSD the usual process is to have U-Boot start loader.efi from the FAT partition in either EFI/boot/bootarm.efi or EFI/boot/bootaa64.efi depending on the architecture.
Some precompiled u-boot are available via ports and packages. For instance, you can simply enter pkg install u-boot-cubieboard, and all the files you will need to get U-Boot onto an SD card are installed for you in /usr/local/share/u-boot, including a README file that tells you how to install the file(s) onto the SD card.
The following U-Boot ports and packages are available for Allwinner systems:
Technical note: these are all slave ports of sysutils/u-boot-master with some predefined variables.