Sean Rhodes | ab5b7b3 | 2021-10-22 14:33:27 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <variants.h> |
| 4 | |
| 5 | /* |
| 6 | * All definitions are taken from a comparison of the output of "inteltool -a" |
| 7 | * using the stock BIOS and with coreboot. |
| 8 | */ |
| 9 | |
| 10 | /* Early pad configuration in bootblock. */ |
| 11 | const struct pad_config early_gpio_table[] = { |
| 12 | /* C20: UART2_RXD */ |
| 13 | PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), |
| 14 | /* C21: UART2_TXD */ |
| 15 | PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), |
| 16 | }; |
| 17 | |
| 18 | const struct pad_config *variant_early_gpio_table(size_t *num) |
| 19 | { |
| 20 | *num = ARRAY_SIZE(early_gpio_table); |
| 21 | return early_gpio_table; |
| 22 | } |
| 23 | |
| 24 | /* Pad configuration in ramstage. */ |
| 25 | const struct pad_config gpio_table[] = { |
| 26 | /* GPD0: PM_BATLOW_N */ |
| 27 | PAD_CFG_NF(GPD0, UP_20K, PWROK, NF1), |
| 28 | /* GPD1: AC_PRESENT */ |
| 29 | PAD_CFG_NF(GPD1, NATIVE, PWROK, NF1), |
| 30 | /* GPD2: Not Connected */ |
| 31 | PAD_NC(GPD2, NONE), |
| 32 | /* GPD3: SOC_PWRBTN_N */ |
| 33 | PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1), |
| 34 | /* GPD4: SLP_S3_N */ |
| 35 | PAD_CFG_NF(GPD4, NONE, PWROK, NF1), |
| 36 | /* GPD5: SLP_S4_N */ |
| 37 | PAD_CFG_NF(GPD5, NONE, PWROK, NF1), |
| 38 | /* GPD6: Not Connected */ |
| 39 | PAD_NC(GPD6, NONE), |
| 40 | /* GPD7: Not Connected */ |
| 41 | PAD_NC(GPD7, NONE), |
| 42 | /* GPD8: SUS_CLK */ |
| 43 | PAD_CFG_NF(GPD8, NONE, PWROK, NF1), |
| 44 | /* GPD9: Not Connected */ |
| 45 | PAD_NC(GPD9, NONE), |
| 46 | /* GPD10: Not Connected */ |
| 47 | PAD_NC(GPD10, NONE), |
| 48 | /* GPD11: Not Connected */ |
| 49 | PAD_NC(GPD11, NONE), |
| 50 | /* GPP_A0: KBRST_N */ |
| 51 | PAD_NC(GPP_A0, NONE), |
| 52 | /* GPP_A1: LDC_AD0 */ |
| 53 | PAD_CFG_NF(GPP_A1, NONE, DEEP, NF1), |
| 54 | /* GPP_A2: LPC_AD1 */ |
| 55 | PAD_CFG_NF(GPP_A2, NONE, DEEP, NF1), |
| 56 | /* GPP_A3: LDC_AD2 */ |
| 57 | PAD_CFG_NF(GPP_A3, NONE, DEEP, NF1), |
| 58 | /* GPP_A4: LDC_AD3 */ |
| 59 | PAD_CFG_NF(GPP_A4, NONE, DEEP, NF1), |
| 60 | /* GPP_A5: LPC_FRAME_N */ |
| 61 | PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1), |
| 62 | /* GPP_A6: LPC_SERIRQ */ |
| 63 | PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1), |
| 64 | /* GPP_A7: Not Connected */ |
| 65 | PAD_NC(GPP_A7, NONE), |
| 66 | /* GPP_A8: PM_CLKRUN_N */ |
| 67 | PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1), |
| 68 | /* GPP_A9: LPC_CLK_EC */ |
| 69 | PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1), |
| 70 | /* GPP_A10: LPC_CLK_Debug */ |
| 71 | PAD_NC(GPP_A10, DN_20K), |
| 72 | /* GPP_A11: PME_N */ |
| 73 | PAD_CFG_GPI(GPP_A11, DN_20K, DEEP), |
| 74 | /* GPP_A12: Not Connected */ |
| 75 | PAD_NC(GPP_A12, NONE), |
| 76 | /* GPP_A13: SUSPWRDNACK */ |
| 77 | PAD_NC(GPP_A13, DN_20K), |
| 78 | /* GPP_A14: PM_SUS_STAT_N */ |
| 79 | PAD_NC(GPP_A14, DN_20K), |
| 80 | /* GPP_A15: SUSACK# */ |
| 81 | PAD_NC(GPP_A15, DN_20K), |
| 82 | /* GPP_A16: Not Connected */ |
| 83 | PAD_NC(GPP_A16, DN_20K), |
| 84 | /* GPP_A17: Not Connected */ |
| 85 | PAD_NC(GPP_A17, DN_20K), |
| 86 | /* GPP_A18: Not Connected */ |
| 87 | PAD_NC(GPP_A18, DN_20K), |
| 88 | /* GPP_A19: Not Connected */ |
| 89 | PAD_NC(GPP_A19, DN_20K), |
| 90 | /* GPP_A20: Not Connected */ |
| 91 | PAD_NC(GPP_A20, NONE), |
| 92 | /* GPP_A21: Not Connected */ |
| 93 | PAD_NC(GPP_A21, DN_20K), |
| 94 | /* GPP_A22: FP_SSP0_INT */ |
| 95 | PAD_NC(GPP_A22, DN_20K), |
| 96 | /* GPP_A23: FP_SSP0_RST */ |
| 97 | PAD_NC(GPP_A23, DN_20K), |
| 98 | /* GPP_B0: Not Connected */ |
| 99 | PAD_NC(GPP_B0, DN_20K), |
| 100 | /* GPP_B1: Not Connected */ |
| 101 | PAD_NC(GPP_B1, DN_20K), |
| 102 | /* GPP_B2: +V3P3A_PCH */ |
| 103 | PAD_NC(GPP_B2, DN_20K), |
| 104 | /* GPP_B3: Not Connected */ |
| 105 | PAD_NC(GPP_B3, DN_20K), |
| 106 | /* GPP_B4: BT_OFF_N_MCP */ |
| 107 | PAD_CFG_TERM_GPO(GPP_B4, 1, UP_20K, DEEP), |
| 108 | /* GPP_B5: SRCCLKREQ0# */ |
| 109 | PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1), |
| 110 | /* GPP_B6: CLKREQ1# */ |
| 111 | PAD_CFG_GPI(GPP_B6, DN_20K, DEEP), |
| 112 | /* GPP_B7: CLKREQ2# */ |
| 113 | PAD_CFG_NF(GPP_B7, DN_20K, DEEP, NF1), |
| 114 | /* GPP_B8: CLKREQ3# */ |
| 115 | PAD_CFG_NF(GPP_B8, DN_20K, DEEP, NF1), |
| 116 | /* GPP_B9: WLAN_CLKREQ# */ |
| 117 | PAD_CFG_NF(GPP_B9, NONE, DEEP, NF1), |
| 118 | /* GPP_B10: CLKREQ5# */ |
| 119 | PAD_CFG_NF(GPP_B10, DN_20K, DEEP, NF1), |
| 120 | /* GPP_B11: Not Connected */ |
| 121 | PAD_NC(GPP_B11, DN_20K), |
| 122 | /* GPP_B12 SLP_S0_N */ |
| 123 | PAD_NC(GPP_B12, DN_20K), |
| 124 | /* GPP_B13: SYS_RESET# */ |
| 125 | PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1), |
| 126 | /* GPP_B14: HDA_SPKR */ |
| 127 | PAD_NC(GPP_B14, DN_20K), |
| 128 | /* GPP_B15: Not Connected */ |
| 129 | PAD_NC(GPP_B15, DN_20K), |
| 130 | /* GPP_B16: Not Connected */ |
| 131 | PAD_NC(GPP_B16, DN_20K), |
| 132 | /* GPP_B17: Not Connected */ |
| 133 | PAD_NC(GPP_B17, DN_20K), |
| 134 | /* GPP_B18: +V3P3A_PCH */ |
| 135 | PAD_NC(GPP_B18, DN_20K), |
| 136 | /* GPP_B19: FP_SSP0_CS */ |
| 137 | PAD_NC(GPP_B19, DN_20K), |
| 138 | /* GPP_B20: FP_SSP0_CLK */ |
| 139 | PAD_NC(GPP_B20, DN_20K), |
| 140 | /* GPP_21: FP_SSP0_MISO */ |
| 141 | PAD_NC(GPP_B21, DN_20K), |
| 142 | /* GPP_22: FP_SSP0_MOSI */ |
| 143 | PAD_NC(GPP_B22, DN_20K), |
| 144 | /* GPP_B23: SML1ALERT#/PCHHOT# */ |
| 145 | PAD_NC(GPP_B23, DN_20K), |
| 146 | /*GPP_C0: SMBCLK */ |
| 147 | PAD_CFG_NF(GPP_C0, UP_20K, DEEP, NF1), |
| 148 | /* GPP_C1: SMBDATA */ |
| 149 | PAD_CFG_NF(GPP_C1, UP_20K, DEEP, NF1), |
| 150 | /* GPP_C2: SMBALERT# */ |
| 151 | PAD_NC(GPP_C2, DN_20K), |
| 152 | /* GPP_C3: SML0CLK */ |
| 153 | PAD_NC(GPP_C3, DN_20K), |
| 154 | /* GPP_C4: SML0DATA */ |
| 155 | PAD_NC(GPP_C4, DN_20K), |
| 156 | /* GPP_C5: SML0ALERT# */ |
| 157 | PAD_NC(GPP_C5, DN_20K), |
| 158 | /* GPP_C6: SML1CLK */ |
| 159 | PAD_NC(GPP_C6, DN_20K), |
| 160 | /* GPP_C7: SML1DATA */ |
| 161 | PAD_NC(GPP_C7, DN_20K), |
| 162 | /* GPP_C8: UART0_RXD */ |
| 163 | PAD_CFG_NF(GPP_C8, UP_20K, DEEP, NF1), |
| 164 | /* GPP_C9: UART0_TXD */ |
| 165 | PAD_CFG_NF(GPP_C9, UP_20K, DEEP, NF1), |
| 166 | /* GPP_C10: UART0_RTS# */ |
| 167 | PAD_CFG_NF(GPP_C10, NONE, DEEP, NF1), |
| 168 | /* GPP_C11: UART0_CTS# */ |
| 169 | PAD_CFG_NF(GPP_C11, UP_20K, DEEP, NF1), |
| 170 | /* GPP_C12: Not Connected */ |
| 171 | PAD_NC(GPP_C12, UP_20K), |
| 172 | /* GPP_C13: Not Connected */ |
| 173 | PAD_NC(GPP_C13, UP_20K), |
| 174 | /* GPP_C14: Not Connected */ |
| 175 | PAD_NC(GPP_C14, UP_20K), |
| 176 | /* GPP_C15: Not Connected */ |
| 177 | PAD_NC(GPP_C15, UP_20K), |
| 178 | /* GPP_C16: DAT_I2C_TP */ |
| 179 | PAD_CFG_NF(GPP_C16, NONE, DEEP, NF1), |
| 180 | /* GPP_C17: CLK_I2C_TP */ |
| 181 | PAD_CFG_NF(GPP_C17, NONE, DEEP, NF1), |
| 182 | /* GPP_C18: TOUCH_I2C_SDA */ |
| 183 | PAD_CFG_NF(GPP_C18, NONE, DEEP, NF1), |
| 184 | /* GPP_C19: TOUCH_I2C_CLK */ |
| 185 | PAD_CFG_NF(GPP_C19, NONE, DEEP, NF1), |
| 186 | /* GPP_C22: Not Connected */ |
| 187 | PAD_NC(GPP_C22, NONE), |
| 188 | /* GPP_C23: TOUCHPAD_INT */ |
| 189 | PAD_CFG_GPI_APIC_LOW(GPP_C23, NONE, PLTRST), |
| 190 | /* GPP_D0: Not Connected */ |
| 191 | PAD_NC(GPP_D0, DN_20K), |
| 192 | /* GPP_D1: Not Connected */ |
| 193 | PAD_NC(GPP_D1, DN_20K), |
| 194 | /* GPP_D2: Not Connected */ |
| 195 | PAD_NC(GPP_D2, DN_20K), |
| 196 | /* GPP_D3: Not Connected */ |
| 197 | PAD_NC(GPP_D3, DN_20K), |
| 198 | /* GPP_D4: Not Connected */ |
| 199 | PAD_NC(GPP_D4, DN_20K), |
| 200 | /* GPP_D5: Not Connected */ |
| 201 | PAD_NC(GPP_D5, DN_20K), |
| 202 | /* GPP_D6: Not Connected */ |
| 203 | PAD_NC(GPP_D6, DN_20K), |
| 204 | /* GPP_D7: Not Connected */ |
| 205 | PAD_NC(GPP_D7, DN_20K), |
| 206 | /* GPP_D8: Not Connected */ |
| 207 | PAD_NC(GPP_D8, DN_20K), |
| 208 | /* GPP_D9: VOLUME_UP */ |
| 209 | PAD_NC(GPP_D9, DN_20K), |
| 210 | /* GPP_D10: VOLUME_DOWN */ |
| 211 | PAD_NC(GPP_D10, DN_20K), |
| 212 | /* GPP_D11: Not Connected */ |
| 213 | PAD_NC(GPP_D11, DN_20K), |
| 214 | /* GPP_D12: Not Connected */ |
| 215 | PAD_NC(GPP_D12, DN_20K), |
| 216 | /* GPP_D13: Not Connected */ |
| 217 | PAD_NC(GPP_D13, DN_20K), |
| 218 | /* GPP_D14: GPP_D14 */ |
| 219 | PAD_NC(GPP_D14, DN_20K), |
| 220 | /* GPP_D15: GPP_D15 */ |
| 221 | PAD_NC(GPP_D15, DN_20K), |
| 222 | /* GPP_D16: GPP_D16 */ |
| 223 | PAD_NC(GPP_D16, DN_20K), |
| 224 | /* GPP_D17: PCH_AUDIO_PWREN */ |
| 225 | PAD_NC(GPP_D17, DN_20K), |
| 226 | /* GPP_D18: Not Connected */ |
| 227 | PAD_NC(GPP_D18, DN_20K), |
| 228 | /* GPP_D19: Not Connected */ |
| 229 | PAD_NC(GPP_D19, DN_20K), |
| 230 | /* GPP_D20: WIFI_OFF_N_MCP */ |
| 231 | PAD_CFG_TERM_GPO(GPP_D20, 1, UP_20K, DEEP), |
| 232 | /* GPP_D21: Not Connected */ |
| 233 | PAD_NC(GPP_D21, DN_20K), |
| 234 | /* GPP_D22: Not Connected */ |
| 235 | PAD_NC(GPP_D22, DN_20K), |
| 236 | /* GPP_D23: Not Connected */ |
| 237 | PAD_NC(GPP_D23, DN_20K), |
| 238 | /* GPP_E0: Not Connected */ |
| 239 | PAD_NC(GPP_E0, DN_20K), |
| 240 | /* GPP_E1: Not Connected */ |
| 241 | PAD_NC(GPP_E1, DN_20K), |
| 242 | /* GPP_E2: SATA2_SSD_Type */ |
| 243 | PAD_NC(GPP_E2, DN_20K), |
| 244 | /* GPP_E3: Not Connected */ |
| 245 | PAD_NC(GPP_E3, DN_20K), |
| 246 | /* GPP_E4: Not Connected */ |
| 247 | PAD_NC(GPP_E4, DN_20K), |
| 248 | /* GPP_E5: Not Connected */ |
| 249 | PAD_NC(GPP_E5, DN_20K), |
| 250 | /* GPP_E6: SATA2_SSD_DEVSLP */ |
| 251 | PAD_CFG_NF(GPP_E6, NONE, PWROK, NF1), |
| 252 | /* GPP_E7: TOUCH_PANEL_INT_N */ |
| 253 | PAD_NC(GPP_E7, DN_20K), |
| 254 | /* GPP_E8: Not Connected */ |
| 255 | PAD_NC(GPP_E8, DN_20K), |
| 256 | /* GPP_E9: USB2_P1_WP1_OC_N */ |
| 257 | PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1), |
| 258 | /* GPP_E10: USB2_P2_WP2_OC_N */ |
| 259 | PAD_CFG_NF(GPP_E10, NONE, DEEP, NF1), |
| 260 | /* GPP_E11: USB2_P3_WP2_OC_N */ |
| 261 | PAD_CFG_NF(GPP_E11, NONE, DEEP, NF1), |
| 262 | /* GPP_E12: Not Connected */ |
| 263 | PAD_NC(GPP_E12, DN_20K), |
| 264 | /* GPP_E13: DDI1_HPD */ |
| 265 | PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1), |
| 266 | /* GPP_E14: DDI2_HPD */ |
| 267 | PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1), |
| 268 | /* E15: SMC_SMI_N */ |
| 269 | PAD_CFG_GPI_SMI_LOW(GPP_E15, NONE, DEEP, EDGE_SINGLE), |
| 270 | /* E16: SMC_SCI_N */ |
| 271 | PAD_CFG_GPI_SCI_LOW(GPP_E16, NONE, PLTRST, LEVEL), |
| 272 | /* GPP_E17: EDP_HPD */ |
| 273 | PAD_CFG_NF(GPP_E17, NONE, DEEP, NF1), |
| 274 | /* GPP_E18: DDI1_DDC_SCL */ |
| 275 | PAD_CFG_NF(GPP_E18, NONE, DEEP, NF1), |
| 276 | /* GPP_E19: DDI1_DDC_SDA */ |
| 277 | PAD_CFG_NF(GPP_E19, DN_20K, DEEP, NF1), |
| 278 | /* GPP_E20: Not Connected */ |
| 279 | PAD_NC(GPP_E20, DN_20K), |
| 280 | /* GPP_E21: DDI2_DDC_SDA */ |
| 281 | PAD_NC(GPP_E21, DN_20K), |
| 282 | /* GPP_E22: Not Connected */ |
| 283 | PAD_NC(GPP_E22, DN_20K), |
| 284 | /* GPP_E23: TOUCH_PANEL_RESET_N */ |
| 285 | PAD_NC(GPP_E23, DN_20K), |
| 286 | /* GPP_F0: Not Connected */ |
| 287 | PAD_NC(GPP_F0, DN_20K), |
| 288 | /* GPP_F1: Not Connected */ |
| 289 | PAD_NC(GPP_F1, DN_20K), |
| 290 | /* GPP_F2: Not Connected */ |
| 291 | PAD_NC(GPP_F2, DN_20K), |
| 292 | /* GPP_F3: Not Connected */ |
| 293 | PAD_NC(GPP_F3, DN_20K), |
| 294 | /* GPP_F4: GSENSOR_I2C_SDA */ |
| 295 | PAD_NC(GPP_F4, DN_20K), |
| 296 | /* GPP_F5: GSENSOR_I2C_SCL */ |
| 297 | PAD_NC(GPP_F5, DN_20K), |
| 298 | /* GPP_F6: Not Connected */ |
| 299 | PAD_NC(GPP_F6, DN_20K), |
| 300 | /* GPP_F7: Not Connected */ |
| 301 | PAD_NC(GPP_F7, DN_20K), |
| 302 | /* GPP_F8: Not Connected */ |
| 303 | PAD_NC(GPP_F8, NONE), |
| 304 | /* GPP_F9: Not Connected */ |
| 305 | PAD_NC(GPP_F9, NONE), |
| 306 | /* GPP_F10: ACCEL2_INT */ |
| 307 | PAD_NC(GPP_F10, DN_20K), |
| 308 | /* GPP_F11: ACCEL1_INT */ |
| 309 | PAD_NC(GPP_F11, DN_20K), |
| 310 | /* GPP_F12: Not Connected */ |
| 311 | PAD_NC(GPP_F12, DN_20K), |
| 312 | /* GPP_F13: Not Connected */ |
| 313 | PAD_NC(GPP_F13, DN_20K), |
| 314 | /* GPP_F14: Not Connected */ |
| 315 | PAD_NC(GPP_F14, DN_20K), |
| 316 | /* GPP_F15: Not Connected */ |
| 317 | PAD_NC(GPP_F15, DN_20K), |
| 318 | /* GPP_F16: Not Connected */ |
| 319 | PAD_NC(GPP_F16, DN_20K), |
| 320 | /* GPP_F17: Not Connected */ |
| 321 | PAD_NC(GPP_F17, DN_20K), |
| 322 | /* GPP_F18: Not Connected */ |
| 323 | PAD_NC(GPP_F18, DN_20K), |
| 324 | /* GPP_F19: Not Connected */ |
| 325 | PAD_NC(GPP_F19, DN_20K), |
| 326 | /* GPP_F20: Not Connected */ |
| 327 | PAD_NC(GPP_F20, DN_20K), |
| 328 | /* GPP_F21: Not Connected */ |
| 329 | PAD_NC(GPP_F21, DN_20K), |
| 330 | /* GPP_F22: Not Connected */ |
| 331 | PAD_NC(GPP_F22, DN_20K), |
| 332 | /* GPP_F23: Not Connected */ |
| 333 | PAD_NC(GPP_F23, DN_20K), |
| 334 | /* GPP_G0: Not Connected */ |
| 335 | PAD_NC(GPP_G0, NONE), |
| 336 | /* GPP_G1: Not Connected */ |
| 337 | PAD_NC(GPP_G1, NONE), |
| 338 | /* GPP_G2: Not Connected */ |
| 339 | PAD_NC(GPP_G2, NONE), |
| 340 | /* GPP_G3: Not Connected */ |
| 341 | PAD_NC(GPP_G3, NONE), |
| 342 | /* GPP_G4: Not Connected */ |
| 343 | PAD_NC(GPP_G4, NONE), |
| 344 | /* GPP_G5: Not Connected */ |
| 345 | PAD_NC(GPP_G5, NONE), |
| 346 | /* GPP_G6: Not Connected */ |
| 347 | PAD_NC(GPP_G6, NONE), |
| 348 | /* GPP_G7: Not Connected */ |
| 349 | PAD_NC(GPP_G7, NONE), |
| 350 | }; |
| 351 | |
| 352 | const struct pad_config *variant_gpio_table(size_t *num) |
| 353 | { |
| 354 | *num = ARRAY_SIZE(gpio_table); |
| 355 | return gpio_table; |
| 356 | } |