soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / mainboard / google / guybrush / chromeos.c
blobb39f7c077a9fa56a34e3ecfbdc4934cbab10d287
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <boardid.h>
5 #include <bootmode.h>
6 #include <boot/coreboot_tables.h>
7 #include <gpio.h>
8 #include <types.h>
9 #include <vendorcode/google/chromeos/chromeos.h>
11 void fill_lb_gpios(struct lb_gpios *gpios)
13 struct lb_gpio chromeos_gpios[] = {
14 {GPIO_EC_IN_RW, ACTIVE_HIGH, gpio_get(GPIO_EC_IN_RW), "EC in RW"},
16 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
19 static const struct cros_gpio cros_gpios[] = {
20 CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
21 CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
23 DECLARE_CROS_GPIOS(cros_gpios);
25 int get_ec_is_trusted(void)
27 /* Board versions 1 & 2 support H1 DB, but the EC_IN_RW signal is not
28 routed. So emulate EC is trusted. */
29 if (CONFIG(BOARD_GOOGLE_GUYBRUSH) &&
30 (board_id() == UNDEFINED_STRAPPING_ID || board_id() < 3))
31 return 1;
32 /* EC is trusted if not in RW. */
33 return !gpio_get(GPIO_EC_IN_RW);