[coreboot-gerrit] New patch to review for coreboot: veyron_danger: Enable developer mode switch
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Wed Jul 8 10:13:31 CEST 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10839
-gerrit
commit 69b7244b06af3f18efa0ee3a3454d2c6ccdc58c3
Author: David Hendricks <dhendrix at chromium.org>
Date: Wed Jun 3 16:40:16 2015 -0700
veyron_danger: Enable developer mode switch
Danger has a physical developer mode switch, it was just never
set up. This patch defines it, sets it up in fill_lb_gpios(),
and disables VIRTUAL_DEV_SWITCH.
Note: For now at least, dev mode is a bit wonky on Danger. It's
connected to both a DIP switch and a button. The button is normally
open, pulling dev mode high (defaulting to ON). The switch's "ON"
position will pull the value low, so we invert the value in coreboot
to see the expected behavior. Dev mode is enabled by holding the
button down during boot or by setting switch 2 in the DIP bank to
the ON position.
BUG=none
BRANCH=none
TEST=toggled dev switch on Danger and saw dev screen show up (or
not) as expected
Change-Id: I9369b96b6c9b54553d969b919ed663abdc704dd2
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
Original-Commit-Id: dce53f1a31919f15f6e46c4a7d1c5ce541c2b318
Original-Change-Id: I737f165d7704e2f73375099367f012b365e3e77d
Original-Signed-off-by: David Hendricks <dhendrix at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/280852
Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
---
src/mainboard/google/veyron_danger/Kconfig | 1 -
src/mainboard/google/veyron_danger/chromeos.c | 10 ++++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/mainboard/google/veyron_danger/Kconfig b/src/mainboard/google/veyron_danger/Kconfig
index 5a41690..562f281 100644
--- a/src/mainboard/google/veyron_danger/Kconfig
+++ b/src/mainboard/google/veyron_danger/Kconfig
@@ -33,7 +33,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select SPI_FLASH
select SPI_FLASH_GIGADEVICE
select SPI_FLASH_WINBOND
- select VIRTUAL_DEV_SWITCH
config MAINBOARD_DIR
string
diff --git a/src/mainboard/google/veyron_danger/chromeos.c b/src/mainboard/google/veyron_danger/chromeos.c
index 7eed42e..62bc1a4 100644
--- a/src/mainboard/google/veyron_danger/chromeos.c
+++ b/src/mainboard/google/veyron_danger/chromeos.c
@@ -28,11 +28,13 @@
#define GPIO_WP GPIO(7, A, 6)
#define GPIO_POWER GPIO(0, A, 5)
#define GPIO_RECOVERY GPIO(0, B, 1)
+#define GPIO_DEV_MODE GPIO(7, B, 2)
void setup_chromeos_gpios(void)
{
gpio_input(GPIO_WP);
gpio_input(GPIO_POWER);
+ gpio_input(GPIO_DEV_MODE);
gpio_input_pullup(GPIO_RECOVERY);
}
@@ -64,9 +66,9 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
- /* Developer: GPIO active high */
- gpios->gpios[count].port = -1;
- gpios->gpios[count].polarity = ACTIVE_HIGH;
+ /* Developer: Danger has a physical dev switch that is active low */
+ gpios->gpios[count].port = GPIO_DEV_MODE.raw;
+ gpios->gpios[count].polarity = ACTIVE_LOW;
gpios->gpios[count].value = get_developer_mode_switch();
strncpy((char *)gpios->gpios[count].name, "developer",
GPIO_MAX_NAME_LENGTH);
@@ -88,7 +90,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
int get_developer_mode_switch(void)
{
- return 0;
+ return !gpio_get(GPIO_DEV_MODE);
}
int get_recovery_mode_switch(void)
More information about the coreboot-gerrit
mailing list