From 7049a8fd47b5e57e9b9a51845bd82312c565895b Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Fri, 30 Jan 2015 11:55:39 +0800 Subject: veyron_rialto: Change recovery GPIO to PUSH_KEY. The recovery button on Rialto should be GPIO 255, the LED Push Key. Note we want to keep the recovery button on servo functional because many protos are not assembled and developers can't "push" the push key. The GPIO passed to payloads (and kernel) is only mapped to Push Key. BUG=none TEST=emerge-veyron_rialto coreboot chromeos-bootimage BRANCH=veyron_rialto Change-Id: I66f94cf232caa53a3b28db517620e4b6e9b9af0e Signed-off-by: Stefan Reinauer Original-Commit-Id: 66ee55f6312efaeb337eb2881cd5eff5365b4105 Original-Change-Id: I0a7ebeed6506fbd938084c9a078a7cf1c7b914b9 Original-Signed-off-by: Hung-Te Lin Original-Reviewed-on: https://chromium-review.googlesource.com/244515 Original-Reviewed-by: David Hendricks Reviewed-on: http://review.coreboot.org/9657 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/mainboard/google/veyron_rialto/chromeos.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/mainboard/google/veyron_rialto') diff --git a/src/mainboard/google/veyron_rialto/chromeos.c b/src/mainboard/google/veyron_rialto/chromeos.c index 9e7317dd14..9efa855f24 100644 --- a/src/mainboard/google/veyron_rialto/chromeos.c +++ b/src/mainboard/google/veyron_rialto/chromeos.c @@ -27,13 +27,15 @@ #define GPIO_WP GPIO(7, A, 6) #define GPIO_POWER GPIO(0, A, 5) -#define GPIO_RECOVERY GPIO(0, B, 1) +#define GPIO_RECOVERY_SERVO GPIO(0, B, 1) +#define GPIO_RECOVERY_PUSHKEY GPIO(7, B, 1) void setup_chromeos_gpios(void) { gpio_input(GPIO_WP); gpio_input(GPIO_POWER); - gpio_input_pullup(GPIO_RECOVERY); + gpio_input_pullup(GPIO_RECOVERY_SERVO); + gpio_input_pullup(GPIO_RECOVERY_PUSHKEY); } void fill_lb_gpios(struct lb_gpios *gpios) @@ -49,9 +51,12 @@ void fill_lb_gpios(struct lb_gpios *gpios) count++; /* Recovery: active low */ - gpios->gpios[count].port = GPIO_RECOVERY.raw; + /* Note for early development, we want to support both servo and + * pushkey recovery buttons in firmware boot stages. + */ + gpios->gpios[count].port = GPIO_RECOVERY_PUSHKEY.raw; gpios->gpios[count].polarity = ACTIVE_LOW; - gpios->gpios[count].value = gpio_get(GPIO_RECOVERY); + gpios->gpios[count].value = !get_recovery_mode_switch(); strncpy((char *)gpios->gpios[count].name, "recovery", GPIO_MAX_NAME_LENGTH); count++; @@ -93,7 +98,9 @@ int get_developer_mode_switch(void) int get_recovery_mode_switch(void) { - return !gpio_get(GPIO_RECOVERY); + // Both RECOVERY_SERVO and RECOVERY_PUSHKEY are low active. + return !(gpio_get(GPIO_RECOVERY_SERVO) && + gpio_get(GPIO_RECOVERY_PUSHKEY)); } int get_write_protect_state(void) -- cgit v1.2.3