[coreboot-gerrit] Change in coreboot[master]: drivers/elog: Add Ramstage helper to add boot count

Karthik Ramasubramanian (Code Review) gerrit at coreboot.org
Thu Nov 8 01:12:32 CET 2018


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 at 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;
 }
 

-- 
To view, visit https://review.coreboot.org/29542
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic79f1a702548d8a2cd5c13175a9b2d718527953f
Gerrit-Change-Number: 29542
Gerrit-PatchSet: 1
Gerrit-Owner: Karthik Ramasubramanian <kramasub at google.com>
Gerrit-Reviewer: Karthikeyan Ramasubramanian <kramasub at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181108/79aa497c/attachment.html>


More information about the coreboot-gerrit mailing list