From fec1032ee8589cb8e6bd666b2d8fbe8d5e3011d2 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 19 Nov 2025 12:44:45 +0530 Subject: [PATCH] arch/arm64: Add timestamps for Secure OS (BL32) loading Add boot timestamps to measure the duration of loading the Secure OS (BL32) payload in the `run_bl31()` function. The Secure OS is loaded if the Kconfig option `CONFIG_ARM64_USE_SECURE_OS` is enabled. The new timestamps are: - "TS_TFA_LOAD_BL32_START": Placed immediately before the Secure OS (BL32) loading process begins. - "TS_TFA_LOAD_BL32_END": Placed after the BL32 entry point information is set up and before the BL33 parameters are finalized. This instrumentation helps profile the boot time cost of the Trusted Firmware-A (TFA) BL32 component loading. Change-Id: I6ca74b8d4b11dfab4829f8bc5fbaa39ee5212137 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/90113 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal Reviewed-by: Paul Menzel --- src/arch/arm64/bl31.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/arch/arm64/bl31.c b/src/arch/arm64/bl31.c index a0402d7351..18f3eff056 100644 --- a/src/arch/arm64/bl31.c +++ b/src/arch/arm64/bl31.c @@ -9,7 +9,7 @@ #include #include #include - +#include #include static entry_point_info_t bl32_ep_info = { @@ -81,6 +81,7 @@ void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr) bl31_entry = prog_entry(&bl31); if (CONFIG(ARM64_USE_SECURE_OS)) { + timestamp_add_now(TS_TFA_LOAD_BL32_START); struct prog bl32 = PROG_INIT(PROG_BL32, CONFIG_CBFS_PREFIX"/secure_os"); @@ -96,6 +97,7 @@ void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr) bl32_ep_info.spsr = SPSR_EXCEPTION_MASK | get_eret_el(EL1, SPSR_USE_L); bl33_params_node.next_params_info = &bl32_params_node; + timestamp_add_now(TS_TFA_LOAD_BL32_END); } bl33_ep_info.pc = payload_entry;