summaryrefslogtreecommitdiff
path: root/src/mainboard/google/sarien
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2019-01-15 10:32:22 -0700
committerPatrick Georgi <pgeorgi@google.com>2019-01-17 13:02:08 +0000
commitd1215269a7bc9b3df82548a7ebdb0e468b18e1df (patch)
treea31d623f7f8b2a06d1f66bfb8fb11f1e081478b0 /src/mainboard/google/sarien
parente371d421137901043ba495f8e4f5063be26b6764 (diff)
src/mainboard/google/sarien: query recovery mode from Cr50
On the Sarien/Arcada platforms, the EC is not trusted to provide the state of the ESC+REFRESH+PWR recovery combination. On these platforms the Cr50 latches the state of REFRESH+PWR for use as the recovery mode key combination. BUG=b:122715254 BRANCH=none TEST=Verify recovery mode screen shown after pressing REFRESH+PWR Change-Id: If336e9d7016987be151ab30d5c037ead3a998fe0 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://review.coreboot.org/c/30937 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/mainboard/google/sarien')
-rw-r--r--src/mainboard/google/sarien/chromeos.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mainboard/google/sarien/chromeos.c b/src/mainboard/google/sarien/chromeos.c
index 1e77cd9ff8..8b2090e5b0 100644
--- a/src/mainboard/google/sarien/chromeos.c
+++ b/src/mainboard/google/sarien/chromeos.c
@@ -19,6 +19,8 @@
#include <soc/gpio.h>
#include <variant/gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>
+#include <security/tpm/tss.h>
+
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -70,7 +72,16 @@ int get_write_protect_state(void)
int get_recovery_mode_switch(void)
{
- return cros_get_gpio_value(CROS_GPIO_REC);
+ uint8_t recovery_button_state;
+ int recovery_mode_switch = 0;
+
+ if (cros_get_gpio_value(CROS_GPIO_REC))
+ recovery_mode_switch = 1;
+ else if (tlcl_cr50_get_recovery_button(&recovery_button_state)
+ == TPM_SUCCESS)
+ recovery_mode_switch = recovery_button_state;
+
+ return recovery_mode_switch;
}
int get_lid_switch(void)