Build U-Boot(基于TI AM64)

5 篇文章 0 订阅

Build U-Boot(基于SDK安装环境的,重点记录)refer Linux Academy for AM64X

需要重新编译的情况:

  • Enabling features which are disabled in the U-Boot defconfig
  • Disabling features which are enabled in the U-Boot defconfig
  • Modifying U-Boot source code to port U-Boot to a custom board

important tip:

  1. 一定注意ubuntu是ubuntu18.04.6LTS,尽量不要使用很久以前发布的镜像
  2. 需要先sudo su,提升权限。否则在sudo make时系统变量失效,导致arm-none-linux-gnueabihf-gcc can’t found错误。

step:

  1. Getting Security Dev Tool(must be set for HS)
$ git clone https://git.ti.com/git/security-development-tools/core-secdev-k3.git -b master
$ export TI_SECURE_DEV_PKG=`pwd`/core-secdev-k3
  1. Set Toolchain Path And Other Path
export SDK_INSTALL_DIR=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04
export PATH=$PATH:$SDK_INSTALL_DIR/linux-devkit/sysroots/x86_64-arago-linux/usr/bin
export UBOOT_DIR=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366
  1. Compile R5 Image
$ cd $UBOOT_DIR
$ export ARCH=arm
$ export CROSS_COMPILE=arm-none-linux-gnueabihf-
$ make am64x_evm_r5_defconfig O=build/r5
$ make O=build/r5
$ cd ../k3-image-gen-<version>/
$ make SOC=am64x SBL=$UBOOT_DIR/build/r5/spl/u-boot-spl.bin SYSFW_PATH=../prebuilt-images/<TI-SYSFW.bin>

**tip**:如果是GP版本,则不需要SYSFW_PATH,忽略即可。
```bash
$ make SOC=am64x SBL=<UBOOT_DIR>/build/r5/spl/u-boot-spl.bin 
  1. Compile ARM64 Image
    tip:
$ cd $UBOOT_DIR
$ export ARCH=arm
$ export CROSS_COMPILE=aarch64-none-linux-gnu-
$ make am64x_evm_a53_defconfig O=build/arm64
$ make ATF=$(pwd)/../prebuilt-images/bl31.bin TEE=$(pwd)/../prebuilt-images/bl32.bin O=build/arm64 #may be error,refer blow
  • unable to execute ‘swig’: No such file or directory
    error: command ‘swig’ failed with exit status 1
sudo apt install swig

tip:pay attention to python version

  • scripts/dtc/pylibfdt/libfdt_wrap.c:149:11: fatal error: Python.h: No such file or directory
sudo apt-get install python-dev
sudo apt-get install python3.6-dev #attention,match your python3 version ,my version is 3.6.9

Target Images
The steps above will generate the following U-Boot images.

  • tiboot3.bin
    Located under folder <SDK_INSTALL_DIR>/board-support/k3-image-gen-/. This is the first stage of the boot loader running on R5F core.

  • tispl.bin
    Located under folder <UBOOT_DIR>/build/arm64/. This is the first stage of the boot loader running on A53 core.

  • u-boot.img
    Located under folder <UBOOT_DIR>/build/arm64/. This is the second stage of the boot loader running on A53 core.

Update U-Boot on SD Card

$ ls /media/<username>/boot
  tiboot3.bin  tispl.bin  uboot.env  u-boot.img  uEnv.txt  wificfg
$ cd <UBOOT_DIR>
$ sudo cp ../k3-image-gen-<version>/tiboot3.bin /media/<username>/boot/
$ sudo cp build/arm64/tispl.bin /media/<username>/boot/
$ sudo cp build/arm64/u-boot.img /media/<username>/boot/
$ sudo umount /media/<username>/boot
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值