Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/87152?usp=email )
Change subject: {commonlib, lib}: Add timestamp for early chip initialization ......................................................................
{commonlib, lib}: Add timestamp for early chip initialization
This commit introduces a new timestamp `TS_DEVICE_INIT_CHIPS` to specifically mark the start of the `dev_initialize_chips()` function.
Previously, the `TS_DEVICE_ENUMERATE` timestamp was incorrectly associated with the `bs_dev_init_chips` function.
This patch corrects this by:
- Adding the `TS_DEVICE_INIT_CHIPS` enum and name definition. - Updating `bs_dev_init_chips` in `src/lib/hardwaremain.c` to use `TS_DEVICE_INIT_CHIPS`. - Moving the `TS_DEVICE_ENUMERATE` timestamp addition to the `bs_dev_enumerate` function where device enumeration actually begins.
This change provides a more accurate and meaningful timestamp for the early chipset initialization phase.
TEST=Able to build and boot google/fatcat.
``` 971:loading FSP-S 836,277 (10,658) 17:starting LZ4 decompress (ignore for x86) 847,297 (11,019) 18:finished LZ4 decompress (ignore for x86) 847,376 (79) 30:early chipset initialization 854,579 (7,203) 17:starting LZ4 decompress (ignore for x86) 863,483 (8,903) 18:finished LZ4 decompress (ignore for x86) 863,490 (6) 17:starting LZ4 decompress (ignore for x86) 875,196 (11,705) 18:finished LZ4 decompress (ignore for x86) 875,237 (41) 954:calling FspSiliconInit 875,344 (107) 955:returning from FspSiliconInit 942,740 (67,396) 962:calling FspMultiPhaseSiInit 942,744 (4) 963:returning from FspMultiPhaseSiInit 1,081,355 (138,610) 31:device enumeration 1,081,708 (352) 40:device configuration 1,085,721 (4,013) 50:device enable 1,091,517 (5,795) ```
Change-Id: Ib6860901c6b1528ec5098fc93240c6e65777642b Signed-off-by: Subrata Banik subratabanik@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/87152 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Karthik Ramasubramanian kramasub@google.com Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Wonkyu Kim wonkyu.kim@intel.com Reviewed-by: Kapil Porwal kapilporwal@google.com Reviewed-by: Jayvik Desai jayvik@google.com --- M src/commonlib/include/commonlib/timestamp_serialized.h M src/lib/hardwaremain.c 2 files changed, 6 insertions(+), 2 deletions(-)
Approvals: Karthik Ramasubramanian: Looks good to me, approved build bot (Jenkins): Verified Kapil Porwal: Looks good to me, approved Julius Werner: Looks good to me, approved Wonkyu Kim: Looks good to me, but someone else must approve Jayvik Desai: Looks good to me, approved
diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h index f60e040..6bcbabc 100644 --- a/src/commonlib/include/commonlib/timestamp_serialized.h +++ b/src/commonlib/include/commonlib/timestamp_serialized.h @@ -37,7 +37,8 @@ TS_ULZMA_END = 16, TS_ULZ4F_START = 17, TS_ULZ4F_END = 18, - TS_DEVICE_ENUMERATE = 30, + TS_DEVICE_INIT_CHIPS = 30, + TS_DEVICE_ENUMERATE = 31, TS_DEVICE_CONFIGURE = 40, TS_DEVICE_ENABLE = 50, TS_DEVICE_INITIALIZE = 60, @@ -218,6 +219,7 @@ TS_NAME_DEF(TS_ULZMA_END, 0, "finished LZMA decompress (ignore for x86)"), TS_NAME_DEF(TS_ULZ4F_START, TS_ULZ4F_END, "starting LZ4 decompress (ignore for x86)"), TS_NAME_DEF(TS_ULZ4F_END, 0, "finished LZ4 decompress (ignore for x86)"), + TS_NAME_DEF(TS_DEVICE_INIT_CHIPS, TS_DEVICE_ENUMERATE, "early chipset initialization"), TS_NAME_DEF(TS_DEVICE_ENUMERATE, TS_DEVICE_CONFIGURE, "device enumeration"), TS_NAME_DEF(TS_DEVICE_CONFIGURE, TS_DEVICE_ENABLE, "device configuration"), TS_NAME_DEF(TS_DEVICE_ENABLE, TS_DEVICE_INITIALIZE, "device enable"), diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index fda6c62..7e5d848 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -93,7 +93,7 @@
static boot_state_t bs_dev_init_chips(void *arg) { - timestamp_add_now(TS_DEVICE_ENUMERATE); + timestamp_add_now(TS_DEVICE_INIT_CHIPS);
/* Initialize chips early, they might disable unused devices. */ dev_initialize_chips(); @@ -103,6 +103,8 @@
static boot_state_t bs_dev_enumerate(void *arg) { + timestamp_add_now(TS_DEVICE_ENUMERATE); + /* Find the devices we don't have hard coded knowledge about. */ dev_enumerate();