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  /* A13 : PMC_I2C_SCL ==> GSC_PCH_INT_ODL */
11  PAD_CFG_GPI_APIC(GPP_A13, NONE, PLTRST, LEVEL, INVERT),
12  /* B4 : PROC_GP3 ==> SSD_PERST_L */
13  PAD_CFG_GPO(GPP_B4, 0, DEEP),
14  /*
15  * D1 : ISH_GP1 ==> FP_RST_ODL
16  * FP_RST_ODL comes out of reset as hi-z and does not have an external pull-down.
17  * To ensure proper power sequencing for the FPMCU device, reset signal is driven low
18  * early on in bootblock, followed by enabling of power. Reset signal is deasserted
19  * later on in ramstage. Since reset signal is asserted in bootblock, it results in
20  * FPMCU not working after a S3 resume. This is a known issue.
21  */
22  PAD_CFG_GPO(GPP_D1, 0, DEEP),
23  /* D2 : ISH_GP2 ==> EN_FP_PWR */
24  PAD_CFG_GPO(GPP_D2, 1, DEEP),
25  /* E15 : RSVD_TP ==> PCH_WP_OD */
27  /* F14 : GSXDIN ==> EN_PP3300_SSD */
28  PAD_CFG_GPO(GPP_F14, 1, DEEP),
29  /* F18 : THC1_SPI2_INT# ==> EC_IN_RW_OD */
30  PAD_CFG_GPI(GPP_F18, NONE, DEEP),
31  /* H6 : I2C1_SDA ==> PCH_I2C_TPM_SDA */
32  PAD_CFG_NF(GPP_H6, NONE, DEEP, NF1),
33  /* H7 : I2C1_SCL ==> PCH_I2C_TPM_SCL */
34  PAD_CFG_NF(GPP_H7, NONE, DEEP, NF1),
35  /* H10 : UART0_RXD ==> UART_PCH_RX_DBG_TX */
36  PAD_CFG_NF(GPP_H10, NONE, DEEP, NF2),
37  /* H11 : UART0_TXD ==> UART_PCH_TX_DBG_RX */
38  PAD_CFG_NF(GPP_H11, NONE, DEEP, NF2),
39  /* H13 : I2C7_SCL ==> EN_PP3300_SD */
40  PAD_CFG_GPO(GPP_H13, 1, DEEP),
41 
42  /* CPU PCIe VGPIO for PEG60 */
43  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_48, NONE, PLTRST, NF1),
44  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_49, NONE, PLTRST, NF1),
45  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_50, NONE, PLTRST, NF1),
46  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_51, NONE, PLTRST, NF1),
47  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_52, NONE, PLTRST, NF1),
48  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_53, NONE, PLTRST, NF1),
49  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_54, NONE, PLTRST, NF1),
50  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_55, NONE, PLTRST, NF1),
51  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_56, NONE, PLTRST, NF1),
52  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_57, NONE, PLTRST, NF1),
53  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_58, NONE, PLTRST, NF1),
54  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_59, NONE, PLTRST, NF1),
55  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_60, NONE, PLTRST, NF1),
56  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_61, NONE, PLTRST, NF1),
57  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_62, NONE, PLTRST, NF1),
58  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_63, NONE, PLTRST, NF1),
59  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_76, NONE, PLTRST, NF1),
60  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_77, NONE, PLTRST, NF1),
61  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_78, NONE, PLTRST, NF1),
62  PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_79, NONE, PLTRST, NF1),
63 };
64 
65 static const struct pad_config romstage_gpio_table[] = {
66  /* B4 : PROC_GP3 ==> SSD_PERST_L */
67  PAD_CFG_GPO(GPP_B4, 1, DEEP),
68 };
69 
70 const struct pad_config *variant_early_gpio_table(size_t *num)
71 {
73  return early_gpio_table;
74 }
75 
76 const struct pad_config *variant_romstage_gpio_table(size_t *num)
77 {
79  return romstage_gpio_table;
80 }
#define GPP_vGPIO_PCIE_57
#define GPP_D1
#define GPP_vGPIO_PCIE_48
#define GPP_vGPIO_PCIE_55
#define GPP_vGPIO_PCIE_78
#define GPP_vGPIO_PCIE_76
#define GPP_H11
#define GPP_vGPIO_PCIE_53
#define GPP_vGPIO_PCIE_62
#define GPP_vGPIO_PCIE_49
#define GPP_vGPIO_PCIE_50
#define GPP_vGPIO_PCIE_77
#define GPP_D2
#define GPP_H6
#define GPP_H13
#define GPP_H7
#define GPP_vGPIO_PCIE_60
#define GPP_vGPIO_PCIE_54
#define GPP_F14
#define GPP_vGPIO_PCIE_52
#define GPP_A13
#define GPP_vGPIO_PCIE_59
#define GPP_E15
#define GPP_vGPIO_PCIE_61
#define GPP_vGPIO_PCIE_63
#define GPP_vGPIO_PCIE_58
#define GPP_F18
#define GPP_vGPIO_PCIE_51
#define GPP_vGPIO_PCIE_79
#define GPP_B4
Definition: gpio_soc_defs.h:57
#define GPP_H10
#define GPP_vGPIO_PCIE_56
#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:65
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_NF_VWEN(pad, pull, rst, func)
Definition: gpio_defs.h:241
#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