[coreboot-gerrit] New patch to review for coreboot: google/gru: Enable coreboot read recovery event

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Fri Jul 8 00:28:10 CEST 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15585

-gerrit

commit 18efd43c0858ff0edf85452d45c83c84bc774f62
Author: Shelley Chen <shchen at chromium.org>
Date:   Thu Jun 30 12:51:57 2016 -0700

    google/gru: Enable coreboot read recovery event
    
    Enable reading of keyboard recovery host event from coreboot.
    
    BUG=None
    BRANCH=None
    TEST=esc+refresh+power combo and make sure you
         see recovery fw screen.
    
    Change-Id: I166619d6202e23569395434e9dc1adb2a6a53296
    Signed-off-by: Martin Roth <martinroth at chromium.org>
    Original-Commit-Id: f9279c8c06abb170589b1b11bf5287fbf38c9905
    Original-Change-Id: Id980c77c8d7695b2c1b3343d968ad2a302d42aaa
    Original-Signed-off-by: Shelley Chen <shchen at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/357841
    Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-by: Shawn N <shawnn at chromium.org>
---
 src/mainboard/google/gru/chromeos.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mainboard/google/gru/chromeos.c b/src/mainboard/google/gru/chromeos.c
index 912d13c..f8aa4fa 100644
--- a/src/mainboard/google/gru/chromeos.c
+++ b/src/mainboard/google/gru/chromeos.c
@@ -15,6 +15,8 @@
  */
 
 #include <boot/coreboot_tables.h>
+#include <ec/google/chromeec/ec.h>
+#include <ec/google/chromeec/ec_commands.h>
 #include <gpio.h>
 #include <vendorcode/google/chromeos/chromeos.h>
 
@@ -24,6 +26,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
 {
 	struct lb_gpio chromeos_gpios[] = {
 		{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
+		{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
 		{GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},
 		{GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},
 		{GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},
@@ -40,7 +43,11 @@ int get_developer_mode_switch(void)
 
 int get_recovery_mode_switch(void)
 {
-	return 0;
+	uint32_t ec_events;
+
+	ec_events = google_chromeec_get_events_b();
+	return !!(ec_events &
+		  EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
 }
 
 int get_write_protect_state(void)



More information about the coreboot-gerrit mailing list