Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 14 | */ |
| 15 | |
Stefan Reinauer | e265d20 | 2013-03-12 14:32:26 -0700 | [diff] [blame] | 16 | #ifndef BASKING_RIDGE_GPIO_H |
| 17 | #define BASKING_RIDGE_GPIO_H |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 18 | |
| 19 | #include "southbridge/intel/lynxpoint/gpio.h" |
| 20 | |
| 21 | const struct pch_gpio_set1 pch_gpio_set1_mode = { |
Aaron Durbin | bdd89d0 | 2012-12-13 16:50:10 -0600 | [diff] [blame] | 22 | .gpio0 = GPIO_MODE_GPIO, /* PCH_GPIO0_R -> S_GPIO -> J9F4 */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 23 | .gpio1 = GPIO_MODE_GPIO, /* SMC_EXTSMI_N */ |
| 24 | .gpio2 = GPIO_MODE_GPIO, /* TP_RSVD_TESTMODE - float */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 25 | .gpio3 = GPIO_MODE_NATIVE, /* PCH_PCI_IRQ_N -> SIO GPIO12/SMI# */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 26 | .gpio4 = GPIO_MODE_GPIO, /* EXTTS_SNI_DRV0_PCH - float */ |
| 27 | .gpio5 = GPIO_MODE_GPIO, /* EXTTS_SNI_DRV1_PCH - float */ |
| 28 | .gpio6 = GPIO_MODE_GPIO, /* DGPU_HPD_INTR_N */ |
| 29 | .gpio7 = GPIO_MODE_GPIO, /* SMC_RUNTIME_SCI_N */ |
| 30 | .gpio8 = GPIO_MODE_GPIO, /* PCH_GPIO8 -> DDR Voltage Select Bit 0 */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 31 | .gpio9 = GPIO_MODE_NATIVE, /* USB_OC_10_11_R_N */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 32 | .gpio10 = GPIO_MODE_NATIVE, /* USB_OC_12_13_R_N */ |
| 33 | .gpio11 = GPIO_MODE_GPIO, /* PCH_GPIO11 -> HOST_ALERT2_N -> PCIE_RSVD_2_N (3GIO_X1) slot 4 */ |
| 34 | .gpio12 = GPIO_MODE_GPIO, /* PM_LANPHY_ENABLE */ |
| 35 | .gpio13 = GPIO_MODE_NATIVE, /* HDA_DOCK_RST_N */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 36 | .gpio14 = GPIO_MODE_GPIO, /* SMC_WAKE_SCI_N (not stuffed) & USB_8_9_PWR */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 37 | .gpio15 = GPIO_MODE_GPIO, /* Always GPIO: HOST_ALERT1_R_N -> PCIE_RSV_1_N */ |
| 38 | .gpio16 = GPIO_MODE_NATIVE, /* SATA_DET4_R_N */ |
| 39 | .gpio17 = GPIO_MODE_GPIO, /* DGPU_PWROK */ |
| 40 | .gpio18 = GPIO_MODE_NATIVE, /* CK_SLOT1_OE_N_R */ |
| 41 | .gpio19 = GPIO_MODE_GPIO, /* BBS_BIT0_R - STRAP */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 42 | .gpio20 = GPIO_MODE_NATIVE, /* CK_SLOT2_OE_N_R */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 43 | .gpio21 = GPIO_MODE_GPIO, /* SATA_DET0_R_N -> J9H4 */ |
| 44 | .gpio22 = GPIO_MODE_GPIO, /* BIOS_REC -> J8G1 */ |
| 45 | .gpio23 = GPIO_MODE_NATIVE, /* PCH_DRQ1_N */ |
| 46 | .gpio24 = GPIO_MODE_GPIO, /* Always GPIO: PCH_GPIO24_R1 -> DDR Voltage Select Bit 2 */ |
| 47 | .gpio25 = GPIO_MODE_NATIVE, /* CK_SLOT3_OE_N */ |
| 48 | .gpio26 = GPIO_MODE_NATIVE, /* CK_SLOT4_OE_N */ |
| 49 | .gpio27 = GPIO_MODE_GPIO, /* Always GPIO: PCH_GPIO_27 -> SMC_WAKE_SCI_N & LANWAKE_N */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 50 | .gpio28 = GPIO_MODE_GPIO, /* Always GPIO: PLL_ODVR_EN -> PCH_AUDIO_PWR_N */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 51 | .gpio29 = GPIO_MODE_NATIVE, /* PCH_SLP_WLAN_N */ |
| 52 | .gpio30 = GPIO_MODE_NATIVE, /* SUS_PWR_ACK_R */ |
| 53 | .gpio31 = GPIO_MODE_NATIVE, /* AC_PRESENT_R */ |
| 54 | }; |
| 55 | |
| 56 | const struct pch_gpio_set1 pch_gpio_set1_direction = { |
| 57 | .gpio0 = GPIO_DIR_INPUT, |
| 58 | .gpio1 = GPIO_DIR_INPUT, |
| 59 | .gpio2 = GPIO_DIR_OUTPUT, |
| 60 | /* .gpio3 NATIVE */ |
| 61 | .gpio4 = GPIO_DIR_OUTPUT, |
| 62 | .gpio5 = GPIO_DIR_OUTPUT, |
| 63 | .gpio6 = GPIO_DIR_INPUT, |
| 64 | .gpio7 = GPIO_DIR_INPUT, |
| 65 | .gpio8 = GPIO_DIR_OUTPUT, |
| 66 | .gpio9 = GPIO_DIR_INPUT, |
| 67 | /* .gpio10 NATIVE */ |
| 68 | .gpio11 = GPIO_DIR_INPUT, |
| 69 | .gpio12 = GPIO_DIR_OUTPUT, |
| 70 | /* .gpio13 NATIVE */ |
| 71 | .gpio14 = GPIO_DIR_INPUT, |
| 72 | .gpio15 = GPIO_DIR_INPUT, |
| 73 | /* .gpio16 NATIVE */ |
| 74 | .gpio17 = GPIO_DIR_INPUT, |
| 75 | /* .gpio18 NATIVE */ |
| 76 | .gpio19 = GPIO_DIR_INPUT, |
| 77 | .gpio20 = GPIO_DIR_INPUT, |
| 78 | .gpio21 = GPIO_DIR_INPUT, |
| 79 | .gpio22 = GPIO_DIR_INPUT, |
| 80 | /* .gpio23 NATIVE */ |
| 81 | .gpio24 = GPIO_DIR_OUTPUT, |
| 82 | /* .gpio25 NATIVE */ |
| 83 | /* .gpio26 NATIVE */ |
| 84 | .gpio27 = GPIO_DIR_INPUT, |
| 85 | .gpio28 = GPIO_DIR_INPUT, |
| 86 | /* .gpio29 NATIVE */ |
| 87 | /* .gpio30 NATIVE */ |
| 88 | /* .gpio31 NATIVE */ |
| 89 | }; |
| 90 | |
| 91 | const struct pch_gpio_set1 pch_gpio_set1_level = { |
| 92 | .gpio2 = GPIO_LEVEL_HIGH, |
| 93 | .gpio4 = GPIO_LEVEL_HIGH, |
| 94 | .gpio5 = GPIO_LEVEL_HIGH, |
| 95 | .gpio8 = GPIO_LEVEL_HIGH, |
| 96 | .gpio12 = GPIO_LEVEL_LOW, |
| 97 | .gpio24 = GPIO_LEVEL_LOW, |
| 98 | }; |
| 99 | |
| 100 | const struct pch_gpio_set1 pch_gpio_set1_invert = { |
| 101 | }; |
| 102 | |
| 103 | const struct pch_gpio_set2 pch_gpio_set2_mode = { |
| 104 | .gpio32 = GPIO_MODE_NATIVE, /* Always GPIO on desktop. Mobile Native. PM_CLKRUN_N */ |
| 105 | .gpio33 = GPIO_MODE_NATIVE, /* HDADOCKEN_R_N */ |
| 106 | .gpio34 = GPIO_MODE_GPIO, /* PCH_GPIO34 -> SATA_PWR_EN0_N */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 107 | .gpio35 = GPIO_MODE_GPIO, /* SATA_PWR_EN1_R_N */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 108 | .gpio36 = GPIO_MODE_NATIVE, /* SATA_ODD_PRSNT_R_N */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 109 | .gpio37 = GPIO_MODE_NATIVE, /* SATA_ODD_DA_N_R */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 110 | .gpio38 = GPIO_MODE_GPIO, /* MFG_MODE */ |
| 111 | .gpio39 = GPIO_MODE_GPIO, /* GFX_CRB_DET */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 112 | .gpio40 = GPIO_MODE_NATIVE, /* USB_OC_2_5_R_N */ |
| 113 | .gpio41 = GPIO_MODE_GPIO, /* USB_0_1_PWR */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 114 | .gpio42 = GPIO_MODE_NATIVE, /* USB_OC_6_7_R_N */ |
| 115 | .gpio43 = GPIO_MODE_NATIVE, /* USB_OSC_8_9_R_N */ |
| 116 | .gpio44 = GPIO_MODE_NATIVE, /* CK_SLOT5_OE_N */ |
| 117 | .gpio45 = GPIO_MODE_NATIVE, /* CK_PCIE_LAN_REQ_N */ |
| 118 | .gpio46 = GPIO_MODE_GPIO, /* PCH_GPIO46_R -> DDR Voltage Select Bit 1 */ |
| 119 | .gpio47 = GPIO_MODE_NATIVE, /* PEGA_CKREQ_N */ |
Aaron Durbin | bdd89d0 | 2012-12-13 16:50:10 -0600 | [diff] [blame] | 120 | .gpio48 = GPIO_MODE_GPIO, /* BIOS_RESP -> J8E3 */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 121 | .gpio49 = GPIO_MODE_GPIO, /* PCH_GP_49 -> CRIT_TEMP_REP_N */ |
| 122 | .gpio50 = GPIO_MODE_GPIO, /* DGPU_HOLD_RST_N */ |
| 123 | .gpio51 = GPIO_MODE_GPIO, /* BBS_BIT1 Strap */ |
| 124 | .gpio52 = GPIO_MODE_GPIO, /* DGPU_SELECT_N */ |
| 125 | .gpio53 = GPIO_MODE_GPIO, /* DGPU_PWM_SELECT_N -> PEG_JTAG5 */ |
| 126 | .gpio54 = GPIO_MODE_GPIO, /* DGPU_PWR_EN_N -> PEG_RSVD5 */ |
| 127 | .gpio55 = GPIO_MODE_GPIO, /* STP_A16OVR Strap */ |
| 128 | .gpio56 = GPIO_MODE_NATIVE, /* MC_CKREQ_N */ |
| 129 | .gpio57 = GPIO_MODE_GPIO, /* Always GPIO. NFC_IRQ_R */ |
| 130 | .gpio58 = GPIO_MODE_NATIVE, /* SML1_CK */ |
| 131 | .gpio59 = GPIO_MODE_NATIVE, /* USB_OC_0_1_R_N */ |
| 132 | .gpio60 = GPIO_MODE_GPIO, /* DRAMRST_CNTRL_PCH */ |
| 133 | .gpio61 = GPIO_MODE_NATIVE, /* PM_SUS_STAT_N */ |
| 134 | .gpio62 = GPIO_MODE_NATIVE, /* SUS_CK */ |
| 135 | .gpio63 = GPIO_MODE_NATIVE, /* SLP_S5_R_N */ |
| 136 | }; |
| 137 | |
| 138 | const struct pch_gpio_set2 pch_gpio_set2_direction = { |
| 139 | /* .gpio32 NATIVE */ |
| 140 | /* .gpio33 NATIVE */ |
| 141 | .gpio34 = GPIO_DIR_OUTPUT, |
| 142 | .gpio35 = GPIO_DIR_OUTPUT, |
| 143 | /* .gpio36 NATIVE */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 144 | /* .gpio37 NATIVE */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 145 | .gpio38 = GPIO_DIR_INPUT, |
| 146 | .gpio39 = GPIO_DIR_INPUT, |
| 147 | /* .gpio40 NATIVE */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 148 | .gpio41 = GPIO_DIR_OUTPUT, |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 149 | /* .gpio42 NATIVE */ |
| 150 | /* .gpio43 NATIVE */ |
| 151 | /* .gpio44 NATIVE */ |
| 152 | /* .gpio45 NATIVE */ |
| 153 | .gpio46 = GPIO_DIR_OUTPUT, |
| 154 | /* .gpio47 NATIVE */ |
| 155 | .gpio48 = GPIO_DIR_INPUT, |
| 156 | .gpio49 = GPIO_DIR_OUTPUT, |
| 157 | .gpio50 = GPIO_DIR_OUTPUT, |
| 158 | .gpio51 = GPIO_DIR_OUTPUT, |
| 159 | .gpio52 = GPIO_DIR_OUTPUT, |
| 160 | .gpio53 = GPIO_DIR_OUTPUT, |
| 161 | .gpio54 = GPIO_DIR_OUTPUT, |
| 162 | .gpio55 = GPIO_DIR_OUTPUT, |
| 163 | /* .gpio56 NATIVE */ |
| 164 | .gpio57 = GPIO_DIR_INPUT, |
| 165 | /* .gpio58 NATIVE */ |
| 166 | /* .gpio59 NATIVE */ |
| 167 | .gpio60 = GPIO_DIR_OUTPUT, |
| 168 | /* .gpio61 NATIVE */ |
| 169 | /* .gpio62 NATIVE */ |
| 170 | /* .gpio63 NATIVE */ |
| 171 | }; |
| 172 | |
| 173 | const struct pch_gpio_set2 pch_gpio_set2_level = { |
| 174 | .gpio34 = GPIO_LEVEL_LOW, |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 175 | .gpio41 = GPIO_LEVEL_HIGH, |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 176 | .gpio35 = GPIO_LEVEL_LOW, |
| 177 | .gpio46 = GPIO_LEVEL_HIGH, |
| 178 | .gpio49 = GPIO_LEVEL_HIGH, |
| 179 | .gpio50 = GPIO_LEVEL_HIGH, |
| 180 | .gpio51 = GPIO_LEVEL_LOW, |
| 181 | .gpio52 = GPIO_LEVEL_LOW, |
| 182 | .gpio53 = GPIO_LEVEL_LOW, |
| 183 | .gpio54 = GPIO_LEVEL_LOW, |
| 184 | .gpio55 = GPIO_LEVEL_LOW, |
| 185 | .gpio60 = GPIO_LEVEL_HIGH, |
| 186 | }; |
| 187 | |
| 188 | const struct pch_gpio_set3 pch_gpio_set3_mode = { |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 189 | .gpio64 = GPIO_MODE_NATIVE, /* CK_PCH_SIO_DOCK_R -> TP_CK_PCI_SIO_DOCK */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 190 | .gpio65 = GPIO_MODE_NATIVE, /* CK_FLEX1 */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 191 | .gpio66 = GPIO_MODE_GPIO, /* CK_FLEX2 */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 192 | .gpio67 = GPIO_MODE_GPIO, /* DGPU_PRSNT_N -> PEG_RSVD3 */ |
| 193 | .gpio68 = GPIO_MODE_GPIO, /* SATA_ODD_PWRGT */ |
Aaron Durbin | bdd89d0 | 2012-12-13 16:50:10 -0600 | [diff] [blame] | 194 | .gpio69 = GPIO_MODE_GPIO, /* SV_DET -> J8E2 */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 195 | .gpio70 = GPIO_MODE_GPIO, /* USB3_DET_P2_N */ |
| 196 | .gpio71 = GPIO_MODE_GPIO, /* USB3_DET_P3_N */ |
| 197 | .gpio72 = GPIO_MODE_NATIVE, /* PM_BATLOW_R_N */ |
| 198 | .gpio73 = GPIO_MODE_NATIVE, /* CK_REQ_DOCK_N */ |
Aaron Durbin | 68724fd | 2012-12-07 09:47:16 -0600 | [diff] [blame] | 199 | .gpio74 = GPIO_MODE_NATIVE, /* PCH_GPIO74_R -> AMB_THM2_R_N (PCHHOT) */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 200 | .gpio75 = GPIO_MODE_NATIVE, /* SM1_DATA */ |
| 201 | }; |
| 202 | |
| 203 | const struct pch_gpio_set3 pch_gpio_set3_direction = { |
| 204 | .gpio64 = GPIO_DIR_OUTPUT, |
| 205 | /* .gpio65 NATIVE */ |
| 206 | .gpio66 = GPIO_DIR_OUTPUT, |
| 207 | .gpio67 = GPIO_DIR_INPUT, |
| 208 | .gpio68 = GPIO_DIR_OUTPUT, |
| 209 | .gpio69 = GPIO_DIR_INPUT, |
| 210 | .gpio70 = GPIO_DIR_INPUT, |
| 211 | .gpio71 = GPIO_DIR_INPUT, |
| 212 | /* .gpio72 NATIVE */ |
| 213 | /* .gpio73 NATIVE */ |
| 214 | /* .gpio74 NATIVE */ |
| 215 | /* .gpio75 NATIVE */ |
| 216 | }; |
| 217 | |
| 218 | const struct pch_gpio_set3 pch_gpio_set3_level = { |
| 219 | .gpio64 = GPIO_LEVEL_LOW, |
| 220 | .gpio66 = GPIO_LEVEL_LOW, |
| 221 | .gpio68 = GPIO_LEVEL_HIGH, |
| 222 | }; |
| 223 | |
Stefan Reinauer | e265d20 | 2013-03-12 14:32:26 -0700 | [diff] [blame] | 224 | const struct pch_gpio_map mainboard_gpio_map = { |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 225 | .set1 = { |
| 226 | .mode = &pch_gpio_set1_mode, |
| 227 | .direction = &pch_gpio_set1_direction, |
| 228 | .level = &pch_gpio_set1_level, |
| 229 | .invert = &pch_gpio_set1_invert, |
| 230 | }, |
| 231 | .set2 = { |
| 232 | .mode = &pch_gpio_set2_mode, |
| 233 | .direction = &pch_gpio_set2_direction, |
| 234 | .level = &pch_gpio_set2_level, |
| 235 | }, |
| 236 | .set3 = { |
| 237 | .mode = &pch_gpio_set3_mode, |
| 238 | .direction = &pch_gpio_set3_direction, |
| 239 | .level = &pch_gpio_set3_level, |
| 240 | }, |
| 241 | }; |
| 242 | |
| 243 | #endif |