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 <commonlib/helpers.h>
6 #include <soc/gpio.h>
7 
8 /* Early pad configuration in bootblock */
9 static const struct pad_config early_gpio_table[] = {
10  /* F12 : GSXDOUT ==> WWAN_RST_L */
11  PAD_CFG_GPO(GPP_F12, 0, DEEP),
12  /* H12 : UART0_RTS# ==> SD_PERST_L */
13  PAD_CFG_GPO(GPP_H12, 0, DEEP),
14  /* A13 : GPP_A13 ==> GSC_SOC_INT_ODL */
15  PAD_CFG_GPI_APIC(GPP_A13, NONE, PLTRST, LEVEL, INVERT),
16  /* D6 : SRCCLKREQ1# ==> WWAN_EN */
17  PAD_CFG_GPO(GPP_D6, 1, DEEP),
18  /* E12 : THC0_SPI1_IO1 ==> SOC_WP_OD */
20  /* F18 : THC1_SPI2_INT# ==> EC_IN_RW_OD */
21  PAD_CFG_GPI(GPP_F18, NONE, DEEP),
22  /* H4 : I2C0_SDA ==> SOC_I2C_GSC_SDA */
23  PAD_CFG_NF(GPP_H4, NONE, DEEP, NF1),
24  /* H5 : I2C0_SCL ==> SOC_I2C_GSC_SCL */
25  PAD_CFG_NF(GPP_H5, NONE, DEEP, NF1),
26  /* H10 : UART0_RXD ==> UART_SOC_RX_DBG_TX */
27  PAD_CFG_NF(GPP_H10, NONE, DEEP, NF2),
28  /* H11 : UART0_TXD ==> UART_SOC_TX_DBG_RX */
29  PAD_CFG_NF(GPP_H11, NONE, DEEP, NF2),
30  /* H13 : UART0_CTS# ==> EN_PP3300_SD_X */
31  PAD_CFG_GPO(GPP_H13, 1, DEEP),
32 };
33 
34 static const struct pad_config romstage_gpio_table[] = {
35  /* H12 : UART0_RTS# ==> SD_PERST_L */
36  PAD_CFG_GPO(GPP_H12, 1, DEEP),
37 };
38 
39 const struct pad_config *variant_early_gpio_table(size_t *num)
40 {
42  return early_gpio_table;
43 }
44 
45 const struct pad_config *variant_romstage_gpio_table(size_t *num)
46 {
48  return romstage_gpio_table;
49 }
#define GPP_F12
#define GPP_H11
#define GPP_D6
#define GPP_H12
#define GPP_H13
#define GPP_H5
#define GPP_A13
#define GPP_F18
#define GPP_H10
#define GPP_E12
#define GPP_H4
#define ARRAY_SIZE(a)
Definition: helpers.h:12
const struct pad_config * variant_romstage_gpio_table(size_t *num)
Definition: gpio.c:210
const struct pad_config * variant_early_gpio_table(size_t *num)
Definition: gpio.c:204
static const struct pad_config romstage_gpio_table[]
Definition: gpio.c:34
static const struct pad_config early_gpio_table[]
Definition: gpio.c:9
#define PAD_CFG_GPI(pad, pull, rst)
Definition: gpio_defs.h:284
#define PAD_CFG_NF(pad, pull, rst, func)
Definition: gpio_defs.h:197
#define PAD_CFG_GPI_APIC(pad, pull, rst, trig, inv)
Definition: gpio_defs.h:376
#define PAD_CFG_GPO(pad, val, rst)
Definition: gpio_defs.h:247
#define PAD_CFG_GPI_GPIO_DRIVER(pad, pull, rst)
Definition: gpio_defs.h:323