1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <boot/coreboot_tables.h>
9 #define GPIO_WP GPIO(7, A, 6)
10 #define GPIO_RECOVERY GPIO(0, B, 1)
12 void setup_chromeos_gpios(void)
15 gpio_input_pullup(GPIO_RECOVERY
);
18 void fill_lb_gpios(struct lb_gpios
*gpios
)
20 struct lb_gpio chromeos_gpios
[] = {
21 {GPIO_RECOVERY
.raw
, ACTIVE_LOW
,
22 !get_recovery_mode_switch(), "presence"},
23 {GPIO_RESET
.raw
, ACTIVE_HIGH
, -1, "reset"},
25 lb_add_gpios(gpios
, chromeos_gpios
, ARRAY_SIZE(chromeos_gpios
));
28 int get_recovery_mode_switch(void)
30 return !gpio_get(GPIO_RECOVERY
);
33 int get_write_protect_state(void)
35 return !gpio_get(GPIO_WP
);
38 int get_ec_is_trusted(void)
40 /* Do not have a Chrome EC involved in entering recovery mode;
41 Always return trusted. */