3.10. ARM Trusted Firmware-A

Overview

Trusted Firmware-A (TF-A) provides a reference implementation of secure world software for Armv7-A and Armv8-A, including a Secure Monitor executing at Exception Level 3 (EL3).

TF-A is the initial code on ARMv8-A cores for all K3 platforms. After setting up the initial core state and applying any needed errata fixes it sets up itself as the EL3 monitor handler. Following that, it installs the secure world open source Trusted Execution Environment (OP-TEE) software and passes execution on to either the Linux kernel or U-Boot in the non-secure world.

Power and Clock Management using SCMI

The AM62Lx System-on-Chip (SoC) utilizes the System Control and Management Interface (SCMI) protocol to manage clocks and power domains. SCMI is a standardized interface for system control and management, providing a common way to access and control system resources. The SCMI IDs used in the AM62L TF-A implementation are documented in the TF-A documentation.

SCMI and TI SCI

The AM62Lx represents a transition in Texas Instruments’ approach to system control interfaces. In the previous K3 devices, the Texas Instruments System Controller Interface (TI SCI) was the primary protocol used for power, clock, and resource management. SCMI now serves as a replacement for newer devices like the AM62L, offering similar functionality through an industry-standard ARM protocol. This transition is in part due to the absence of any Device Management (R5 core) in the AM62Lx.

Implementation Overview

The AM62L TF-A implementation runs a SCMI server that manages:

  • Power Domains: Over 100 power domains are defined for various peripherals and subsystems

  • Clock Management: Extensive clock control for all major peripherals including:

    • Multiple clock sources (PLLs, oscillators, external clocks)

    • Clock multiplexers for flexible clock routing

    • Clock dividers for frequency scaling

    • Support for dynamic clock rate configuration

Clock Infrastructure

The clock management system supports:

  • Parent Clock Selection - Multiple clock sources can be selected as parents for each peripheral

  • Clock Multiplexing - Dynamic switching between different clock sources

  • Rate Configuration - Flexible frequency configuration within supported ranges

Usage in Linux

Linux kernel drivers can use standard SCMI client APIs to:

  • Request power state changes for devices

  • Configure clock rates and parents

  • Query current power and clock states

  • Implement dynamic power management policies


Getting the TF-A Source Code

The pre-built TF-A binary is in the TI Processor SDK: <path-to-processor-sdk>/board-support/prebuilt-images/<optional-build-machine-name>/bl31.bin. Use this binary since it is tested with TI Processor SDK.

If it is not possible to use a pre-built binary, use the following:

$ git clone https://github.com/TexasInstruments/arm-trusted-firmware.git
$ git checkout <hash>

Where <hash> is the commit shown in Build Information.


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.

Building TF-A

Without OP-TEE enabled:

$ export TFA_DIR=<path-to-arm-trusted-firmware>
$ cd $TFA_DIR
$ make ARCH=aarch64 CROSS_COMPILE="$CROSS_COMPILE_64" PLAT=k3 TARGET_BOARD=am62l

Default load locations

+---------------------------+------------+
| TF-A image                | 0x80000000 |
+---------------------------+------------+
| OP-TEE image              | 0x80200000 |
+---------------------------+------------+
| U-Boot/Linux kernel image | 0x80080000 |
+---------------------------+------------+
| DTB                       | 0x82000000 |
+---------------------------+------------+