summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandru Gagniuc <alexandrux.gagniuc@intel.com>2016-04-26 15:01:01 -0700
committerMartin Roth <martinroth@google.com>2016-05-06 18:57:36 +0200
commit532f319c9d5504b6b1f6a044e138c4c62e6311b4 (patch)
tree8bab5d6750f0f8c4560db3a25c0dfd3c11b02134 /src
parent0d3a5126db2e9da4314915689b92ae10a0ce3a7d (diff)
intel/amenia: Check with EC if we should enter recovery mode
Change-Id: Id35a74e3968315659b323e0ba348ad38ca11981b Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com> Reviewed-on: https://review.coreboot.org/14590 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/intel/amenia/chromeos.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mainboard/intel/amenia/chromeos.c b/src/mainboard/intel/amenia/chromeos.c
index dabb899e36..b6669bf0e0 100644
--- a/src/mainboard/intel/amenia/chromeos.c
+++ b/src/mainboard/intel/amenia/chromeos.c
@@ -15,6 +15,9 @@
* GNU General Public License for more details.
*/
+#include "ec.h"
+
+#include <ec/google/chromeec/ec.h>
#include <vendorcode/google/chromeos/chromeos.h>
int get_lid_switch(void)
@@ -31,6 +34,13 @@ int get_developer_mode_switch(void)
int get_recovery_mode_switch(void)
{
+ uint32_t ec_events;
+
+ /* Recovery mode via ESC + Refresh + PWR ? */
+ ec_events = google_chromeec_get_events_b();
+ if (ec_events & EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY))
+ return 1;
+
return 0;
}