3.1.1.2. Build

3.1.1.2.1. Build U-Boot

Note

The following commands are intended to be run from the root of the U-Boot tree unless otherwise specified. The root of the U-Boot tree is the top-level directory and can be identified by looking for the “MAINTAINERS” file.

Note

Note about HSM Rearchitecture

After HSM rearchitecture in bootloader, loading of remote cores with firmware will be supported at A72 SPL stage only and not at R5 SPL stage. Early loading of remote core firmware in R5 SPL requires core reset functionality. As part of HSM rearchitecture, this functionality has moved into the DM service which requires SPL to re-implement device and clock control. This support is not present in Uboot R5 SPL due to memory constraints on the existing 64-bit TI devices.

Note

As of Processor SDK 9.0, compilation of bootloader images will no longer require different defconfigs for GP and HS devices. The same build commands will generate images for GP, HS-SE and HS-FS devices.

Prebuilt Images

Several prebuilt images are required from the TI Processor SDK for building U-Boot on K3 based platforms.

  • TF-A (BL-31): Refer to ARM Trusted Firmware-A for more information

  • OP-TEE (TEE): Refer to OP-TEE for more information

  • ti-linux-firmware (BINMAN_INDIRS): Prebuilt binaries for DM and SYSFW available here.

All of these are available in the SDK at <path to tisdk>/board-support/prebuilt-images>

Go here to download and install the SDK.

Setting up the toolchain paths

Before compiling any of the sources referenced in this document, set the cross compiler paths to the toolchains packaged in the Processor SDK [Recommended] as shown below. Refer to Yocto-built SDK Toolchains section for more details on usage.

host# export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
host# export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
host# export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
host# export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"

If the Processor SDK is not installed, the Arm GNU toolchains can be downloaded and setup. Refer to ARM toolchains section for more details on usage.

Compiling R5 and ARM64 images

Use the following table to determine what defconfig to use to configure with:

Board

SD / eMMC / UART / OSPI Boot

USB DFU

USB MSC

AM62X SK

am62x_evm_r5_defconfig am62x_evm_a53_defconfig

am62x_evm_r5_defconfig am62x_r5_usbdfu.config am62x_evm_a53_defconfig

am62x_evm_r5_defconfig am62x_r5_usbmsc.config am62x_evm_a53_defconfig

AM62X LP SK

am62x_lpsk_r5_defconfig am62x_lpsk_a53_defconfig

am62x_lpsk_r5_defconfig am62x_r5_usbdfu.config am62x_lpsk_a53_defconfig

am62x_lpsk_r5_defconfig am62x_r5_usbmsc.config am62x_lpsk_a53_defconfig

AM62SIP SK

am62xsip_evm_r5_defconfig am62xsip_evm_a53_defconfig

am62xsip_evm_r5_defconfig am62x_r5_usbdfu.config am62xsip_evm_a53_defconfig

am62xsip_evm_r5_defconfig am62x_r5_usbmsc.config am62xsip_evm_a53_defconfig

Note

Where to get the sources: Getting the Source Code

$ export UBOOT_DIR=<path-to-ti-u-boot>
$ export TI_LINUX_FW_DIR=<path-to-ti-linux-firmware>
$ export TFA_DIR=<path-to-arm-trusted-firmware>
$ export OPTEE_DIR=<path-to-ti-optee-os>

Note

The instructions below assume all binaries are built manually. For instructions to build bl31.bin go to: OP-TEE. For instructions to build tee-pager_v2.bin (bl32.bin) go to: ARM Trusted Firmware-A. BINMAN_INDIRS can point to <path-to-tisdk>/board-support/prebuilt-images/am62xx-evm to use the pre-built binaries that come in the pre-built SDK (bl31.bin for BL31, bl32.bin for TEE).

$ cd $UBOOT_DIR

R5
To build tiboot3.bin. Saved in $UBOOT_DIR/out/r5.

For AM62X
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" am62x_evm_r5_defconfig O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" O=$UBOOT_DIR/out/r5 BINMAN_INDIRS=$TI_LINUX_FW_DIR

For AM62X LP
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" am62x_lpsk_r5_defconfig O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" O=$UBOOT_DIR/out/r5 BINMAN_INDIRS=$TI_LINUX_FW_DIR

For AM62SIP
NOTE: AM62SIP Uses config fragment model.
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" am62x_evm_r5_defconfig am62xsip_sk_r5.config O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" O=$UBOOT_DIR/out/r5 BINMAN_INDIRS=$TI_LINUX_FW_DIR

A53
To build tispl.bin and u-boot.img. Saved in $UBOOT_DIR/out/a53. Requires bl31.bin, tee-pager_v2.bin

For AM62X or AM62SIP
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_64" am62x_evm_a53_defconfig O=$UBOOT_DIR/out/a53
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_64" CC="$CC_64" BL31=$TFA_DIR/build/k3/lite/release/bl31.bin TEE=$OPTEE_DIR/out/arm-plat-k3/core/tee-pager_v2.bin O=$UBOOT_DIR/out/a53 BINMAN_INDIRS=$TI_LINUX_FW_DIR

For AM62X LP
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_64" am62x_lpsk_a53_defconfig O=$UBOOT_DIR/out/a53
$ make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_64" CC="$CC_64" BL31=$TFA_DIR/build/k3/lite/release/bl31.bin TEE=$OPTEE_DIR/out/arm-plat-k3/core/tee-pager_v2.bin O=$UBOOT_DIR/out/a53 BINMAN_INDIRS=$TI_LINUX_FW_DIR

Note

BINMAN_INDIRS is used to fetch the DM binary from <path to ti-linux-firmware>/ti-dm/ and SYSFW binaries from <path to ti-linux-firmware>/ti-sysfw/. If using the SDK, BINMAN_INDIRS can point to <path to SDK>/board-support/prebuilt-images. Else any folder where DM is located in <path to folder>/ti-dm/ and SYSFW binaries are present in <path to folder>/ti-sysfw/ can be used. Please make sure to use the absolute path.

Note

It is also possible to pick up a custom DM binary by adding TI_DM argument pointing to the file. If not provided, it defaults to picking up the DM binary from BINMAN_INDIRS. This is only applicable to devices that utilize split firmware.