coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <gpio.h>
6 #include <soc/gpio.h>
8 
9 static const struct soc_amd_gpio bid_1_gpio_set_stage_ram[] = {
10  /* TP */
11  PAD_NC(GPIO_32),
12  /* EN_DEV_BEEP_L */
13  PAD_GPO(GPIO_89, HIGH),
14  /* USI_RESET */
15  PAD_GPO(GPIO_140, HIGH),
16 };
17 
18 static const struct soc_amd_gpio vilboz_gpio_set_stage_ram[] = {
19  /* P sensor INT */
20  PAD_INT(GPIO_40, PULL_NONE, LEVEL_LOW, STATUS_DELIVERY),
21  /* LTE_RST_L */
22  PAD_GPO(GPIO_89, HIGH),
23 };
24 
25 const struct soc_amd_gpio *variant_override_gpio_table(size_t *size)
26 {
27  uint32_t board_version;
28 
29  /*
30  * If board version cannot be read, assume that this is an older revision of the board
31  * and so apply overrides. If board version is provided by the EC, then apply overrides
32  * if version < 2.
33  */
34  if (google_chromeec_cbi_get_board_version(&board_version) != 0)
35  board_version = 1;
36 
37  if (board_version < 2) {
40  }
41 
44 }
#define GPIO_32
Definition: gpio_ftns.h:15
#define ARRAY_SIZE(a)
Definition: helpers.h:12
int google_chromeec_cbi_get_board_version(uint32_t *version)
Definition: ec.c:870
#define PULL_NONE
Definition: buildOpts.c:72
const struct pad_config *__weak variant_override_gpio_table(size_t *num)
Definition: gpio.c:450
static const struct soc_amd_gpio bid_1_gpio_set_stage_ram[]
Definition: gpio.c:9
static const struct soc_amd_gpio vilboz_gpio_set_stage_ram[]
Definition: gpio.c:18
#define GPIO_89
Definition: gpio.h:65
#define GPIO_140
Definition: gpio.h:87
#define GPIO_40
Definition: gpio.h:49
#define PAD_NC(pin)
Definition: gpio_defs.h:263
#define PAD_GPO(pin, direction)
Definition: gpio_defs.h:220
#define PAD_INT(pin, pull, trigger, action)
Definition: gpio_defs.h:224
unsigned int uint32_t
Definition: stdint.h:14