Texas Instruments 处理器资料导航(TI AM64x)

链接

  1. processor-sdk-linux
  2. AM6442: Sitara Webinar Series: Using Codesys Control on Sitara AM64x RT Linux for PLC controller stacks
  3. AM64X Linux Academy
  • 定制硬件上构建定制Linux系统更快更容易
    • Linux System Design:整体设计过程,从硬件设计参考、处理器SDK、系统设计Checklist和Romote Core Development四个层面说明。
    • Evaluating Linux:开箱即用,允许客户通过各种各样的Labs与SDK交互,动手实践,学习加速开发的tips和tricks。
    • Develop Linux on TI EVM:讨论了如何在开发过程中修改SDK。介绍引导模式、闪烁、重新构建U-Boot或Linux内核等核心组件等。
    • Porting Linux to Custom Hardware:Porting U-Boot 和Porting Kernel
  1. TI E2E处理器技术支持论坛
  2. TI 处理器选型指南
  3. TISCI
    TIFS(Texas Instruments Foundational Security,德州仪器基础安全):TI提供的基础安全软件。
    TISCI(Texas Instruments System Controller Interface,德州仪器系统控制器接口):TIFS、RM/PM服务的API接口。
    DM(Device Manager,设备管理器):资源管理和电源管理软件的统称。
    RM(Resource Management,资源管理):用来指代资源管理软件的术语。
    PM(Power Management,电源管理):用来指电源管理软件的术语。
    SYSFW(System Firmware,系统固件):用来指代TIFS和RM/PM软件的统称。
  4. TMDS64GPEVM
  5. AM64x MCU+ SDK 08.02.00

Connecting with Linux

dmesg | grep ttyUSB
screen /dev/ttyUSB0 115200

Linux Boot Flow

在基于K3架构的设备上,ROM只支持通过R5引导。这意味着引导加载程序必须在R5核心上运行。Linux引导体系结构如下图所示。这种引导体系结构考虑了安全性,同时还允许更快的引导时间。

+------------------------------------------------------------------------+
|      DMSC(M3)          |         R5            |        ARM64(A53)     |
+------------------------------------------------------------------------+
|    +---------+         |                       |                       |
|    |  Reset  |         |                       |                       |
|    +---------+         |                       |                       |
|         :              |                       |                       |
|    +---------+         |   +------------+      |                       |
|    | *ROM*   |---------|-->| Reset rls  |      |                       |
|    +---------+         |   +------------+      |                       |
|    |         |         |         :             |                       |
|    |  ROM    |         |         :             |                       |
|    |services |         |         :             |                       |
|    |         |         |   +-------------+     |                       |
|    |         |         |   |  *R5 ROM*   |     |                       |
|    |         |         |   +-------------+     |                       |
|    |         |<--------|---| Load & auth |     |                       |
|    |         |         |   | tiboot3.bin |     |                       |
|    |         |         |   | (R5 SPL +   |     |                       |
|    | Start   |         |   | SYSFW image)|     |                       |
|    | SYSFW   |         |   +-------------+     |                       |
|    +--------+          |         :             |                       |
|        :               |         :             |                       |
|    +---------+         |         :             |                       |
|    | *SYSFW* |         |   +-------------+     |                       |
|    |         |         |   |  *R5 SPL*   |     |                       |
|    |         |         |   +-------------+     |                       |
|    |         |         |   |    DDR      |     |                       |
|    |         |         |   |   Config    |     |                       |
|    |         |         |   +-------------+     |                       |
|    |         |<--------|---|  Start A53  |     |                       |
|    |         |         |   |  and Reset  |     |                       |
|    |         |         |   +-------------+     |                       |
|    |         |         |                       |     +-----------+     |
|    |         |---------|-----------------------|---->| Reset rls |     |
|    |         |         |                       |     +-----------+     |
|    |  DMSC   |         |                       |          :            |
|    |Services |         |                       |     +-----------+     |
|    |         |<--------|-----------------------|---->|*ATF/OPTEE*|     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |          :            |
|    |         |         |                       |     +-----------+     |
|    |         |<--------|-----------------------|---->| *A53 SPL* |     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |     |   Load    |     |
|    |         |         |                       |     | u-boot.img|     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |          :            |
|    |         |         |                       |     +-----------+     |
|    |         |<--------|-----------------------|---->| *U-Boot*  |     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |     |  prompt   |     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |     |   Load    |     |
|    |         |         |                       |     |Kernel/DTB |     |
|    |         |         |                       |     +-----------+     |
|    |         |         |                       |          :            |
|    |         |         |                       |     +-----------+     |
|    |         |<--------|-----------------------|---->| *Linux*   |     |
|    |         |         |                       |     +-----------+     |
|    +---------+         |                       |                       |
|                        |                       |                       |
+------------------------------------------------------------------------+

DMSC充当主服务器并提供所有关键服务。R5和ARM64请求DMSC获得这些服务,如上图所示。

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

tip:需要先sudo su,提升权限。否则在sudo make时系统变量失效,导致arm-none-linux-gnueabihf-gcc can’t found错误。

  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
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

e2e
cc error

  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>
root@ideapad:/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366# make ATF=$(pwd)/../prebuilt-images/bl31.bin TEE=$(pwd)/../prebuilt-images/bl32.bin O=build/arm64
make[1]: Entering directory '/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366/build/arm64'
Using /opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366 as source for U-Boot
  GEN     ./Makefile
  UPD     include/generated/timestamp_autogenerated.h
rm -f scripts/dtc/pylibfdt/_libfdt*.so
  PYMOD   scripts/dtc/pylibfdt/_libfdt.so
cc: error: unrecognized command line option ‘-fmacro-prefix-map=/nativesdk-python3/3.8.13-r0=/usr/src/debug/nativesdk-python3/3.8.13-r0’
cc: error: unrecognized command line option ‘-fmacro-prefix-map=/nativesdk-python3/3.8.13-r0=/usr/src/debug/nativesdk-python3/3.8.13-r0’
error: command 'cc' failed with exit status 1
/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366/scripts/dtc/pylibfdt/Makefile:27: recipe for target 'scripts/dtc/pylibfdt/_libfdt.so' failed
make[4]: *** [scripts/dtc/pylibfdt/_libfdt.so] Error 1
/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366/scripts/Makefile.build:419: recipe for target 'scripts/dtc/pylibfdt' failed
make[3]: *** [scripts/dtc/pylibfdt] Error 2
/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366/scripts/Makefile.build:419: recipe for target 'scripts/dtc' failed
make[2]: *** [scripts/dtc] Error 2

maybe gcc version low 7.5.0

tip:如果是GP版本,则不需要SYSFW_PATH,忽略即可。

$ 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

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

error

Build U-Boot(基于源码和独立的交叉编译工具)

  1. Getting Security Dev Tool
$ 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. Setting the tool chain path

We strongly recommend using the toolchain that came with the Linux Core release that corresponds to this U-Boot release. For e.g:

export PATH=$HOME/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin:$PATH
export PATH=$HOME/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin:$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

  1. Compiling R5 and ARM64 images
    ti-u-boot. Branch: ti-u-boot-2021.01.
    ti-k3-image-gen.
    ti-linux-firmware. Branch: ti-linux-firmware.
git clone https://git.ti.com/git/processor-firmware/ti-linux-firmware.git/ -b master
cd ti-linux-firmware
git checkout ti-linux-firmware

ti-arm-trusted-firmware.openE2E

ti-optee-os.build
OP-TEE is a Trusted Execution Environment (TEE) designed as companion to a non-secure Linux kernel running on Arm; Cortex-A cores using the TrustZone technology. OP-TEE implements TEE Internal Core API v1.1.x which is the API exposed to Trusted Applications and the TEE Client API v1.0, which is the API describing how to communicate with a TEE. Those APIs are defined in the GlobalPlatform API specifications.

export TI_SECURE_DEV_PKG=`pwd`/core-secdev-k3
export PATH=$PATH:/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin
export PATH=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH
on GP
make CROSS_COMPILE64=aarch64-none-linux-gnu- CROSS_COMPILE32=arm-none-linux-gnueabihf- PLATFORM=k3-am65x CFG_ARM64_core=y

ModuleNotFoundError: No module named ‘cryptography’ always error


pip3 install -U pip setuptools #No module named 'setuptools_rust'
sudo apt install python-pip
pip install --upgrade cryptography
pip install cryptography

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

$ export UBOOT_DIR=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/u-boot-2021.01+gitAUTOINC+2dd2e1d366-g2dd2e1d366
$ export K3IG_DIR=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/k3-image-gen-2022.01
$ export SYSFW_DIR=/home/wzx/ti-linux-firmware/ti-sysfw
$ export TFA_DIR=/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/trusted-firmware-a-2.6
$ export OPTEE_DIR=/home/wzx/ti-optee-os

Makefile:185: recipe for target ‘/home/wzx/ti-linux-firmware/ti-sysfw/ti-sci-firmware-am64x-gp.bin’ failedE2E


unable to execute ‘swig’: No such file or directory
error: command ‘swig’ failed with exit status 1

sudo apt install swig

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-dev

WARNING: TI_SECURE_DEV_PKG environment variable must be defined for TI secure devices. arch/arm/dts/k3-am642-evm-nand.dtbo was NOT secured!

cd /opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/k3-image-gen-2022.01
export TI_SECURE_DEV_PKG=`pwd`/core-secdev-k3

binman: [Errno 2] No such file or directory: ‘/opt/ti-processor-sdk-linux-am64xx-evm-08.04.01.04/board-support/trusted-firmware-a-2.6/build/k3/lite/release/bl31.bin’


下面的说明假设所有二进制文件都是手动构建的。有关构建bl31.bin的说明,请访问:OP-TEE。关于构建bl32.bin/tee-pager_v2.bin的说明,请访问:ARM Trusted Firmware-A。要使用现有的映像,请转到/board-support/prebuilt-images获取预构建sdk中的预构建二进制文件。
on GP

R5
To build u-boot-spl.bin for tiboot3.bin. Saved in $UBOOT_DIR/out/r5.
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- am64x_evm_r5_defconfig O=$UBOOT_DIR/out/r5
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O=$UBOOT_DIR/out/r5

To build tiboot3-am64x-gp-evm.bin. Saved in $K3IG_DIR. Requires u-boot-spl.bin and ti-sci-firmware-am64x-gp.bin.
$ cd $K3IG_DIR
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- SOC=am64x SOC_TYPE=gp SBL=$UBOOT_DIR/out/r5/spl/u-boot-spl.bin SYSFW_DIR=$SYSFW_DIR

A53
To build tispl.bin_unsigned and u-boot.img_unsigned. Saved in $UBOOT_DIR/out/a53. Requires bl31.bin and tee-pager_v2.bin.
$ make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- am64x_evm_a53_defconfig O=$UBOOT_DIR/out/a53
$ make 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 O=$UBOOT_DIR/out/a53

如果不使用TI SDK,而是从主线构建U-Boot,那么k3-image-gen(用于生成tiboot3.bin)项目位于这里

Linux固件(设备特定的ti-dm和ti-sysfw二进制文件)项目位于这里。映像在ti-dm和ti-sysfw文件夹下

你可能感兴趣的:(TI,linux,运维,服务器)