1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <baseboard/gpio.h>
4 #include <bootmode.h>
5 #include <boot/coreboot_tables.h>
6 #include <gpio.h>
7 #include <types.h>
8
fill_lb_gpios(struct lb_gpios * gpios)9 void fill_lb_gpios(struct lb_gpios *gpios)
10 {
11 struct lb_gpio chromeos_gpios[] = {
12 #if CONFIG(VBOOT_LID_SWITCH)
13 {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
14 #else
15 /* fake LID open to avoid shutdown in depthcharge */
16 {-1, ACTIVE_HIGH, 1, "lid"},
17 #endif
18 {-1, ACTIVE_HIGH, 0, "power"},
19 {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
20 {-1, ACTIVE_HIGH, 0, "EC in RW"},
21 };
22 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
23 }
24
get_write_protect_state(void)25 int get_write_protect_state(void)
26 {
27 return gpio_get(GPIO_PCH_WP);
28 }
29
get_ec_is_trusted(void)30 int get_ec_is_trusted(void)
31 {
32 /* VB2_CONTEXT_EC_TRUSTED should be set according to the Ti50 boot mode. */
33 return 0;
34 }
35