aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2015-01-30 11:55:39 +0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-04-15 22:12:27 +0200
commit7049a8fd47b5e57e9b9a51845bd82312c565895b (patch)
treeb4c4840fedffd3b043f27936f697206f4ee78541
parent941c3547121f5c1f6fb5dff7afd8b2cfbf5b980a (diff)
downloadcoreboot-7049a8fd47b5e57e9b9a51845bd82312c565895b.tar.gz
coreboot-7049a8fd47b5e57e9b9a51845bd82312c565895b.tar.xz
coreboot-7049a8fd47b5e57e9b9a51845bd82312c565895b.zip
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 <reinauer@chromium.org> Original-Commit-Id: 66ee55f6312efaeb337eb2881cd5eff5365b4105 Original-Change-Id: I0a7ebeed6506fbd938084c9a078a7cf1c7b914b9 Original-Signed-off-by: Hung-Te Lin <hungte@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/244515 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/9657 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
-rw-r--r--src/mainboard/google/veyron_rialto/chromeos.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mainboard/google/veyron_rialto/chromeos.c b/src/mainboard/google/veyron_rialto/chromeos.c
index 9e7317dd1..9efa855f2 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)