Angel Pons | 952f6b0 | 2020-04-05 13:22:37 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <baseboard/variants.h> |
Kyösti Mälkki | 9a3bde0 | 2021-11-06 16:13:15 +0200 | [diff] [blame] | 5 | #include <types.h> |
Kyösti Mälkki | 91c077f | 2021-11-03 18:34:14 +0200 | [diff] [blame] | 6 | #include <vendorcode/google/chromeos/chromeos.h> |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 7 | |
| 8 | /* |
| 9 | * Pad configuration in ramstage. The order largely follows the 'GPIO Muxing' |
| 10 | * table found in EDS vol 1, but some pins aren't grouped functionally in |
| 11 | * the table so those were moved for more logical grouping. |
| 12 | */ |
| 13 | static const struct pad_config gpio_table[] = { |
| 14 | /* PCIE_WAKE[0:3]_N */ |
Vaibhav Shankar | 767009a | 2016-09-15 14:02:54 -0700 | [diff] [blame] | 15 | PAD_CFG_GPI_SCI_LOW(GPIO_205, UP_20K, DEEP, EDGE_SINGLE), /* WLAN */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 16 | PAD_CFG_GPI(GPIO_206, UP_20K, DEEP), /* Unused */ |
| 17 | PAD_CFG_GPI(GPIO_207, UP_20K, DEEP), /* Unused */ |
| 18 | PAD_CFG_GPI(GPIO_208, UP_20K, DEEP), /* Unused */ |
| 19 | |
| 20 | /* EMMC interface */ |
| 21 | PAD_CFG_NF(GPIO_156, DN_20K, DEEP, NF1), /* EMMC_CLK */ |
Lijian Zhao | 55cad16 | 2017-05-04 13:27:09 -0700 | [diff] [blame] | 22 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_157, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D0 */ |
| 23 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_158, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D1 */ |
| 24 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_159, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D2 */ |
| 25 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_160, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D3 */ |
| 26 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_161, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D4 */ |
| 27 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_162, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D5 */ |
| 28 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_163, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D6 */ |
| 29 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_164, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_D7 */ |
| 30 | PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_165, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* EMMC_CMD */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 31 | PAD_CFG_NF(GPIO_182, DN_20K, DEEP, NF1), /* EMMC_RCLK */ |
| 32 | |
| 33 | /* SDIO -- unused. */ |
| 34 | PAD_CFG_GPI(GPIO_166, UP_20K, DEEP), /* SDIO_CLK */ |
| 35 | PAD_CFG_GPI(GPIO_167, UP_20K, DEEP), /* SDIO_D0 */ |
| 36 | /* Configure SDIO to enable power gating */ |
| 37 | PAD_CFG_NF(GPIO_168, UP_20K, DEEP, NF1), /* SDIO_D1 */ |
| 38 | PAD_CFG_GPI(GPIO_169, UP_20K, DEEP), /* SDIO_D2 */ |
| 39 | PAD_CFG_GPI(GPIO_170, UP_20K, DEEP), /* SDIO_D3 */ |
| 40 | PAD_CFG_GPI(GPIO_171, UP_20K, DEEP), /* SDIO_CMD */ |
| 41 | |
| 42 | /* SDCARD */ |
| 43 | /* Pull down clock by 20K */ |
| 44 | PAD_CFG_NF(GPIO_172, DN_20K, DEEP, NF1), /* SDCARD_CLK */ |
| 45 | PAD_CFG_NF(GPIO_173, UP_20K, DEEP, NF1), /* SDCARD_D0 */ |
| 46 | PAD_CFG_NF(GPIO_174, UP_20K, DEEP, NF1), /* SDCARD_D1 */ |
| 47 | PAD_CFG_NF(GPIO_175, UP_20K, DEEP, NF1), /* SDCARD_D2 */ |
| 48 | PAD_CFG_NF(GPIO_176, UP_20K, DEEP, NF1), /* SDCARD_D3 */ |
Aaron Durbin | aa6482e | 2017-01-20 14:03:50 -0600 | [diff] [blame] | 49 | /* Card detect is active LOW with external pull up. */ |
Venkateswarlu Vinjamuri | 415949a | 2017-03-22 18:37:21 -0700 | [diff] [blame] | 50 | PAD_CFG_NF(GPIO_177, NONE, DEEP, NF1), /* SDCARD_CD_N */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 51 | PAD_CFG_NF(GPIO_178, UP_20K, DEEP, NF1), /* SDCARD_CMD */ |
| 52 | /* CLK feedback, internal signal, needs 20K pull down */ |
| 53 | PAD_CFG_NF(GPIO_179, DN_20K, DEEP, NF1), /* SDCARD_CLK_FB */ |
| 54 | /* No h/w write proect for uSD cards, pull down by 20K */ |
| 55 | PAD_CFG_NF(GPIO_186, DN_20K, DEEP, NF1), /* SDCARD_LVL_WP */ |
| 56 | /* EN_SD_SOCKET_PWR_L for SD slot power control. Default on. */ |
| 57 | PAD_CFG_GPO(GPIO_183, 0, DEEP), /* SDIO_PWR_DOWN_N */ |
| 58 | |
| 59 | /* SMBus -- unused. */ |
| 60 | PAD_CFG_GPI(SMB_ALERTB, UP_20K, DEEP), /* SMB_ALERT _N */ |
| 61 | PAD_CFG_GPI(SMB_CLK, UP_20K, DEEP), /* SMB_CLK */ |
| 62 | PAD_CFG_GPI(SMB_DATA, UP_20K, DEEP), /* SMB_DATA */ |
| 63 | |
Michael Niewöhner | 17721be | 2020-12-21 17:09:08 +0100 | [diff] [blame] | 64 | /* |
| 65 | * LPC |
| 66 | * Note: It's unconfirmed if this redundancy to the bootblock table is necessary. |
| 67 | */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 68 | PAD_CFG_NF(LPC_ILB_SERIRQ, UP_20K, DEEP, NF1), /* LPC_SERIRQ */ |
| 69 | PAD_CFG_NF(LPC_CLKOUT0, NONE, DEEP, NF1), /* LPC_CLKOUT0 */ |
| 70 | PAD_CFG_GPI(LPC_CLKOUT1, UP_20K, DEEP), /* LPC_CLKOUT1 -- unused */ |
Shamile Khan | 93c5470 | 2016-09-01 13:36:50 -0700 | [diff] [blame] | 71 | PAD_CFG_NF(LPC_AD0, UP_20K, DEEP, NF1), /* LPC_AD0 */ |
| 72 | PAD_CFG_NF(LPC_AD1, UP_20K, DEEP, NF1), /* LPC_AD1 */ |
| 73 | PAD_CFG_NF(LPC_AD2, UP_20K, DEEP, NF1), /* LPC_AD2 */ |
| 74 | PAD_CFG_NF(LPC_AD3, UP_20K, DEEP, NF1), /* LPC_AD3 */ |
| 75 | PAD_CFG_NF(LPC_CLKRUNB, UP_20K, DEEP, NF1), /* LPC_CLKRUN_N */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 76 | PAD_CFG_NF(LPC_FRAMEB, NATIVE, DEEP, NF1), /* LPC_FRAME_N */ |
| 77 | |
| 78 | /* I2C0 - Audio */ |
| 79 | PAD_CFG_NF(GPIO_124, UP_2K, DEEP, NF1), /* LPSS_I2C0_SDA */ |
| 80 | PAD_CFG_NF(GPIO_125, UP_2K, DEEP, NF1), /* LPSS_I2C0_SCL */ |
| 81 | |
| 82 | /* I2C1 - NFC with external pulls */ |
| 83 | PAD_CFG_NF(GPIO_126, NONE, DEEP, NF1), /* LPSS_I2C1_SDA */ |
| 84 | PAD_CFG_NF(GPIO_127, NONE, DEEP, NF1), /* LPSS_I2C1_SCL */ |
| 85 | |
| 86 | /* I2C2 - TPM */ |
| 87 | PAD_CFG_NF(GPIO_128, UP_2K, DEEP, NF1), /* LPSS_I2C2_SDA */ |
| 88 | PAD_CFG_NF(GPIO_129, UP_2K, DEEP, NF1), /* LPSS_I2C2_SCL */ |
| 89 | |
| 90 | /* I2C3 - touch */ |
| 91 | PAD_CFG_NF(GPIO_130, UP_2K, DEEP, NF1), /* LPSS_I2C3_SDA */ |
| 92 | PAD_CFG_NF(GPIO_131, UP_2K, DEEP, NF1), /* LPSS_I2C3_SCL */ |
| 93 | |
| 94 | /* I2C4 - trackpad */ |
Vaibhav Shankar | f224e83 | 2017-01-27 11:37:30 -0800 | [diff] [blame] | 95 | /* LPSS_I2C4_SDA */ |
| 96 | PAD_CFG_NF_IOSSTATE(GPIO_132, UP_2K, DEEP, NF1, HIZCRx1), |
| 97 | /* LPSS_I2C4_SCL */ |
| 98 | PAD_CFG_NF_IOSSTATE(GPIO_133, UP_2K, DEEP, NF1, HIZCRx1), |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 99 | |
| 100 | /* I2C5 -- pen with external pulls */ |
| 101 | PAD_CFG_NF(GPIO_134, NONE, DEEP, NF1), /* LPSS_I2C5_SDA */ |
| 102 | PAD_CFG_NF(GPIO_135, NONE, DEEP, NF1), /* LPSS_I2C5_SCL */ |
| 103 | |
| 104 | /* I2C6-7 -- unused. */ |
| 105 | PAD_CFG_GPI(GPIO_136, UP_20K, DEEP), /* LPSS_I2C6_SDA */ |
| 106 | PAD_CFG_GPI(GPIO_137, UP_20K, DEEP), /* LPSS_I2C6_SCL */ |
| 107 | PAD_CFG_GPI(GPIO_138, UP_20K, DEEP), /* LPSS_I2C7_SDA */ |
| 108 | PAD_CFG_GPI(GPIO_139, UP_20K, DEEP), /* LPSS_I2C7_SCL */ |
| 109 | |
| 110 | /* Audio Amp - I2S6 */ |
| 111 | PAD_CFG_NF(GPIO_146, NATIVE, DEEP, NF2), /* ISH_GPIO_0 - I2S6_BCLK */ |
| 112 | PAD_CFG_NF(GPIO_147, NATIVE, DEEP, NF2), /* ISH_GPIO_1 - I2S6_WS_SYNC */ |
| 113 | PAD_CFG_GPI(GPIO_148, UP_20K, DEEP), /* ISH_GPIO_2 - unused */ |
| 114 | PAD_CFG_NF(GPIO_149, NATIVE, DEEP, NF2), /* ISH_GPIO_3 - I2S6_SDO */ |
| 115 | |
| 116 | /* NFC Reset */ |
| 117 | PAD_CFG_GPO(GPIO_150, 1, DEEP), /* ISH_GPIO_4 */ |
| 118 | |
| 119 | PAD_CFG_GPI(GPIO_151, UP_20K, DEEP), /* ISH_GPIO_5 - unused */ |
| 120 | |
| 121 | /* Touch enable */ |
| 122 | PAD_CFG_GPO(GPIO_152, 1, DEEP), /* ISH_GPIO_6 */ |
| 123 | |
| 124 | PAD_CFG_GPI(GPIO_153, UP_20K, DEEP), /* ISH_GPIO_7 - unused */ |
| 125 | PAD_CFG_GPI(GPIO_154, UP_20K, DEEP), /* ISH_GPIO_8 - unused */ |
| 126 | PAD_CFG_GPI(GPIO_155, UP_20K, DEEP), /* ISH_GPIO_9 - unused */ |
| 127 | |
| 128 | /* PCIE_CLKREQ[0:3]_N */ |
| 129 | PAD_CFG_NF(GPIO_209, NONE, DEEP, NF1), /* WLAN with external pull */ |
| 130 | PAD_CFG_GPI(GPIO_210, UP_20K, DEEP), /* unused */ |
| 131 | PAD_CFG_GPI(GPIO_211, UP_20K, DEEP), /* unused */ |
| 132 | PAD_CFG_GPI(GPIO_212, UP_20K, DEEP), /* unused */ |
| 133 | |
| 134 | /* OSC_CLK_OUT_[0:4] -- unused */ |
| 135 | PAD_CFG_GPI(OSC_CLK_OUT_0, UP_20K, DEEP), |
| 136 | PAD_CFG_GPI(OSC_CLK_OUT_1, UP_20K, DEEP), |
| 137 | PAD_CFG_GPI(OSC_CLK_OUT_2, UP_20K, DEEP), |
| 138 | PAD_CFG_GPI(OSC_CLK_OUT_3, UP_20K, DEEP), |
| 139 | PAD_CFG_GPI(OSC_CLK_OUT_4, UP_20K, DEEP), |
| 140 | |
| 141 | /* PMU Signals */ |
| 142 | PAD_CFG_GPI(PMU_AC_PRESENT, UP_20K, DEEP), /* PMU_AC_PRESENT - unused */ |
| 143 | PAD_CFG_NF(PMU_BATLOW_B, UP_20K, DEEP, NF1), /* PMU_BATLOW_N */ |
| 144 | PAD_CFG_NF(PMU_PLTRST_B, NONE, DEEP, NF1), /* PMU_PLTRST_N */ |
| 145 | PAD_CFG_NF(PMU_PWRBTN_B, UP_20K, DEEP, NF1), /* PMU_PWRBTN_N */ |
| 146 | PAD_CFG_NF(PMU_RESETBUTTON_B, NONE, DEEP, NF1), /* PMU_RSTBTN_N */ |
| 147 | PAD_CFG_NF_IOSSTATE(PMU_SLP_S0_B, NONE, DEEP, NF1, IGNORE), /* PMU_SLP_S0_N */ |
| 148 | PAD_CFG_NF(PMU_SLP_S3_B, NONE, DEEP, NF1), /* PMU_SLP_S3_N */ |
| 149 | PAD_CFG_NF(PMU_SLP_S4_B, NONE, DEEP, NF1), /* PMU_SLP_S4_N */ |
| 150 | PAD_CFG_NF(PMU_SUSCLK, NONE, DEEP, NF1), /* PMU_SUSCLK */ |
| 151 | PAD_CFG_GPO(PMU_WAKE_B, 1, DEEP), /* EN_PP3300_EMMC */ |
| 152 | PAD_CFG_NF(SUS_STAT_B, NONE, DEEP, NF1), /* SUS_STAT_N */ |
| 153 | PAD_CFG_NF(SUSPWRDNACK, NONE, DEEP, NF1), /* SUSPWRDNACK */ |
| 154 | |
| 155 | /* DDI[0:1] SDA and SCL -- unused */ |
| 156 | PAD_CFG_GPI(GPIO_187, UP_20K, DEEP), /* HV_DDI0_DDC_SDA */ |
| 157 | PAD_CFG_GPI(GPIO_188, UP_20K, DEEP), /* HV_DDI0_DDC_SCL */ |
| 158 | PAD_CFG_GPI(GPIO_189, UP_20K, DEEP), /* HV_DDI1_DDC_SDA */ |
| 159 | PAD_CFG_GPI(GPIO_190, UP_20K, DEEP), /* HV_DDI1_DDC_SCL */ |
| 160 | |
| 161 | /* MIPI I2C -- unused */ |
| 162 | PAD_CFG_GPI(GPIO_191, UP_20K, DEEP), /* MIPI_I2C_SDA */ |
| 163 | PAD_CFG_GPI(GPIO_192, UP_20K, DEEP), /* MIPI_I2C_SCL */ |
| 164 | |
| 165 | /* Panel 0 control */ |
| 166 | PAD_CFG_NF(GPIO_193, NATIVE, DEEP, NF1), /* PNL0_VDDEN */ |
| 167 | PAD_CFG_NF(GPIO_194, NATIVE, DEEP, NF1), /* PNL0_BKLTEN */ |
| 168 | PAD_CFG_NF(GPIO_195, NATIVE, DEEP, NF1), /* PNL0_BKLTCTL */ |
| 169 | |
| 170 | /* Panel 1 control -- unused */ |
| 171 | PAD_CFG_NF(GPIO_196, NATIVE, DEEP, NF1), /* PNL1_VDDEN */ |
| 172 | PAD_CFG_NF(GPIO_197, NATIVE, DEEP, NF1), /* PNL1_BKLTEN */ |
| 173 | PAD_CFG_NF(GPIO_198, NATIVE, DEEP, NF1), /* PNL1_BKLTCTL */ |
| 174 | |
| 175 | /* Hot plug detect. */ |
| 176 | PAD_CFG_NF(GPIO_199, UP_20K, DEEP, NF2), /* HV_DDI1_HPD */ |
| 177 | PAD_CFG_NF(GPIO_200, UP_20K, DEEP, NF2), /* HV_DDI0_HPD */ |
| 178 | |
| 179 | /* MDSI signals -- unused */ |
| 180 | PAD_CFG_GPI(GPIO_201, UP_20K, DEEP), /* MDSI_A_TE */ |
| 181 | PAD_CFG_GPI(GPIO_202, UP_20K, DEEP), /* MDSI_A_TE */ |
| 182 | |
| 183 | /* USB overcurrent pins. */ |
| 184 | PAD_CFG_NF(GPIO_203, UP_20K, DEEP, NF1), /* USB_OC0_N */ |
| 185 | PAD_CFG_NF(GPIO_204, UP_20K, DEEP, NF1), /* USB_OC1_N */ |
| 186 | |
| 187 | /* PMC SPI -- almost entirely unused */ |
| 188 | PAD_CFG_GPI(PMC_SPI_FS0, UP_20K, DEEP), |
| 189 | PAD_CFG_NF(PMC_SPI_FS1, UP_20K, DEEP, NF2), /* HV_DDI2_HPD -- EDP HPD */ |
| 190 | PAD_CFG_GPI(PMC_SPI_FS2, UP_20K, DEEP), |
| 191 | PAD_CFG_GPI(PMC_SPI_RXD, UP_20K, DEEP), |
| 192 | PAD_CFG_GPI(PMC_SPI_TXD, UP_20K, DEEP), |
| 193 | PAD_CFG_GPI(PMC_SPI_CLK, UP_20K, DEEP), |
| 194 | |
| 195 | /* PMIC Signals Unused signals related to an old PMIC interface */ |
| 196 | PAD_CFG_NF_IOSSTATE(PMIC_RESET_B, NATIVE, DEEP, NF1, IGNORE), /* PMIC_RESET_B */ |
| 197 | PAD_CFG_GPI(GPIO_213, NONE, DEEP), /* unused external pull */ |
| 198 | PAD_CFG_GPI(GPIO_214, UP_20K, DEEP), /* unused */ |
| 199 | PAD_CFG_GPI(GPIO_215, UP_20K, DEEP), /* unused */ |
| 200 | PAD_CFG_NF(PMIC_THERMTRIP_B, UP_20K, DEEP, NF1), /* THERMTRIP_N */ |
| 201 | PAD_CFG_GPI(PMIC_STDBY, UP_20K, DEEP), /* unused */ |
| 202 | PAD_CFG_NF(PROCHOT_B, UP_20K, DEEP, NF1), /* PROCHOT_N */ |
| 203 | PAD_CFG_NF(PMIC_I2C_SCL, UP_1K, DEEP, NF1), /* PMIC_I2C_SCL */ |
| 204 | PAD_CFG_NF(PMIC_I2C_SDA, UP_1K, DEEP, NF1), /* PMIC_I2C_SDA */ |
| 205 | |
| 206 | /* I2S1 -- largely unused */ |
| 207 | PAD_CFG_GPI(GPIO_74, UP_20K, DEEP), /* I2S1_MCLK */ |
| 208 | PAD_CFG_GPI(GPIO_75, UP_20K, DEEP), /* I2S1_BCLK -- PCH_WP */ |
| 209 | PAD_CFG_GPO(GPIO_76, 0, DEEP), /* I2S1_WS_SYNC -- SPK_PA_EN */ |
| 210 | PAD_CFG_GPI(GPIO_77, UP_20K, DEEP), /* I2S1_SDI */ |
| 211 | PAD_CFG_GPI(GPIO_78, UP_20K, DEEP), /* I2S1_SDO */ |
| 212 | |
| 213 | /* DMIC or I2S4 */ |
Vaibhav Shankar | c0eae61 | 2017-01-16 14:54:29 -0800 | [diff] [blame] | 214 | /* AVS_DMIC_CLK_A1 */ |
| 215 | PAD_CFG_NF_IOSSTATE(GPIO_79, NATIVE, DEEP, NF1, IGNORE), |
Sathyanarayana Nujella | 2e23700 | 2017-03-27 13:24:16 -0700 | [diff] [blame] | 216 | PAD_CFG_NF(GPIO_80, NATIVE, DEEP, NF1), /* AVS_DMIC_CLK_B1 */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 217 | PAD_CFG_NF(GPIO_81, NATIVE, DEEP, NF1), /* AVS_DMIC_DATA_1 */ |
| 218 | PAD_CFG_GPI(GPIO_82, DN_20K, DEEP), /* unused -- strap */ |
Sathyanarayana Nujella | 50198c1 | 2016-10-31 10:48:43 -0700 | [diff] [blame] | 219 | PAD_CFG_NF(GPIO_83, NATIVE, DEEP, NF1), /* AVS_DMIC_DATA_2 */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 220 | |
| 221 | /* I2S2 -- Headset amp */ |
| 222 | PAD_CFG_NF(GPIO_84, NATIVE, DEEP, NF1), /* AVS_I2S2_MCLK */ |
| 223 | PAD_CFG_NF(GPIO_85, NATIVE, DEEP, NF1), /* AVS_I2S2_BCLK */ |
| 224 | PAD_CFG_NF(GPIO_86, NATIVE, DEEP, NF1), /* AVS_I2S2_SW_SYNC */ |
| 225 | PAD_CFG_NF(GPIO_87, NATIVE, DEEP, NF1), /* AVS_I2S2_SDI */ |
| 226 | PAD_CFG_NF(GPIO_88, NATIVE, DEEP, NF1), /* AVS_I2S2_SDO */ |
| 227 | |
| 228 | /* I2S3 -- largely unused. */ |
| 229 | PAD_CFG_GPI(GPIO_89, UP_20K, DEEP), /* unused */ |
| 230 | PAD_CFG_GPI(GPIO_90, UP_20K, DEEP), /* GPS_HOST_WAKE */ |
| 231 | PAD_CFG_GPO(GPIO_91, 1, DEEP), /* GPS_EN */ |
| 232 | PAD_CFG_GPI(GPIO_92, DN_20K, DEEP), /* unused -- strap */ |
| 233 | |
| 234 | /* Fast SPI */ |
Lijian Zhao | 8b89252 | 2017-01-13 14:01:42 -0800 | [diff] [blame] | 235 | PAD_CFG_NF_IOSSTATE(GPIO_97, NATIVE, DEEP, NF1, IGNORE), /* FST_SPI_CS0_B */ |
| 236 | PAD_CFG_GPI(GPIO_98, UP_20K, DEEP), /* FST_SPI_CS1_B -- unused */ |
| 237 | PAD_CFG_NF_IOSSTATE(GPIO_99, NATIVE, DEEP, NF1, IGNORE), /* FST_SPI_MOSI_IO0 */ |
| 238 | PAD_CFG_NF_IOSSTATE(GPIO_100, NATIVE, DEEP, NF1, IGNORE), /* FST_SPI_MISO_IO1 */ |
Lijian Zhao | 55cad16 | 2017-05-04 13:27:09 -0700 | [diff] [blame] | 239 | PAD_CFG_GPI(GPIO_101, NONE, DEEP), /* FST_IO2 -- MEM_CONFIG0 */ |
| 240 | PAD_CFG_GPI(GPIO_102, NONE, DEEP), /* FST_IO3 -- MEM_CONFIG1 */ |
Lijian Zhao | 8b89252 | 2017-01-13 14:01:42 -0800 | [diff] [blame] | 241 | PAD_CFG_NF_IOSSTATE(GPIO_103, NATIVE, DEEP, NF1, IGNORE), /* FST_SPI_CLK */ |
| 242 | PAD_CFG_NF_IOSSTATE(FST_SPI_CLK_FB, NATIVE, DEEP, NF1, IGNORE), /* FST_SPI_CLK_FB */ |
| 243 | PAD_CFG_NF_IOSSTATE(GPIO_106, NATIVE, DEEP, NF3, IGNORE), /* FST_SPI_CS2_N */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 244 | |
| 245 | /* SIO_SPI_0 - Used for FP */ |
Lijian Zhao | 8b89252 | 2017-01-13 14:01:42 -0800 | [diff] [blame] | 246 | PAD_CFG_NF(GPIO_104, NATIVE, DEEP, NF1), /* SIO_SPI_0_CLK */ |
| 247 | PAD_CFG_NF(GPIO_105, NATIVE, DEEP, NF1), /* SIO_SPI_0_FS0 */ |
| 248 | PAD_CFG_NF(GPIO_109, NATIVE, DEEP, NF1), /* SIO_SPI_0_RXD */ |
| 249 | PAD_CFG_NF(GPIO_110, NATIVE, DEEP, NF1), /* SIO_SPI_0_TXD */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 250 | |
| 251 | /* SIO_SPI_1 -- largely unused */ |
| 252 | PAD_CFG_GPI(GPIO_111, UP_20K, DEEP), /* SIO_SPI_1_CLK */ |
| 253 | PAD_CFG_GPI(GPIO_112, UP_20K, DEEP), /* SIO_SPI_1_FS0 */ |
| 254 | PAD_CFG_GPI(GPIO_113, UP_20K, DEEP), /* SIO_SPI_1_FS1 */ |
| 255 | /* Headset interrupt */ |
| 256 | PAD_CFG_GPI_APIC_LOW(GPIO_116, NONE, DEEP), /* SIO_SPI_1_RXD */ |
| 257 | PAD_CFG_GPI(GPIO_117, UP_20K, DEEP), /* SIO_SPI_1_TXD */ |
| 258 | |
| 259 | /* SIO_SPI_2 -- unused */ |
| 260 | PAD_CFG_GPI(GPIO_118, UP_20K, DEEP), /* SIO_SPI_2_CLK */ |
| 261 | PAD_CFG_GPI(GPIO_119, UP_20K, DEEP), /* SIO_SPI_2_FS0 */ |
| 262 | PAD_CFG_GPI(GPIO_120, UP_20K, DEEP), /* SIO_SPI_2_FS1 */ |
| 263 | PAD_CFG_GPI(GPIO_121, UP_20K, DEEP), /* SIO_SPI_2_FS2 */ |
| 264 | /* WLAN_PE_RST - default to deasserted. */ |
| 265 | PAD_CFG_GPO(GPIO_122, 0, DEEP), /* SIO_SPI_2_RXD */ |
| 266 | PAD_CFG_GPI(GPIO_123, UP_20K, DEEP), /* SIO_SPI_2_TXD */ |
| 267 | |
| 268 | /* Debug tracing. */ |
| 269 | PAD_CFG_GPI(GPIO_0, UP_20K, DEEP), |
| 270 | PAD_CFG_GPI(GPIO_1, UP_20K, DEEP), |
| 271 | PAD_CFG_GPI(GPIO_2, UP_20K, DEEP), |
| 272 | PAD_CFG_GPI_SCI_HIGH(GPIO_3, DN_20K, DEEP, LEVEL), /* FP_INT */ |
| 273 | PAD_CFG_GPI(GPIO_4, UP_20K, DEEP), |
| 274 | PAD_CFG_GPI(GPIO_5, UP_20K, DEEP), |
| 275 | PAD_CFG_GPI(GPIO_6, UP_20K, DEEP), |
| 276 | PAD_CFG_GPI(GPIO_7, UP_20K, DEEP), |
| 277 | PAD_CFG_GPI(GPIO_8, UP_20K, DEEP), |
| 278 | |
| 279 | PAD_CFG_GPI_APIC_LOW(GPIO_9, NONE, DEEP), /* dTPM IRQ */ |
Aaron Durbin | 76069f3 | 2016-12-12 14:12:22 -0600 | [diff] [blame] | 280 | PAD_CFG_GPI(GPIO_10, DN_20K, DEEP), /* Board phase enforcement */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 281 | PAD_CFG_GPI_SCI_LOW(GPIO_11, NONE, DEEP, EDGE_SINGLE), /* EC SCI */ |
| 282 | PAD_CFG_GPI(GPIO_12, UP_20K, DEEP), /* unused */ |
Aaron Durbin | aa6482e | 2017-01-20 14:03:50 -0600 | [diff] [blame] | 283 | PAD_CFG_GPI_APIC_LOW(GPIO_13, NONE, DEEP), /* PEN_INT_ODL */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 284 | PAD_CFG_GPI_APIC_HIGH(GPIO_14, DN_20K, DEEP), /* FP_INT */ |
| 285 | PAD_CFG_GPI_SCI_LOW(GPIO_15, NONE, DEEP, EDGE_SINGLE), /* TRACKPAD_INT_1V8_ODL */ |
| 286 | PAD_CFG_GPI(GPIO_16, UP_20K, DEEP), /* unused */ |
Aaron Durbin | 558c8a5 | 2016-10-27 12:11:15 -0500 | [diff] [blame] | 287 | PAD_CFG_GPI(GPIO_17, UP_20K, DEEP), /* 1 vs 4 DMIC config */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 288 | PAD_CFG_GPI_APIC_LOW(GPIO_18, NONE, DEEP), /* Trackpad IRQ */ |
| 289 | PAD_CFG_GPI(GPIO_19, UP_20K, DEEP), /* unused */ |
| 290 | PAD_CFG_GPI_APIC_LOW(GPIO_20, UP_20K, DEEP), /* NFC IRQ */ |
| 291 | PAD_CFG_GPI_APIC_LOW(GPIO_21, NONE, DEEP), /* Touch IRQ */ |
Vaibhav Shankar | 6e56091 | 2017-01-30 12:18:42 -0800 | [diff] [blame] | 292 | PAD_CFG_GPI_SCI_LOW(GPIO_22, NONE, DEEP, EDGE_SINGLE), /* EC wake */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 293 | PAD_CFG_GPI(GPIO_23, UP_20K, DEEP), /* unused */ |
Aaron Durbin | aa6482e | 2017-01-20 14:03:50 -0600 | [diff] [blame] | 294 | PAD_CFG_GPI(GPIO_24, NONE, DEEP), /* PEN_PDCT_ODL */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 295 | PAD_CFG_GPI(GPIO_25, UP_20K, DEEP), /* unused */ |
| 296 | PAD_CFG_GPI(GPIO_26, UP_20K, DEEP), /* unused */ |
| 297 | PAD_CFG_GPI(GPIO_27, UP_20K, DEEP), /* unused */ |
| 298 | PAD_CFG_GPI_APIC_LOW(GPIO_28, NONE, DEEP), /* TPM IRQ */ |
| 299 | PAD_CFG_GPO(GPIO_29, 1, DEEP), /* FP reset */ |
| 300 | PAD_CFG_GPI_APIC_LOW(GPIO_30, NONE, DEEP), /* KB IRQ */ |
| 301 | PAD_CFG_GPO(GPIO_31, 0, DEEP), /* NFC FW DL */ |
| 302 | PAD_CFG_NF(GPIO_32, NONE, DEEP, NF5), /* SUS_CLK2 */ |
| 303 | PAD_CFG_GPI_APIC_LOW(GPIO_33, NONE, DEEP), /* PMIC IRQ */ |
| 304 | PAD_CFG_GPI(GPIO_34, UP_20K, DEEP), /* unused */ |
| 305 | PAD_CFG_GPO(GPIO_35, 0, DEEP), /* PEN_RESET - active high */ |
| 306 | PAD_CFG_GPO(GPIO_36, 0, DEEP), /* touch reset */ |
| 307 | PAD_CFG_GPI(GPIO_37, UP_20K, DEEP), /* unused */ |
| 308 | |
| 309 | /* LPSS_UART[0:2] */ |
Lijian Zhao | 55cad16 | 2017-05-04 13:27:09 -0700 | [diff] [blame] | 310 | PAD_CFG_GPI(GPIO_38, NONE, DEEP), /* LPSS_UART0_RXD - MEM_CONFIG2*/ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 311 | /* Next 2 are straps. */ |
| 312 | PAD_CFG_GPI(GPIO_39, DN_20K, DEEP), /* LPSS_UART0_TXD - unused */ |
| 313 | PAD_CFG_GPI(GPIO_40, DN_20K, DEEP), /* LPSS_UART0_RTS - unused */ |
| 314 | PAD_CFG_GPI(GPIO_41, NONE, DEEP), /* LPSS_UART0_CTS - EC_IN_RW */ |
| 315 | PAD_CFG_NF(GPIO_42, NATIVE, DEEP, NF1), /* LPSS_UART1_RXD */ |
| 316 | PAD_CFG_NF(GPIO_43, NATIVE, DEEP, NF1), /* LPSS_UART1_TXD */ |
| 317 | PAD_CFG_GPO(GPIO_44, 1, DEEP), /* GPS_RST_ODL */ |
Lijian Zhao | 55cad16 | 2017-05-04 13:27:09 -0700 | [diff] [blame] | 318 | PAD_CFG_GPI(GPIO_45, NONE, DEEP), /* LPSS_UART1_CTS - MEM_CONFIG3 */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 319 | PAD_CFG_NF(GPIO_46, NATIVE, DEEP, NF1), /* LPSS_UART2_RXD */ |
Furquan Shaikh | 6bedbd6 | 2018-10-04 11:11:49 -0700 | [diff] [blame] | 320 | PAD_CFG_NF_IOSSTATE(GPIO_47, NATIVE, DEEP, NF1, Tx1RxDCRx0), /* LPSS_UART2_TXD */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 321 | PAD_CFG_GPI(GPIO_48, UP_20K, DEEP), /* LPSS_UART2_RTS - unused */ |
| 322 | PAD_CFG_GPI_SMI_LOW(GPIO_49, NONE, DEEP, EDGE_SINGLE), /* LPSS_UART2_CTS - EC_SMI_L */ |
| 323 | |
| 324 | /* Camera interface -- completely unused. */ |
| 325 | PAD_CFG_GPI(GPIO_62, UP_20K, DEEP), /* GP_CAMERASB00 */ |
| 326 | PAD_CFG_GPI(GPIO_63, UP_20K, DEEP), /* GP_CAMERASB01 */ |
| 327 | PAD_CFG_GPI(GPIO_64, UP_20K, DEEP), /* GP_CAMERASB02 */ |
| 328 | PAD_CFG_GPI(GPIO_65, UP_20K, DEEP), /* GP_CAMERASB03 */ |
| 329 | PAD_CFG_GPI(GPIO_66, UP_20K, DEEP), /* GP_CAMERASB04 */ |
| 330 | PAD_CFG_GPI(GPIO_67, UP_20K, DEEP), /* GP_CAMERASB05 */ |
| 331 | PAD_CFG_GPI(GPIO_68, UP_20K, DEEP), /* GP_CAMERASB06 */ |
| 332 | PAD_CFG_GPI(GPIO_69, UP_20K, DEEP), /* GP_CAMERASB07 */ |
| 333 | PAD_CFG_GPI(GPIO_70, UP_20K, DEEP), /* GP_CAMERASB08 */ |
| 334 | PAD_CFG_GPI(GPIO_71, UP_20K, DEEP), /* GP_CAMERASB09 */ |
| 335 | PAD_CFG_GPI(GPIO_72, UP_20K, DEEP), /* GP_CAMERASB10 */ |
| 336 | PAD_CFG_GPI(GPIO_73, UP_20K, DEEP), /* GP_CAMERASB11 */ |
| 337 | }; |
| 338 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 339 | const struct pad_config * __weak variant_gpio_table(size_t *num) |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 340 | { |
| 341 | *num = ARRAY_SIZE(gpio_table); |
| 342 | return gpio_table; |
| 343 | } |
| 344 | |
| 345 | /* GPIOs needed prior to ramstage. */ |
| 346 | static const struct pad_config early_gpio_table[] = { |
Michael Niewöhner | 17721be | 2020-12-21 17:09:08 +0100 | [diff] [blame] | 347 | /* LPC */ |
| 348 | PAD_CFG_NF(LPC_ILB_SERIRQ, UP_20K, DEEP, NF1), /* LPC_SERIRQ */ |
| 349 | PAD_CFG_NF(LPC_CLKOUT0, NONE, DEEP, NF1), /* LPC_CLKOUT0 */ |
| 350 | PAD_CFG_GPI(LPC_CLKOUT1, UP_20K, DEEP), /* LPC_CLKOUT1 -- unused */ |
| 351 | PAD_CFG_NF(LPC_AD0, UP_20K, DEEP, NF1), /* LPC_AD0 */ |
| 352 | PAD_CFG_NF(LPC_AD1, UP_20K, DEEP, NF1), /* LPC_AD1 */ |
| 353 | PAD_CFG_NF(LPC_AD2, UP_20K, DEEP, NF1), /* LPC_AD2 */ |
| 354 | PAD_CFG_NF(LPC_AD3, UP_20K, DEEP, NF1), /* LPC_AD3 */ |
| 355 | PAD_CFG_NF(LPC_CLKRUNB, UP_20K, DEEP, NF1), /* LPC_CLKRUN_N */ |
| 356 | PAD_CFG_NF(LPC_FRAMEB, NATIVE, DEEP, NF1), /* LPC_FRAME_N */ |
| 357 | |
Michael Niewöhner | a7bc5b8 | 2020-12-21 03:46:58 +0100 | [diff] [blame] | 358 | /* UART */ |
| 359 | PAD_CFG_NF(GPIO_46, NATIVE, DEEP, NF1), /* LPSS_UART2_RXD */ |
| 360 | PAD_CFG_NF_IOSSTATE(GPIO_47, NATIVE, DEEP, NF1, Tx1RxDCRx0), /* LPSS_UART2_TXD */ |
| 361 | |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 362 | PAD_CFG_GPI(GPIO_75, UP_20K, DEEP), /* I2S1_BCLK -- PCH_WP */ |
Michael Niewöhner | 17721be | 2020-12-21 17:09:08 +0100 | [diff] [blame] | 363 | |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 364 | /* I2C2 - TPM */ |
| 365 | PAD_CFG_NF(GPIO_128, UP_2K, DEEP, NF1), /* LPSS_I2C2_SDA */ |
| 366 | PAD_CFG_NF(GPIO_129, UP_2K, DEEP, NF1), /* LPSS_I2C2_SCL */ |
Duncan Laurie | 401bd31 | 2016-09-19 17:24:55 -0700 | [diff] [blame] | 367 | PAD_CFG_GPI_APIC_LOW(GPIO_28, NONE, DEEP), /* TPM IRQ */ |
Michael Niewöhner | 17721be | 2020-12-21 17:09:08 +0100 | [diff] [blame] | 368 | |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 369 | /* WLAN_PE_RST - default to deasserted just in case FSP misbehaves. */ |
| 370 | PAD_CFG_GPO(GPIO_122, 0, DEEP), /* SIO_SPI_2_RXD */ |
Hsuan-ting Chen | 642508a | 2021-10-27 10:59:41 +0000 | [diff] [blame] | 371 | |
| 372 | PAD_CFG_GPI(GPIO_41, NONE, DEEP), /* LPSS_UART0_CTS - EC_IN_RW */ |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 373 | }; |
| 374 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 375 | const struct pad_config * __weak |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 376 | variant_early_gpio_table(size_t *num) |
| 377 | { |
| 378 | *num = ARRAY_SIZE(early_gpio_table); |
| 379 | return early_gpio_table; |
| 380 | } |
| 381 | |
| 382 | /* GPIO settings before entering sleep. */ |
| 383 | static const struct pad_config sleep_gpio_table[] = { |
| 384 | PAD_CFG_GPO(GPIO_150, 0, DEEP), /* NFC_RESET_ODL */ |
| 385 | PAD_CFG_GPI_APIC_LOW(GPIO_20, NONE, DEEP), /* NFC_INT_L */ |
| 386 | }; |
| 387 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 388 | const struct pad_config * __weak |
Ben Chan | eeb475c | 2017-11-09 16:53:26 -0800 | [diff] [blame] | 389 | variant_sleep_gpio_table(u8 slp_typ, size_t *num) |
Aaron Durbin | 10d67cb | 2016-09-02 16:56:03 -0500 | [diff] [blame] | 390 | { |
| 391 | *num = ARRAY_SIZE(sleep_gpio_table); |
| 392 | return sleep_gpio_table; |
| 393 | } |
Aaron Durbin | 475d2cb | 2016-09-02 17:50:22 -0500 | [diff] [blame] | 394 | |
Matt DeVillier | beb58a9 | 2022-12-20 16:29:02 -0600 | [diff] [blame^] | 395 | /* GPIOs needed to be set in romstage. */ |
| 396 | static const struct pad_config romstage_gpio_table[] = { |
| 397 | /* Enable touchscreen, hold in reset */ |
| 398 | PAD_CFG_GPO(GPIO_152, 1, DEEP), /* Touch enable */ |
| 399 | PAD_CFG_GPO(GPIO_36, 1, DEEP), /* Touch reset */ |
| 400 | }; |
| 401 | |
Matt DeVillier | 40c8cc9 | 2022-12-20 16:20:18 -0600 | [diff] [blame] | 402 | /* Weak implementation of romstage gpio */ |
| 403 | const struct pad_config *__weak variant_romstage_gpio_table(size_t *num) |
| 404 | { |
Matt DeVillier | beb58a9 | 2022-12-20 16:29:02 -0600 | [diff] [blame^] | 405 | *num = ARRAY_SIZE(romstage_gpio_table); |
| 406 | return romstage_gpio_table; |
Matt DeVillier | 40c8cc9 | 2022-12-20 16:20:18 -0600 | [diff] [blame] | 407 | } |
| 408 | |
Aaron Durbin | 475d2cb | 2016-09-02 17:50:22 -0500 | [diff] [blame] | 409 | static const struct cros_gpio cros_gpios[] = { |
| 410 | CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_COMM_NW_NAME), |
| 411 | CROS_GPIO_WP_AH(PAD_NW(GPIO_PCH_WP), GPIO_COMM_NW_NAME), |
Aaron Durbin | 76069f3 | 2016-12-12 14:12:22 -0600 | [diff] [blame] | 412 | CROS_GPIO_PE_AH(PAD_N(GPIO_SHIP_MODE), GPIO_COMM_N_NAME), |
Aaron Durbin | 475d2cb | 2016-09-02 17:50:22 -0500 | [diff] [blame] | 413 | }; |
| 414 | |
Kyösti Mälkki | 4ff218a | 2021-11-02 13:03:06 +0200 | [diff] [blame] | 415 | DECLARE_WEAK_CROS_GPIOS(cros_gpios); |