1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <boot/coreboot_tables.h>
5 #include <drivers/tpm/cr50.h>
10 void setup_chromeos_gpios(void)
13 gpio_input_pullup(EC_IN_RW
);
14 gpio_input_pullup(EC_IRQ
);
15 gpio_input_pullup(CR50_IRQ
);
16 gpio_output(GPIO_RESET
, 0);
17 gpio_output(GPIO_EN_SPK_AMP
, 0);
20 void fill_lb_gpios(struct lb_gpios
*gpios
)
22 struct lb_gpio chromeos_gpios
[] = {
23 {EC_IN_RW
.id
, ACTIVE_HIGH
, -1, "EC in RW"},
24 {EC_IRQ
.id
, ACTIVE_LOW
, -1, "EC interrupt"},
25 {CR50_IRQ
.id
, ACTIVE_HIGH
, -1, "TPM interrupt"},
26 {GPIO_EN_SPK_AMP
.id
, ACTIVE_HIGH
, -1, CONFIG_SPEAKER_GPIO_NAME
},
28 lb_add_gpios(gpios
, chromeos_gpios
, ARRAY_SIZE(chromeos_gpios
));
31 int get_write_protect_state(void)
33 return !gpio_get(GPIO_WP
);
36 int cr50_plat_irq_status(void)
38 return gpio_eint_poll(CR50_IRQ
);
41 int get_ec_is_trusted(void)
43 /* EC is trusted if not in RW. */
44 return !gpio_get(EC_IN_RW
);