Angel Pons | 2e8a4b0 | 2020-04-05 13:22:54 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef STOUT_GPIO_H |
| 4 | #define STOUT_GPIO_H |
| 5 | |
Patrick Rudolph | e8e66f4 | 2016-02-06 17:42:42 +0100 | [diff] [blame] | 6 | #include <southbridge/intel/common/gpio.h> |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 7 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 8 | static const struct pch_gpio_set1 pch_gpio_set1_mode = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 9 | .gpio0 = GPIO_MODE_GPIO, /* GPIO0 */ |
| 10 | .gpio1 = GPIO_MODE_GPIO, /* SIO_EXT_SMI# */ |
| 11 | .gpio2 = GPIO_MODE_NONE, /* NOT USED */ |
| 12 | .gpio3 = GPIO_MODE_NONE, /* NOT USED */ |
| 13 | .gpio4 = GPIO_MODE_NONE, /* NOT USED */ |
| 14 | .gpio5 = GPIO_MODE_GPIO, /* INTH# */ |
| 15 | .gpio6 = GPIO_MODE_GPIO, /* SIO_EXT_SCI# */ |
| 16 | .gpio7 = GPIO_MODE_GPIO, /* GE_SCR_WP# */ |
| 17 | .gpio8 = GPIO_MODE_NONE, /* NOT USED */ |
| 18 | .gpio9 = GPIO_MODE_NATIVE, /* USB_OC5# */ |
| 19 | .gpio10 = GPIO_MODE_NATIVE, /* USB_OC6# */ |
| 20 | .gpio11 = GPIO_MODE_NATIVE, /* SMBALERT# */ |
| 21 | .gpio12 = GPIO_MODE_GPIO, /* GPIO12 */ |
| 22 | .gpio13 = GPIO_MODE_GPIO, /* GPIO13 */ |
| 23 | .gpio14 = GPIO_MODE_NATIVE, /* USB_OC7# */ |
| 24 | .gpio15 = GPIO_MODE_GPIO, /* GPIO15 */ |
| 25 | .gpio16 = GPIO_MODE_GPIO, /* WWAN_LED_ON */ |
| 26 | .gpio17 = GPIO_MODE_GPIO, /* WLAN_LED_ON */ |
| 27 | .gpio18 = GPIO_MODE_NATIVE, /* PCIE_CLKREQ_WLAN# */ |
| 28 | .gpio19 = GPIO_MODE_GPIO, /* BBS_BIT0 */ |
| 29 | .gpio20 = GPIO_MODE_NATIVE, /* PCIE_CLKREQ_CARD# */ |
| 30 | .gpio21 = GPIO_MODE_GPIO, /* BT_DET# / TP29 */ |
| 31 | .gpio22 = GPIO_MODE_GPIO, /* MODEL_ID0 */ |
| 32 | .gpio23 = GPIO_MODE_GPIO, /* LCD_BK_OFF */ |
| 33 | .gpio24 = GPIO_MODE_NATIVE, /* GPIO24 */ |
| 34 | .gpio25 = GPIO_MODE_NATIVE, /* PCIE_REQ_WWAN# / TP89 */ |
| 35 | .gpio26 = GPIO_MODE_NATIVE, /* CLK_PCIE_REQ4# / TP59 */ |
| 36 | .gpio27 = GPIO_MODE_GPIO, /* MSATA_DTCT# */ |
| 37 | .gpio28 = GPIO_MODE_GPIO, /* PLL_ODVR_EN */ |
| 38 | .gpio29 = GPIO_MODE_GPIO, /* WLAN_AOAC_ON */ |
| 39 | .gpio30 = GPIO_MODE_NATIVE, /* SUS_PWR_ACK */ |
| 40 | .gpio31 = GPIO_MODE_NATIVE, /* AC_PRESENT */ |
| 41 | }; |
| 42 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 43 | static const struct pch_gpio_set1 pch_gpio_set1_direction = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 44 | /* |
| 45 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 46 | * direction configured. |
| 47 | */ |
| 48 | .gpio0 = GPIO_DIR_OUTPUT, |
| 49 | .gpio1 = GPIO_DIR_INPUT, |
| 50 | .gpio2 = GPIO_DIR_INPUT, |
| 51 | .gpio3 = GPIO_DIR_INPUT, |
| 52 | .gpio4 = GPIO_DIR_INPUT, |
| 53 | .gpio5 = GPIO_DIR_OUTPUT, |
| 54 | .gpio6 = GPIO_DIR_INPUT, |
| 55 | .gpio7 = GPIO_DIR_INPUT, |
| 56 | .gpio8 = GPIO_DIR_INPUT, |
| 57 | |
| 58 | .gpio12 = GPIO_DIR_OUTPUT, |
| 59 | .gpio13 = GPIO_DIR_OUTPUT, |
| 60 | |
| 61 | .gpio15 = GPIO_DIR_INPUT, |
| 62 | .gpio16 = GPIO_DIR_OUTPUT, |
| 63 | .gpio17 = GPIO_DIR_OUTPUT, |
| 64 | |
| 65 | .gpio19 = GPIO_DIR_OUTPUT, |
| 66 | |
| 67 | .gpio21 = GPIO_DIR_OUTPUT, |
| 68 | .gpio22 = GPIO_DIR_INPUT, |
| 69 | .gpio23 = GPIO_DIR_OUTPUT, |
| 70 | |
| 71 | .gpio27 = GPIO_DIR_INPUT, |
| 72 | .gpio28 = GPIO_DIR_OUTPUT, |
| 73 | .gpio29 = GPIO_DIR_OUTPUT, |
| 74 | }; |
| 75 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 76 | static const struct pch_gpio_set1 pch_gpio_set1_level = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 77 | /* |
| 78 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 79 | * level set. |
| 80 | */ |
| 81 | .gpio0 = GPIO_LEVEL_HIGH, |
| 82 | .gpio1 = GPIO_LEVEL_LOW, |
| 83 | .gpio2 = GPIO_LEVEL_LOW, |
| 84 | .gpio3 = GPIO_LEVEL_LOW, |
| 85 | .gpio4 = GPIO_LEVEL_LOW, |
| 86 | .gpio5 = GPIO_LEVEL_HIGH, |
| 87 | .gpio6 = GPIO_LEVEL_LOW, |
| 88 | .gpio7 = GPIO_LEVEL_HIGH, |
| 89 | .gpio8 = GPIO_LEVEL_LOW, |
| 90 | |
| 91 | .gpio12 = GPIO_LEVEL_LOW, |
| 92 | .gpio13 = GPIO_LEVEL_LOW, |
| 93 | |
| 94 | .gpio15 = GPIO_LEVEL_LOW, |
| 95 | .gpio16 = GPIO_LEVEL_HIGH, |
| 96 | .gpio17 = GPIO_LEVEL_LOW, |
| 97 | |
| 98 | .gpio19 = GPIO_LEVEL_LOW, |
| 99 | |
| 100 | .gpio21 = GPIO_LEVEL_LOW, |
| 101 | .gpio22 = GPIO_LEVEL_LOW, |
| 102 | .gpio23 = GPIO_LEVEL_LOW, |
| 103 | |
| 104 | .gpio27 = GPIO_LEVEL_LOW, |
| 105 | .gpio28 = GPIO_LEVEL_HIGH, |
| 106 | .gpio29 = GPIO_LEVEL_HIGH, |
| 107 | }; |
| 108 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 109 | static const struct pch_gpio_set1 pch_gpio_set1_invert = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 110 | .gpio1 = GPIO_INVERT, |
| 111 | .gpio6 = GPIO_INVERT, |
| 112 | .gpio8 = GPIO_INVERT, |
| 113 | }; |
| 114 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 115 | static const struct pch_gpio_set2 pch_gpio_set2_mode = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 116 | .gpio32 = GPIO_MODE_NATIVE, /* PCI_CLKRUN# */ |
| 117 | .gpio33 = GPIO_MODE_GPIO, /* GPIO33 */ |
| 118 | .gpio34 = GPIO_MODE_GPIO, /* CCD_ON */ |
| 119 | .gpio35 = GPIO_MODE_GPIO, /* BT_ON */ |
| 120 | .gpio36 = GPIO_MODE_NONE, /* NOT USED */ |
| 121 | .gpio37 = GPIO_MODE_NONE, /* NOT USED */ |
| 122 | .gpio38 = GPIO_MODE_NONE, /* NOT USED */ |
| 123 | .gpio39 = GPIO_MODE_NONE, /* NOT USED */ |
| 124 | .gpio40 = GPIO_MODE_GPIO, /* USB_OC1# */ |
| 125 | .gpio41 = GPIO_MODE_GPIO, /* USB_OC2# */ |
| 126 | .gpio42 = GPIO_MODE_NATIVE, /* USB_OC3# */ |
| 127 | .gpio43 = GPIO_MODE_NATIVE, /* USB_OC4_AUO4# */ |
| 128 | .gpio44 = GPIO_MODE_NATIVE, /* PCIE_CLKREQ_LAN# */ |
| 129 | .gpio45 = GPIO_MODE_NATIVE, /* PCIECLKRQ6# / TP48 */ |
| 130 | .gpio46 = GPIO_MODE_NATIVE, /* PCIECLKRQ7# / TP57 */ |
| 131 | .gpio47 = GPIO_MODE_NATIVE, /* CLK_PEGA_REQ# */ |
| 132 | .gpio48 = GPIO_MODE_GPIO, /* DIS_BT_ON# */ |
| 133 | .gpio49 = GPIO_MODE_GPIO, /* GPIO49 */ |
| 134 | .gpio50 = GPIO_MODE_NATIVE, /* PCI_REQ1# */ |
| 135 | .gpio51 = GPIO_MODE_GPIO, /* BBS_BIT1 */ |
| 136 | .gpio52 = GPIO_MODE_NATIVE, /* PCI_REQ2# */ |
| 137 | .gpio53 = GPIO_MODE_GPIO, /* PWM_SELECT# / TP44 */ |
| 138 | .gpio54 = GPIO_MODE_GPIO, /* PCI_REQ3# */ |
| 139 | .gpio55 = GPIO_MODE_NATIVE, /* PCI_GNT3# */ |
| 140 | .gpio56 = GPIO_MODE_NATIVE, /* CLK_PEGB_REQ# / TP60 */ |
| 141 | .gpio57 = GPIO_MODE_GPIO, /* PCH_GPIO57 */ |
| 142 | .gpio58 = GPIO_MODE_NATIVE, /* SMB_ME1_CLK */ |
| 143 | .gpio59 = GPIO_MODE_GPIO, /* USB_OC0_1# */ |
| 144 | .gpio60 = GPIO_MODE_GPIO, /* DRAMRST_CNTRL_PCH */ |
| 145 | .gpio61 = GPIO_MODE_GPIO, /* LPCPD# */ |
| 146 | .gpio62 = GPIO_MODE_NATIVE, /* PCH_SUSCLK_L / TP54 */ |
| 147 | .gpio63 = GPIO_MODE_NATIVE, /* TP51 */ |
| 148 | }; |
| 149 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 150 | static const struct pch_gpio_set2 pch_gpio_set2_direction = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 151 | /* |
| 152 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 153 | * direction configured. |
| 154 | */ |
| 155 | .gpio33 = GPIO_DIR_OUTPUT, |
| 156 | .gpio34 = GPIO_DIR_OUTPUT, |
| 157 | .gpio35 = GPIO_DIR_OUTPUT, |
| 158 | .gpio36 = GPIO_DIR_INPUT, |
| 159 | .gpio37 = GPIO_DIR_INPUT, |
| 160 | .gpio38 = GPIO_DIR_INPUT, |
| 161 | .gpio39 = GPIO_DIR_INPUT, |
| 162 | .gpio40 = GPIO_DIR_INPUT, |
| 163 | .gpio41 = GPIO_DIR_INPUT, |
| 164 | |
| 165 | .gpio48 = GPIO_DIR_OUTPUT, |
| 166 | .gpio49 = GPIO_DIR_INPUT, |
| 167 | |
| 168 | .gpio51 = GPIO_DIR_OUTPUT, |
| 169 | |
| 170 | .gpio53 = GPIO_DIR_OUTPUT, |
| 171 | .gpio54 = GPIO_DIR_INPUT, |
| 172 | |
| 173 | .gpio57 = GPIO_DIR_INPUT, |
| 174 | |
| 175 | .gpio59 = GPIO_DIR_INPUT, |
| 176 | .gpio60 = GPIO_DIR_OUTPUT, |
| 177 | .gpio61 = GPIO_DIR_OUTPUT, |
| 178 | }; |
| 179 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 180 | static const struct pch_gpio_set2 pch_gpio_set2_level = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 181 | /* |
| 182 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 183 | * level set. |
| 184 | */ |
| 185 | .gpio33 = GPIO_LEVEL_LOW, |
| 186 | .gpio34 = GPIO_LEVEL_HIGH, |
| 187 | .gpio35 = GPIO_LEVEL_HIGH, |
| 188 | .gpio36 = GPIO_LEVEL_LOW, |
| 189 | .gpio37 = GPIO_LEVEL_LOW, |
| 190 | .gpio38 = GPIO_LEVEL_LOW, |
| 191 | .gpio39 = GPIO_LEVEL_LOW, |
| 192 | .gpio40 = GPIO_LEVEL_HIGH, |
| 193 | .gpio41 = GPIO_LEVEL_LOW, |
| 194 | |
| 195 | .gpio48 = GPIO_LEVEL_LOW, |
| 196 | .gpio49 = GPIO_LEVEL_HIGH, |
| 197 | |
| 198 | .gpio51 = GPIO_LEVEL_HIGH, |
| 199 | |
| 200 | .gpio53 = GPIO_LEVEL_HIGH, |
| 201 | .gpio54 = GPIO_LEVEL_LOW, |
| 202 | |
| 203 | .gpio57 = GPIO_LEVEL_LOW, |
| 204 | |
| 205 | .gpio59 = GPIO_LEVEL_HIGH, |
| 206 | .gpio60 = GPIO_LEVEL_HIGH, |
| 207 | .gpio61 = GPIO_LEVEL_LOW, |
| 208 | }; |
| 209 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 210 | static const struct pch_gpio_set3 pch_gpio_set3_mode = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 211 | .gpio64 = GPIO_MODE_GPIO, /* CLK_FLEX0 / TP38 */ |
| 212 | .gpio65 = GPIO_MODE_GPIO, /* CLK_FLEX1 / TP45 */ |
| 213 | .gpio66 = GPIO_MODE_GPIO, /* CLK_FLEX2 / TP83 */ |
| 214 | .gpio67 = GPIO_MODE_GPIO, /* CLK_FLEX3 / TP82 */ |
| 215 | .gpio68 = GPIO_MODE_GPIO, /* WWAN_DTCT# */ |
| 216 | .gpio69 = GPIO_MODE_GPIO, /* GPIO69 */ |
| 217 | .gpio70 = GPIO_MODE_GPIO, /* WLAN_OFF# */ |
| 218 | .gpio71 = GPIO_MODE_GPIO, /* WWAN_OFF# */ |
| 219 | .gpio72 = GPIO_MODE_GPIO, /* PM_BATLOW# */ |
| 220 | .gpio73 = GPIO_MODE_NATIVE, /* PCIECLKRQ0# / TP39 */ |
| 221 | .gpio74 = GPIO_MODE_NATIVE, /* SML1ALERT#_R / TP56 */ |
| 222 | .gpio75 = GPIO_MODE_NATIVE, /* SMB_ME1_DAT */ |
| 223 | }; |
| 224 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 225 | static const struct pch_gpio_set3 pch_gpio_set3_direction = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 226 | /* |
| 227 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 228 | * direction configured. |
| 229 | */ |
| 230 | .gpio64 = GPIO_DIR_OUTPUT, |
| 231 | .gpio65 = GPIO_DIR_OUTPUT, |
| 232 | .gpio66 = GPIO_DIR_OUTPUT, |
| 233 | .gpio67 = GPIO_DIR_INPUT, |
| 234 | .gpio68 = GPIO_DIR_INPUT, |
| 235 | .gpio69 = GPIO_DIR_OUTPUT, |
| 236 | .gpio70 = GPIO_DIR_OUTPUT, |
| 237 | .gpio71 = GPIO_DIR_OUTPUT, |
| 238 | .gpio72 = GPIO_DIR_OUTPUT, |
| 239 | }; |
| 240 | |
Peter Lemenkov | 6752b615 | 2019-06-15 21:39:32 +0200 | [diff] [blame] | 241 | static const struct pch_gpio_set3 pch_gpio_set3_level = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 242 | /* |
| 243 | * Note: Only gpio configured as "gpio" or "none" need to have the |
| 244 | * level set. |
| 245 | */ |
| 246 | .gpio64 = GPIO_LEVEL_HIGH, |
| 247 | .gpio65 = GPIO_LEVEL_LOW, |
| 248 | .gpio66 = GPIO_LEVEL_HIGH, |
| 249 | .gpio67 = GPIO_LEVEL_LOW, |
| 250 | .gpio68 = GPIO_LEVEL_HIGH, |
| 251 | .gpio69 = GPIO_LEVEL_LOW, |
| 252 | .gpio70 = GPIO_LEVEL_HIGH, |
| 253 | .gpio71 = GPIO_LEVEL_HIGH, |
| 254 | .gpio72 = GPIO_LEVEL_HIGH, |
| 255 | }; |
| 256 | |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 257 | const struct pch_gpio_map mainboard_gpio_map = { |
Stefan Reinauer | b7ecf6d | 2013-03-13 17:13:32 -0700 | [diff] [blame] | 258 | .set1 = { |
| 259 | .mode = &pch_gpio_set1_mode, |
| 260 | .direction = &pch_gpio_set1_direction, |
| 261 | .level = &pch_gpio_set1_level, |
| 262 | .invert = &pch_gpio_set1_invert, |
| 263 | }, |
| 264 | .set2 = { |
| 265 | .mode = &pch_gpio_set2_mode, |
| 266 | .direction = &pch_gpio_set2_direction, |
| 267 | .level = &pch_gpio_set2_level, |
| 268 | }, |
| 269 | .set3 = { |
| 270 | .mode = &pch_gpio_set3_mode, |
| 271 | .direction = &pch_gpio_set3_direction, |
| 272 | .level = &pch_gpio_set3_level, |
| 273 | }, |
| 274 | }; |
| 275 | #endif |