U-Boot

Overview

U-Boot is the ubiquitous boot loader for most non-x86 based CPUs.  U-Boot is commonly used to run diagnostic tests on an embedded system.  These tests can include detecting devices on the PCIe bus, memory tests, and initializing board specific data.  As important as all of these tasks may be, the primary job of U-Boot is preparing the hardware to boot into Linux.  U-Boot is responsible for initializing enough of the hardware so that the Linux kernel can be loaded into memory and begin its boot process.

Downloading U-Boot

For the purposes of our class, we will not delve into the specifics of what U-Boot does or how to develop a board support package (BSP) for the Intel SoC.  Instead, we are simply going to download U-Boot from the public Intel GIT repository and compile the source code into a U-Boot image.

We can grab a copy of the Intel U-Boot source from GitHub.

git clone https://github.com/altera-opensource/u-boot-socfpga.git
cd u-boot-socfpga

Once inside the u-boot-socfpga directory, we need to check out a recent BSP release.  We can look at the released BSPs by using the following command:

git tag -l rel_socfpga*

We are going to use the following tag:

git checkout rel_socfpga_v2013.01.01_18.06.02_pr

Compiling U-BOOT

Unfortunately, the source in this tag does not compile with the 7.x version of the gcc compiler.  So we will download version 6.4 of the gcc compiler to build U-Boot

cd
wget https://releases.linaro.org/components/toolchain/binaries/6.4-2018.05/arm-linux-gnueabihf/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
tar -xf gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
export CROSS_COMPILE=/home/ece453/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

Now that we have a compiler that will correctly compile U-Boot, we will configure and compile the source.

cd u-boot-socfpga
make mrproper
make socfpga_cyclone5_config
make

The compiled image is named u-boot.img.  This file will need to be placed in the first partition of the bootable SD card.

u-boot