From d0177bd1024774e06c2bfc3420aab11f6ec621b2 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 19 Nov 2025 12:40:00 +0530 Subject: [PATCH] soc/qualcomm: Add QCLib execution timestamps Instrument the Qualcomm QCLib flow with timestamps to measure execution time for both the initial loading/running phase and the subsequent re-entry phase. The timestamps are placed as follows: - TS_QUALCOMM_QCLIB_INIT_START/END: Tracks the execution of `qclib_load_and_run()`. - TS_QUALCOMM_QCLIB_REINIT_START/END: Tracks the execution of `qclib_rerun()`, which typically handles the AOP bring-up. This instrumentation helps in profiling and optimizing the boot performance on Qualcomm platforms. Change-Id: I200ea5a78f4630000e80aed6dc38581af4d2e8aa Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/90112 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/soc/qualcomm/common/qclib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/soc/qualcomm/common/qclib.c b/src/soc/qualcomm/common/qclib.c index fa12ed9634..dd679964cd 100644 --- a/src/soc/qualcomm/common/qclib.c +++ b/src/soc/qualcomm/common/qclib.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #define QCLIB_VERSION 0 @@ -247,6 +248,8 @@ void qclib_load_and_run(void) { ssize_t data_size; + timestamp_add_now(TS_QUALCOMM_QCLIB_INIT_START); + /* zero ddr_information SRAM region, needs new data each boot */ memset(ddr_region, 0, sizeof(struct region)); @@ -328,6 +331,7 @@ void qclib_load_and_run(void) assert((uintptr_t)_dram == region_offset(ddr_region) && region_sz(ddr_region) >= (u8 *)cbmem_top() - _dram); + timestamp_add_now(TS_QUALCOMM_QCLIB_INIT_END); return; fail: @@ -336,6 +340,8 @@ fail: void qclib_rerun(void) { + timestamp_add_now(TS_QUALCOMM_QCLIB_REINIT_START); + ssize_t data_size; assert(prog_type(&qclib) == PROG_REFCODE) @@ -372,6 +378,7 @@ void qclib_rerun(void) printk(BIOS_DEBUG, "\n\n\nRe-enter QCLib to bring up AOP\n"); qclib_prepare_and_run(); + timestamp_add_now(TS_QUALCOMM_QCLIB_REINIT_END); return; fail: