[coreboot-gerrit] New patch to review for coreboot: 5c3041c google/veyron_rialto: support the developer key GPIO

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Apr 21 15:29:12 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/9928

-gerrit

commit 5c3041c2833735796fa8841699bae51907cc541c
Author: Jonathan Dixon <joth at google.com>
Date:   Wed Apr 1 14:02:34 2015 -0700

    google/veyron_rialto: support the developer key GPIO
    
    Currently (EVT) this is a pullup resistor on the board (i.e. always in
    dev mode). Future builds it will be pull down and require servo or HW
    modification to control. Either way, this change means the FW should
    acknowledge it.
    
    BUG=chrome-os-partner:38663
    TEST=Manually verified that servo devmode switch toggles this GPIO. requires FW signing to verify GPIO is observed and dev mode active.
    BRANCH=none
    
    Change-Id: Ib05216992abc5f6175fe7395471bd379f185b61f
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 702c8d222a3d19d6b8db89d122dcdf594c85da99
    Original-Change-Id: I1d0f31819b9f7a1ab63deac52bcaf0b996499b0c
    Original-Reviewed-on: https://chromium-review.googlesource.com/263529
    Original-Reviewed-by: Hung-Te Lin <hungte at chromium.org>
    Original-Tested-by: Jonathan Dixon <joth at chromium.org>
    Original-Commit-Queue: Jonathan Dixon <joth at chromium.org>
---
 src/mainboard/google/veyron_rialto/Kconfig    | 1 -
 src/mainboard/google/veyron_rialto/chromeos.c | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mainboard/google/veyron_rialto/Kconfig b/src/mainboard/google/veyron_rialto/Kconfig
index f4a90df..597dd19 100644
--- a/src/mainboard/google/veyron_rialto/Kconfig
+++ b/src/mainboard/google/veyron_rialto/Kconfig
@@ -35,7 +35,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_rialto/chromeos.c b/src/mainboard/google/veyron_rialto/chromeos.c
index 9efa855..4b78ba8 100644
--- a/src/mainboard/google/veyron_rialto/chromeos.c
+++ b/src/mainboard/google/veyron_rialto/chromeos.c
@@ -29,6 +29,8 @@
 #define GPIO_POWER	GPIO(0, A, 5)
 #define GPIO_RECOVERY_SERVO	GPIO(0, B, 1)
 #define GPIO_RECOVERY_PUSHKEY	GPIO(7, B, 1)
+#define GPIO_DEVELOPER_SWITCH	GPIO(7, B, 2)
+
 
 void setup_chromeos_gpios(void)
 {
@@ -36,6 +38,7 @@ void setup_chromeos_gpios(void)
 	gpio_input(GPIO_POWER);
 	gpio_input_pullup(GPIO_RECOVERY_SERVO);
 	gpio_input_pullup(GPIO_RECOVERY_PUSHKEY);
+	gpio_input(GPIO_DEVELOPER_SWITCH);  // board has pull up/down resistor.
 }
 
 void fill_lb_gpios(struct lb_gpios *gpios)
@@ -70,7 +73,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
 	count++;
 
 	/* Developer: GPIO active high */
-	gpios->gpios[count].port = -1;
+	gpios->gpios[count].port = GPIO_DEVELOPER_SWITCH.raw;
 	gpios->gpios[count].polarity = ACTIVE_HIGH;
 	gpios->gpios[count].value = get_developer_mode_switch();
 	strncpy((char *)gpios->gpios[count].name, "developer",
@@ -93,7 +96,8 @@ void fill_lb_gpios(struct lb_gpios *gpios)
 
 int get_developer_mode_switch(void)
 {
-	return 0;
+	// GPIO_DEVELOPER_SWITCH is active high.
+	return gpio_get(GPIO_DEVELOPER_SWITCH);
 }
 
 int get_recovery_mode_switch(void)



More information about the coreboot-gerrit mailing list