coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef MAINBOARD_GPIO_H
4 #define MAINBOARD_GPIO_H
5 
6 #include <soc/gpe.h>
7 #include <soc/gpio.h>
8 
9 #ifndef __ACPI__
10 
11 /* Name format: <pad name> / <net/pin name in schematics> */
12 
13 /* Early pad configuration in bootblock */
14 static const struct pad_config early_gpio_table[] = {
15  PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), /* UART2_RXD */
16  PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), /* UART2_TXD */
17  PAD_NC(GPP_C22, UP_20K),
18  PAD_NC(GPP_C23, UP_20K),
19 };
20 
21 /* Pad configuration in ramstage. */
22 static const struct pad_config gpio_table[] = {
23  /* ------- GPIO Group GPD ------- */
24  PAD_NC(GPD0, NONE),
25  PAD_CFG_NF(GPD1, NATIVE, DEEP, NF1), /* ACPRESENT / AC_PRESENT */
26  PAD_NC(GPD2, UP_20K),
27  PAD_CFG_NF(GPD3, UP_20K, DEEP, NF1), /* PWRBTN# / PWR_BTN# */
28  PAD_CFG_NF(GPD4, NONE, DEEP, NF1), /* SLP_S3# / SUSB#_PCH */
29  PAD_CFG_NF(GPD5, NONE, DEEP, NF1), /* SLP_S4# / SUSC#_PCH */
30  PAD_NC(GPD6, UP_20K),
31  PAD_NC(GPD7, NONE),
32  PAD_CFG_NF(GPD8, NONE, DEEP, NF1), /* SUSCLK / SUS_CLK */
33  PAD_NC(GPD9, UP_20K),
34  PAD_NC(GPD10, UP_20K),
35  PAD_NC(GPD11, UP_20K),
36 
37  /* ------- GPIO Group GPP_A ------- */
38  PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1), /* RCIN# / SB_KBCRST# */
39  PAD_CFG_NF(GPP_A1, NATIVE, DEEP, NF1), /* LAD0 / LPC_AD0 */
40  PAD_CFG_NF(GPP_A2, NATIVE, DEEP, NF1), /* LAD1 / LPC_AD1 */
41  PAD_CFG_NF(GPP_A3, NATIVE, DEEP, NF1), /* LAD2 / LPC_AD2 */
42  PAD_CFG_NF(GPP_A4, NATIVE, DEEP, NF1), /* LAD3 / LPC_AD3 */
43  PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1), /* LFRAME# / LPC_FRAME# */
44  PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1), /* SERIRQ */
45  PAD_CFG_NF(GPP_A7, NONE, DEEP, NF1), /* PIRQA# / TPM_PIRQ# */
46  PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1), /* CLKRUN# / PM_CLKRUN#
47  Note: R209 is populated despite being
48  marked no-stuff in schematic
49  */
50  PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1), /* CLKOUT_LPC0 / PCLK_KBC */
51  PAD_NC(GPP_A10, UP_20K),
52  PAD_NC(GPP_A11, NONE), /* INTP_OUT (unknown and unused) */
53  PAD_NC(GPP_A12, UP_20K),
54  PAD_NC(GPP_A13, UP_20K), /* SUSWARN#
55  (unused due to missing DeepSx support)
56  */
57  PAD_NC(GPP_A14, UP_20K),
58  PAD_NC(GPP_A15, UP_20K),
59  PAD_NC(GPP_A16, UP_20K),
60  PAD_NC(GPP_A17, NONE), /* LEDKB_DET#
61  (unused in cb; all devices of that
62  model have KB LED)
63  */
64  PAD_NC(GPP_A18, UP_20K),
65  PAD_NC(GPP_A19, UP_20K),
66  PAD_CFG_GPO(GPP_A20, 0, DEEP), /* GPP_A20 / TEST_R */
67  PAD_NC(GPP_A21, UP_20K),
68  PAD_NC(GPP_A22, UP_20K),
69  PAD_NC(GPP_A23, UP_20K),
70 
71  /* ------- GPIO Group GPP_B ------- */
72  PAD_NC(GPP_B0, UP_20K),
73  PAD_NC(GPP_B1, UP_20K),
74  PAD_NC(GPP_B2, UP_20K), /* CNVI_WAKE#
75  (UART_WAKE# in M.2 spec; unused)
76  */
77  PAD_CFG_GPI_APIC_LOW(GPP_B3, NONE, PLTRST), /* GPP_B3 (touchpad interrupt) */
78  PAD_NC(GPP_B4, UP_20K),
79  PAD_NC(GPP_B5, UP_20K),
80  PAD_NC(GPP_B6, UP_20K),
81  PAD_CFG_NF(GPP_B7, NONE, DEEP, NF1), /* SRCCLKREQ2# / WLAN_CLKREQ# */
82  PAD_CFG_NF(GPP_B8, NONE, DEEP, NF1), /* SRCCLKREQ3# / CARD_CLKREQ# */
83  PAD_CFG_NF(GPP_B9, NONE, DEEP, NF1), /* SRCCLKREQ4# / SSD2_CLKREQ# */
84  PAD_CFG_NF(GPP_B10, NONE, DEEP, NF1), /* SRCCLKREQ5# / SSD1_CLKREQ# */
86  PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1), /* SLP_S0# */
87  PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1), /* PLT_RST# */
88  PAD_CFG_NF(GPP_B14, NONE, DEEP, NF1), /* SPKR / PCH_SPKR */
89  PAD_NC(GPP_B15, UP_20K),
90  PAD_NC(GPP_B16, UP_20K),
92  PAD_NC(GPP_B18, UP_20K),
93  PAD_NC(GPP_B19, UP_20K),
94  PAD_NC(GPP_B20, UP_20K),
95  PAD_NC(GPP_B21, UP_20K),
96  PAD_NC(GPP_B22, UP_20K),
97  PAD_NC(GPP_B23, UP_20K),
98 
99  /* ------- GPIO Group GPP_C ------- */
100  PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1), /* SMBCLK / SMB_CLK_DDR */
101  PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1), /* SMBDATA / SMB_DAT_DDR */
102  PAD_NC(GPP_C2, UP_20K),
103  PAD_NC(GPP_C3, UP_20K),
104  PAD_NC(GPP_C4, UP_20K),
105  PAD_NC(GPP_C5, UP_20K),
106  PAD_NC(GPP_C6, UP_20K),
107  PAD_NC(GPP_C7, UP_20K),
108  PAD_NC(GPP_C8, UP_20K),
109  PAD_NC(GPP_C9, UP_20K),
110  PAD_NC(GPP_C10, UP_20K),
111  PAD_NC(GPP_C11, UP_20K),
112  PAD_NC(GPP_C12, UP_20K),
113  PAD_CFG_GPO(GPP_C13, 1, PLTRST), /* GPP_C13 / SSD1_PWR_DN# */
114  PAD_NC(GPP_C14, UP_20K),
115  PAD_NC(GPP_C15, UP_20K),
116  PAD_CFG_NF(GPP_C16, NONE, DEEP, NF1), /* I2C0_SDA / T_SDA */
117  PAD_CFG_NF(GPP_C17, NONE, DEEP, NF1), /* I2C0_SCL / T_SCL */
118  PAD_NC(GPP_C18, UP_20K),
119  PAD_NC(GPP_C19, UP_20K),
120  PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), /* UART2_RXD */
121  PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), /* UART2_TXD */
122  PAD_NC(GPP_C22, UP_20K),
123  PAD_NC(GPP_C23, UP_20K),
124 
125  /* ------- GPIO Group GPP_D ------- */
126  PAD_NC(GPP_D0, UP_20K),
127  PAD_NC(GPP_D1, UP_20K),
128  PAD_NC(GPP_D2, UP_20K),
129  PAD_NC(GPP_D3, UP_20K),
130  PAD_NC(GPP_D4, UP_20K),
131  PAD_NC(GPP_D5, UP_20K),
132  PAD_NC(GPP_D6, UP_20K),
133  PAD_NC(GPP_D7, UP_20K),
134  PAD_CFG_GPO(GPP_D8, 1, DEEP), /* SB_BLON */
135  PAD_CFG_GPI_SCI_LOW(GPP_D9, NONE, DEEP, LEVEL), /* EC SWI# */
136  PAD_NC(GPP_D10, NONE), /* DDR_TYPE_D10
137  (unused; there is only one on-board
138  ram type/model)
139  */
140  PAD_NC(GPP_D11, NONE), /* BOARD_ID
141  (unused in cb; we already know the
142  device model)
143  */
144  PAD_NC(GPP_D12, UP_20K),
145  PAD_NC(GPP_D13, UP_20K),
146  PAD_CFG_GPO(GPP_D14, 1, PLTRST), /* SSD2_PWR_DN# */
147  PAD_NC(GPP_D15, UP_20K),
148  PAD_NC(GPP_D16, UP_20K),
149  PAD_NC(GPP_D17, UP_20K),
150  PAD_NC(GPP_D18, UP_20K),
151  PAD_NC(GPP_D19, UP_20K),
152  PAD_NC(GPP_D20, UP_20K),
153  PAD_NC(GPP_D21, NONE), /* TPM_DET#
154  (currently unused in cb; there seem
155  to be no devices without TPM)
156  */
157  PAD_NC(GPP_D22, NONE), /* DDR_TYPE_D22
158  (unused in cb; there is only one
159  on-board ram type)
160  */
161  PAD_NC(GPP_D23, UP_20K),
162 
163  /* ------- GPIO Group GPP_E ------- */
164  PAD_NC(GPP_E0, UP_20K),
165  PAD_CFG_NF(GPP_E1, NONE, DEEP, NF1), /* SATAXPCIE1 / SATAGP1 */
166  PAD_CFG_NF(GPP_E2, NONE, DEEP, NF1), /* SATAXPCIE2 / SATAGP2 */
167  PAD_NC(GPP_E3, UP_20K),
168  PAD_NC(GPP_E4, UP_20K),
169  PAD_CFG_NF(GPP_E5, NONE, DEEP, NF1), /* DEVSLP1 */
170  PAD_CFG_NF(GPP_E6, NONE, DEEP, NF1), /* DEVSLP2 */
171  PAD_NC(GPP_E7, UP_20K),
172  PAD_NC(GPP_E8, NONE),
173  PAD_NC(GPP_E9, NONE),
174  PAD_NC(GPP_E10, NONE),
175  PAD_NC(GPP_E11, NONE),
176  PAD_NC(GPP_E12, NONE),
177  PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1), /* DDPB_HPD0 / MUX_HPD */
178  PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1), /* DDPC_HPD1 / HDMI_HPD */
179  PAD_CFG_GPI_SMI_LOW(GPP_E15, NONE, DEEP, EDGE_SINGLE), /* EC SMI# */
180  PAD_CFG_GPI_SCI_LOW(GPP_E16, NONE, PLTRST, LEVEL), /* EC SCI# */
181  PAD_CFG_NF(GPP_E17, NONE, DEEP, NF1), /* EDP_HPD */
182  PAD_NC(GPP_E18, UP_20K),
183  PAD_NC(GPP_E19, NONE),
184  PAD_CFG_NF(GPP_E20, NONE, DEEP, NF1), /* DPPC_CTRLCLK / HDMI_CTRLCLK */
185  PAD_CFG_NF(GPP_E21, NONE, DEEP, NF1), /* DPPC_CTRLDATA / HDMI_CTRLDATA */
186  PAD_NC(GPP_E22, UP_20K),
187  PAD_NC(GPP_E23, UP_20K),
188 
189  /* ------- GPIO Group GPP_F ------- */
190  PAD_NC(GPP_F0, UP_20K),
191  PAD_NC(GPP_F1, UP_20K),
192  PAD_NC(GPP_F2, UP_20K),
193  PAD_NC(GPP_F3, UP_20K),
194  PAD_CFG_NF(GPP_F4, NONE, DEEP, NF1), /* CNV_BRI_DT / CNVI_BRI_DT */
195  PAD_CFG_NF(GPP_F5, UP_20K, DEEP, NF1), /* CNV_BRI_RSP / CNVI_BRI_RSP */
196  PAD_CFG_NF(GPP_F6, NONE, DEEP, NF1), /* CNV_RGI_DT / CNVI_RGI_DT */
197  PAD_CFG_NF(GPP_F7, UP_20K, DEEP, NF1), /* CNV_RGI_RSP / CNVI_RGI_RSP */
198  PAD_NC(GPP_F8, UP_20K),
199  PAD_NC(GPP_F9, UP_20K),
200  PAD_NC(GPP_F10, UP_20K),
201  PAD_NC(GPP_F11, UP_20K),
202  PAD_NC(GPP_F12, UP_20K),
203  PAD_NC(GPP_F13, UP_20K),
204  PAD_NC(GPP_F14, UP_20K),
205  PAD_NC(GPP_F15, UP_20K),
206  PAD_NC(GPP_F16, UP_20K),
207  PAD_NC(GPP_F17, UP_20K),
208  PAD_NC(GPP_F18, UP_20K),
209  PAD_NC(GPP_F19, UP_20K),
210  PAD_NC(GPP_F20, UP_20K),
211  PAD_NC(GPP_F21, UP_20K),
212  PAD_NC(GPP_F22, UP_20K),
213  PAD_NC(GPP_F23, NONE),
214 
215  /* ------- GPIO Group GPP_G ------- */
216  PAD_NC(GPP_G0, UP_20K),
217  PAD_NC(GPP_G1, UP_20K),
218  PAD_NC(GPP_G2, UP_20K),
219  PAD_NC(GPP_G3, UP_20K),
220  PAD_NC(GPP_G4, UP_20K),
221  PAD_NC(GPP_G5, UP_20K),
222  PAD_NC(GPP_G6, UP_20K),
223  PAD_NC(GPP_G7, UP_20K),
224 
225  /* ------- GPIO Group GPP_H ------- */
226  PAD_NC(GPP_H0, UP_20K),
227  PAD_CFG_NF(GPP_H1, NONE, DEEP, NF3), /* CNV_RF_RESET# / CNVI_RST# */
228  PAD_CFG_NF(GPP_H2, DN_20K, DEEP, NF3), /* MODEM_CLKREQ / CNVI_CLKREQ */
229  PAD_NC(GPP_H3, UP_20K),
230  PAD_CFG_NF(GPP_H4, NONE, DEEP, NF1), /* I2C2_SDA / SMD_7411 */
231  PAD_CFG_NF(GPP_H5, NONE, DEEP, NF1), /* I2C2_SCL / SMC_7411 */
232  PAD_NC(GPP_H6, UP_20K),
233  PAD_NC(GPP_H7, UP_20K),
234  PAD_NC(GPP_H8, UP_20K),
235  PAD_NC(GPP_H9, UP_20K),
236  PAD_NC(GPP_H10, UP_20K),
237  PAD_NC(GPP_H11, UP_20K),
238  PAD_NC(GPP_H12, UP_20K),
239  PAD_NC(GPP_H13, UP_20K),
240  PAD_NC(GPP_H14, UP_20K),
241  PAD_NC(GPP_H15, UP_20K),
242  PAD_NC(GPP_H16, UP_20K),
243  PAD_NC(GPP_H17, UP_20K),
244  PAD_CFG_NF(GPP_H18, NONE, DEEP, NF1), /* CPU_C10_GATE# */
245  PAD_NC(GPP_H19, UP_20K),
246  PAD_NC(GPP_H20, UP_20K),
247  PAD_NC(GPP_H21, NONE),
248  PAD_NC(GPP_H22, UP_20K),
249  PAD_NC(GPP_H23, UP_20K),
250 };
251 
252 #endif
253 
254 #endif
#define GPD11
#define GPP_A4
#define GPP_H22
#define GPP_C15
#define GPD3
#define GPP_H20
#define GPP_B6
Definition: gpio_soc_defs.h:59
#define GPP_H19
#define GPP_D1
#define GPD9
#define GPP_C2
#define GPP_D10
#define GPP_D8
#define GPP_D17
#define GPP_E3
#define GPP_A18
#define GPP_F21
#define GPP_C12
#define GPP_F12
#define GPP_F16
#define GPP_H15
#define GPP_H16
#define GPP_E0
#define GPP_F6
#define GPP_H18
#define GPP_D14
#define GPP_B1
Definition: gpio_soc_defs.h:54
#define GPP_F20
#define GPP_F23
#define GPP_C5
#define GPP_H11
#define GPP_A14
#define GPP_B12
Definition: gpio_soc_defs.h:65
#define GPP_H17
#define GPP_D12
#define GPP_B16
Definition: gpio_soc_defs.h:69
#define GPP_A5
#define GPP_B2
Definition: gpio_soc_defs.h:55
#define GPP_D7
#define GPP_B13
Definition: gpio_soc_defs.h:66
#define GPP_E6
#define GPP_F0
#define GPP_D6
#define GPP_A19
#define GPP_D2
#define GPP_H12
#define GPP_H6
#define GPP_C9
#define GPP_H2
#define GPP_C22
#define GPP_H9
#define GPD0
#define GPP_D9
#define GPP_F5
#define GPP_B15
Definition: gpio_soc_defs.h:68
#define GPP_E13
#define GPP_A2
#define GPP_H21
#define GPP_C23
#define GPP_H13
#define GPP_C8
#define GPP_D11
#define GPP_H7
#define GPP_A6
#define GPP_H1
#define GPP_C11
#define GPP_H14
#define GPP_D5
#define GPP_B22
Definition: gpio_soc_defs.h:75
#define GPP_A23
#define GPP_C18
#define GPP_F9
#define GPP_C13
#define GPP_E14
#define GPP_E23
#define GPP_E9
#define GPP_C17
#define GPP_E8
#define GPP_A7
#define GPP_E5
#define GPP_A0
#define GPD7
#define GPP_B8
Definition: gpio_soc_defs.h:61
#define GPP_C20
#define GPP_B20
Definition: gpio_soc_defs.h:73
#define GPP_A20
#define GPP_A16
#define GPP_F1
#define GPP_F17
#define GPP_A12
#define GPP_F15
#define GPP_D4
#define GPP_C10
#define GPP_C6
#define GPD2
#define GPP_F10
#define GPP_A3
#define GPP_E7
#define GPP_C16
#define GPP_F7
#define GPD1
#define GPP_F13
#define GPP_C4
#define GPP_D18
#define GPP_B19
Definition: gpio_soc_defs.h:72
#define GPP_E17
#define GPP_E2
#define GPP_E19
#define GPP_H0
#define GPP_H5
#define GPP_C21
#define GPP_B9
Definition: gpio_soc_defs.h:62
#define GPD10
#define GPP_E18
#define GPP_F14
#define GPP_H3
#define GPP_F4
#define GPP_A10
#define GPP_A8
#define GPP_D0
#define GPP_A1
#define GPP_B14
Definition: gpio_soc_defs.h:67
#define GPP_B11
Definition: gpio_soc_defs.h:64
#define GPP_D13
#define GPP_B18
Definition: gpio_soc_defs.h:71
#define GPP_B5
Definition: gpio_soc_defs.h:58
#define GPP_B0
Definition: gpio_soc_defs.h:53
#define GPP_A11
#define GPP_C14
#define GPP_E20
#define GPP_A15
#define GPP_A9
#define GPP_E10
#define GPP_F8
#define GPP_C19
#define GPD8
#define GPP_A13
#define GPP_A21
#define GPP_B23
Definition: gpio_soc_defs.h:76
#define GPP_E15
#define GPP_B10
Definition: gpio_soc_defs.h:63
#define GPP_E16
#define GPP_D19
#define GPP_C1
#define GPP_F2
#define GPP_E11
#define GPD6
#define GPP_F18
#define GPP_B3
Definition: gpio_soc_defs.h:56
#define GPP_A22
#define GPP_F22
#define GPP_D15
#define GPP_F11
#define GPP_B21
Definition: gpio_soc_defs.h:74
#define GPD4
#define GPP_B4
Definition: gpio_soc_defs.h:57
#define GPP_D16
#define GPP_F3
#define GPP_E22
#define GPP_H10
#define GPP_E21
#define GPP_C3
#define GPP_E12
#define GPP_A17
#define GPP_B17
Definition: gpio_soc_defs.h:70
#define GPP_E4
#define GPP_C0
#define GPD5
#define GPP_E1
#define GPP_H8
#define GPP_F19
#define GPP_H4
#define GPP_H23
#define GPP_B7
Definition: gpio_soc_defs.h:60
#define GPP_C7
#define GPP_D3
#define GPP_D23
#define GPP_G1
Definition: gpio_soc_defs.h:89
#define GPP_G7
Definition: gpio_soc_defs.h:95
#define GPP_D22
#define GPP_G4
Definition: gpio_soc_defs.h:92
#define GPP_G2
Definition: gpio_soc_defs.h:90
#define GPP_D21
#define GPP_G6
Definition: gpio_soc_defs.h:94
#define GPP_G0
Definition: gpio_soc_defs.h:88
#define GPP_D20
#define GPP_G3
Definition: gpio_soc_defs.h:91
#define GPP_G5
Definition: gpio_soc_defs.h:93
static const struct pad_config gpio_table[]
Definition: gpio.h:22
static const struct pad_config early_gpio_table[]
Definition: gpio.h:14
#define PAD_NC(pin)
Definition: gpio_defs.h:263
#define PAD_CFG_GPI_SCI_LOW(pad, pull, rst, trig)
Definition: gpio_defs.h:452
#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
#define PAD_CFG_GPI_SMI_LOW(pad, pull, rst, trig)
Definition: gpio_defs.h:425
#define PAD_CFG_GPI_APIC_LOW(pad, pull, rst)
Definition: gpio_defs.h:402