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-only */
2 
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <gpio.h>
6 #include <soc/gpio.h>
7 
8 /* GPIOs needed prior to ramstage. */
9 static const struct pad_config early_gpio_table[] = {
10  PAD_CFG_GPI(GPIO_190, NONE, DEEP), /* PCH_WP_OD */
11  /* GSPI0_INT */
12  PAD_CFG_GPI_APIC_IOS(GPIO_63, NONE, DEEP, LEVEL, INVERT, TxDRxE,
13  DISPUPD), /* H1_PCH_INT_ODL */
14  /* GSPI0_CLK */
15  PAD_CFG_NF(GPIO_79, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CLK_R */
16  /* GSPI0_CS# */
17  PAD_CFG_NF(GPIO_80, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CS_L_R */
18  /* GSPI0_MISO */
19  PAD_CFG_NF(GPIO_82, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MISO */
20  /* GSPI0_MOSI */
21  PAD_CFG_NF(GPIO_83, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MOSI_R */
22 
23  /* Enable power to wifi early in bootblock and de-assert PERST#. */
24  PAD_CFG_GPO(GPIO_178, 1, DEEP), /* EN_PP3300_WLAN */
25  PAD_CFG_GPO(GPIO_164, 0, DEEP), /* WLAN_PE_RST */
26 
27  /*
28  * ESPI_IO1 acts as ALERT# (which is open-drain) and requires a weak
29  * pull-up for proper operation. Since there is no external pull present
30  * on this platform, configure an internal weak pull-up.
31  */
32  PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_151, UP_20K, DEEP, NF2, HIZCRx1,
33  ENPU), /* ESPI_IO1 */
34 };
35 
36 const struct pad_config *variant_early_gpio_table(size_t *num)
37 {
39  return early_gpio_table;
40 }
#define GPIO_190
Definition: gpio_ftns.h:20
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define GPIO_82
Definition: gpio_apl.h:187
#define GPIO_178
Definition: gpio_apl.h:300
#define GPIO_83
Definition: gpio_apl.h:188
#define GPIO_164
Definition: gpio_apl.h:285
#define GPIO_151
Definition: gpio_apl.h:245
#define GPIO_63
Definition: gpio_apl.h:116
const struct pad_config * variant_early_gpio_table(size_t *num)
Definition: gpio.c:204
static const struct pad_config early_gpio_table[]
Definition: gpio.c:9
#define GPIO_79
Definition: gpio.h:66
#define GPIO_80
Definition: gpio.h:67
#define PAD_CFG_GPI_APIC_IOS(pad, pull, rst, trig, inv, iosstate, iosterm)
Definition: gpio_defs.h:391
#define PAD_CFG_GPI(pad, pull, rst)
Definition: gpio_defs.h:284
#define PAD_CFG_NF_IOSSTATE_IOSTERM(pad, pull, rst, func, iosstate, iosterm)
Definition: gpio_defs.h:234
#define PAD_CFG_NF(pad, pull, rst, func)
Definition: gpio_defs.h:197
#define PAD_CFG_GPO(pad, val, rst)
Definition: gpio_defs.h:247