Angel Pons | 2de6bdf | 2020-04-05 13:21:00 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 3 | |
| 4 | #include <mainboard/google/cyan/irqroute.h> |
| 5 | #include <soc/gpio.h> |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 6 | |
| 7 | /* South East Community */ |
| 8 | static const struct soc_gpio_map gpse_gpio_map[] = { |
| 9 | Native_M1,/* MF_PLT_CLK0 */ |
| 10 | GPIO_NC, /* 01 PWM1 */ |
| 11 | GPIO_INPUT_NO_PULL, /* 02 MF_PLT_CLK1, RAMID2 */ |
| 12 | GPIO_NC, /* 03 MF_PLT_CLK4 */ |
| 13 | GPIO_NC, /* 04 MF_PLT_CLK3 */ |
| 14 | GPIO_NC, /* PWM0 05 */ |
| 15 | GPIO_NC, /* 06 MF_PLT_CLK5 */ |
| 16 | GPIO_NC, /* 07 MF_PLT_CLK2 */ |
| 17 | GPIO_NC, /* 15 SDMMC2_D3_CD_B */ |
| 18 | Native_M1, /* 16 SDMMC1_CLK */ |
| 19 | NATIVE_PU20K(1), /* 17 SDMMC1_D0 */ |
| 20 | GPIO_NC, /* 18 SDMMC2_D1 */ |
| 21 | GPIO_NC, /* 19 SDMMC2_CLK */ |
| 22 | NATIVE_PU20K(1),/* 20 SDMMC1_D2 */ |
| 23 | GPIO_NC, /* 21 SDMMC2_D2 */ |
| 24 | GPIO_NC, /* 22 SDMMC2_CMD */ |
| 25 | NATIVE_PU20K(1), /* 23 SDMMC1_CMD */ |
| 26 | NATIVE_PU20K(1), /* 24 SDMMC1_D1 */ |
| 27 | GPIO_NC, /* 25 SDMMC2_D0 */ |
| 28 | NATIVE_PU20K(1), /* 26 SDMMC1_D3_CD_B */ |
| 29 | NATIVE_PU20K(1), /* 30 SDMMC3_D1 */ |
| 30 | Native_M1, /* 31 SDMMC3_CLK */ |
| 31 | NATIVE_PU20K(1), /* 32 SDMMC3_D3 */ |
| 32 | NATIVE_PU20K(1), /* 33 SDMMC3_D2 */ |
| 33 | NATIVE_PU20K(1), /* 34 SDMMC3_CMD */ |
| 34 | NATIVE_PU20K(1), /* 35 SDMMC3_D0 */ |
| 35 | NATIVE_PU20K(1), /* 45 MF_LPC_AD2 */ |
| 36 | NATIVE_PU20K(1), /* 46 LPC_CLKRUNB */ |
| 37 | NATIVE_PU20K(1), /* 47 MF_LPC_AD0 */ |
| 38 | Native_M1, /* 48 LPC_FRAMEB */ |
| 39 | Native_M1, /* 49 MF_LPC_CLKOUT1 */ |
| 40 | NATIVE_PU20K(1), /* 50 MF_LPC_AD3 */ |
| 41 | Native_M1, /* 51 MF_LPC_CLKOUT0 */ |
| 42 | NATIVE_PU20K(1), /* 52 MF_LPC_AD1 */ |
| 43 | Native_M1,/* SPI1_MISO */ |
| 44 | Native_M1, /* 61 SPI1_CS0_B */ |
| 45 | Native_M1, /* SPI1_CLK */ |
| 46 | NATIVE_PU20K(1), /* 63 MMC1_D6 */ |
| 47 | Native_M1, /* 62 SPI1_MOSI */ |
| 48 | NATIVE_PU20K(1), /* 65 MMC1_D5 */ |
| 49 | GPIO_NC, /* SPI1_CS1_B 66 */ |
| 50 | NATIVE_PU20K(1), /* 67 MMC1_D4_SD_WE */ |
| 51 | NATIVE_PU20K(1), /* 68 MMC1_D7 */ |
| 52 | GPIO_NC, /* 69 MMC1_RCLK */ |
| 53 | Native_M1, /* 75 GPO USB_OC1_B */ |
| 54 | Native_M1, /* 76 PMU_RESETBUTTON_B */ |
Elyes HAOUAS | a342f39 | 2018-10-17 10:56:26 +0200 | [diff] [blame] | 55 | GPI(trig_edge_both, L0, NA, non_maskable, en_edge_detect, NA, NA), |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 56 | /* GPIO_ALERT 77 */ |
| 57 | Native_M1, /* 78 SDMMC3_PWR_EN_B */ |
| 58 | GPIO_NC, /* 79 GPI ILB_SERIRQ */ |
| 59 | Native_M1, /* 80 USB_OC0_B */ |
| 60 | NATIVE_INT_PU20K(1, L1), /* 81 SDMMC3_CD_B */ |
Matt DeVillier | d6735b0 | 2017-10-07 17:04:29 -0500 | [diff] [blame] | 61 | GPIO_NC, /* 82 spkr assumed gpio number */ |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 62 | Native_M1, /* 83 SUSPWRDNACK */ |
| 63 | SPARE_PIN,/* 84 spare pin */ |
| 64 | Native_M1, /* 85 SDMMC3_1P8_EN */ |
| 65 | GPIO_END |
| 66 | }; |
| 67 | |
| 68 | |
| 69 | /* South West Community */ |
| 70 | static const struct soc_gpio_map gpsw_gpio_map[] = { |
| 71 | GPIO_NC, /* 00 FST_SPI_D2 */ |
| 72 | Native_M1, /* 01 FST_SPI_D0 */ |
| 73 | Native_M1, /* 02 FST_SPI_CLK */ |
| 74 | GPIO_NC, /* 03 FST_SPI_D3 */ |
| 75 | GPIO_NC, /* GPO FST_SPI_CS1_B */ |
| 76 | Native_M1, /* 05 FST_SPI_D1 */ |
| 77 | Native_M1, /* 06 FST_SPI_CS0_B */ |
| 78 | GPIO_NC, /* 07 FST_SPI_CS2_B */ |
| 79 | GPIO_NC, /* 15 UART1_RTS_B */ |
| 80 | Native_M2, /* 16 UART1_RXD */ |
| 81 | GPIO_NC, /* 17 UART2_RXD */ |
| 82 | GPIO_NC, /* 18 UART1_CTS_B */ |
| 83 | GPIO_NC, /* 19 UART2_RTS_B */ |
| 84 | Native_M2, /* 20 UART1_TXD */ |
| 85 | GPIO_NC, /* 21 UART2_TXD */ |
| 86 | GPIO_NC, /* 22 UART2_CTS_B */ |
| 87 | GPIO_NC, /* 30 MF_HDA_CLK */ |
| 88 | GPIO_NC, /* 31 GPIO_SW31/MF_HDA_RSTB */ |
| 89 | GPIO_NC, /* 32 GPIO_SW32 /MF_HDA_SDI0 */ |
| 90 | GPIO_NC, /* 33 MF_HDA_SDO */ |
| 91 | GPIO_NC, /* 34 MF_HDA_DOCKRSTB */ |
| 92 | GPIO_NC, /* 35 MF_HDA_SYNC */ |
| 93 | GPIO_NC, /* 36 GPIO_SW36 MF_HDA_SDI1 */ |
| 94 | GPIO_NC, /* 37 MF_HDA_DOCKENB */ |
| 95 | NATIVE_PU1K_CSEN_INVTX(1), /* 45 I2C5_SDA */ |
| 96 | NATIVE_PU1K_CSEN_INVTX(1), /* 46 I2C4_SDA */ |
| 97 | Native_M2, /* 47 I2C6_SDA */ |
| 98 | NATIVE_PU1K_CSEN_INVTX(1), /* 48 I2C5_SCL */ |
| 99 | GPIO_NC, /* 49 I2C_NFC_SDA */ |
| 100 | NATIVE_PU1K_CSEN_INVTX(1), /* 50 I2C4_SCL */ |
| 101 | GPIO_NC, /* 51 I2C6_SCL */ |
| 102 | GPIO_NC, /* 52 I2C_NFC_SCL */ |
| 103 | NATIVE_PU1K_CSEN_INVTX(1), /* 60 I2C1_SDA */ |
| 104 | GPIO_NC, /* 61 I2C0_SDA */ |
| 105 | GPIO_NC, /* 62 I2C2_SDA */ |
| 106 | NATIVE_PU1K_CSEN_INVTX(1), /* 63 I2C1_SCL */ |
| 107 | GPIO_INPUT_NO_PULL, /* 64 I2C3_SDA RAMID3*/ |
| 108 | GPIO_NC, /* 65 I2C0_SCL */ |
| 109 | GPIO_NC, /* 66 I2C2_SCL */ |
| 110 | GPIO_INPUT_NO_PULL,/* 67 I2C3_SCL,RAMID1 */ |
| 111 | GPIO_OUT_HIGH, /* 75 SATA_GP0 */ |
| 112 | GPIO_NC, /* 76 GPI SATA_GP1 */ |
| 113 | GPIO_INPUT_PU_20K, /* 77 SATA_LEDN, EC_IN_RW */ |
| 114 | GPIO_NC, /* 78 SATA_GP2 */ |
| 115 | GPIO_NC, /* 79 MF_SMB_ALERTB */ |
| 116 | GPIO_INPUT_NO_PULL, /* 80 SATA_GP3,RAMID0 */ |
Elyes HAOUAS | a342f39 | 2018-10-17 10:56:26 +0200 | [diff] [blame] | 117 | Native_M1, /* 81 NFC_DEV_WAKE, MF_SMB_CLK */ |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 118 | Native_M1, /* 82 NFC_FW_DOWNLOAD, MF_SMB_DATA */ |
| 119 | /* Per DE request, change PCIE_CLKREQ0123B to GPIO_INPUT */ |
| 120 | Native_M1, /* 90 PCIE_CLKREQ0B */ |
| 121 | GPIO_INPUT_PU_20K, /* 91 GPI PCIE_CLKREQ1B/LTE_WAKE# */ |
| 122 | Native_M1, /* 92 GP_SSP_2_CLK */ |
| 123 | NATIVE_PU20K(1), /* 93 PCIE_CLKREQ2B/PCIE_CLKREQ_WLAN# */ |
| 124 | Native_M1, /* 94 GP_SSP_2_RXD */ |
Matt DeVillier | eb7940d | 2018-07-31 16:53:43 -0500 | [diff] [blame] | 125 | GPI(trig_edge_both, L1, P_5K_H, 0, en_edge_detect, NA, NA), |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 126 | /* 95 PCIE_CLKREQ3B/AUDIO_CODEC_IRQ */ |
| 127 | Native_M1, /* 96 GP_SSP_2_FS */ |
| 128 | NATIVE_FUNC(1, 0, inv_tx_enable), /* 97 GP_SSP_2f_TXD */ |
| 129 | GPIO_END |
| 130 | }; |
| 131 | |
| 132 | |
| 133 | /* North Community */ |
| 134 | static const struct soc_gpio_map gpn_gpio_map[] = { |
| 135 | GPIO_NC, /* 00 GPIO_DFX0 */ |
| 136 | GPIO_NC, /* 01 GPIO_DFX3 */ |
| 137 | GPIO_NC, /* 02 GPIO_DFX7 */ |
| 138 | GPIO_NC, /* 03 GPIO_DFX1 */ |
| 139 | GPIO_NC, /* 04 GPIO_DFX5 */ |
| 140 | GPIO_NC, /* 05 GPIO_DFX4 */ |
| 141 | GPIO_NC, /* 06 GPIO_DFX8 */ |
| 142 | GPIO_NC, /* 07 GPIO_DFX2 */ |
| 143 | GPIO_NC, /* 08 GPIO_DFX6 */ |
Elyes HAOUAS | a342f39 | 2018-10-17 10:56:26 +0200 | [diff] [blame] | 144 | GPI(trig_edge_low, L8, NA, non_maskable, en_edge_rx_data, |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 145 | UNMASK_WAKE, SCI), /* 15 GPIO_SUS0 */ |
| 146 | GPO_FUNC(NA, NA), /* 16 SEC_GPIO_SUS10 */ |
| 147 | GPI(trig_edge_low, L0, P_1K_H, non_maskable, NA, NA, NA), |
| 148 | /* 17 GPIO_SUS3 */ |
Matt DeVillier | 75476ec | 2019-12-19 01:03:05 -0600 | [diff] [blame^] | 149 | GPI(trig_level_low, L1, P_1K_H, non_maskable, NA, UNMASK_WAKE, NA), |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 150 | /* 18 GPIO_SUS7 */ |
| 151 | GPIO_NC, /* 19 GPIO_SUS1 */ |
| 152 | GPIO_NC, /* 20 GPIO_SUS5 */ |
| 153 | GPIO_NC, /* 21 SEC_GPIO_SUS11 */ |
| 154 | GPIO_NC, /* 22 GPIO_SUS4 */ |
| 155 | GPIO_NC, |
| 156 | /* 23 SEC_GPIO_SUS8 */ |
| 157 | Native_M6, /* 24 GPIO_SUS2 */ |
| 158 | GPIO_INPUT_PU_5K,/* 25 GPIO_SUS6 */ |
| 159 | Native_M1, /* 26 CX_PREQ_B */ |
| 160 | GPIO_NC, /* 27 SEC_GPIO_SUS9 */ |
| 161 | Native_M1, /* 30 TRST_B */ |
| 162 | Native_M1, /* 31 TCK */ |
| 163 | GPIO_SKIP, /* 32 PROCHOT_B */ |
| 164 | GPIO_SKIP, /* 33 SVID0_DATA */ |
| 165 | Native_M1, /* 34 TMS */ |
| 166 | GPIO_NC, /* 35 CX_PRDY_B_2 */ |
| 167 | GPIO_NC, /* 36 TDO_2 */ |
| 168 | Native_M1, /* 37 CX_PRDY_B */ |
| 169 | GPIO_SKIP, /* 38 SVID0_ALERT_B */ |
| 170 | Native_M1, /* 39 TDO */ |
| 171 | GPIO_SKIP, /* 40 SVID0_CLK */ |
| 172 | Native_M1, /* 41 TDI */ |
| 173 | Native_M2, /* 45 GP_CAMERASB05 */ |
| 174 | Native_M2, /* 46 GP_CAMERASB02 */ |
| 175 | Native_M2, /* 47 GP_CAMERASB08 */ |
| 176 | Native_M2, /* 48 GP_CAMERASB00 */ |
| 177 | Native_M2, /* 49 GP_CAMERASBO6 */ |
| 178 | GPIO_NC, /* 50 GP_CAMERASB10 */ |
| 179 | Native_M2, /* 51 GP_CAMERASB03 */ |
| 180 | GPIO_NC, /* 52 GP_CAMERASB09 */ |
| 181 | Native_M2, /* 53 GP_CAMERASB01 */ |
| 182 | Native_M2, /* 54 GP_CAMERASB07 */ |
| 183 | GPIO_NC, /* 55 GP_CAMERASB11 */ |
| 184 | Native_M2, /* 56 GP_CAMERASB04 */ |
| 185 | GPIO_NC, /* 60 PANEL0_BKLTEN */ |
| 186 | GPIO_NC, /* 61 HV_DDI0_HPD */ |
| 187 | NATIVE_PU1K_M1, /* 62 HV_DDI2_DDC_SDA */ |
| 188 | Native_M1, /* 63 PANEL1_BKLTCTL */ |
| 189 | NATIVE_TX_RX_EN, /* 64 HV_DDI1_HPD */ |
| 190 | GPIO_NC, /* 65 PANEL0_BKLTCTL */ |
| 191 | GPIO_NC, /* 66 HV_DDI0_DDC_SDA */ |
| 192 | NATIVE_PU1K_M1, /* 67 HV_DDI2_DDC_SCL */ |
| 193 | NATIVE_TX_RX_EN, /* 68 HV_DDI2_HPD */ |
| 194 | Native_M1, /* 69 PANEL1_VDDEN */ |
| 195 | Native_M1, /* 70 PANEL1_BKLTEN */ |
| 196 | GPIO_NC, /* 71 HV_DDI0_DDC_SCL */ |
| 197 | GPIO_NC, /* 72 PANEL0_VDDEN */ |
| 198 | GPIO_END |
| 199 | }; |
| 200 | |
| 201 | |
| 202 | /* East Community */ |
| 203 | static const struct soc_gpio_map gpe_gpio_map[] = { |
| 204 | Native_M1, /* 00 PMU_SLP_S3_B */ |
| 205 | GPIO_NC, /* 01 PMU_BATLOW_B */ |
| 206 | Native_M1, /* 02 SUS_STAT_B */ |
| 207 | Native_M1, /* 03 PMU_SLP_S0IX_B */ |
| 208 | Native_M1, /* 04 PMU_AC_PRESENT */ |
| 209 | Native_M1, /* 05 PMU_PLTRST_B */ |
| 210 | Native_M1, /* 06 PMU_SUSCLK */ |
| 211 | GPIO_NC, /* 07 PMU_SLP_LAN_B */ |
| 212 | Native_M1, /* 08 PMU_PWRBTN_B */ |
| 213 | Native_M1, /* 09 PMU_SLP_S4_B */ |
| 214 | NATIVE_FUNC(M1, P_1K_H, NA), /* 10 PMU_WAKE_B */ |
| 215 | GPIO_NC, /* 11 PMU_WAKE_LAN_B */ |
| 216 | GPIO_NC, /* 15 MF_GPIO_3 */ |
| 217 | GPIO_NC, /* 16 MF_GPIO_7 */ |
| 218 | GPIO_NC, /* 17 MF_I2C1_SCL */ |
| 219 | GPIO_NC, /* 18 MF_GPIO_1 */ |
| 220 | GPIO_NC, /* 19 MF_GPIO_5 */ |
| 221 | GPIO_NC, /* 20 MF_GPIO_9 */ |
| 222 | GPIO_NC, /* 21 MF_GPIO_0 */ |
| 223 | GPIO_INPUT_PU_20K, /* 22 MF_GPIO_4 */ |
| 224 | GPIO_NC, /* 23 MF_GPIO_8 */ |
| 225 | GPIO_NC, /* 24 MF_GPIO_2 */ |
| 226 | GPIO_NC, /* 25 MF_GPIO_6 */ |
| 227 | GPIO_NC, /* 26 MF_I2C1_SDA */ |
| 228 | GPIO_END |
| 229 | }; |
| 230 | |
| 231 | |
| 232 | static struct soc_gpio_config gpio_config = { |
| 233 | /* BSW */ |
| 234 | .north = gpn_gpio_map, |
| 235 | .southeast = gpse_gpio_map, |
| 236 | .southwest = gpsw_gpio_map, |
| 237 | .east = gpe_gpio_map |
| 238 | }; |
| 239 | |
| 240 | struct soc_gpio_config *mainboard_get_gpios(void) |
| 241 | { |
| 242 | return &gpio_config; |
| 243 | } |