diff options
author | Hung-Te Lin <hungte@chromium.org> | 2019-04-17 11:03:20 +0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2019-04-17 18:08:40 +0000 |
commit | 5c1fadbf0f660678aa70028e5bb9650f4e76776c (patch) | |
tree | 47594245001776a27e2892267a0ef9f58c541415 /src/mainboard | |
parent | 0873e27720a217c343af89dbe387b6499bdef814 (diff) | |
download | coreboot-5c1fadbf0f660678aa70028e5bb9650f4e76776c.tar.xz |
google/kukui: Get write protection status from WP GPIO
Write protection (get_write_protect_state) was hard-coded to 0 and
should be fixed to read from correct GPIO (PERIPHERAL_EN0 from
schematics).
BUG=b:130681408
TEST=make -j; boots on Kukui Rev2.
BRANCH=None
Change-Id: I75b98b1d587abe5e8cdf3df28ea661bc1ffa19f9
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32336
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: You-Cheng Syu <youcheng@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Joel Kitching <kitching@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/google/kukui/chromeos.c | 5 | ||||
-rw-r--r-- | src/mainboard/google/kukui/gpio.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mainboard/google/kukui/chromeos.c b/src/mainboard/google/kukui/chromeos.c index 09c47eec28..44e75e29f0 100644 --- a/src/mainboard/google/kukui/chromeos.c +++ b/src/mainboard/google/kukui/chromeos.c @@ -22,6 +22,7 @@ void setup_chromeos_gpios(void) { + gpio_input(GPIO_WP); gpio_input_pullup(EC_IN_RW); gpio_input_pullup(EC_IRQ); gpio_input_pullup(CR50_IRQ); @@ -31,6 +32,8 @@ void setup_chromeos_gpios(void) void fill_lb_gpios(struct lb_gpios *gpios) { struct lb_gpio chromeos_gpios[] = { + {GPIO_WP.id, ACTIVE_LOW, + !get_write_protect_state(), "write protect"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {EC_IN_RW.id, ACTIVE_HIGH, -1, "EC in RW"}, {EC_IRQ.id, ACTIVE_LOW, -1, "EC interrupt"}, @@ -41,7 +44,7 @@ void fill_lb_gpios(struct lb_gpios *gpios) int get_write_protect_state(void) { - return 0; + return !gpio_get(GPIO_WP); } int tis_plat_irq_status(void) diff --git a/src/mainboard/google/kukui/gpio.h b/src/mainboard/google/kukui/gpio.h index 024b0d79db..92d238ece2 100644 --- a/src/mainboard/google/kukui/gpio.h +++ b/src/mainboard/google/kukui/gpio.h @@ -18,6 +18,7 @@ #include <soc/gpio.h> +#define GPIO_WP GPIO(PERIPHERAL_EN0) #define EC_IRQ GPIO(PERIPHERAL_EN1) #define EC_IN_RW GPIO(PERIPHERAL_EN14) #define CR50_IRQ GPIO(PERIPHERAL_EN3) |