summaryrefslogtreecommitdiff
path: root/src/drivers/elog/elog.c
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2018-11-06 13:00:27 -0700
committerAaron Durbin <adurbin@chromium.org>2018-11-13 17:22:44 +0000
commitcca1f371d2c1f775fce69e526a20bd424a4aecb8 (patch)
tree5f42840f4b06f911b3b8cecaeed4a31ab14c8d60 /src/drivers/elog/elog.c
parent07bc08c2995b535b554a54e48673c144650fb234 (diff)
downloadcoreboot-cca1f371d2c1f775fce69e526a20bd424a4aecb8.tar.xz
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> Reviewed-on: https://review.coreboot.org/29542 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/elog/elog.c')
-rw-r--r--src/drivers/elog/elog.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 18ca3b7adf..e006ded265 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -789,6 +789,19 @@ static bool elog_do_add_boot_count(void)
#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
*/
@@ -838,15 +851,8 @@ int elog_init(void)
" shrink size %d\n", region_device_sz(&es->nv_dev),
es->full_threshold, es->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;
}