blob: 5ed041f52b7c7b226e4b8a832116769e2f720de4 [file] [log] [blame]
Eric Lai366fba22022-05-24 09:25:57 +08001/* 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
9void fill_lb_gpios(struct lb_gpios *gpios)
10{
11 struct lb_gpio chromeos_gpios[] = {
Subrata Banik3ff6b2f2023-09-07 12:57:42 +000012#if CONFIG(VBOOT_LID_SWITCH)
Eric Lai366fba22022-05-24 09:25:57 +080013 {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
Subrata Banik3ff6b2f2023-09-07 12:57:42 +000014#else
15 /* fake LID open to avoid shutdown in depthcharge */
16 {-1, ACTIVE_HIGH, 1, "lid"},
17#endif
Eric Lai366fba22022-05-24 09:25:57 +080018 {-1, ACTIVE_HIGH, 0, "power"},
19 {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
Kapil Porwal40608602022-08-30 11:54:45 +000020 {-1, ACTIVE_HIGH, 0, "EC in RW"},
Eric Lai366fba22022-05-24 09:25:57 +080021 };
22 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
23}
24
25int get_write_protect_state(void)
26{
27 return gpio_get(GPIO_PCH_WP);
28}
29
30int get_ec_is_trusted(void)
31{
Kapil Porwal40608602022-08-30 11:54:45 +000032 /* VB2_CONTEXT_EC_TRUSTED should be set according to the Ti50 boot mode. */
33 return 0;
Eric Lai366fba22022-05-24 09:25:57 +080034}