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 used as the initial start code on ARMv8-A cores for am62lx. The following is the sequence of A53 execution with TF-A:
The FreeRTOS/NoRTOS kernel runs in non-secure EL1 level at all times. All exceptions/interrupts are routed to non-secure EL1 in the application.
If building the TF-A bl31 binary is needed separately, users can go to this path in the SDK: ${MCU_PLUS_SDK_PATH}/source/atf/trusted-firmware-a and build from there.
Otherwise, the TF-A repository can be cloned from the below source:
To compile TF-A source independent of the SDK, set the cross compiler paths to the toolchain [Recommended] as shown below.
Refer to GCC_AARCH64_DOWNLOAD section for more details on usage.
Default load locations for A53 core 0:
TF-A image | 0x80000000 |
RTOS application core image | 0x82000000 |
${MCU_PLUS_SDK_PATH}/source/atf/lib/soc/am62lx/
The following points are important in understanding the application core startup sequence in TF-A integrated flow:
_c_int00: mrs x0, currentel cmp x0, #0xC bne _c_int00_atf /* Current EL is not EL3, hence application booted with ATF. */
mov x0, #0x1 msr s3_0_c12_c12_7, x0 /* Enable Non-secure group 1 interrupts */
ldr x0, =CacheP_wbInvAll /* Cache invalidation since it is not done in EL3 by ATF */
MEMORY { DDR : ORIGIN = 0x82000000, LENGTH = 0x2000000 AMP_SHM : ORIGIN = 0x99000000, LENGTH = 0x4000 }
/* Keeping the .text.boot:_c_int00 section of the code at the ATF Jump address to ensure the code entry point is from this address. */ .text.boot:_c_int00 : AT (0x82000000) {} > DDR