mb/starlabs/{lite_adl,byte_adl}: Don't select MAINBOARD_HAS_TPM2
[coreboot2.git] / src / mainboard / system76 / rpl / variants / oryp11 / gpio.c
blob20ecef6b6c56d1779856c95632841836c3e8232f
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_CFG_NF(GPD2, NATIVE, PWROK, NF1), // PCH_LAN_WAKE#
11 PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1), // PWR_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_CFG_GPO(GPD7, 0, DEEP), // GPD_7
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_CFG_GPO(GPD11, 1, DEEP),
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), // SERIRQ_ESPI_ALERT0
28 PAD_CFG_GPO(GPP_A6, 1, DEEP),
29 PAD_CFG_GPO(GPP_A7, 1, DEEP),
30 PAD_CFG_GPO(GPP_A8, 1, DEEP), // GPP_A8
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_CFG_GPO(GPP_A11, 1, DEEP),
34 PAD_CFG_GPO(GPP_A12, 1, DEEP),
35 PAD_CFG_GPO(GPP_A13, 1, PLTRST), // BT_EN
36 // GPP_A14 (DGPU_PWR_EN) configured in bootblock
37 _PAD_CFG_STRUCT(GPP_A15, 0x86880100, 0x0000), // G_DP_A_HPD_L
38 PAD_CFG_NF(GPP_A16, NONE, DEEP, NF1), // USB_OC3#
39 PAD_CFG_GPI_INT(GPP_A17, NONE, PLTRST, LEVEL), // TP_ATTN#
40 _PAD_CFG_STRUCT(GPP_A18, 0x86880100, 0x0000), // HDMI_HPD
41 PAD_CFG_GPI(GPP_A19, NONE, DEEP), // DGPU_PWRGD_R
42 PAD_CFG_GPO(GPP_A20, 1, DEEP), // DGPU_OVRM
43 PAD_CFG_GPO(GPP_A21, 1, DEEP), // GPIO_LANRTD3
44 PAD_CFG_GPO(GPP_A22, 1, DEEP),
45 PAD_CFG_GPO(GPP_A23, 1, DEEP),
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#_PCH) configured in bootblock
51 PAD_CFG_GPI(GPP_B3, NONE, DEEP), // SCI#
52 PAD_CFG_GPI(GPP_B4, NONE, DEEP), // SWI#
53 _PAD_CFG_STRUCT(GPP_B5, 0x44000a01, 0x0000), // GPPB_I2C2_SDA
54 _PAD_CFG_STRUCT(GPP_B6, 0x44000a01, 0x0000), // GPPB_I2C2_SCL
55 PAD_CFG_GPO(GPP_B7, 1, DEEP),
56 PAD_CFG_GPO(GPP_B8, 1, DEEP),
57 PAD_CFG_GPO(GPP_B9, 1, DEEP),
58 PAD_CFG_GPO(GPP_B10, 1, DEEP),
59 PAD_CFG_NF(GPP_B11, NONE, RSMRST, NF1), // GPP_B11
60 PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1), // SLP_S0#
61 PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1), // SYS_RESET#
62 PAD_CFG_NF(GPP_B14, NONE, DEEP, NF1), // GPP_B14
63 PAD_CFG_GPO(GPP_B15, 1, DEEP),
64 PAD_CFG_GPO(GPP_B16, 1, DEEP),
65 PAD_CFG_GPO(GPP_B17, 1, DEEP),
66 PAD_CFG_GPO(GPP_B18, 0, DEEP), // GPP_B18
67 PAD_CFG_GPO(GPP_B19, 1, DEEP),
68 PAD_CFG_GPO(GPP_B20, 1, DEEP),
69 PAD_CFG_GPO(GPP_B21, 1, DEEP),
70 PAD_CFG_GPO(GPP_B22, 1, DEEP),
71 PAD_CFG_GPO(GPP_B23, 0, DEEP), // GPP_B23
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_SSD1_PWR_EN
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), // GPP_C5
80 PAD_CFG_NF(GPP_C6, NONE, DEEP, NF1), // SML1_CLK
81 PAD_CFG_NF(GPP_C7, NONE, DEEP, NF1), // SML1_DATA
82 PAD_NC(GPP_C8, NONE),
83 PAD_NC(GPP_C9, NONE),
84 PAD_NC(GPP_C10, NONE),
85 PAD_NC(GPP_C11, NONE),
86 PAD_NC(GPP_C12, NONE),
87 PAD_NC(GPP_C13, NONE),
88 PAD_NC(GPP_C14, NONE),
89 PAD_NC(GPP_C15, NONE),
90 PAD_NC(GPP_C16, NONE),
91 PAD_NC(GPP_C17, NONE),
92 PAD_NC(GPP_C18, NONE),
93 PAD_NC(GPP_C19, NONE),
94 PAD_NC(GPP_C20, NONE),
95 PAD_NC(GPP_C21, NONE),
96 PAD_NC(GPP_C22, NONE),
97 PAD_NC(GPP_C23, NONE),
99 /* ------- GPIO Group GPP_D ------- */
100 PAD_CFG_GPO(GPP_D0, 1, DEEP), // SB_BLON
101 PAD_CFG_GPO(GPP_D1, 1, DEEP),
102 PAD_CFG_GPO(GPP_D2, 0, DEEP), // ROM_I2C_EN
103 PAD_CFG_GPO(GPP_D3, 1, DEEP),
104 PAD_CFG_GPO(GPP_D4, 0, DEEP), // PS8461_SW
105 // GPP_D5 (PEX_SSD2_CLKREQ#) configured by FSP
106 PAD_CFG_GPO(GPP_D6, 1, DEEP),
107 // GPP_D7 (WLAN_CLKREQ#) configured by FSP
108 // GPP_D8 (PEG_CLKREQ#) configured by FSP
109 PAD_CFG_GPO(GPP_D9, 1, DEEP),
110 PAD_CFG_GPO(GPP_D10, 0, DEEP), // GPP_D10
111 _PAD_CFG_STRUCT(GPP_D11, 0x44001700, 0x3c00),
112 PAD_CFG_GPO(GPP_D12, 0, DEEP), // GPP_D12
113 PAD_CFG_GPI(GPP_D13, NONE, DEEP), // WLAN_W AKEUP#
114 PAD_CFG_GPO(GPP_D14, 1, PLTRST), // M2_SSD2_PWR_EN
115 PAD_CFG_GPO(GPP_D15, 1, DEEP),
116 PAD_CFG_GPO(GPP_D16, 1, DEEP),
117 PAD_CFG_GPO(GPP_D17, 1, DEEP),
118 PAD_CFG_GPO(GPP_D18, 1, DEEP),
119 PAD_CFG_GPO(GPP_D19, 1, DEEP),
121 /* ------- GPIO Group GPP_E ------- */
122 PAD_CFG_GPI(GPP_E0, NONE, DEEP), // CNVI_W AKE#
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),
127 PAD_CFG_GPO(GPP_E5, 0, DEEP),
128 PAD_CFG_GPO(GPP_E6, 0, DEEP), // GPP_E6
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_GPO(GPP_E10, 1, DEEP),
133 PAD_CFG_GPI(GPP_E11, NONE, DEEP), // BOARD_ID1
134 PAD_CFG_GPO(GPP_E12, 1, DEEP),
135 PAD_CFG_GPI(GPP_E13, NONE, DEEP), // BOARD_ID4
136 PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1), // PCH_EDP_HPD
137 PAD_CFG_GPO(GPP_E15, 1, DEEP), // CCD_FW_WP#
138 PAD_CFG_GPO(GPP_E16, 1, DEEP),
139 PAD_CFG_GPI(GPP_E17, NONE, DEEP), // BOARD_ID3
140 // GPP_E18 (TBT_LSX0_TXD) configured by FSP
141 // GPP_E19 (TBT_LSX0_RXD) configured by FSP
142 PAD_CFG_GPO(GPP_E20, 1, DEEP),
143 PAD_CFG_GPO(GPP_E21, 0, DEEP), // GPP_E21
144 PAD_CFG_GPO(GPP_E22, 1, DEEP),
145 PAD_CFG_GPO(GPP_E23, 1, DEEP),
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_RF_RST#
153 // GPP_F5 (XTAL_CLKREQ) configured by FSP
154 PAD_CFG_NF(GPP_F6, NONE, DEEP, NF1), // CNVI_GNSS_PA_BLANKING
155 PAD_CFG_GPO(GPP_F7, 1, DEEP), // LAN_PLT_RST#
156 PAD_CFG_GPO(GPP_F8, 1, DEEP),
157 PAD_CFG_GPO(GPP_F9, 1, DEEP),
158 PAD_CFG_GPO(GPP_F10, 0, DEEP), // GPP_F10
159 PAD_CFG_GPO(GPP_F11, 1, DEEP),
160 PAD_CFG_GPI(GPP_F12, NONE, DEEP), // GPIO4_GC6_NVVDD_EN_R
161 PAD_CFG_GPI(GPP_F13, NONE, DEEP), // GC6_FB_EN_PCH
162 PAD_CFG_GPO(GPP_F14, 1, DEEP),
163 PAD_CFG_GPO(GPP_F15, 1, DEEP),
164 PAD_CFG_GPI(GPP_F16, NONE, PLTRST), // GPU_EVENT#
165 PAD_CFG_GPO(GPP_F17, 1, DEEP),
166 PAD_CFG_GPO(GPP_F18, 1, DEEP),
167 // GPP_F19 (LAN_CLKREQ#) configured by FSP
168 PAD_CFG_GPO(GPP_F20, 1, PLTRST), // M2_SSD2_RST#
169 PAD_CFG_GPO(GPP_F21, 1, DEEP),
170 PAD_CFG_GPO(GPP_F22, 1, DEEP),
171 PAD_CFG_GPO(GPP_F23, 1, DEEP),
173 /* ------- GPIO Group GPP_H ------- */
174 PAD_CFG_GPO(GPP_H0, 0, DEEP), // GPP_H0
175 PAD_CFG_GPO(GPP_H1, 1, PLTRST), // M2_SSD1_RST#
176 PAD_CFG_GPO(GPP_H2, 1, PLTRST), // M2_WLAN_RST#
177 PAD_CFG_GPI(GPP_H3, NONE, DEEP), // TPM_DET
178 PAD_CFG_NF(GPP_H4, NONE, DEEP, NF1), // I2C_SDA_TP
179 PAD_CFG_NF(GPP_H5, NONE, DEEP, NF1), // I2C_SCL_TP
180 PAD_CFG_NF(GPP_H6, NONE, DEEP, NF1), // PCH_I2C_SDA
181 PAD_CFG_NF(GPP_H7, NONE, DEEP, NF1), // PCH_I2C_SCL
182 PAD_CFG_NF(GPP_H8, NONE, DEEP, NF2), // CNVI_MFUART2_RXD
183 PAD_CFG_GPO(GPP_H9, 0, DEEP), // CNVI_MFUART2_TXD
184 // GPP_H10 (UART0_RXD) configured in bootblock
185 // GPP_H11 (UART0_TXD) configured in bootblock
186 PAD_CFG_GPO(GPP_H12, 1, DEEP),
187 PAD_CFG_GPO(GPP_H13, 1, DEEP),
188 PAD_CFG_GPO(GPP_H14, 1, DEEP),
189 PAD_CFG_GPO(GPP_H15, 1, DEEP),
190 PAD_CFG_GPO(GPP_H16, 1, DEEP),
191 PAD_CFG_GPO(GPP_H17, 1, DEEP),
192 PAD_CFG_NF(GPP_H18, NONE, DEEP, NF1), // CPU_C10_GATE#
193 PAD_CFG_NF(GPP_H19, NONE, DEEP, NF1), // PEX_SSD1_CLKREQ#
194 PAD_CFG_GPI(GPP_H20, NONE, DEEP),
195 PAD_CFG_GPI(GPP_H21, NONE, DEEP),
196 PAD_CFG_GPO(GPP_H22, 0, DEEP),
197 // GPP_H23 (CARD_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#_R
205 PAD_CFG_GPO(GPP_R5, 1, DEEP),
206 PAD_CFG_GPO(GPP_R6, 1, DEEP),
207 PAD_CFG_GPO(GPP_R7, 1, DEEP),
209 /* ------- GPIO Group GPP_S ------- */
210 PAD_CFG_GPO(GPP_S0, 1, DEEP),
211 PAD_CFG_GPO(GPP_S1, 1, DEEP),
212 PAD_CFG_GPO(GPP_S2, 1, DEEP),
213 PAD_CFG_GPO(GPP_S3, 1, DEEP),
214 PAD_CFG_GPO(GPP_S4, 1, DEEP),
215 PAD_CFG_GPO(GPP_S5, 1, DEEP),
216 PAD_CFG_GPO(GPP_S6, 1, DEEP),
217 PAD_CFG_GPO(GPP_S7, 1, DEEP),
219 /* ------- GPIO Group GPP_T ------- */
220 PAD_CFG_GPO(GPP_T2, 1, DEEP),
221 PAD_CFG_GPO(GPP_T3, 1, DEEP),
224 void mainboard_configure_gpios(void)
226 gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));