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 <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90113
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Subrata Banik 2025-11-19 12:44:45 +05:30
commit fec1032ee8

View file

@ -9,7 +9,7 @@
#include <cbmem.h>
#include <console/console.h>
#include <program_loading.h>
#include <timestamp.h>
#include <arm-trusted-firmware/include/export/common/bl_common_exp.h>
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;