Michał Kopeć | cce6dfb | 2023-09-23 14:48:25 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <mainboard/gpio.h> |
| 4 | #include <soc/gpio.h> |
| 5 | |
| 6 | /* Pad configuration was generated automatically using intelp2m utility */ |
| 7 | static const struct pad_config gpio_table[] = { |
Michał Kopeć | cce6dfb | 2023-09-23 14:48:25 +0200 | [diff] [blame] | 8 | /* ------- GPIO Community 0 ------- */ |
| 9 | |
| 10 | /* ------- GPIO Group GPP_A ------- */ |
| 11 | |
| 12 | PAD_CFG_NF(GPP_A0, NONE, PLTRST, NF1), |
| 13 | PAD_CFG_NF(GPP_A1, UP_20K, PLTRST, NF1), |
| 14 | PAD_CFG_NF(GPP_A2, UP_20K, PLTRST, NF1), |
| 15 | PAD_CFG_NF(GPP_A3, UP_20K, PLTRST, NF1), |
| 16 | PAD_CFG_NF(GPP_A4, UP_20K, PLTRST, NF1), |
| 17 | PAD_CFG_NF(GPP_A5, NONE, PLTRST, NF1), |
| 18 | PAD_CFG_NF(GPP_A6, NONE, PLTRST, NF1), |
| 19 | PAD_CFG_NF(GPP_A7, NONE, PLTRST, NF1), |
| 20 | PAD_CFG_NF(GPP_A8, NONE, PLTRST, NF1), |
| 21 | PAD_CFG_NF(GPP_A9, DN_20K, PLTRST, NF1), |
| 22 | PAD_CFG_NF(GPP_A10, DN_20K, PLTRST, NF1), |
| 23 | PAD_CFG_NF(GPP_A11, NONE, PLTRST, NF1), |
| 24 | PAD_NC(GPP_A12, NONE), |
| 25 | PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1), |
| 26 | PAD_CFG_NF(GPP_A14, NONE, DEEP, NF1), |
| 27 | PAD_CFG_NF(GPP_A15, UP_20K, DEEP, NF1), |
| 28 | PAD_NC(GPP_A16, NONE), |
| 29 | PAD_CFG_GPO(GPP_A17, 1, PLTRST), |
| 30 | PAD_NC(GPP_A18, NONE), |
| 31 | PAD_CFG_GPI_TRIG_OWN(GPP_A19, NONE, PLTRST, OFF, ACPI), |
| 32 | PAD_NC(GPP_A20, NONE), |
| 33 | PAD_NC(GPP_A21, NONE), |
| 34 | PAD_CFG_GPI_TRIG_OWN(GPP_A22, NONE, PLTRST, OFF, ACPI), |
| 35 | PAD_CFG_GPO(GPP_A23, 1, PLTRST), |
| 36 | |
| 37 | /* ------- GPIO Group GPP_B ------- */ |
| 38 | |
| 39 | PAD_CFG_GPO(GPP_B0, 0, DEEP), |
| 40 | PAD_CFG_GPO(GPP_B1, 0, DEEP), |
| 41 | PAD_CFG_NF(GPP_B2, NONE, PLTRST, NF1), |
| 42 | PAD_CFG_GPI_TRIG_OWN(GPP_B3, NONE, PLTRST, OFF, ACPI), |
| 43 | PAD_CFG_GPI_TRIG_OWN(GPP_B4, NONE, PLTRST, OFF, ACPI), |
| 44 | PAD_NC(GPP_B5, NONE), |
| 45 | PAD_CFG_NF(GPP_B6, NONE, DEEP, NF1), |
| 46 | PAD_NC(GPP_B7, NONE), |
| 47 | PAD_NC(GPP_B8, NONE), |
| 48 | PAD_NC(GPP_B9, NONE), |
| 49 | PAD_CFG_GPI_TRIG_OWN(GPP_B10, NONE, PLTRST, OFF, ACPI), |
| 50 | PAD_CFG_GPO(GPP_B11, 0, DEEP), |
| 51 | PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1), |
| 52 | PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1), |
| 53 | PAD_CFG_NF(GPP_B14, DN_20K, PLTRST, NF1), |
| 54 | PAD_CFG_GPI_TRIG_OWN(GPP_B15, NONE, PLTRST, OFF, ACPI), |
| 55 | PAD_CFG_GPI_TRIG_OWN(GPP_B16, NONE, PLTRST, OFF, ACPI), |
| 56 | PAD_CFG_GPI_TRIG_OWN(GPP_B17, NONE, PLTRST, OFF, ACPI), |
| 57 | PAD_CFG_GPO(GPP_B18, 0, PLTRST), |
| 58 | PAD_CFG_NF(GPP_B19, NONE, PLTRST, NF1), |
| 59 | PAD_CFG_GPI_TRIG_OWN(GPP_B20, NONE, PLTRST, OFF, ACPI), |
| 60 | PAD_CFG_GPI_TRIG_OWN(GPP_B21, NONE, PLTRST, OFF, ACPI), |
| 61 | PAD_CFG_GPO(GPP_B22, 0, PLTRST), |
| 62 | PAD_CFG_NF(GPP_B23, DN_20K, PLTRST, NF1), |
| 63 | |
| 64 | /* ------- GPIO Community 1 ------- */ |
| 65 | |
| 66 | /* ------- GPIO Group GPP_C ------- */ |
| 67 | |
| 68 | PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1), |
| 69 | PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1), |
| 70 | PAD_CFG_GPI_TRIG_OWN(GPP_C2, NONE, DEEP, OFF, ACPI), |
| 71 | PAD_CFG_NF(GPP_C3, NONE, DEEP, NF1), |
| 72 | PAD_CFG_NF(GPP_C4, NONE, DEEP, NF1), |
| 73 | PAD_CFG_NF(GPP_C5, NONE, PLTRST, NF1), |
| 74 | /* GPP_C6 - RESERVED */ |
| 75 | /* GPP_C7 - RESERVED */ |
| 76 | PAD_CFG_GPI_TRIG_OWN(GPP_C8, NONE, PLTRST, OFF, ACPI), |
| 77 | PAD_NC(GPP_C9, NONE), |
| 78 | PAD_NC(GPP_C10, NONE), |
| 79 | PAD_NC(GPP_C11, NONE), |
| 80 | PAD_NC(GPP_C12, NONE), |
| 81 | PAD_CFG_GPI_TRIG_OWN(GPP_C13, NONE, PLTRST, OFF, ACPI), |
| 82 | PAD_NC(GPP_C14, NONE), |
| 83 | PAD_CFG_GPO(GPP_C15, 1, PLTRST), |
| 84 | PAD_CFG_NF(GPP_C16, NONE, DEEP, NF1), |
| 85 | PAD_CFG_NF(GPP_C17, NONE, DEEP, NF1), |
| 86 | PAD_CFG_GPI_TRIG_OWN(GPP_C18, NONE, PLTRST, OFF, ACPI), |
| 87 | PAD_CFG_GPI_TRIG_OWN(GPP_C19, NONE, PLTRST, OFF, ACPI), |
| 88 | PAD_NC(GPP_C22, NONE), |
| 89 | PAD_CFG_GPO(GPP_C23, 0, PLTRST), |
| 90 | |
| 91 | /* ------- GPIO Group GPP_D ------- */ |
| 92 | |
| 93 | PAD_NC(GPP_D0, NONE), |
| 94 | PAD_NC(GPP_D1, NONE), |
| 95 | PAD_NC(GPP_D2, NONE), |
| 96 | PAD_NC(GPP_D3, NONE), |
| 97 | PAD_NC(GPP_D4, NONE), |
| 98 | PAD_NC(GPP_D5, NONE), |
| 99 | PAD_NC(GPP_D6, NONE), |
| 100 | PAD_NC(GPP_D7, NONE), |
| 101 | PAD_NC(GPP_D8, NONE), |
| 102 | PAD_CFG_GPO(GPP_D9, 1, PLTRST), |
| 103 | PAD_CFG_GPO(GPP_D10, 1, PLTRST), |
| 104 | PAD_NC(GPP_D11, NONE), |
| 105 | PAD_NC(GPP_D12, NONE), |
| 106 | PAD_CFG_GPI_TRIG_OWN(GPP_D13, NONE, PLTRST, OFF, ACPI), |
| 107 | PAD_CFG_GPI_TRIG_OWN(GPP_D14, NONE, PLTRST, OFF, ACPI), |
| 108 | PAD_CFG_GPI_TRIG_OWN(GPP_D15, NONE, PLTRST, OFF, ACPI), |
| 109 | PAD_CFG_GPI_TRIG_OWN(GPP_D16, NONE, PLTRST, OFF, ACPI), |
| 110 | PAD_CFG_GPI_TRIG_OWN(GPP_D17, NONE, PLTRST, OFF, ACPI), |
| 111 | PAD_CFG_GPI_TRIG_OWN(GPP_D18, NONE, PLTRST, OFF, ACPI), |
| 112 | PAD_NC(GPP_D19, NONE), |
| 113 | PAD_NC(GPP_D20, NONE), |
| 114 | PAD_NC(GPP_D21, NONE), |
| 115 | PAD_NC(GPP_D22, NONE), |
| 116 | PAD_CFG_GPI_TRIG_OWN(GPP_D23, NONE, PLTRST, OFF, ACPI), |
| 117 | |
| 118 | /* ------- GPIO Group GPP_E ------- */ |
| 119 | |
| 120 | PAD_CFG_GPI_TRIG_OWN(GPP_E0, NONE, PLTRST, OFF, ACPI), |
| 121 | PAD_NC(GPP_E1, NONE), |
| 122 | PAD_CFG_GPI_TRIG_OWN(GPP_E2, NONE, PLTRST, OFF, ACPI), |
| 123 | PAD_CFG_GPI_TRIG_OWN(GPP_E3, NONE, PLTRST, OFF, ACPI), |
| 124 | PAD_NC(GPP_E4, NONE), |
| 125 | PAD_NC(GPP_E5, NONE), |
| 126 | PAD_NC(GPP_E6, NONE), |
| 127 | PAD_CFG_GPI_TRIG_OWN(GPP_E7, NONE, PLTRST, OFF, ACPI), |
| 128 | PAD_CFG_NF(GPP_E8, NONE, PLTRST, NF1), |
| 129 | PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1), |
| 130 | PAD_CFG_NF(GPP_E10, NONE, DEEP, NF1), |
| 131 | PAD_CFG_NF(GPP_E11, NONE, DEEP, NF1), |
| 132 | PAD_CFG_NF(GPP_E12, NONE, DEEP, NF1), |
| 133 | |
| 134 | /* ------- GPIO Group GPP_F ------- */ |
| 135 | |
| 136 | PAD_NC(GPP_F0, NONE), |
| 137 | PAD_CFG_NF(GPP_F1, NONE, DEEP, NF1), |
| 138 | PAD_CFG_NF(GPP_F2, NONE, DEEP, NF1), |
| 139 | PAD_NC(GPP_F3, NONE), |
| 140 | PAD_NC(GPP_F4, NONE), |
| 141 | PAD_CFG_GPI_SCI(GPP_F5, NONE, DEEP, EDGE_SINGLE, NONE), |
| 142 | PAD_CFG_GPI_TRIG_OWN(GPP_F6, NONE, RSMRST, OFF, ACPI), |
| 143 | PAD_NC(GPP_F7, NONE), |
| 144 | PAD_NC(GPP_F8, NONE), |
| 145 | PAD_NC(GPP_F9, NONE), |
| 146 | PAD_CFG_GPI_APIC_HIGH(GPP_F10, NONE, PLTRST), |
| 147 | PAD_CFG_GPI_TRIG_OWN(GPP_F11, NONE, PLTRST, OFF, ACPI), |
| 148 | PAD_CFG_GPI_APIC_HIGH(GPP_F12, NONE, PLTRST), |
| 149 | PAD_CFG_GPI_APIC_HIGH(GPP_F13, NONE, PLTRST), |
| 150 | PAD_CFG_GPI_APIC_HIGH(GPP_F14, NONE, DEEP), |
| 151 | PAD_CFG_NF(GPP_F15, NONE, DEEP, NF1), |
| 152 | PAD_NC(GPP_F16, NONE), |
| 153 | PAD_NC(GPP_F17, NONE), |
| 154 | PAD_NC(GPP_F18, NONE), |
| 155 | PAD_CFG_GPI_TRIG_OWN(GPP_F19, NONE, PLTRST, OFF, ACPI), |
| 156 | PAD_CFG_GPI_TRIG_OWN(GPP_F20, NONE, PLTRST, OFF, ACPI), |
| 157 | PAD_CFG_GPI_TRIG_OWN(GPP_F21, NONE, PLTRST, OFF, ACPI), |
| 158 | PAD_NC(GPP_F22, NONE), |
| 159 | PAD_NC(GPP_F23, NONE), |
| 160 | |
| 161 | /* ------- GPIO Group GPP_G ------- */ |
| 162 | |
| 163 | PAD_NC(GPP_G0, NONE), |
| 164 | PAD_NC(GPP_G1, NONE), |
| 165 | PAD_NC(GPP_G2, NONE), |
| 166 | PAD_NC(GPP_G3, NONE), |
| 167 | PAD_NC(GPP_G4, NONE), |
| 168 | PAD_NC(GPP_G5, NONE), |
| 169 | PAD_NC(GPP_G6, NONE), |
| 170 | PAD_NC(GPP_G7, NONE), |
| 171 | PAD_CFG_NF(GPP_G8, NONE, DEEP, NF1), |
| 172 | PAD_CFG_NF(GPP_G9, NONE, DEEP, NF1), |
| 173 | PAD_CFG_NF(GPP_G10, NONE, DEEP, NF1), |
| 174 | PAD_CFG_NF(GPP_G11, NONE, DEEP, NF1), |
| 175 | PAD_CFG_GPI_TRIG_OWN(GPP_G12, NONE, PLTRST, OFF, ACPI), |
| 176 | PAD_CFG_GPI_TRIG_OWN(GPP_G13, NONE, PLTRST, OFF, ACPI), |
| 177 | PAD_CFG_GPI_TRIG_OWN(GPP_G14, NONE, PLTRST, OFF, ACPI), |
| 178 | PAD_CFG_GPI_TRIG_OWN(GPP_G15, NONE, PLTRST, OFF, ACPI), |
| 179 | PAD_CFG_GPI_TRIG_OWN(GPP_G16, NONE, PLTRST, OFF, ACPI), |
| 180 | PAD_CFG_GPI_TRIG_OWN(GPP_G17, NONE, PLTRST, OFF, ACPI), |
| 181 | PAD_CFG_GPO(GPP_G18, 0, PLTRST), |
| 182 | PAD_CFG_GPI_SCI(GPP_G19, NONE, PLTRST, LEVEL, INVERT), |
| 183 | PAD_CFG_GPI_TRIG_OWN(GPP_G20, NONE, PLTRST, OFF, ACPI), |
| 184 | PAD_CFG_GPI_TRIG_OWN(GPP_G21, NONE, PLTRST, OFF, ACPI), |
| 185 | PAD_NC(GPP_G22, NONE), |
| 186 | PAD_NC(GPP_G23, NONE), |
| 187 | |
| 188 | /* ------- GPIO Group GPP_H ------- */ |
| 189 | |
| 190 | PAD_NC(GPP_H0, NONE), |
| 191 | PAD_NC(GPP_H1, NONE), |
| 192 | PAD_NC(GPP_H2, NONE), |
| 193 | PAD_NC(GPP_H3, NONE), |
| 194 | PAD_CFG_GPI_TRIG_OWN(GPP_H4, NONE, PLTRST, OFF, ACPI), |
| 195 | PAD_CFG_NF(GPP_H5, NONE, DEEP, NF1), |
| 196 | PAD_CFG_GPI_TRIG_OWN(GPP_H6, NONE, PLTRST, OFF, ACPI), |
| 197 | PAD_NC(GPP_H7, NONE), |
| 198 | PAD_NC(GPP_H8, NONE), |
| 199 | PAD_CFG_GPI_TRIG_OWN(GPP_H9, NONE, PLTRST, OFF, ACPI), |
| 200 | PAD_NC(GPP_H10, NONE), |
| 201 | PAD_CFG_GPO(GPP_H11, 1, PLTRST), |
| 202 | PAD_CFG_GPO(GPP_H12, 0, PLTRST), |
| 203 | PAD_NC(GPP_H13, NONE), |
| 204 | PAD_NC(GPP_H14, NONE), |
| 205 | PAD_NC(GPP_H15, NONE), |
| 206 | PAD_NC(GPP_H16, NONE), |
| 207 | PAD_NC(GPP_H17, NONE), |
| 208 | PAD_NC(GPP_H18, NONE), |
| 209 | PAD_CFG_GPI_TRIG_OWN(GPP_H19, NONE, PLTRST, OFF, ACPI), |
| 210 | PAD_CFG_GPI_TRIG_OWN(GPP_H20, NONE, PLTRST, OFF, ACPI), |
| 211 | PAD_CFG_GPO(GPP_H21, 1, PLTRST), |
| 212 | PAD_CFG_GPI_TRIG_OWN(GPP_H22, NONE, PLTRST, OFF, ACPI), |
| 213 | PAD_CFG_GPI_TRIG_OWN(GPP_H23, NONE, PLTRST, OFF, ACPI), |
| 214 | |
| 215 | /* ------- GPIO Community 2 ------- */ |
| 216 | |
| 217 | /* -------- GPIO Group GPD -------- */ |
| 218 | |
| 219 | PAD_CFG_GPI_TRIG_OWN(GPD0, NONE, PLTRST, OFF, ACPI), |
| 220 | PAD_CFG_GPI_TRIG_OWN(GPD1, NONE, PWROK, OFF, ACPI), |
| 221 | PAD_CFG_NF(GPD2, DN_20K, PWROK, NF1), |
| 222 | PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1), |
| 223 | PAD_CFG_NF(GPD4, NONE, PWROK, NF1), |
| 224 | PAD_CFG_NF(GPD5, NONE, PWROK, NF1), |
| 225 | PAD_CFG_NF(GPD6, NONE, PWROK, NF1), |
| 226 | PAD_CFG_GPO(GPD7, 1, PWROK), |
| 227 | PAD_CFG_NF(GPD8, NONE, PWROK, NF1), |
| 228 | PAD_CFG_NF(GPD9, NONE, PWROK, NF1), |
| 229 | PAD_CFG_NF(GPD10, NONE, PWROK, NF1), |
| 230 | PAD_CFG_NF(GPD11, NONE, PWROK, NF1), |
| 231 | |
| 232 | /* ------- GPIO Community 3 ------- */ |
| 233 | |
| 234 | /* ------- GPIO Group GPP_I ------- */ |
| 235 | |
| 236 | PAD_CFG_NF(GPP_I0, NONE, PLTRST, NF1), |
| 237 | PAD_CFG_NF(GPP_I1, NONE, PLTRST, NF1), |
| 238 | PAD_CFG_NF(GPP_I2, NONE, PLTRST, NF1), |
| 239 | PAD_CFG_GPI_SMI(GPP_I3, NONE, PLTRST, EDGE_SINGLE, NONE), |
| 240 | PAD_CFG_GPI_TRIG_OWN(GPP_I4, NONE, PLTRST, OFF, ACPI), |
| 241 | PAD_CFG_NF(GPP_I5, NONE, PLTRST, NF1), |
| 242 | PAD_CFG_NF(GPP_I6, DN_20K, PLTRST, NF1), |
| 243 | PAD_CFG_NF(GPP_I7, NONE, PLTRST, NF1), |
| 244 | PAD_CFG_NF(GPP_I8, DN_20K, PLTRST, NF1), |
| 245 | PAD_CFG_NF(GPP_I9, NONE, PLTRST, NF1), |
| 246 | PAD_CFG_NF(GPP_I10, DN_20K, PLTRST, NF1), |
| 247 | }; |
| 248 | |
| 249 | void mainboard_configure_gpios(void) |
| 250 | { |
| 251 | gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); |
| 252 | } |