Building U-Boot

Sunxi U-Boot

Since the Sunxi "legacy" U-Boot for the A10 and A20 need GCC 4.x at the latest, a Buildroot Toolchain may need to be prepared before attempting to build U-Boot itself.

GCC 4.9 cross-toolchain from Buildroot

A tested recipe with a GCC 4.9 cross-toolchain from Buildroot 2018.08.4:

git clone https://github.com/linux-sunxi/u-boot-sunxi.git
cd u-boot-sunxi
make CROSS_COMPILE=arm-linux- EOMA68_A20_config
make CROSS_COMPILE=arm-linux-

To speed things up on modern hardware, use -j <processes> for parallel builds, as is typical for the use of make. For example:

make -j8 CROSS_COMPILE=arm-linux-

Note that Buildroot compilers tend to use their own naming, so it is arm-linux- and not arm-linux-gnueabihf- (as Debian uses) that needs to be used. However, if another compatible compiler is available with the Debian-style naming, then the CROSS_COMPILE setting should use that naming instead.

In the above, the use of EOMA68_A20_config sets up a bootloader for SD cards, whereas EOMA68_A20_FEL_config would set up a USB-bootable payload. See the documentation for all the details.

The above recipe should provide the u-boot-sunxi-with-spl.bin file that needs to be deployed on a suitable memory card.

Older, still installed gcc versions

Debian gcc versions are kept installed. export the right environment variables to use different gcc versions:

export CC=gcc-4.9
export CROSS_COMPILE=arm-linux-gnueabihf- (or something)
export ARCH=arm

or just:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CC=gcc-4.9 {insertwhatever}

Mainline U-Boot