Debian Codegraph @

src/mainboard/google/bluey/chromeos.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <boot/coreboot_tables.h>
4 #include <bootmode.h>
5 #include <drivers/tpm/cr50.h>
6 #include "board.h"
7
8 void setup_chromeos_gpios(void)
9 {
10 if (CONFIG(EC_GOOGLE_CHROMEEC))
11 gpio_input_pullup(GPIO_AP_EC_INT);
12
13 if (CONFIG(TPM_GOOGLE_TI50))
14 gpio_input_irq(GPIO_GSC_AP_INT, IRQ_TYPE_RISING_EDGE, GPIO_PULL_UP);
15
16 if (CONFIG(MAINBOARD_HAS_FINGERPRINT)) {
17 gpio_output(GPIO_FP_RST_L, 0);
18 if (CONFIG(MAINBOARD_HAS_FINGERPRINT_VIA_SPI)) {
19 gpio_output(GPIO_FPMCU_BOOT0, 0);
20 gpio_output(GPIO_EN_FP_RAILS, 0);
21 gpio_input_irq(GPIO_FPMCU_INT, IRQ_TYPE_LEVEL, GPIO_PULL_UP);
22 }
23 }
24
25 gpio_output(GPIO_SNDW_AMP_0_ENABLE, 0);
26 gpio_output(GPIO_SNDW_AMP_1_ENABLE, 0);
27 }
28
29 void fill_lb_gpios(struct lb_gpios *gpios)
30 {
31 /* TODO: Add required GPIO after referring to the schematics */
32 const struct lb_gpio chromeos_gpios[] = {
33 #if CONFIG(EC_GOOGLE_CHROMEEC)
34 {GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT),
35 "EC interrupt"},
36 #endif
37 #if CONFIG(TPM_GOOGLE_TI50)
38 {GPIO_GSC_AP_INT.addr, ACTIVE_HIGH, gpio_get(GPIO_GSC_AP_INT),
39 "TPM interrupt"},
40 #endif
41 {GPIO_SNDW_AMP_0_ENABLE.addr, ACTIVE_HIGH, gpio_get(GPIO_SNDW_AMP_0_ENABLE),
42 "Speaker 0 enable"},
43 {GPIO_SNDW_AMP_1_ENABLE.addr, ACTIVE_HIGH, gpio_get(GPIO_SNDW_AMP_1_ENABLE),
44 "Speaker 1 enable"},
45 #if CONFIG(MAINBOARD_HAS_SD_CONTROLLER)
46 {GPIO_SD_CD_L.addr, ACTIVE_LOW, gpio_get(GPIO_SD_CD_L),
47 "SD card detect"},
48 #endif
49 };
50
51 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
52 }
53
54 int cr50_plat_irq_status(void)
55 {
56 return gpio_irq_status(GPIO_GSC_AP_INT);
57 }