1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <bootmode.h>
4 #include <boot/coreboot_tables.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <gpio.h>
7 #include <types.h>
8 #include <variant/gpio.h>
9
fill_lb_gpios(struct lb_gpios * gpios)10 void fill_lb_gpios(struct lb_gpios *gpios)
11 {
12 struct lb_gpio chromeos_gpios[] = {
13 {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
14 {-1, ACTIVE_HIGH, 0, "power"},
15 {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
16 {-1, ACTIVE_HIGH, 0, "EC in RW"},
17 };
18 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
19 }
20
get_write_protect_state(void)21 int get_write_protect_state(void)
22 {
23 return 0;
24 }
25
get_lid_switch(void)26 int __weak get_lid_switch(void)
27 {
28 return -1;
29 }
30
get_ec_is_trusted(void)31 int get_ec_is_trusted(void)
32 {
33 /* Do not have a Chrome EC involved in entering recovery mode;
34 Always return trusted. */
35 return 1;
36 }
37