mb/ocp/tiogapass: Fix GPIOs
[coreboot2.git] / src / mainboard / system76 / adl / variants / oryp9 / gpio.c
blob5c56f80e1621aa51238922aa2263f1b3eece7799
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <mainboard/gpio.h>
4 #include <soc/gpio.h>
6 static const struct pad_config gpio_table[] = {
7 /* ------- GPIO Group GPD ------- */
8 PAD_CFG_NF(GPD0, UP_20K, PWROK, NF1), // PM_BATLOW#
9 PAD_CFG_NF(GPD1, NATIVE, PWROK, NF1), // AC_PRESENT
10 PAD_NC(GPD2, NONE),
11 PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1), // PWN_BTN#
12 PAD_CFG_NF(GPD4, NONE, PWROK, NF1), // SUSB#_PCH
13 PAD_CFG_NF(GPD5, NONE, PWROK, NF1), // SUSC#_PCH
14 PAD_CFG_NF(GPD6, NONE, PWROK, NF1), // SLP_A#
15 PAD_NC(GPD7, NONE),
16 PAD_CFG_NF(GPD8, NONE, PWROK, NF1), // SUS_CLK
17 PAD_CFG_GPO(GPD9, 0, PWROK), // SLP_WLAN#
18 PAD_CFG_NF(GPD10, NONE, PWROK, NF1), // SLP_S5#
19 PAD_NC(GPD11, NONE),
21 /* ------- GPIO Group GPP_A ------- */
22 PAD_CFG_NF(GPP_A0, UP_20K, DEEP, NF1), // ESPI_IO0_EC
23 PAD_CFG_NF(GPP_A1, UP_20K, DEEP, NF1), // ESPI_IO1_EC
24 PAD_CFG_NF(GPP_A2, UP_20K, DEEP, NF1), // ESPI_IO2_EC
25 PAD_CFG_NF(GPP_A3, UP_20K, DEEP, NF1), // ESPI_IO3_EC
26 PAD_CFG_NF(GPP_A4, UP_20K, DEEP, NF1), // ESPI_CS_EC#
27 PAD_CFG_NF(GPP_A5, UP_20K, DEEP, NF1), // ESPI_ALRT0#
28 _PAD_CFG_STRUCT(GPP_A6, 0x80100100, 0x0000), // INTP_8851
29 PAD_CFG_GPI(GPP_A7, NONE, PLTRST), // GC6_FB_EN_PCH
30 PAD_CFG_GPO(GPP_A8, 0, DEEP), // GPIO_LANRTD3
31 PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1), // ESPI_CLK_EC
32 PAD_CFG_NF(GPP_A10, NONE, DEEP, NF1), // ESPI_RESET#
33 PAD_NC(GPP_A11, NONE), // GPU_PROCHOT#
34 PAD_NC(GPP_A12, NONE),
35 PAD_CFG_GPO(GPP_A13, 1, PLTRST), // PCH_BT_EN
36 // GPP_A14 (DGPU_PWR_EN) configured in bootblock
37 _PAD_CFG_STRUCT(GPP_A15, 0x46880100, 0x0000), // G_DP_HDPD_E
38 PAD_NC(GPP_A16, NONE), // USB_OC3#
39 PAD_NC(GPP_A17, NONE),
40 _PAD_CFG_STRUCT(GPP_A18, 0x46880100, 0x0000), // HDMI_HPD
41 PAD_NC(GPP_A19, NONE),
42 _PAD_CFG_STRUCT(GPP_A20, 0x46880100, 0x0000), // DP_F_HPD
43 PAD_NC(GPP_A21, NONE),
44 PAD_CFG_GPO(GPP_A22, 0, DEEP), // PCIE4_WAKE_N
45 PAD_CFG_GPI(GPP_A23, UP_20K, DEEP), // GPIO4_NVVDD_EN
47 /* ------- GPIO Group GPP_B ------- */
48 PAD_CFG_NF(GPP_B0, NONE, DEEP, NF1), // VCCIN_AUX_VID0
49 PAD_CFG_NF(GPP_B1, NONE, DEEP, NF1), // VCCIN_AUX_VID1
50 // GPP_B2 (DGPU_RST#_CPU) configured in bootblock
51 PAD_CFG_GPI(GPP_B3, NONE, DEEP), // SCI#
52 PAD_CFG_GPI(GPP_B4, NONE, DEEP), // SWI#
53 PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1), // GPPB_I2C2_SDA (Pantone)
54 PAD_CFG_NF(GPP_B6, NONE, DEEP, NF1), // GPPB_I2C2_SCL (Pantone)
55 PAD_CFG_NF(GPP_B7, NONE, DEEP, NF1), // I2C3_SDA (IT8851)
56 PAD_CFG_NF(GPP_B8, NONE, DEEP, NF1), // I2C3_SCL (IT8851)
57 // GPP_B9 missing
58 // GPP_B10 missing
59 PAD_CFG_NF(GPP_B11, NONE, PWROK, NF1), // TBT_I2C_INT
60 PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1), // SLP_S0#
61 PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1), // PLT_RST#
62 PAD_NC(GPP_B14, NONE), // Top swap override
63 PAD_CFG_GPI(GPP_B15, NONE, DEEP), // PS8461_SW
64 PAD_NC(GPP_B16, NONE),
65 PAD_NC(GPP_B17, NONE),
66 PAD_CFG_GPI(GPP_B18, NONE, DEEP), // NO REBOOT strap
67 // GPP_B19 missing
68 // GPP_B20 missing
69 // GPP_B21 missing
70 // GPP_B22 missing
71 PAD_CFG_GPO(GPP_B23, 0, DEEP), // CPUNSSC CLOCK FREQ strap
73 /* ------- GPIO Group GPP_C ------- */
74 PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1), // SMB_CLK
75 PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1), // SMB_DATA
76 PAD_CFG_GPO(GPP_C2, 1, PLTRST), // M2_PWR_EN2
77 PAD_CFG_NF(GPP_C3, NONE, DEEP, NF1), // SML0_CLK
78 PAD_CFG_NF(GPP_C4, NONE, DEEP, NF1), // SML0_DATA
79 PAD_CFG_GPO(GPP_C5, 0, DEEP), // ESPI OR EC LESS strap
80 PAD_CFG_NF(GPP_C6, NONE, DEEP, NF1), // TBT_I2C_SCL
81 PAD_CFG_NF(GPP_C7, NONE, DEEP, NF1), // TBT_I2C_SDA
82 // GPP_C8 missing
83 // GPP_C9 missing
84 // GPP_C10 missing
85 // GPP_C11 missing
86 // GPP_C12 missing
87 // GPP_C13 missing
88 // GPP_C14 missing
89 // GPP_C15 missing
90 // GPP_C16 missing
91 // GPP_C17 missing
92 // GPP_C18 missing
93 // GPP_C19 missing
94 // GPP_C20 missing
95 // GPP_C21 missing
96 // GPP_C22 missing
97 // GPP_C23 missing
99 /* ------- GPIO Group GPP_D ------- */
100 PAD_CFG_GPO(GPP_D0, 1, DEEP), // SB_BLON
101 PAD_CFG_GPI(GPP_D1, NONE, DEEP), // SB_KBCRST#
102 PAD_CFG_GPO(GPP_D2, 0, DEEP), // ROM_I2C_EN
103 PAD_NC(GPP_D3, NONE),
104 PAD_CFG_GPO(GPP_D4, 1, PLTRST), // GPIO_LAN_EN
105 // GPP_D5 (SSD0_CLKREQ#) configured by FSP
106 PAD_CFG_GPO(GPP_D6, 1, DEEP), // LAN_PLT_RST#
107 // GPP_D7 (WLAN_CLKREQ#) configured by FSP
108 // GPP_D8 (GPU_PCIE_CLKREQ#) configured by FSP
109 PAD_NC(GPP_D9, NONE),
110 PAD_NC(GPP_D10, NONE),
111 PAD_NC(GPP_D11, NONE),
112 PAD_CFG_GPI(GPP_D12, NATIVE, DEEP), // DGPU_PWRGD_R
113 PAD_CFG_GPI(GPP_D13, NONE, DEEP), // WLAN_WAKEUP#
114 PAD_CFG_GPO(GPP_D14, 1, PLTRST), // M2_PWR_EN1
115 PAD_NC(GPP_D15, NONE),
116 PAD_NC(GPP_D16, NONE),
117 PAD_NC(GPP_D17, NONE),
118 PAD_NC(GPP_D18, NONE),
119 PAD_CFG_GPO(GPP_D19, 1, PLTRST), // SATA_LED#
121 /* ------- GPIO Group GPP_E ------- */
122 PAD_CFG_GPI(GPP_E0, NONE, DEEP), // CNVI_WAKE#
123 _PAD_CFG_STRUCT(GPP_E1, 0x40100100, 0x3000), // TPM_PIRQ#
124 PAD_CFG_GPI(GPP_E2, NONE, DEEP), // BOARD_ID2
125 PAD_CFG_GPO(GPP_E3, 1, PLTRST), // PCH_WLAN_EN
126 PAD_CFG_GPO(GPP_E4, 0, PLTRST), // TC_RETIMER_FORCE_PWR
127 PAD_NC(GPP_E5, NONE),
128 PAD_CFG_GPI(GPP_E6, NONE, DEEP), // JTAG ODT DISABLE strap
129 PAD_CFG_GPI(GPP_E7, NONE, DEEP), // SMI#
130 PAD_CFG_GPI(GPP_E8, NONE, DEEP), // SLP_DRAM#
131 PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1), // USB_OC0#
132 PAD_CFG_GPI(GPP_E10, NONE, DEEP), // BOARD_ID4
133 PAD_CFG_GPI(GPP_E11, NONE, DEEP), // BOARD_ID1
134 PAD_CFG_GPI_INT(GPP_E12, NONE, PLTRST, LEVEL), // TP_ATTN#
135 PAD_CFG_GPI(GPP_E13, NONE, DEEP), // BOARD_ID3
136 PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1), // EDP_HPD
137 PAD_NC(GPP_E15, NONE),
138 PAD_NC(GPP_E16, NONE),
139 PAD_CFG_GPI(GPP_E17, NONE, DEEP), // BOARD_ID5
140 // GPP_E18 (TBTA_LSX2_TXD) configured by FSP
141 // GPP_E19 (TBTA_LSX2_RXD) configured by FSP
142 PAD_NC(GPP_E20, NONE),
143 PAD_NC(GPP_E21, NONE), // Strap
144 PAD_NC(GPP_E22, NONE),
145 PAD_NC(GPP_E23, NONE),
147 /* ------- GPIO Group GPP_F ------- */
148 PAD_CFG_NF(GPP_F0, NONE, DEEP, NF1), // CNVI_BRI_DT
149 PAD_CFG_NF(GPP_F1, UP_20K, DEEP, NF1), // CNVI_BRI_RSP
150 PAD_CFG_NF(GPP_F2, NONE, DEEP, NF1), // CNVI_RGI_DT
151 PAD_CFG_NF(GPP_F3, UP_20K, DEEP, NF1), // CNVI_RGI_RSP
152 PAD_CFG_NF(GPP_F4, NONE, DEEP, NF1), // CNVI_RST#
153 // GPP_F5 (CNVI_CLKREQ) configured by FSP
154 PAD_CFG_NF(GPP_F6, NONE, DEEP, NF1), // CNVI_GNSS_PA_BLANKING
155 PAD_NC(GPP_F7, NONE), // MCRO LDO BYPASS strap
156 // GPP_F8 missing
157 PAD_NC(GPP_F9, NONE),
158 PAD_NC(GPP_F10, NONE), // RSMRSTB SAMPLING strap
159 PAD_NC(GPP_F11, NONE),
160 PAD_CFG_GPO(GPP_F12, 0, DEEP), // OVRM
161 PAD_NC(GPP_F13, NONE),
162 PAD_NC(GPP_F14, NONE),
163 PAD_CFG_GPI(GPP_F15, NONE, DEEP), // BOARD_ID6
164 PAD_CFG_GPI(GPP_F16, NONE, DEEP), // BOARD_ID7
165 PAD_CFG_GPI(GPP_F17, NONE, DEEP), // PLVDD_RST_EC
166 PAD_NC(GPP_F18, NONE),
167 // GPP_F19 (CARD_CLKREQ#) configured by FSP
168 PAD_CFG_GPO(GPP_F20, 1, PLTRST), // M.2_PLT_RST_CNTRL1#
169 PAD_NC(GPP_F21, NONE),
170 PAD_NC(GPP_F22, NONE),
171 PAD_NC(GPP_F23, NONE),
173 /* ------- GPIO Group GPP_H ------- */
174 PAD_NC(GPP_H0, NONE),
175 PAD_CFG_GPO(GPP_H1, 1, PLTRST), // M.2_PLT_RST_CNTRL2#
176 PAD_CFG_GPO(GPP_H2, 1, PLTRST), // M.2_PLT_RST_CNTRL3#
177 PAD_CFG_GPI(GPP_H3, NONE, DEEP), // TPM_DET
178 PAD_CFG_NF(GPP_H4, NONE, DEEP, NF1), // I2C_SDA_TP (Touchpad)
179 PAD_CFG_NF(GPP_H5, NONE, DEEP, NF1), // I2C_SCL_TP (Touchpad)
180 PAD_CFG_NF(GPP_H6, NONE, DEEP, NF1), // PCH_I2C_SDA (Retimer)
181 PAD_CFG_NF(GPP_H7, NONE, DEEP, NF1), // PCH_I2C_SCL (Retimer)
182 PAD_CFG_NF(GPP_H8, NONE, DEEP, NF1), // CNVI_MFUART2_RXD
183 PAD_CFG_NF(GPP_H9, NONE, DEEP, NF1), // CNVI_MFUART2_TXD
184 // GPP_H10 (UART0_RX) configured in bootblock
185 // GPP_H11 (UART0_TX) configured in bootblock
186 PAD_NC(GPP_H12, NONE),
187 PAD_NC(GPP_H13, NONE),
188 // GPP_H14 missing
189 PAD_NC(GPP_H15, NONE),
190 // GPP_H16 missing
191 PAD_NC(GPP_H17, NONE),
192 PAD_CFG_NF(GPP_H18, NONE, DEEP, NF1), // CPU_C10_GATE#
193 // GPP_H19 (SSD1_CLKREQ#) configured by FSP
194 PAD_NC(GPP_H20, NONE),
195 PAD_NC(GPP_H21, NONE),
196 PAD_NC(GPP_H22, NONE),
197 // GPP_H23 (GLAN_CLKREQ#) configured by FSP
199 /* ------- GPIO Group GPP_R ------- */
200 PAD_CFG_NF(GPP_R0, NONE, DEEP, NF1), // HDA_BITCLK
201 PAD_CFG_NF(GPP_R1, NATIVE, DEEP, NF1), // HDA_SYNC
202 PAD_CFG_NF(GPP_R2, NATIVE, DEEP, NF1), // HDA_SDOUT
203 PAD_CFG_NF(GPP_R3, NATIVE, DEEP, NF1), // HDA_SDIN0
204 PAD_CFG_NF(GPP_R4, NONE, DEEP, NF1), // HDA_RST#
205 PAD_CFG_GPO(GPP_R5, 1, DEEP), // PCH_MUTE#
206 PAD_CFG_GPI(GPP_R6, NONE, DEEP), // GPPR_DMIC_CLK
207 PAD_CFG_GPI(GPP_R7, NONE, DEEP), // GPPR_DMIC_DATA
209 /* ------- GPIO Group GPP_S ------- */
210 PAD_NC(GPP_S0, NONE),
211 PAD_NC(GPP_S1, NONE),
212 PAD_NC(GPP_S2, NONE),
213 PAD_NC(GPP_S3, NONE),
214 PAD_NC(GPP_S4, NONE),
215 PAD_NC(GPP_S5, NONE),
216 PAD_NC(GPP_S6, NONE),
217 PAD_NC(GPP_S7, NONE),
219 /* ------- GPIO Group GPP_T ------- */
220 PAD_NC(GPP_T2, NONE),
221 PAD_NC(GPP_T3, NONE),
224 void mainboard_configure_gpios(void)
226 gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));