[coreboot-gerrit] New patch to review for coreboot: vboot: Add new function for logging recovery mode switches

Furquan Shaikh (furquan@google.com) gerrit at coreboot.org
Sun Nov 13 04:55:59 CET 2016


Furquan Shaikh (furquan at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17408

-gerrit

commit 5596433a7c53e881f5cf51319979628577761df4
Author: Furquan Shaikh <furquan at chromium.org>
Date:   Sat Nov 12 11:09:28 2016 -0800

    vboot: Add new function for logging recovery mode switches
    
    BUG=chrome-os-partner:59352
    BRANCH=None
    TEST=Compiles successfully
    
    Change-Id: I87cd675ea45a8b05a178cf64119bf5f9d8d218ca
    Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
 src/include/bootmode.h                    | 1 +
 src/vboot/vboot_handoff.c                 | 4 ++++
 src/vendorcode/google/chromeos/chromeos.c | 5 +++++
 3 files changed, 10 insertions(+)

diff --git a/src/include/bootmode.h b/src/include/bootmode.h
index c807472..db40a6d 100644
--- a/src/include/bootmode.h
+++ b/src/include/bootmode.h
@@ -24,6 +24,7 @@ int get_developer_mode_switch(void);
 int get_recovery_mode_switch(void);
 int get_recovery_mode_retrain_switch(void);
 int clear_recovery_mode_switch(void);
+void log_recovery_mode_switch(void);
 int get_wipeout_mode_switch(void);
 int get_lid_switch(void);
 
diff --git a/src/vboot/vboot_handoff.c b/src/vboot/vboot_handoff.c
index b0bd04c..b732b3a 100644
--- a/src/vboot/vboot_handoff.c
+++ b/src/vboot/vboot_handoff.c
@@ -153,6 +153,10 @@ void vboot_fill_handoff(void)
 	/* needed until we finish transtion to vboot2 for kernel verification */
 	fill_vboot_handoff(vh, sd);
 
+
+	/* Log the recovery mode switches if required, before clearing them. */
+	log_recovery_mode_switch();
+
 	/*
 	 * The recovery mode switch is cleared (typically backed by EC) here
 	 * to allow multiple queries to get_recovery_mode_switch() and have
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c
index 563f6fd..b7d1e45 100644
--- a/src/vendorcode/google/chromeos/chromeos.c
+++ b/src/vendorcode/google/chromeos/chromeos.c
@@ -33,3 +33,8 @@ int __attribute__((weak)) get_sw_write_protect_state(void)
 	// Can be implemented by a platform / mainboard
 	return 0;
 }
+
+void __attribute__((weak)) log_recovery_mode_switch(void)
+{
+	// Weak implementation. Nothing to do.
+}



More information about the coreboot-gerrit mailing list