summaryrefslogtreecommitdiff
path: root/src/mainboard/google/gru/chromeos.c
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2016-08-04 09:27:40 -0700
committerMartin Roth <martinroth@google.com>2016-08-09 18:01:34 +0200
commit4884c5d52d23ca02be326d41233dc16b829d6535 (patch)
tree97dfb41d7ececb01a466bb604d5e62e190b31efc /src/mainboard/google/gru/chromeos.c
parent9d130a9e1038e406c4be74a70a99f5530ef5c55d (diff)
google/gru: Fix rk3399-gru write protect
The write protect GPIO is active high, not active low. After fixing I can see this after removing the write-protect screw: $ crossystem | grep wpsw_boot wpsw_boot = 0 Putting the screw in shows: $ crossystem | grep wpsw_boot wpsw_boot = 1 Caution: this CL contains explicit material. It explicitly sets the pullup on the WP GPIO even though that's the boot default. BRANCH=None BUG=chrome-os-partner:55933 TEST=See desc. Change-Id: I23e17e3bbbe7dcd83e81814de46117491e61baaa Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: e6969f4be42c00c6e88bbb14929cf0454462ad21 Original-Change-Id: Ie65db9cf182b0a0a05ae412f86904df6b239e0f4 Original-Signed-off-by: Douglas Anderson <dianders@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/366131 Original-Tested-by: Brian Norris <briannorris@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/16115 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/gru/chromeos.c')
-rw-r--r--src/mainboard/google/gru/chromeos.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mainboard/google/gru/chromeos.c b/src/mainboard/google/gru/chromeos.c
index f8aa4fa4f9..cc2b3b6604 100644
--- a/src/mainboard/google/gru/chromeos.c
+++ b/src/mainboard/google/gru/chromeos.c
@@ -22,10 +22,16 @@
#include "board.h"
+int get_write_protect_state(void)
+{
+ return gpio_get(GPIO_WP);
+}
+
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio chromeos_gpios[] = {
- {GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
+ {GPIO_WP.raw, ACTIVE_HIGH, get_write_protect_state(),
+ "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},
{GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},
@@ -50,14 +56,9 @@ int get_recovery_mode_switch(void)
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
}
-int get_write_protect_state(void)
-{
- return !gpio_get(GPIO_WP);
-}
-
void setup_chromeos_gpios(void)
{
- gpio_input(GPIO_WP);
+ gpio_input_pullup(GPIO_WP);
gpio_input_pullup(GPIO_EC_IN_RW);
gpio_input_pullup(GPIO_EC_IRQ);
}