1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <commonlib/helpers.h>
7 static const struct pad_config gpio_table
[] = {
8 /* A17 : SD_VDD1_PWR_EN */
11 PAD_NC(GPP_A18
, NONE
),
13 PAD_NC(GPP_A19
, NONE
),
14 /* A20 : TOUCH_INT_ODL */
15 PAD_CFG_GPI_IRQ_WAKE(GPP_A20
, NONE
, PLTRST
, LEVEL
, INVERT
),
16 /* A21 : FPMCU_PCH_BOOT0 */
17 PAD_NC(GPP_A21
, NONE
),
18 /* A22 : FPMCU_PCH_INT_L */
19 PAD_NC(GPP_A22
, NONE
),
20 /* A23 : M2_WLAN_INT_ODL */
21 PAD_CFG_GPI_APIC(GPP_A23
, NONE
, PLTRST
, LEVEL
, INVERT
),
24 PAD_CFG_NF(GPP_C0
, NONE
, DEEP
, NF1
),
26 PAD_CFG_NF(GPP_C1
, NONE
, DEEP
, NF1
),
31 /* C6: M2_WLAN_WAKE_ODL */
32 PAD_CFG_GPI_SCI_LOW(GPP_C6
, NONE
, DEEP
, EDGE_SINGLE
),
33 /* C7 : LAN_WAKE_ODL */
36 PAD_NC(GPP_C11
, NONE
),
37 /* C15 : WLAN_OFF_L */
38 PAD_CFG_GPO(GPP_C15
, 1, DEEP
),
40 PAD_NC(GPP_C18
, NONE
),
42 PAD_NC(GPP_C19
, NONE
),
44 /* D16 : DMIC_ON_OFF MIC_SWITCH_L */
45 PAD_CFG_GPI_GPIO_DRIVER(GPP_D16
, NONE
, DEEP
),
47 /* E2 : EN_PP_MST_OD */
48 PAD_CFG_GPO(GPP_E2
, 1, DEEP
),
59 PAD_CFG_NF(GPP_F11
, NONE
, DEEP
, NF1
),
60 /* F12 : EMMC_DATA0 */
61 PAD_CFG_NF(GPP_F12
, NONE
, DEEP
, NF1
),
62 /* F13 : EMMC_DATA1 */
63 PAD_CFG_NF(GPP_F13
, NONE
, DEEP
, NF1
),
64 /* F14 : EMMC_DATA2 */
65 PAD_CFG_NF(GPP_F14
, NONE
, DEEP
, NF1
),
66 /* F15 : EMMC_DATA3 */
67 PAD_CFG_NF(GPP_F15
, NONE
, DEEP
, NF1
),
68 /* F16 : EMMC_DATA4 */
69 PAD_CFG_NF(GPP_F16
, NONE
, DEEP
, NF1
),
70 /* F17 : EMMC_DATA5 */
71 PAD_CFG_NF(GPP_F17
, NONE
, DEEP
, NF1
),
72 /* F18 : EMMC_DATA6 */
73 PAD_CFG_NF(GPP_F18
, NONE
, DEEP
, NF1
),
74 /* F19 : EMMC_DATA7 */
75 PAD_CFG_NF(GPP_F19
, NONE
, DEEP
, NF1
),
77 PAD_CFG_NF(GPP_F20
, NONE
, DEEP
, NF1
),
79 PAD_CFG_NF(GPP_F21
, NONE
, DEEP
, NF1
),
80 /* F22 : EMMC_RST_L */
81 PAD_CFG_NF(GPP_F22
, NONE
, DEEP
, NF1
),
99 PAD_CFG_GPO(GPP_H3
, 1, DEEP
),
101 PAD_CFG_NF(GPP_H4
, NONE
, DEEP
, NF1
),
103 PAD_CFG_NF(GPP_H5
, NONE
, DEEP
, NF1
),
104 /* H6 : PCH_I2C_TOUCH_SDA */
105 PAD_CFG_NF(GPP_H6
, NONE
, DEEP
, NF1
),
106 /* H7 : PCH_I2C_TOUCH_SDL */
107 PAD_CFG_NF(GPP_H7
, NONE
, DEEP
, NF1
),
110 const struct pad_config
*override_gpio_table(size_t *num
)
112 *num
= ARRAY_SIZE(gpio_table
);
116 /* Early pad configuration in bootblock */
117 static const struct pad_config early_gpio_table
[] = {
118 /* B14 : GPP_B14_STRAP */
119 PAD_NC(GPP_B14
, NONE
),
120 /* B22 : GPP_B22_STRAP */
121 PAD_NC(GPP_B22
, NONE
),
122 /* E19 : GPP_E19_STRAP */
123 PAD_NC(GPP_E19
, NONE
),
124 /* E21 : GPP_E21_STRAP */
125 PAD_NC(GPP_E21
, NONE
),
126 /* B15 : H1_SLAVE_SPI_CS_L */
127 PAD_CFG_NF(GPP_B15
, NONE
, DEEP
, NF1
),
128 /* B16 : H1_SLAVE_SPI_CLK */
129 PAD_CFG_NF(GPP_B16
, NONE
, DEEP
, NF1
),
130 /* B17 : H1_SLAVE_SPI_MISO_R */
131 PAD_CFG_NF(GPP_B17
, NONE
, DEEP
, NF1
),
132 /* B18 : H1_SLAVE_SPI_MOSI_R */
133 PAD_CFG_NF(GPP_B18
, NONE
, DEEP
, NF1
),
134 /* C8 : UART_PCH_RX_DEBUG_TX */
135 PAD_CFG_NF(GPP_C8
, NONE
, DEEP
, NF1
),
136 /* C9 : UART_PCH_TX_DEBUG_RX */
137 PAD_CFG_NF(GPP_C9
, NONE
, DEEP
, NF1
),
138 /* C14 : BT_DISABLE_L */
139 PAD_CFG_GPO(GPP_C14
, 0, DEEP
),
141 PAD_CFG_GPI(GPP_C20
, NONE
, DEEP
),
142 /* C21 : H1_PCH_INT_ODL */
143 PAD_CFG_GPI_APIC(GPP_C21
, NONE
, PLTRST
, LEVEL
, INVERT
),
144 /* C22 : EC_IN_RW_OD */
145 PAD_CFG_GPI(GPP_C22
, NONE
, DEEP
),
146 /* C23 : WLAN_PE_RST# */
147 PAD_CFG_GPO(GPP_C23
, 1, DEEP
),
148 /* E1 : M2_SSD_PEDET */
149 PAD_CFG_NF(GPP_E1
, NONE
, DEEP
, NF1
),
150 /* E5 : SATA_DEVSLP1 */
151 PAD_CFG_NF(GPP_E5
, NONE
, PLTRST
, NF1
),
154 const struct pad_config
*variant_early_gpio_table(size_t *num
)
156 *num
= ARRAY_SIZE(early_gpio_table
);
157 return early_gpio_table
;