• Build U-Boot(基于TI AM64)


    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
    • 2
    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
    • 2
    • 3
    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    
    **tip**:如果是GP版本,则不需要SYSFW_PATH,忽略即可。
    ```bash
    $ make SOC=am64x SBL=<UBOOT_DIR>/build/r5/spl/u-boot-spl.bin 
    
    • 1
    • 2
    • 3
    • 4
    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • unable to execute ‘swig’: No such file or directory
      error: command ‘swig’ failed with exit status 1
    sudo apt install swig
    
    • 1

    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
    
    • 1
    • 2

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

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

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

    • u-boot.img
      Located under folder /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
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
  • 相关阅读:
    【深度学习】DDoS-Detection-Challenge aitrans2024 入侵检测,基于机器学习(深度学习)判断网络入侵
    Linux常用命令——常用网络命令
    Redis_10_Redis集群实现RedisCluster应对大数据量
    数据结构之AVL树
    Java教程之面向对象 - 继承
    【GD32F427开发板试用】添加 shell 功能用于控制板载外设
    信息化发展35
    Java程序设计复习提纲(上:入门语法)
    Tableau长期免费使用的方法总结
    星途星纪元 ES,用艺术思维表达工程技术
  • 原文地址:https://blog.csdn.net/wzx_numberone/article/details/128054036