3.1.1.2. Build
Build BL-1
Note
The following commands are intended to be run from the root of the TF-A tree unless otherwise specified. The root of the TF-A tree is the top-level directory and can be identified by looking for the “licenses” directory.
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.
$ cd <path to tf-a dir>
$ make CROSS_COMPILE="$CROSS_COMPILE_64" ARCH=aarch64 PLAT=k3 TARGET_BOARD=am62l am62l_bl1
<or to build bl-1 and bl-31 binaries from TF-A repo>
$ make CROSS_COMPILE="$CROSS_COMPILE_64" ARCH=aarch64 PLAT=k3 TARGET_BOARD=am62l
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.
Prebuilt Images
Several prebuilt images are required from the TI Processor SDK for building U-Boot on K3 based platforms.
TF-A (BL-1 and BL-31): Refer to ARM Trusted Firmware-A for more information
ti-linux-firmware (BINMAN_INDIRS): Prebuilt TIFS binaries are available in ti-linux-firmware.
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.
Board |
SD / eMMC / UART / OSPI / USB DFU / USB MSC |
---|---|
AM62LX EVM |
|
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>
Note
The instructions below assume all binaries are built manually.
For instructions to build bl1.bin
or bl31.bin
go
to: ARM Trusted Firmware-A.
BINMAN_INDIRS can point to
<path-to-tisdk>/board-support/prebuilt-images
to use
the pre-built binaries that come in the pre-built SDK.
$ cd $UBOOT_DIR
$ make CROSS_COMPILE="$CROSS_COMPILE_64" am62lx_evm_defconfig
$ make CROSS_COMPILE="$CROSS_COMPILE_64" \
BL1=$TFA_DIR/build/k3/lite/release/bl1.bin \
BL31=$TFA_DIR/build/k3/lite/release/bl31.bin \
BINMAN_INDIRS=$TI_LINUX_FW_DIR
Note
BINMAN_INDIRS is used to fetch the TIFS 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 SYSFW binaries are present in
<path to folder>/ti-sysfw/
can be used. Please make sure
to use the absolute path.