1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <gpio.h>
#include "include/gpio.h"
/*
* TODO: Vendor configures many NC pads as _TERM_GPO. Why?
* - On direction: Are some of these comments illusory? At least some pads
* are bidirectional on the other side of the GPIO.
*/
/* NB: Do not reconfigure pads used by Optimus, their assertion state may be lost */
/*
* TODO: Newgate-SLS and Rayleigh-SLS have PCH-H and use the same ProgramGPIOPei module.
* The GPIO tables retrieved from PCDs are ignored. However, progress on those SKUs
* is held up because the final table passed to function similar to RC's
* GpioConfigureSklPch() is neither, but a zero-assigned variable. The code may be
* computing and dereferencing address pointers from a blob of internal data.
*/
/* Pad configuration was generated automatically using intelp2m utility */
static const struct pad_config gpio_table[] = {
/* ------- GPIO Community 0 ------- */
/* ------- GPIO Group GPP_A ------- */
// RCIN# <= H_RCIN#
PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1),
// LAD0 (ESPI_IO0) <=> LPC_AD_CPU_P0
PAD_CFG_NF(GPP_A1, NATIVE, DEEP, NF1),
// LAD1 (ESPI_IO1) <=> LPC_AD_CPU_P1
PAD_CFG_NF(GPP_A2, NATIVE, DEEP, NF1),
// LAD2 (ESPI_IO2) <=> LPC_AD_CPU_P2
PAD_CFG_NF(GPP_A3, NATIVE, DEEP, NF1),
// LAD3 (ESPI_IO3) <=> LPC_AD_CPU_P3
PAD_CFG_NF(GPP_A4, NATIVE, DEEP, NF1),
// LFRAME# (ESPI_CS#) => LPC_FRAME#_CPU
PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1),
// SERIRQ <=> INT_SERIRQ
PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1),
// PIRQA# = PIRQA#
PAD_CFG_NF(GPP_A7, NONE, DEEP, NF1),
// CLKRUN# <= PM_CLKRUN#_EC
PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1),
// CLKOUT_LPC0 (ESPI_CLK) <= LPC_CLK_CPU_P0
PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1),
// CLKOUT_LPC1 <= LPC_CLK_CPU_P1
PAD_CFG_NF(GPP_A10, DN_20K, DEEP, NF1),
// GPIO (PME#) // NC
PAD_CFG_TERM_GPO(GPP_A11, 1, DN_20K, DEEP),
// GPIO (SX_EXIT_HOLDOFF#/BM_BUSY#/ISH_GP6) <= GC6_FB_EN
PAD_CFG_GPI_TRIG_OWN(GPP_A12, NONE, DEEP, OFF, ACPI),
// SUSWARN#/SUSPWRDNACK = PM_SUSACK#
PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1),
// SUS_STAT# (ESPI_RESET#) => PM_SUS_STAT#
PAD_CFG_NF(GPP_A14, NONE, DEEP, NF1),
// SUS_ACK# = PM_SUSACK#
PAD_CFG_NF(GPP_A15, DN_20K, DEEP, NF1),
// GPIO (SD_1P8_SEL) // NC
PAD_NC(GPP_A16, DN_20K),
// GPIO (SD_PWR_EN#/ISH_GP7) // NC
PAD_NC(GPP_A17, DN_20K),
// GPIO (ISH_GP0) => GSENSOR_INT#
PAD_CFG_GPI_TRIG_OWN(GPP_A18, NONE, DEEP, OFF, ACPI),
// GPIO (ISH_GP1) // NC
PAD_NC(GPP_A19, DN_20K),
// GPIO (ISH_GP3) // NC
PAD_NC(GPP_A21, DN_20K),
// GPIO (ISH_GP4) <= GPU_EVENT#
PAD_CFG_GPO(GPP_A22, 1, DEEP),
// GPIO (ISH_GP5) // NC
PAD_NC(GPP_A23, DN_20K),
/* ------- GPIO Group GPP_B ------- */
// CORE_VID0 // V0.85A_VID0
PAD_CFG_NF(GPP_B0, NONE, DEEP, NF1),
// CORE_VID1 // V0.85A_VID1
PAD_CFG_NF(GPP_B1, NONE, DEEP, NF1),
// GPIO (CPU_GP2) <= TP_IN#
// TODO: APIC-routed pads don't have host owners?
PAD_CFG_GPI_APIC_HIGH(GPP_B3, NONE, DEEP),
// SRCCLKREQ0# <= PEG_CLKREQ_CPU#
PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1),
// SRCCLKREQ1# <= LAN_CLKREQ_CPU#
PAD_CFG_NF(GPP_B6, NONE, DEEP, NF1),
// SRCCLKREQ2# <= WLAN_CLKREQ_CPU#
PAD_CFG_NF(GPP_B7, NONE, DEEP, NF1),
// SRCCLKREQ3# <= MSATA_CLKREQ_CPU#
PAD_CFG_NF(GPP_B8, NONE, DEEP, NF1),
// SRCCLKREQ4# // SRCCLKREQ4# ("Remove TBT")
PAD_CFG_NF(GPP_B9, NONE, DEEP, NF1),
// SRCCLKREQ5# // SRCCLKREQ5#
PAD_CFG_NF(GPP_B10, NONE, DEEP, NF1),
// GPIO (EXT_PWR_GATE#) = EXT_PWR_GATE#
PAD_CFG_TERM_GPO(GPP_B11, 1, DN_20K, DEEP),
// GPIO (SLP_S0#) // NC
PAD_CFG_TERM_GPO(GPP_B12, 1, DN_20K, DEEP),
// PLTRST# => PLT_RST#
PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1),
// GPIO (SPKR) => HDA_SPKR (Strap - Top Swap Override)
PAD_CFG_TERM_GPO(GPP_B14, 1, DN_20K, DEEP),
// GPIO (GSPI0_CS#) = TOUCH_DET#
PAD_CFG_GPO(GPP_B15, 0, DEEP),
// GPIO (GSPI0_CLK) // NC
PAD_CFG_GPO(GPP_B16, 0, DEEP),
// GPIO (GSPI0_MISO) // NC ("Remove TBT")
PAD_CFG_GPI_SCI(GPP_B17, DN_20K, DEEP, EDGE_SINGLE, INVERT),
// GPIO (GSPI0_MOSI) => GPP_B18/GSPI0_MOSI (Strap - No reboot)
PAD_CFG_TERM_GPO(GPP_B18, 1, DN_20K, DEEP),
// GPIO (GSPI1_CS#) => RTC_DET#
PAD_CFG_GPI_TRIG_OWN(GPP_B19, NONE, DEEP, OFF, ACPI),
// GPIO (GSPI1_CLK) <= PSW_CLR#
PAD_CFG_GPI_TRIG_OWN(GPP_B20, DN_20K, DEEP, OFF, ACPI),
// GPIO (GSPI1_MOSI) => GPP_B22/GSPI1_MOSI (Strap - Boot BIOS strap)
PAD_CFG_TERM_GPO(GPP_B22, 1, DN_20K, DEEP),
// GPIO (SML1ALERT#/PCHHOT#) => GPP_B23 (Strap)
PAD_CFG_TERM_GPO(GPP_B23, 1, DN_20K, DEEP),
/* ------- GPIO Community 1 ------- */
/* ------- GPIO Group GPP_C ------- */
// SMBCLK <= SMB_CLK
PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1),
// SMBDATA = SMB_DATA
PAD_CFG_NF(GPP_C1, DN_20K, DEEP, NF1),
// GPIO (SMBALERT#) => GPP_C2 (Strap - TLS Confidentiality)
PAD_CFG_TERM_GPO(GPP_C2, 1, DN_20K, DEEP),
// GPIO (SML0CLK) // NC
PAD_CFG_TERM_GPO(GPP_C3, 1, DN_20K, DEEP),
// GPIO (SML0DATA) // NC
PAD_CFG_TERM_GPO(GPP_C4, 1, DN_20K, DEEP),
// GPIO (SML0ALERT#) // NC (Strap - eSPI or LPC)
PAD_CFG_TERM_GPO(GPP_C5, 1, DN_20K, DEEP),
// RESERVED (SML1CLK) <=> SML1_CLK (KBC)
// RESERVED (SML1DATA) <=> SML1_DATA (KBC)
// GPIO (UART0_RXD) // NC
PAD_CFG_TERM_GPO(GPP_C8, 1, DN_20K, DEEP),
// GPIO (UART0_TXD) // NC
PAD_CFG_TERM_GPO(GPP_C9, 1, DN_20K, DEEP),
// GPIO (UART0_RTS#) // NC
PAD_CFG_TERM_GPO(GPP_C10, 1, DN_20K, DEEP),
// GPIO (UART0_CTS#) // NC
PAD_CFG_TERM_GPO(GPP_C11, 1, DN_20K, DEEP),
// GPIO (UART1_RXD/ISH_UART1_RXD) // NC
PAD_NC(GPP_C12, DN_20K),
// GPIO (UART1_TXD/ISH_UART1_TXD) // NC
PAD_NC(GPP_C13, DN_20K),
// GPIO (UART1_RTS#/ISH_UART1_RTS#) // NC
PAD_NC(GPP_C14, DN_20K),
// GPIO (UART1_CTS#/ISH_UART1_CTS#) // NC
PAD_NC(GPP_C15, DN_20K),
// I2C0_SDA <=> I2C0_DATA_CPU (Touch Panel)
PAD_CFG_NF(GPP_C16, NONE, DEEP, NF1),
// I2C0_SCL <=> I2C0_CLK_CPU (Touch Panel)
PAD_CFG_NF(GPP_C17, NONE, DEEP, NF1),
// I2C1_SDA <=> I2C1_DATA_CPU (Touch Pad)
PAD_CFG_NF(GPP_C18, NONE, DEEP, NF1),
// I2C1_SCL <=> I2C1_CLK_CPU (Touch Pad)
PAD_CFG_NF(GPP_C19, NONE, DEEP, NF1),
// UART2_RXD = LPSS_UART2_RXD
PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1),
// UART2_TXD = LPSS_UART2_TXD
PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1),
// UART2_RTS# = LPSS_UART2_RTS#
PAD_CFG_NF(GPP_C22, NONE, DEEP, NF1),
// UART2_CTS# = LPSS_UART2_CTS#
PAD_CFG_NF(GPP_C23, NONE, DEEP, NF1),
/* ------- GPIO Group GPP_D ------- */
// GPIO (SPI1_CS#) // NC
PAD_CFG_TERM_GPO(GPP_D0, 1, DN_20K, DEEP),
// GPIO (SPI1_CLK) // NC
PAD_CFG_TERM_GPO(GPP_D1, 1, DN_20K, DEEP),
// SPI1_MISO // NC
PAD_CFG_NF(GPP_D2, NONE, DEEP, NF1),
// SPI1_MOSI // NC
PAD_CFG_NF(GPP_D3, NONE, DEEP, NF1),
// GPIO (FLASHTRIG) // NC
PAD_CFG_TERM_GPO(GPP_D4, 1, DN_20K, DEEP),
// GPIO (ISH_I2C0_SDA) // NC
PAD_NC(GPP_D5, DN_20K),
// GPIO (ISH_I2C0_SCL) // NC
PAD_NC(GPP_D6, DN_20K),
// GPIO (ISH_I2C1_SDA) // NC
PAD_NC(GPP_D7, DN_20K),
// GPIO (ISH_I2C1_SCL) // NC
PAD_NC(GPP_D8, DN_20K),
// GPIO // NC
PAD_CFG_GPI_TRIG_OWN(GPP_D9, NONE, DEEP, LEVEL, ACPI),
// GPIO => TOUCH_S_RST#
PAD_CFG_GPI_TRIG_OWN(GPP_D10, NONE, DEEP, LEVEL, ACPI),
// GPIO // NC
PAD_CFG_GPI_TRIG_OWN(GPP_D11, NONE, DEEP, LEVEL, ACPI),
// GPIO // NC ("Remove TBT")
PAD_CFG_GPI_TRIG_OWN(GPP_D12, NONE, DEEP, LEVEL, ACPI),
// GPIO (ISH_UART0_RXD/SML0BDATA/I2C4B_SDA) // NC
PAD_CFG_TERM_GPO(GPP_D13, 1, DN_20K, DEEP),
// GPIO (ISH_UART0_TXD/SML0BCLK/I2C4B_SCL) // NC
PAD_CFG_TERM_GPO(GPP_D14, 1, DN_20K, DEEP),
// GPIO (ISH_UART0_RTS#) // NC
PAD_CFG_TERM_GPO(GPP_D15, 1, DN_20K, DEEP),
// GPIO (ISH_UART0_CTS#/SML0BALERT#) // NC
PAD_CFG_TERM_GPO(GPP_D16, 1, DN_20K, DEEP),
// GPIO (DMIC_CLK1) // NC
PAD_NC(GPP_D17, DN_20K),
// GPIO (DMIC_DATA1) // NC
PAD_NC(GPP_D18, DN_20K),
// DMIC_CLK0 => DMIC_CLK_CON_R
PAD_CFG_NF(GPP_D19, NONE, DEEP, NF1),
// DMIC_DATA0 => DMIC_PCH_DATA
PAD_CFG_NF(GPP_D20, NONE, DEEP, NF1),
// SPI1_IO2 // NC
PAD_CFG_NF(GPP_D21, NONE, DEEP, NF1),
// SPI1_IO3 // NC
PAD_CFG_NF(GPP_D22, NONE, DEEP, NF1),
// GPIO (I2S_MCLK) // NC
PAD_NC(GPP_D23, DN_20K),
/* ------- GPIO Group GPP_E ------- */
// SATAXPCIE0 (SATAGP0) = SATAGP0
PAD_CFG_NF(GPP_E0, NONE, DEEP, NF1),
// SATAXPCIE1 (SATAGP1) // NC
PAD_CFG_NF(GPP_E1, NONE, DEEP, NF1),
// SATAXPCIE2 (SATAGP2) = SATAGP2
PAD_CFG_NF(GPP_E2, NONE, DEEP, NF1),
// GPIO (CPU_GP0) // NC
PAD_CFG_GPO(GPP_E3, 1, DEEP),
// GPIO (DEVSLP0) // NC ("Remove DEVSLP_PCH")
PAD_CFG_TERM_GPO(GPP_E4, 1, DN_20K, DEEP),
// GPIO (DEVSLP1) // NC
PAD_CFG_TERM_GPO(GPP_E5, 1, DN_20K, DEEP),
// GPIO (DEVSLP2) // NC
PAD_CFG_TERM_GPO(GPP_E6, 1, DN_20K, DEEP),
// GPIO (CPU_GP1) <= TOUCH_INT#
PAD_CFG_GPI_APIC_LOW(GPP_E7, NONE, DEEP),
// SATALED# = SATA_LED#
PAD_CFG_NF(GPP_E8, NONE, DEEP, NF1),
// USB2_OC0# = USB_OC#
PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1),
// USB2_OC1# // USB_OC#
PAD_CFG_NF(GPP_E10, NONE, DEEP, NF1),
// USB2_OC2# // USB_OC#
PAD_CFG_NF(GPP_E11, NONE, DEEP, NF1),
// USB2_OC3# // USB_OC#
PAD_CFG_NF(GPP_E12, NONE, DEEP, NF1),
// DDPB_HPD0 <= DDI1_HDMI_HPD_CPU
PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1),
// DDPC_HPD1 // NC ("Remove HPD")
PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1),
// GPIO (DDPD_HPD2) <= EC_SMI#
// FIXME: Vendor configures as _TERM_GPO. Why?
PAD_CFG_GPI_SMI(GPP_E15, NONE, DEEP, LEVEL, INVERT),
// GPIO (DDPE_HPD3) <= EC_SCI#
PAD_CFG_GPI_SCI(GPP_E16, NONE, PLTRST, LEVEL, INVERT),
// EDP_HPD <= eDP_HPD_CPU
PAD_CFG_NF(GPP_E17, NONE, DEEP, NF1),
// DDPB_CTRLCLK <=> DDI1_HDMI_CLK_CPU
PAD_CFG_NF(GPP_E18, NONE, DEEP, NF1),
// DDPB_CTRLDATA <=> DDI1_HDMI_DATA_CPU (Strap - Display Port B Detected)
PAD_CFG_NF(GPP_E19, DN_20K, DEEP, NF1),
// DDPC_CTRLCLK // NC
PAD_CFG_NF(GPP_E20, NONE, DEEP, NF1),
// DDPC_CTRLDATA => DDPC_CDA (Strap - Display Port C Detected)
PAD_CFG_NF(GPP_E21, DN_20K, DEEP, NF1),
// GPIO // NC
// TODO: Vendor configures as _GPIO_BIDIRECT. Why?
PAD_NC(GPP_E22, NONE),
// GPIO => DDPD_CDA (Strap - Display Port D Detected)
PAD_CFG_TERM_GPO(GPP_E23, 1, DN_20K, DEEP),
/* ------- GPIO Community 2 ------- */
/* -------- GPIO Group GPD -------- */
// GPIO (BATLOW#) = BATLOW
PAD_CFG_TERM_GPO(GPD0, 1, DN_20K, PWROK),
// ACPRESENT <= AC_PRESENT
PAD_CFG_NF(GPD1, NONE, PWROK, NF1),
// GPIO (LAN_WAKE#) = GPD2/LAN_WAKE#
PAD_CFG_TERM_GPO(GPD2, 1, DN_20K, PWROK),
// PWRBTN# <= PM_PWRBTN#
PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1),
// SLP_S3# => PM_SLP_S3#
PAD_CFG_NF(GPD4, NONE, PWROK, NF1),
// SLP_S4# => PM_SLP_S4#
PAD_CFG_NF(GPD5, NONE, PWROK, NF1),
// SLP_A# // NC
PAD_CFG_NF(GPD6, DN_20K, PWROK, NF1),
// GPIO (RSVD#AT15) // NC
PAD_CFG_TERM_GPO(GPD7, 1, DN_20K, PWROK),
// SUSCLK => SUS_CLK_CPU
PAD_CFG_NF(GPD8, NONE, PWROK, NF1),
// SLP_WLAN# // NC
PAD_CFG_NF(GPD9, DN_20K, PWROK, NF1),
// SLP_S5# // NC
PAD_CFG_NF(GPD10, DN_20K, PWROK, NF1),
// GPIO (LANPHYPC) // NC
PAD_CFG_TERM_GPO(GPD11, 1, DN_20K, PWROK),
/* ------- GPIO Community 3 ------- */
/* ------- GPIO Group GPP_F ------- */
// GPIO (I2S2_SCLK) // NC
PAD_NC(GPP_F0, DN_20K),
// GPIO (I2S2_SFRM) // NC
PAD_NC(GPP_F1, DN_20K),
// GPIO (I2S2_TXD) // NC
PAD_NC(GPP_F2, DN_20K),
// GPIO (I2S2_RXD) // NC
PAD_NC(GPP_F3, DN_20K),
// GPIO (I2C2_SDA) // NC
PAD_NC(GPP_F4, DN_20K),
// GPIO (I2C2_SCL) // NC
PAD_NC(GPP_F5, DN_20K),
// GPIO (I2C3_SDA) // NC
PAD_NC(GPP_F6, DN_20K),
// GPIO (I2C3_SCL) // NC
PAD_NC(GPP_F7, DN_20K),
// GPIO (I2C4_SDA) // NC
PAD_CFG_TERM_GPO(GPP_F8, 1, DN_20K, DEEP),
// GPIO (I2C4_SCL) // NC
PAD_CFG_TERM_GPO(GPP_F9, 1, DN_20K, DEEP),
// GPIO (I2C5_SDA/ISH_I2C2_SDA) // NC
PAD_NC(GPP_F10, DN_20K),
// GPIO (I2C5_SCL/ISH_I2C2_SCL) // NC
PAD_NC(GPP_F11, DN_20K),
// GPIO (EMMC_CMD) // NC
PAD_NC(GPP_F12, DN_20K),
// GPIO (EMMC_DATA0) // NC
PAD_NC(GPP_F13, DN_20K),
// GPIO (EMMC_DATA1) // NC
PAD_NC(GPP_F14, DN_20K),
// GPIO (EMMC_DATA2) // NC
PAD_NC(GPP_F15, DN_20K),
// GPIO (EMMC_DATA3) // NC
PAD_NC(GPP_F16, DN_20K),
// GPIO (EMMC_DATA4) // NC
PAD_NC(GPP_F17, DN_20K),
// GPIO (EMMC_DATA5) // NC
PAD_NC(GPP_F18, DN_20K),
// GPIO (EMMC_DATA6) // NC
PAD_NC(GPP_F19, DN_20K),
// GPIO (EMMC_DATA7) // NC
PAD_NC(GPP_F20, DN_20K),
// GPIO (EMMC_RCLK) // NC
PAD_NC(GPP_F21, DN_20K),
// GPIO (EMMC_CLK) // NC
PAD_NC(GPP_F22, DN_20K),
// GPIO // NC
PAD_CFG_GPI_APIC_HIGH(GPP_F23, NONE, DEEP),
/* ------- GPIO Group GPP_G ------- */
// GPIO (SD_CMD) // NC
PAD_NC(GPP_G0, DN_20K),
// GPIO (SD_DATA0) // NC
PAD_NC(GPP_G1, DN_20K),
// GPIO (SD_DATA1) // NC
PAD_NC(GPP_G2, DN_20K),
// GPIO (SD_DATA2) // NC
PAD_NC(GPP_G3, DN_20K),
// GPIO (SD_DATA3) // NC
// TODO: Vendor configures as _GPO. Why?
PAD_NC(GPP_G4, NONE),
// GPIO (SD_CD#) // NC
PAD_NC(GPP_G5, DN_20K),
// GPIO (SD_CLK) // NC
PAD_NC(GPP_G6, DN_20K),
// GPIO (SD_WP) // NC
PAD_NC(GPP_G7, DN_20K),
};
void mainboard_config_stage_gpios(void)
{
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
}
|