Dinesh Gehlot has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83864?usp=email )
Change subject: src: Log boot info before cse sync ......................................................................
src: Log boot info before cse sync
This patch logs the current boot information before proceeding to CSE sync, as CSE sync could potentially trigger a reboot.
BUG=b:354435327 TEST=Verified elog boot info prior to cse sync
Change-Id: I40abfe870d6b3302005b898efbc7ebcae42ed52c Signed-off-by: Dinesh Gehlot digehlot@google.com --- M src/drivers/elog/elog.c M src/include/elog.h M src/soc/intel/common/block/cse/cse_lite.c M src/vendorcode/google/chromeos/elog.c 4 files changed, 10 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/83864/1
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c index ecee145..1bd9a96 100644 --- a/src/drivers/elog/elog.c +++ b/src/drivers/elog/elog.c @@ -896,6 +896,3 @@ sizeof(event)); }
-/* Make sure elog_init() runs at least once to log System Boot event. */ -static void elog_bs_init(void *unused) { elog_init(); } -BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_bs_init, NULL); diff --git a/src/include/elog.h b/src/include/elog.h index db59b76..be6bb1f 100644 --- a/src/include/elog.h +++ b/src/include/elog.h @@ -19,6 +19,7 @@ int elog_add_event_wake(u8 source, u32 instance); int elog_smbios_write_type15(unsigned long *current, int handle); int elog_add_extended_event(u8 type, u32 complement); +void elog_add_vboot_info(void); #else /* Stubs to help avoid littering sources with #if CONFIG_ELOG */ static inline int elog_init(void) { return -1; } @@ -35,6 +36,7 @@ return 0; } static inline int elog_add_extended_event(u8 type, u32 complement) { return 0; } +void elog_add_vboot_info(void) {return;} #endif
#if CONFIG(ELOG_GSMI) diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 8f59724..d442195 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -1426,6 +1426,13 @@
void cse_fw_sync(void) { + /* + * Log boot information prior to initiating CSE sync, as sync process may cause a + * system reboot + */ + elog_init(); + elog_add_vboot_info(); + if (CONFIG(SOC_INTEL_CSE_LITE_SYNC_BY_PAYLOAD)) return;
diff --git a/src/vendorcode/google/chromeos/elog.c b/src/vendorcode/google/chromeos/elog.c index 4d3fc40..4e0b04d 100644 --- a/src/vendorcode/google/chromeos/elog.c +++ b/src/vendorcode/google/chromeos/elog.c @@ -8,7 +8,7 @@ #include <security/vboot/vboot_common.h> #include <vb2_api.h>
-static void elog_add_vboot_info(void *unused) +void elog_add_vboot_info(void) { /* Skip logging boot info in ACPI resume path */ if (acpi_is_wakeup_s3()) @@ -23,5 +23,3 @@
elog_add_event_raw(ELOG_TYPE_FW_VBOOT_INFO, &data, width); } - -BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_add_vboot_info, NULL);