Yocto Build U-Boot TI: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 2: Line 2:
--> {{INIT_RELEASE_PARAM|am62-yocto-dunfell-5.10.140_08.06.00.42-v1.0}}<!--
--> {{INIT_RELEASE_PARAM|am62-yocto-dunfell-5.10.140_08.06.00.42-v1.0}}<!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#vardefine:WORKDIR|~/{{#var:MACHINE_NAME}}-u-boot}} <!--
--> {{PageHeader|Yocto Build U-Boot from source code}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__
--> {{PageHeader|Yocto Build U-Boot from source code}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__


Line 7: Line 8:


This guide walks through the process for manually building and installing the U-Boot images from source. It is derived from TI's [https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/{{#var:TI_RELEASE_}}/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html?highlight=build%20uboot General Information] guide
This guide walks through the process for manually building and installing the U-Boot images from source. It is derived from TI's [https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/{{#var:TI_RELEASE_}}/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html?highlight=build%20uboot General Information] guide
= Fetch source code and install dependencies =
This section describes the one time process to install the toolchains and fetch the necessary source code for building U-Boot.
== Install Toolchains to home directory ==
{{K3_TOOLCHAIN_INSTALL}}
== Fetch Source Code ==
Setup a working directory
$ mkdir {{#var:WORKDIR}}
Fetch the U-Boot source:
{{GIT_FETCH|NAME=U-BOOT|WORKDIR={{#var:WORKDIR}}}}
Fetch the core-secdev-k3 Security Dev Tool:
{{GIT_FETCH|NAME=CORE_SECDEV_K3|WORKDIR={{#var:WORKDIR}}|USE_COMMIT=y}}
Fetch ti-k3-image-gen:
{{GIT_FETCH|NAME=K3_IMAGE_GEN|WORKDIR={{#var:WORKDIR}}|USE_COMMIT=y}}
Fetch ti-linux-firmware:
{{GIT_FETCH|NAME=TI_LINUX_FIRMWARE|WORKDIR={{#var:WORKDIR}}|USE_COMMIT=y}}
Fetch arm-trusted-firmawre:
{{GIT_FETCH|NAME=ATF|WORKDIR={{#var:WORKDIR}}|USE_COMMIT=y}}
Fetch optee-os:
{{GIT_FETCH|NAME=OPTEE|WORKDIR={{#var:WORKDIR}}|USE_COMMIT=y}}
= Build U-Boot out of Yocto tree =
After fetching the source code and installing dependencies, you may return to {{#var:WORKDIR}} anytime and follow these steps to build U-Boot:
== Setup the environment: ==
$ export PATH=$HOME/{{#var:armv7_toolchain}}/bin:$PATH && \
  export PATH=$HOME/{{#var:armv8_toolchain}}/bin:$PATH && \
  export export TI_SECURE_DEV_PKG={{#var:WORKDIR}}/{{#var:CORE_SECDEV_K3_REPO}} && \
  export UBOOT_DIR={{#var:WORKDIR}}/{{#var:U-BOOT_REPO}}  && \
  export K3IG_DIR={{#var:WORKDIR}}/{{#var:K3_IMAGE_GEN_REPO}} && \
  export SYSFW_DIR={{#var:WORKDIR}}/{{#var:TI_LINUX_FIRMWARE_REPO}}/ti-sysfw && \
  export DMFW_DIR={{#var:WORKDIR}}/{{#var:TI_LINUX_FIRMWARE_REPO}}/ti-dm/am62xx && \
  export TFA_DIR={{#var:WORKDIR}}/{{#var:ATF_REPO}} && \
  export OPTEE_DIR={{#var:WORKDIR}}/{{#var:OPTEE_REPO}} \
== Build for GP {{#var:SOC}} SoC: ==
** R5 Images **
Build u-boot-spl.bin for tiboot3.bin. Saved in $UBOOT_DIR/out/r5:
$ cd {{#var:WORKDIR}}/{{#var:U-BOOT_REPO}}
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- {{#var:U-BOOT_R5_DEFCONFIG}} O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O=$UBOOT_DIR/out/r5
Build tiboot3-am62x-gp-evm.bin. Saved in $K3IG_DIR. Requires u-boot-spl.bin and ti-fs-firmware-am62x-gp.bin.
$ cd {{#var:WORKDIR}}/{{#var:U-BOOT_REPO}}
$ cd $K3IG_DIR
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- SOC=am62x SOC_TYPE=gp SBL=$UBOOT_DIR/out/r5/spl/u-boot-spl.bin SYSFW_DIR=$SYSFW_DIR
** A53 Images **
Build tispl.bin and u-boot.img. Saved in $UBOOT_DIR/out/a53. Requires bl31.bin, tee-pager_v2.bin, and ipc_echo_testb_mcu1_0_release_strip.xer5f.
$ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- U-BOOT_A53_DEFCONFIG O=$UBOOT_DIR/out/a53
$ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- ATF=$TFA_DIR/build/k3/lite/release/bl31.bin TEE=$OPTEE_DIR/out/arm-plat-k3/core/tee-pager_v2.bin DM=$DMFW_DIR/ipc_echo_testb_mcu1_0_release_strip.xer5f O=$UBOOT_DIR/out/a53

Revision as of 22:16, 24 March 2023

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release am62-yocto-dunfell-5.10.140_08.06.00.42-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
Yocto Build U-Boot from source code

Introduction

This guide walks through the process for manually building and installing the U-Boot images from source. It is derived from TI's General Information guide

Fetch source code and install dependencies

This section describes the one time process to install the toolchains and fetch the necessary source code for building U-Boot.

Install Toolchains to home directory

$ cd ~
$ wget  && \
   tar -Jxvf  -C $HOME && \
   wget  && \
   tar -Jxvf  -C $HOME

Fetch Source Code

Setup a working directory

$ mkdir ~/-u-boot

Fetch the U-Boot source:

$ cd ~/-u-boot
$ git clone  -b  

Fetch the core-secdev-k3 Security Dev Tool:

$ cd ~/-u-boot
$ git clone  -b  
$ cd  && \
  git checkout  && \
  cd ../

Fetch ti-k3-image-gen:

$ cd ~/-u-boot
$ git clone  -b  
$ cd  && \
  git checkout  && \
  cd ../

Fetch ti-linux-firmware:

$ cd ~/-u-boot
$ git clone  -b  
$ cd  && \
  git checkout  && \
  cd ../

Fetch arm-trusted-firmawre:

$ cd ~/-u-boot
$ git clone  -b  
$ cd  && \
  git checkout  && \
  cd ../

Fetch optee-os:

$ cd ~/-u-boot
$ git clone  -b  
$ cd  && \
  git checkout  && \
  cd ../

Build U-Boot out of Yocto tree

After fetching the source code and installing dependencies, you may return to ~/-u-boot anytime and follow these steps to build U-Boot:

Setup the environment:

$ export PATH=$HOME//bin:$PATH && \
  export PATH=$HOME//bin:$PATH && \
  export export TI_SECURE_DEV_PKG=~/-u-boot/ && \
  export UBOOT_DIR=~/-u-boot/  && \
  export K3IG_DIR=~/-u-boot/ && \
  export SYSFW_DIR=~/-u-boot//ti-sysfw && \
  export DMFW_DIR=~/-u-boot//ti-dm/am62xx && \
  export TFA_DIR=~/-u-boot/ && \
  export OPTEE_DIR=~/-u-boot/ \

Build for GP SoC:

    • R5 Images **

Build u-boot-spl.bin for tiboot3.bin. Saved in $UBOOT_DIR/out/r5:

$ cd ~/-u-boot/
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf-  O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O=$UBOOT_DIR/out/r5

Build tiboot3-am62x-gp-evm.bin. Saved in $K3IG_DIR. Requires u-boot-spl.bin and ti-fs-firmware-am62x-gp.bin.

$ cd ~/-u-boot/
$ cd $K3IG_DIR
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- SOC=am62x SOC_TYPE=gp SBL=$UBOOT_DIR/out/r5/spl/u-boot-spl.bin SYSFW_DIR=$SYSFW_DIR
    • A53 Images **

Build tispl.bin and u-boot.img. Saved in $UBOOT_DIR/out/a53. Requires bl31.bin, tee-pager_v2.bin, and ipc_echo_testb_mcu1_0_release_strip.xer5f.

$ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- U-BOOT_A53_DEFCONFIG O=$UBOOT_DIR/out/a53
$ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- ATF=$TFA_DIR/build/k3/lite/release/bl31.bin TEE=$OPTEE_DIR/out/arm-plat-k3/core/tee-pager_v2.bin DM=$DMFW_DIR/ipc_echo_testb_mcu1_0_release_strip.xer5f O=$UBOOT_DIR/out/a53