Intel Agilex® 7 Hard Processor System Remote System Update User Guide

ID 683184
Date 6/09/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.1.5. Building U-Boot

The following commands can be used to get the U-Boot source code and compile it:
cd $TOP_FOLDER
rm -rf u-boot-socfpga
git clone https://github.com/altera-opensource/u-boot-socfpga
cd u-boot-socfpga
# comment out next line to use the latest default branch
# git chekcout -b test -t origin/socfpga_v2021.10
# Define mmc/sdcard as boot path for sbl->uboot. 
sed -i 's/u-boot,spl-boot-order.*/u-boot\,spl-boot-order = \&mmc;/g' arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
# Disable nand, as we are not using it
sed -i '/&nand {/!b;n;c\\tstatus = "disabled";' arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
sed -i '/NAND/d' configs/socfpga_agilex_defconfig
# change the prompt text
sed -i 's/SOCFPGA_AGILEX #/SOCFPGA #/g' configs/socfpga_agilex_defconfig
# Revert changes related to Single Boot Image. 
# Rename configuration 'default' to 'board-0' in kernel.its
sed -i "/\/delete-node\/ kernel;/d" arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
sed -i "s/default = \"conf\";/default = \"board-0\";/g" arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi
sed -i "s/conf {/board-0 {/g" arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi
# enable dwarf4 debug data for arm ds usage
sed -i 's/PLATFORM_CPPFLAGS += -D__ARM__/PLATFORM_CPPFLAGS += -D__ARM__ -gdwarf-4/g' arch/arm/config.mk
# Link with external files from ATF and Linux
ln -s $TOP_FOLDER/arm-trusted-firmware/build/agilex/release/bl31.bin .
ln -s $TOP_FOLDER/linux-socfpga/arch/arm64/boot/Image .
ln -s $TOP_FOLDER/linux-socfpga/arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dtb linux.dtb
make clean && make mrproper
make socfpga_agilex_defconfig
make -j 48
cd ..
After completing the above steps, the following files are created:
  • u-boot-socfpga/spl/u-boot-spl-dtb.hex — FSBL (U-boot SPL) hex file
  • u-boot-socfpga/u-boot.itb — FIT image file containing SSBL (U-Boot) and ATF (Arm Trusted Firmware) binaries
  • u-boot-socfpga/kernel.itb— FIT image containing the Linux kernel and linux device tree
Note: Intel® policy specifies that only the current and immediately previous U-Boot branches are kept on GitHub. At some point, the current U-Boot branch is removed and the above tag does not work anymore. In such an event, you can move to the latest release of all the components, as this should work. You must keep a local copy of the sources used to build your binaries in case you need to reproduce the build or make changes in the future.