coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chromeos.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <boot/coreboot_tables.h>
4 #include <bootmode.h>
5 #include "board.h"
6 #include <security/tpm/tis.h>
7 
9 {
10  if (CONFIG(EC_GOOGLE_CHROMEEC)) {
13  }
14  if (CONFIG(MAINBOARD_HAS_TPM2))
16 
18 
19  if (CONFIG(HEROBRINE_HAS_FINGERPRINT)) {
23  }
25 }
26 
27 void fill_lb_gpios(struct lb_gpios *gpios)
28 {
29  const struct lb_gpio chromeos_gpios[] = {
31  "SD card detect"},
33  "speaker enable"},
34 #if CONFIG(EC_GOOGLE_CHROMEEC)
36  "EC in RW"},
38  "EC interrupt"},
39 #endif
40 #if CONFIG(MAINBOARD_HAS_TPM2)
42  "TPM interrupt"},
43 #endif
44  };
45 
46  lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
47 }
48 
50 {
51  /* EC is trusted if not in RW. This is active low. */
52  if (CONFIG(EC_GOOGLE_CHROMEEC))
53  return !!gpio_get(GPIO_EC_IN_RW);
54  else /* If no EC, always return true */
55  return 1;
56 }
57 
59 {
61 }
void fill_lb_gpios(struct lb_gpios *gpios)
Definition: chromeos.c:9
#define ARRAY_SIZE(a)
Definition: helpers.h:12
@ CONFIG
Definition: dsi_common.h:201
int get_ec_is_trusted(void)
Definition: chromeos.c:25
int tis_plat_irq_status(void)
Definition: chromeos.c:39
void setup_chromeos_gpios(void)
Definition: chromeos.c:10
#define ACTIVE_HIGH
Definition: chromeos.c:18
#define ACTIVE_LOW
Definition: chromeos.c:17
#define GPIO_SD_CD_L
Definition: board.h:24
#define GPIO_FP_RST_L
Definition: board.h:48
#define GPIO_FPMCU_BOOT0
Definition: board.h:47
#define GPIO_EN_FP_RAILS
Definition: board.h:49
#define GPIO_AP_EC_INT
Definition: board.h:20
#define GPIO_AMP_ENABLE
Definition: board.h:33
void lb_add_gpios(struct lb_gpios *gpios, const struct lb_gpio *gpio_table, size_t count)
int gpio_get(gpio_t gpio)
Definition: gpio.c:166
void gpio_output(gpio_t gpio, int value)
Definition: gpio.c:194
void gpio_input_pullup(gpio_t gpio)
Definition: gpio.c:184
#define GPIO_H1_AP_INT
Definition: gpio.h:12
@ IRQ_TYPE_RISING_EDGE
Definition: gpio_common.h:82
gpio_irq_status
Definition: gpio_common.h:49
void gpio_input_irq(gpio_t gpio, enum gpio_irq_type type, uint32_t pull)
Definition: gpio.c:65
#define GPIO_PULL_UP
Definition: gpio.h:24