Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/29542
Change subject: drivers/elog: Add Ramstage helper to add boot count ......................................................................
drivers/elog: Add Ramstage helper to add boot count
Add a helper function specific to ramstage to add the boot count information into event log at ramstage.
BUG=b:117884485 BRANCH=None TEST=Add an event log from romstage, boot to ChromeOS
Change-Id: Ic79f1a702548d8a2cd5c13175a9b2d718527953f Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/drivers/elog/elog.c 1 file changed, 15 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/29542/1
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c index d1a9f4f..7c650a1 100644 --- a/src/drivers/elog/elog.c +++ b/src/drivers/elog/elog.c @@ -793,6 +793,19 @@ #endif }
+static void ramstage_elog_add_boot_count(void) +{ + if (elog_do_add_boot_count()) { + elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read()); + +#if IS_ENABLED(CONFIG_ARCH_X86) + /* Check and log POST codes from previous boot */ + if (IS_ENABLED(CONFIG_CMOS_POST)) + cmos_post_log(); +#endif + } +} + /* * Event log main entry point */ @@ -843,15 +856,8 @@ " shrink size %d\n", region_device_sz(&g_elog_statep->nv_dev), g_elog_statep->full_threshold, g_elog_statep->shrink_size);
- if (elog_do_add_boot_count()) { - elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read()); - -#if IS_ENABLED(CONFIG_ARCH_X86) - /* Check and log POST codes from previous boot */ - if (IS_ENABLED(CONFIG_CMOS_POST)) - cmos_post_log(); -#endif - } + if (ENV_RAMSTAGE) + ramstage_elog_add_boot_count(); return 0; }