chromeos: clean up "recovery" and "write protect" GPIOs

The "write protect" GPIO's cached value is never actually
read after entering depthcharge.  Ensure the value from
get_write_protect_state() is being transferred accurately,
so that we may read this GPIO value in depthcharge without
resampling.

The cached value of the "recovery" GPIO is read only on certain
boards which have a physical recovery switch.  Correct some of
the values sent to boards which presumably never read the
previously incorrect value.  Most of these inaccuracies are from
non-inverted values on ACTIVE_LOW GPIOs.

BUG=b:124141368, b:124192753, chromium:950273
TEST=make clean && make test-abuild
BRANCH=none

Change-Id: Ic17a98768703d7098480a9233b752fe5b201bd51
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32233
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Joel Kitching 2019-04-07 00:37:14 +08:00 committed by Patrick Georgi
parent 482eec0e1b
commit ae0fb762a2
23 changed files with 51 additions and 49 deletions

View File

@ -25,7 +25,8 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{CROS_WP_GPIO, ACTIVE_HIGH, 0, "write protect"}, {CROS_WP_GPIO, ACTIVE_HIGH, get_write_protect_state(),
"write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},

View File

@ -33,9 +33,10 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_SPI_WP, ACTIVE_HIGH, 0, "write protect"}, {GPIO_SPI_WP, ACTIVE_HIGH,
get_write_protect_state(), "write protect"},
{GPIO_REC_MODE, ACTIVE_LOW, {GPIO_REC_MODE, ACTIVE_LOW,
get_recovery_mode_switch(), "recovery"}, !get_recovery_mode_switch(), "recovery"},
{-1, ACTIVE_HIGH, 1, "lid"}, {-1, ACTIVE_HIGH, 1, "lid"},
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},

View File

@ -38,7 +38,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
"EC in RW"}, "EC in RW"},
{GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT), {GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT),
"EC interrupt"}, "EC interrupt"},
{GPIO_WP_STATE.addr, ACTIVE_LOW, gpio_get(GPIO_WP_STATE), {GPIO_WP_STATE.addr, ACTIVE_LOW, !get_write_protect_state(),
"write protect"}, "write protect"},
{GPIO_H1_AP_INT.addr, ACTIVE_LOW, gpio_get(GPIO_H1_AP_INT), {GPIO_H1_AP_INT.addr, ACTIVE_LOW, gpio_get(GPIO_H1_AP_INT),
"TPM interrupt"}, "TPM interrupt"},

View File

@ -27,7 +27,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
/* Write Protect: active low (WP_GPIO) */ /* Write Protect: active low (WP_GPIO) */
{EXYNOS5_GPD1, ACTIVE_LOW, gpio_get_value(GPIO_D16), {EXYNOS5_GPD1, ACTIVE_LOW, !get_write_protect_state(),
"write protect"}, "write protect"},
/* Recovery: active low */ /* Recovery: active low */

View File

@ -27,7 +27,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
/* TBD(twarren@nvidia.com): Any analogs for these on Foster-FFD? */ /* TBD(twarren@nvidia.com): Any analogs for these on Foster-FFD? */
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
/* Write Protect: active low */ /* Write Protect: active low */
{-1, ACTIVE_LOW, get_write_protect_state(), "write protect"}, {-1, ACTIVE_LOW, !get_write_protect_state(), "write protect"},
/* Recovery: active high */ /* Recovery: active high */
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},

View File

@ -25,9 +25,6 @@
#include <vendorcode/google/chromeos/chromeos.h> #include <vendorcode/google/chromeos/chromeos.h>
#define PP_SW 41 #define PP_SW 41
#define PP_POL ACTIVE_LOW
#define REC_POL ACTIVE_LOW
#define WP_POL ACTIVE_LOW
static int get_rec_sw_gpio_pin(void) static int get_rec_sw_gpio_pin(void)
{ {
@ -70,11 +67,11 @@ static int read_gpio(gpio_t gpio_num)
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{PP_SW, PP_POL, read_gpio(PP_SW), "presence"}, {PP_SW, ACTIVE_LOW, read_gpio(PP_SW), "presence"},
{get_rec_sw_gpio_pin(), REC_POL, {get_rec_sw_gpio_pin(), ACTIVE_LOW,
read_gpio(get_rec_sw_gpio_pin()), "recovery"}, read_gpio(get_rec_sw_gpio_pin()), "recovery"},
{get_wp_status_gpio_pin(), WP_POL, {get_wp_status_gpio_pin(), ACTIVE_LOW,
read_gpio(get_wp_status_gpio_pin()), "write protect"}, !get_write_protect_state(), "write protect"},
{-1, ACTIVE_LOW, 1, "power"}, {-1, ACTIVE_LOW, 1, "power"},
{-1, ACTIVE_LOW, 0, "lid"}, {-1, ACTIVE_LOW, 0, "lid"},
}; };
@ -119,7 +116,7 @@ static enum switch_state get_switch_state(void)
return saved_state; return saved_state;
rec_sw = get_rec_sw_gpio_pin(); rec_sw = get_rec_sw_gpio_pin();
sampled_value = read_gpio(rec_sw) ^ !REC_POL; sampled_value = !read_gpio(rec_sw);
if (!sampled_value) { if (!sampled_value) {
saved_state = no_req; saved_state = no_req;
@ -133,7 +130,7 @@ static enum switch_state get_switch_state(void)
stopwatch_init_msecs_expire(&sw, WIPEOUT_MODE_DELAY_MS); stopwatch_init_msecs_expire(&sw, WIPEOUT_MODE_DELAY_MS);
do { do {
sampled_value = read_gpio(rec_sw) ^ !REC_POL; sampled_value = !read_gpio(rec_sw);
if (!sampled_value) if (!sampled_value)
break; break;
} while (!stopwatch_expired(&sw)); } while (!stopwatch_expired(&sw));
@ -143,7 +140,7 @@ static enum switch_state get_switch_state(void)
printk(BIOS_INFO, "wipeout requested, checking recovery\n"); printk(BIOS_INFO, "wipeout requested, checking recovery\n");
stopwatch_init_msecs_expire(&sw, RECOVERY_MODE_EXTRA_DELAY_MS); stopwatch_init_msecs_expire(&sw, RECOVERY_MODE_EXTRA_DELAY_MS);
do { do {
sampled_value = read_gpio(rec_sw) ^ !REC_POL; sampled_value = !read_gpio(rec_sw);
if (!sampled_value) if (!sampled_value)
break; break;
} while (!stopwatch_expired(&sw)); } while (!stopwatch_expired(&sw));
@ -175,5 +172,5 @@ int get_wipeout_mode_switch(void)
int get_write_protect_state(void) int get_write_protect_state(void)
{ {
return read_gpio(get_wp_status_gpio_pin()) ^ !WP_POL; return !read_gpio(get_wp_status_gpio_pin());
} }

View File

@ -26,15 +26,14 @@ static const uint32_t wp_polarity = CONFIG(GRU_BASEBOARD_SCARLET) ?
int get_write_protect_state(void) int get_write_protect_state(void)
{ {
int raw = gpio_get(GPIO_WP); return gpio_get(GPIO_WP) ^ !wp_polarity;
return wp_polarity == ACTIVE_HIGH ? raw : !raw;
} }
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_WP.raw, wp_polarity, gpio_get(GPIO_WP), {GPIO_WP.raw, wp_polarity,
"write protect"}, get_write_protect_state() ^ !wp_polarity, "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
#if CONFIG(GRU_BASEBOARD_SCARLET) #if CONFIG(GRU_BASEBOARD_SCARLET)
{GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"}, {GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},

View File

@ -35,9 +35,9 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_SPI_WP, ACTIVE_HIGH, {GPIO_SPI_WP, ACTIVE_HIGH,
get_gpio(GPIO_SPI_WP), "write protect"}, get_write_protect_state(), "write protect"},
{GPIO_REC_MODE, ACTIVE_LOW, {GPIO_REC_MODE, ACTIVE_LOW,
get_recovery_mode_switch(), "recovery"}, !get_recovery_mode_switch(), "recovery"},
{-1, ACTIVE_HIGH, 1, "lid"}, {-1, ACTIVE_HIGH, 1, "lid"},
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},

View File

@ -20,7 +20,8 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO(R1), ACTIVE_LOW, gpio_get(GPIO(R1)), "write protect"}, {GPIO(R1), ACTIVE_LOW, !get_write_protect_state(),
"write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{GPIO(R4), ACTIVE_HIGH, -1, "lid"}, {GPIO(R4), ACTIVE_HIGH, -1, "lid"},
{GPIO(Q0), ACTIVE_LOW, -1, "power"}, {GPIO(Q0), ACTIVE_LOW, -1, "power"},

View File

@ -20,7 +20,8 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO(R1), ACTIVE_LOW, gpio_get(GPIO(R1)), "write protect"}, {GPIO(R1), ACTIVE_LOW,
!get_write_protect_state(), "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{GPIO(R4), ACTIVE_HIGH, -1, "lid"}, {GPIO(R4), ACTIVE_HIGH, -1, "lid"},
{GPIO(Q0), ACTIVE_LOW, -1, "power"}, {GPIO(Q0), ACTIVE_LOW, -1, "power"},

View File

@ -20,7 +20,8 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO(R1), ACTIVE_LOW, gpio_get(GPIO(R1)), "write protect"}, {GPIO(R1), ACTIVE_LOW, !get_write_protect_state(),
"write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{GPIO(R4), ACTIVE_HIGH, -1, "lid"}, {GPIO(R4), ACTIVE_HIGH, -1, "lid"},
{GPIO(Q0), ACTIVE_LOW, -1, "power"}, {GPIO(Q0), ACTIVE_LOW, -1, "power"},

View File

@ -35,7 +35,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{WRITE_PROTECT.id, ACTIVE_LOW, {WRITE_PROTECT.id, ACTIVE_LOW,
gpio_get(WRITE_PROTECT), "write protect"}, !get_write_protect_state(), "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{LID.id, ACTIVE_HIGH, -1, "lid"}, {LID.id, ACTIVE_HIGH, -1, "lid"},
{POWER_BUTTON.id, ACTIVE_HIGH, -1, "power"}, {POWER_BUTTON.id, ACTIVE_HIGH, -1, "power"},

View File

@ -27,7 +27,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
/* Write Protect: active low (WP_GPIO) */ /* Write Protect: active low (WP_GPIO) */
{EXYNOS5_GPX3, ACTIVE_LOW, gpio_get_value(GPIO_X30), {EXYNOS5_GPX3, ACTIVE_LOW, !get_write_protect_state(),
"write protect"}, "write protect"},
/* Recovery: active low */ /* Recovery: active low */

View File

@ -36,7 +36,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_PCH_WP, ACTIVE_HIGH, get_write_protect_state(), {GPIO_PCH_WP, ACTIVE_HIGH, get_write_protect_state(),
"write protect"}, "write protect"},
{GPIO_REC_MODE, ACTIVE_LOW, get_recovery_mode_switch(), {GPIO_REC_MODE, ACTIVE_LOW, !get_recovery_mode_switch(),
"recovery"}, "recovery"},
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},

View File

@ -24,7 +24,7 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{58, ACTIVE_HIGH, 0, "write protect"}, {58, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},

View File

@ -22,7 +22,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{WRITE_PROTECT_L, ACTIVE_LOW, {WRITE_PROTECT_L, ACTIVE_LOW,
gpio_get(WRITE_PROTECT_L), "write protect"}, !get_write_protect_state(), "write protect"},
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{POWER_BUTTON, ACTIVE_LOW, -1, "power"}, {POWER_BUTTON, ACTIVE_LOW, -1, "power"},
{EC_IN_RW, ACTIVE_HIGH, -1, "EC in RW"}, {EC_IN_RW, ACTIVE_HIGH, -1, "EC in RW"},

View File

@ -25,11 +25,8 @@
#include <vendorcode/google/chromeos/chromeos.h> #include <vendorcode/google/chromeos/chromeos.h>
#define DEV_SW 15 #define DEV_SW 15
#define DEV_POL ACTIVE_LOW
#define REC_SW 16 #define REC_SW 16
#define REC_POL ACTIVE_LOW
#define WP_SW 17 #define WP_SW 17
#define WP_POL ACTIVE_LOW
static int read_gpio(gpio_t gpio_num) static int read_gpio(gpio_t gpio_num)
{ {
@ -43,7 +40,8 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{REC_SW, ACTIVE_LOW, read_gpio(REC_SW), "recovery"}, {REC_SW, ACTIVE_LOW, read_gpio(REC_SW), "recovery"},
{WP_SW, ACTIVE_LOW, read_gpio(WP_SW), "write protect"}, {WP_SW, ACTIVE_LOW, !get_write_protect_state(),
"write protect"},
{-1, ACTIVE_LOW, 1, "power"}, {-1, ACTIVE_LOW, 1, "power"},
{-1, ACTIVE_LOW, 0, "lid"}, {-1, ACTIVE_LOW, 0, "lid"},
}; };
@ -87,7 +85,7 @@ static enum switch_state get_switch_state(void)
if (saved_state != not_probed) if (saved_state != not_probed)
return saved_state; return saved_state;
sampled_value = read_gpio(REC_SW) ^ !REC_POL; sampled_value = !read_gpio(REC_SW);
if (!sampled_value) { if (!sampled_value) {
saved_state = no_req; saved_state = no_req;
@ -101,7 +99,7 @@ static enum switch_state get_switch_state(void)
stopwatch_init_msecs_expire(&sw, WIPEOUT_MODE_DELAY_MS); stopwatch_init_msecs_expire(&sw, WIPEOUT_MODE_DELAY_MS);
do { do {
sampled_value = read_gpio(REC_SW) ^ !REC_POL; sampled_value = !read_gpio(REC_SW);
if (!sampled_value) if (!sampled_value)
break; break;
} while (!stopwatch_expired(&sw)); } while (!stopwatch_expired(&sw));
@ -111,7 +109,7 @@ static enum switch_state get_switch_state(void)
printk(BIOS_INFO, "wipeout requested, checking recovery\n"); printk(BIOS_INFO, "wipeout requested, checking recovery\n");
stopwatch_init_msecs_expire(&sw, RECOVERY_MODE_EXTRA_DELAY_MS); stopwatch_init_msecs_expire(&sw, RECOVERY_MODE_EXTRA_DELAY_MS);
do { do {
sampled_value = read_gpio(REC_SW) ^ !REC_POL; sampled_value = !read_gpio(REC_SW);
if (!sampled_value) if (!sampled_value)
break; break;
} while (!stopwatch_expired(&sw)); } while (!stopwatch_expired(&sw));
@ -143,5 +141,5 @@ int get_wipeout_mode_switch(void)
int get_write_protect_state(void) int get_write_protect_state(void)
{ {
return read_gpio(WP_SW) ^ !WP_POL; return !read_gpio(WP_SW);
} }

View File

@ -40,9 +40,10 @@ void setup_chromeos_gpios(void)
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"}, {GPIO_WP.raw, ACTIVE_LOW, !get_write_protect_state(),
"write protect"},
{GPIO_RECOVERY.raw, ACTIVE_LOW, {GPIO_RECOVERY.raw, ACTIVE_LOW,
get_recovery_mode_switch(), "recovery"}, !get_recovery_mode_switch(), "recovery"},
{GPIO_LID.raw, ACTIVE_HIGH, -1, "lid"}, {GPIO_LID.raw, ACTIVE_HIGH, -1, "lid"},
{GPIO_POWER.raw, ACTIVE_LOW, -1, "power"}, {GPIO_POWER.raw, ACTIVE_LOW, -1, "power"},
{GPIO_ECINRW.raw, ACTIVE_HIGH, -1, "EC in RW"}, {GPIO_ECINRW.raw, ACTIVE_HIGH, -1, "EC in RW"},

View File

@ -31,9 +31,10 @@ void setup_chromeos_gpios(void)
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"}, {GPIO_WP.raw, ACTIVE_LOW,
!get_write_protect_state(), "write protect"},
{GPIO_RECOVERY.raw, ACTIVE_LOW, {GPIO_RECOVERY.raw, ACTIVE_LOW,
gpio_get(GPIO_RECOVERY), "recovery"}, !get_recovery_mode_switch(), "recovery"},
{GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"}, {GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},
}; };
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));

View File

@ -36,7 +36,8 @@ void setup_chromeos_gpios(void)
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"}, {GPIO_WP.raw, ACTIVE_LOW,
!get_write_protect_state(), "write protect"},
/* Note for early development, we want to support both servo /* Note for early development, we want to support both servo
* and pushkey recovery buttons in firmware boot stages. */ * and pushkey recovery buttons in firmware boot stages. */
{GPIO_RECOVERY_PUSHKEY.raw, ACTIVE_LOW, {GPIO_RECOVERY_PUSHKEY.raw, ACTIVE_LOW,

View File

@ -30,7 +30,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
/* Write Protect: GPIO22 */ /* Write Protect: GPIO22 */
{0, ACTIVE_LOW, get_write_protect_state(), "write protect"}, {0, ACTIVE_LOW, !get_write_protect_state(), "write protect"},
/* Recovery: GPIO69 - SV_DETECT - J8E3 (silkscreen: J8E2) */ /* Recovery: GPIO69 - SV_DETECT - J8E3 (silkscreen: J8E2) */
{69, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {69, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},

View File

@ -30,10 +30,10 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
/* Write Protect: GPIO48 */ /* Write Protect: GPIO48 */
{48, ACTIVE_LOW, get_write_protect_state(), "write protect"}, {48, ACTIVE_LOW, !get_write_protect_state(), "write protect"},
/* Recovery: GPIO22 */ /* Recovery: GPIO22 */
{22, ACTIVE_LOW, get_recovery_mode_switch(), "recovery"}, {22, ACTIVE_LOW, !get_recovery_mode_switch(), "recovery"},
/* Hard code the lid switch GPIO to open. */ /* Hard code the lid switch GPIO to open. */
{-1, ACTIVE_HIGH, 1, "lid"}, {-1, ACTIVE_HIGH, 1, "lid"},

View File

@ -28,8 +28,8 @@
void fill_lb_gpios(struct lb_gpios *gpios) void fill_lb_gpios(struct lb_gpios *gpios)
{ {
struct lb_gpio chromeos_gpios[] = { struct lb_gpio chromeos_gpios[] = {
{-1, ACTIVE_HIGH, 0, "write protect"}, {-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
{-1, ACTIVE_HIGH, REC_MODE_SETTING, "recovery"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
{-1, ACTIVE_HIGH, 1, "lid"}, // force open {-1, ACTIVE_HIGH, 1, "lid"}, // force open
{-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, 0, "power"},
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},