summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/kunimitsu
diff options
context:
space:
mode:
authorrobbie zhang <robbie.zhang@intel.com>2015-08-24 16:41:09 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-08-29 07:34:25 +0000
commitc8dd59df9138dc2b4770865c76025bbdf76304ad (patch)
tree02fe3911a189b8f3a03f731caf6b61467438ff2d /src/mainboard/intel/kunimitsu
parentdfdd33eb53fd5abf90c8bbd2c66c2a187bd6a426 (diff)
downloadcoreboot-c8dd59df9138dc2b4770865c76025bbdf76304ad.tar.xz
intel/kunimitsu: port the change from glados for enabling reading
recovery mode. BUG=chrome-os-partner:43683 BRANCH=none TEST=build and boot on kunimits and successfully enter recovery mode by pressing “Esc + refresh + Power” keys. Change-Id: Id25b9f2195f1caaa8b46967b4b5d4abdab48d6cc Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: 96b1c295448b412a5662afc729fdd37294d3cb61 Original-Change-Id: I9f650b28b0a86b631ffdfe6de5d58d18e48a0a22 Original-Signed-off-by: robbie zhang <robbie.zhang@intel.com> Original-Reviewed-on: https://chromium-review.googlesource.com/295138 Original-Tested-by: Wenkai Du <wenkai.du@intel.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11434 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/intel/kunimitsu')
-rw-r--r--src/mainboard/intel/kunimitsu/chromeos.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mainboard/intel/kunimitsu/chromeos.c b/src/mainboard/intel/kunimitsu/chromeos.c
index 66d1a42209..66be521f46 100644
--- a/src/mainboard/intel/kunimitsu/chromeos.c
+++ b/src/mainboard/intel/kunimitsu/chromeos.c
@@ -22,10 +22,10 @@
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
+#include <ec/google/chromeec/ec.h>
#include <soc/gpio.h>
#include <string.h>
#include <vendorcode/google/chromeos/chromeos.h>
-
#include "gpio.h"
#include "ec.h"
@@ -69,7 +69,20 @@ int get_developer_mode_switch(void)
int get_recovery_mode_switch(void)
{
- return 0;
+ /* Check for dedicated recovery switch first. */
+ if (google_chromeec_get_switches() & EC_SWITCH_DEDICATED_RECOVERY)
+ return 1;
+
+ /* Otherwise check if the EC has posted the keyboard recovery event. */
+ return !!(google_chromeec_get_events_b() &
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
+}
+
+int clear_recovery_mode_switch(void)
+{
+ /* Clear keyboard recovery event. */
+ return google_chromeec_clear_events_b(
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
}
int get_write_protect_state(void)