TMS570LS3137: How to measure boot time and how to reduce boot time
SK-AM62: reduce boot timing
Linux Boot Flow:
+------------------------------------------------------------------------+
| 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* | |
| | | | | +-----------+ |
| +---------+ | | |
| | | |
+------------------------------------------------------------------------+
Boot Flow:
+------------------------------------------------------------------------+-----------------------+
| DMSC | MAIN R50 | A53 | MAIN R51 |
+------------------------------------------------------------------------+-----------------------+
| +--------+ | | | |
| | Reset | | | | |
| +--------+ | | | |
| : | | | |
| +--------+ | +-----------+ | | |
| | *ROM* |----------|-->| Reset rls | | | |
| +--------+ | +-----------+ | | |
| | | | : | | |
| | ROM | | : | | |
| |services| | : | | |
| | | | +-------------+ | | |
| | | | | *R5 ROM* | | | |
| | | | +-------------+ | | |
| | |<---------|---|Load and auth| | | |
| | | | | tiboot3.bin | | | |
| | Start | | +-------------+ | | |
| | SYSFW |<---------|---| Start | | | |
| | | | | SYSFW | | | |
| +--------+ | +-------------+ | | |
| : | | | | | |
| +---------+ | | Load | | | |
| | *SYSFW* | | | system | | | |
| +---------+ | | Config data | | | |
| | |<--------|---| | | | |
| | | | +-------------+ | | |
| | | | : | | |
| | | | : | | |
| | | | : | | |
| | | | +-------------+ | | |
| | | | | *R5 SPL* | | | |
| | | | +-------------+ | | |
| | | | | DDR | | | |
| | | | | config | | | |
| | | | +-------------+ | | |
| | | | | Load | | | |
| | | | | tispl.bin | | | |
| | | | +-------------+ | | |
| | |<--------|---| Start A53 | | | |
| | | | +-------------+ | | |
| | | | | +-----------+ | |
| | |---------|-----------------------|---->| Reset rls | | |
| | | | | +-----------+ | |
| | SYSFW | | | : | |
| |Services | | | +-----------+ | |
| | |<--------|-----------------------|---->|*ATF/OPTEE*| | |
| | | | | +-----------+ | |
| | | | | : | |
| | | | | +-----------+ | |
| | |<--------|-----------------------|---->| *A53 SPL* | | |
| | | | | +-----------+ | |
| | | | | | Load | | |
| | | | | | u-boot.img| | |
| | | | | +-----------+ | |
| | | | | : | |
| | | | | +-----------+ | |
| | |<--------|-----------------------|---->| *U-Boot* | | |
| | | | | +-----------+ | |
| | | | | | prompt | | |
| | | | | +-----------+ | |
| | | | | | Load R5 | | |
| | | | | | Firmware | | |
| | | | | +-----------+ | |
| | |<--------|-----------------------|-----| Start R5 | | +-----------+ |
| | |---------|-----------------------|-----+-----------+-----|----->| R5 starts | |
| | | | | | +-----------+ |
| | | | | | |
| +---------+ | | | |
| | | | |
+------------------------------------------------------------------------+-----------------------+
ARM Trusted Firmware-A
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).
ATF is used as the initial start 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. After this is installs the secure world software (OP-TEE) and passes execution on to either the Linux kernel or U-Boot in the non-secure world.
OP-TEE is a Trusted Execution Environment (TEE) designed as a companion to a non-secure Linux kernel running on Arm Cortex-A cores using the TrustZone technology.
System Firmware is a collective term used to describe the TI Foundational Security (TIFS) and Resource Management (RM)/ Power Management (PM) services. System Firmware executes on the Security Manager and Device Manager Core (DMSC) on AM64x.
[BOOTLOADER PROFILE] SYSFW Load : 17592us
[BOOTLOADER PROFILE] System_init : 18177us
[BOOTLOADER PROFILE] Drivers_open : 764669us
[BOOTLOADER PROFILE] Board_driversOpen : 0us
[BOOTLOADER PROFILE] App_loadImages : 479465us
[BOOTLOADER_PROFILE] SBL Total Time Taken : 1431232us
Image loading done, switching to application ...
Starting linux and RTOS/Baremetal applications
NOTICE: BL31: v2.5(release):08.00.00.004-dirty
NOTICE: BL31: Built : 14:02:03, Aug 5 2021
U-Boot SPL 2021.01-g53e79d0e89 (Aug 05 2021 - 14:03:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
Trying to boot from MMC1
.
.
.
.
.
.
_____ _____ _ _
| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
| | _| .'| . | . | | __| _| . | | | -_| _| _|
|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
|___| |___|
Arago Project http://arago-project.org am64xx-evm ttyS2
Arago 2020.09 am64xx-evm ttyS2
am64xx-evm login:
BOOTLOADER
The Bootloader module provides APIs to write bootloader applications for various boot media like OSPI, UART, SOC memory etc.
支持:
- OSPI Boot
- MEM Boot (Boot media is SOC memory)
- API to parse multicore appimage
- Separate APIs to boot self and non-self cores
- 不支持MMCSD Boot
SysConfig Features
- Bootloader instance name
- Boot Media to be used
- Boot Image offset
启动过程会分为第一阶段bootloader和第二阶段bootloader。
- tiboot3.bin : the first stage of the boot loader running on R5F core.
+-----------------------+
| X.509 |
| Certificate |
| +-------------------+ |
| | | |
| | R5 | |
| | u-boot-spl.bin | |
| | | |
| +-------------------+ |
| | | |
| | FIT header | |
| | +---------------+ | |
| | | | | |
| | | DTB 1...N | | |
| | +---------------+ | |
| +-------------------+ |
| | | |
| | FIT HEADER | |
| | +---------------+ | |
| | | | | |
| | | sysfw.bin | | |
| | +---------------+ | |
| | | | | |
| | | board config | | |
| | +---------------+ | |
| | | | | |
| | | PM config | | |
| | +---------------+ | |
| | | | | |
| | | RM config | | |
| | +---------------+ | |
| | | | | |
| | | Secure config | | |
| | +---------------+ | |
| +-------------------+ |
+-----------------------+
- tispl.bin : the first stage of the boot loader running on A53 core.
+-----------------------+
| |
| FIT HEADER |
| +-------------------+ |
| | | |
| | A53 ATF | |
| +-------------------+ |
| | | |
| | A53 OPTEE | |
| +-------------------+ |
| | | |
| | A53 SPL | |
| +-------------------+ |
| | | |
| | SPL DTB 1...N | |
| +-------------------+ |
+-----------------------+
Booting Remote Cores During Linux Boot
In normal operation, the boot loader (U-Boot) boots and loads Linux onto the A53 cores of the AM64x. If the remote cores are enabled in the Linux devicetree, then Linux will use the RemoteProc driver to boot the remote cores during Linux kernel boot time.
- u-boot.img : the second stage of the boot loader running on A53 core.