blob: 4719a095cbac31c1ac75a84265974e414cbabb45 [file] [log] [blame]
Hannah Williams5e83e8b2018-02-09 18:35:17 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2018 Intel Corp.
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.
14 */
15
Hannah Williams09b883f2018-05-11 19:14:38 -070016#include <arch/acpi.h>
Hannah Williams5e83e8b2018-02-09 18:35:17 -080017#include <baseboard/gpio.h>
18#include <baseboard/variants.h>
19#include <commonlib/helpers.h>
Aaron Durbin64031672018-04-21 14:45:32 -060020#include <compiler.h>
Hannah Williams5e83e8b2018-02-09 18:35:17 -080021
22/*
23 * Pad configuration in ramstage. The order largely follows the 'GPIO Muxing'
24 * table found in EDS vol 1, but some pins aren't grouped functionally in
25 * the table so those were moved for more logical grouping.
26 */
27static const struct pad_config gpio_table[] = {
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080028 /* NORTHWEST COMMUNITY GPIOS */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070029 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_0, NONE, DEEP, NF1), /* TCK */
30 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_1, DN_20K, DEEP, NF1), /* TRST_B */
31 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_2, NONE, DEEP, NF1), /* TMS */
32 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_3, NONE, DEEP, NF1), /* TDI */
33 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_4, NONE, DEEP, NF1), /* TDO */
34 PAD_NC(GPIO_5, UP_20K), /* JTAGX -- unused */
Shamile Khan0805cbe2018-08-22 13:12:26 -070035 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_6, NONE, DEEP, NF1), /* CX_PREQ_B */
36 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_7, NONE, DEEP, NF1), /* CX_PRDY_B */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080037 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_8, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_CLK_VNN */
38 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_9, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA0_VNN */
39 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_10, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA1_VNN */
40 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_11, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA2_VNN */
41 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_12, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA3_VNN */
42 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_13, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA4_VNN */
43 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_14, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA5_VNN */
44 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_15, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA6_VNN */
45 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_16, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_0_DATA7_VNN */
46 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_17, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* DBG_PTI_CLK_1 */
47 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_18, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* DBG_PTI_DATA_8 */
48 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_19, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* DBG_PTI_DATA_9 */
49 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_20, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* DBG_PTI_DATA_10 */
50 PAD_CFG_NF(GPIO_21, UP_20K, DEEP, NF2), /* CNV_MFUART2_RXD */
51 PAD_CFG_NF_IOSSTATE(GPIO_22, UP_20K, DEEP, NF2, TxDRxE), /* CNV_MFUART2_TXD */
52 PAD_CFG_NF(GPIO_23, UP_20K, DEEP, NF2), /* CNV_GNSS_PABLANKIt */
53 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_24, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_1_DATA6_VNN */
54 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_25, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_1_DATA7_VNN */
55 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_26, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_CLK_VNN */
56 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_27, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA0_VNN */
57 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_28, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA1_VNN 0*/
58 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_29, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA2_VNN */
59 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_30, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA3_VNN */
60 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_31, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA4_VNN */
61 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_32, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA5_VNN */
62 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_33, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA6_VNN */
63 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_34, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_2_DATA7_VNN */
64 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_35, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_3_CLK_VNN */
65 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_36, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_3_DATA0_VNN */
66 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_37, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_3_DATA1_VNN */
67 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_38, DN_20K, DEEP, NF5, HIZCRx0, DISPUPD), /* TRACE_3_DATA2_VNN */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070068 PAD_NC(GPIO_39, UP_20K), /* TRACE_3_DATA3_VNN -- unused */
69 PAD_NC(GPIO_40, UP_20K), /* TRACE_3_DATA4_VNN -- unused */
70 PAD_NC(GPIO_41, DN_20K), /* TRACE_3_DATA5_VNN -- unused */
71 PAD_NC(GPIO_42, DN_20K), /* GP_INTD_DSI_TE1 -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080072 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_43, DN_20K, DEEP, NF1, HIZCRx0, DISPUPD), /* GP_INTD_DSI_TE2 */
73 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_44, UP_20K, DEEP, NF1, TxDRxE, ENPU), /* USB_OC0_B */
74 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_45, UP_20K, DEEP, NF1, TxDRxE, ENPU), /* USB_OC1_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070075 PAD_NC(GPIO_46, DN_20K), /* DSI_I2C_SDA -- unused */
76 PAD_NC(GPIO_47, DN_20K), /* DSI_I2C_SCL -- unused */
77
78 /* PMC stays active in suspend so disable standby for these pins */
Hannah Williams8dce5bc2018-03-31 18:23:20 -070079 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_48, NONE, DEEP, NF1), /* PMC_I2C_SDA */
80 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_49, NONE, DEEP, NF1), /* PMC_I2C_SCL */
Furquan Shaikh65161492018-06-05 17:16:11 -070081 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_50, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* PCH_I2C_PEN_SDA */
82 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_51, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* PCH_I2C_PEN_SCL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080083 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_52, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_I2C1_SDA */
84 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_53, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_I2C1_SCL */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070085 PAD_NC(GPIO_54, UP_20K), /* LPSS_I2C2_SDA -- unused */
86 PAD_NC(GPIO_55, UP_20K), /* LPSS_I2C2_SCL -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080087 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_56, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_I2C3_SDA */
88 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_57, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_I2C2_SCL */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070089 PAD_NC(GPIO_58, UP_20K), /* LPSS_I2C4_SDA - unused */
90 PAD_NC(GPIO_59, UP_20K), /* LPSS_I2C4_SCL - unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080091 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_60, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_UART0_RXD */
92 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_61, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_UART0_TXD */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070093 PAD_NC(GPIO_62, UP_20K), /* UART0-RTS_B -- unused */
Furquan Shaikh2d602092018-09-05 13:59:00 -070094 PAD_CFG_GPI_APIC_IOS(GPIO_63, NONE, DEEP, LEVEL, INVERT, TxDRxE, DISPUPD), /* H1_PCH_INT_ODL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -080095 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_64, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_UART2_RXD */
96 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_65, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), /* LPSS_UART2_TXD */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -070097 PAD_NC(GPIO_66, UP_20K), /* UART2-RTS_B -- unused */
98 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_67, 0, DEEP, NONE, TxLASTRxE, DISPUPD), /* UART2-CTS_B -- EN_PP3300_DX_LTE_SOC */
Justin TerAvest22595f62018-03-15 16:28:57 -060099 PAD_CFG_GPI(GPIO_68, NONE, DEEP), /* DRAM_ID0 */
100 PAD_CFG_GPI(GPIO_69, NONE, DEEP), /* DRAM_ID1 */
101 PAD_CFG_GPI(GPIO_70, NONE, DEEP), /* DRAM_ID2 */
102 PAD_CFG_GPI(GPIO_71, NONE, DEEP), /* DRAM_ID3 */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700103 PAD_NC(GPIO_72, DN_20K), /* PMC_SPI_TXD -- unused */
104 PAD_NC(GPIO_73, DN_20K), /* PMC_SPI_CLK -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800105 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_74, UP_20K, DEEP, NF1, TxDRxE, ENPU), /* THERMTRIP_B */
106 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_75, NONE, DEEP, NF1, TxDRxE, DISPUPD), /* PROCHOT_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700107 PAD_NC(GPIO_211, UP_20K), /* EMMC_RST_B -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800108 PAD_CFG_GPI_APIC_IOS(GPIO_212, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD), /* Touch Panel Int */
Shamile Khan280bc302018-05-30 10:32:00 -0700109 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_213, 0, DEEP, NONE, Tx0RxDCRx0, DISPUPD), /* EN_PP3300_TOUCHSCREEN */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800110 PAD_CFG_GPI_APIC_IOS(GPIO_214, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD), /* P_SENSOR_INT_L */
111
112 /* NORTH COMMUNITY GPIOS */
113
114 /* svid - unused */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700115 PAD_NC(GPIO_76, UP_20K),/* SVID Alert - unused */
116 PAD_NC(GPIO_77, UP_20K),/* SVID Data - unused */
117 PAD_NC(GPIO_78, UP_20K),/* SVID Clk - unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800118
119 /* LPSS */
Shamile Khan0805cbe2018-08-22 13:12:26 -0700120 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_79, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* H1_SLAVE_SPI_CLK_R */
121 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_80, NONE, DEEP, NF1, HIZCRx1, DISPUPD), /* H1_SLAVE_SPI_CS_L_R */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800122 PAD_CFG_GPIO_HI_Z(GPIO_81, UP_20K, DEEP, HIZCRx0, DISPUPD), /* GPIO_81_DEBUG (Boot halt) -- MIPI60 DEBUG */
Ravi Sarawadic2934962018-02-27 13:57:01 -0800123 PAD_CFG_NF(GPIO_82, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MISO */
124 PAD_CFG_NF(GPIO_83, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MOSI_R */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700125 PAD_NC(GPIO_84, DN_20K), /* LPSS_SPI_2_CLK - unused */
126 PAD_NC(GPIO_85, DN_20K), /* LPSS_SPI_2_FS0 - unused */
127 PAD_NC(GPIO_86, DN_20K), /* LPSS_SPI_2_FS1 - unused */
128 PAD_NC(GPIO_87, DN_20K), /* LPSS_SPI_2_FS2 - unused */
129 PAD_NC(GPIO_88, DN_20K), /* LPSS_SPI_2_RXD - unused */
130 PAD_NC(GPIO_89, DN_20K), /* LPSS_SPI_2_TXD - unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800131
132 /* Fast SPI */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700133 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_90, NATIVE, DEEP, NF1, HIZCRx1, SAME),/* FST_SPI_CS0_B */
Shamile Khan280bc302018-05-30 10:32:00 -0700134 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_91, 0, DEEP, NONE, Tx0RxDCRx0, DISPUPD),/* FST_SPI_CS1_B -- SPK_PA_EN_R */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700135 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_92, NATIVE, DEEP, NF1, HIZCRx1, SAME),/* FST_SPI_MOSI_IO0 */
136 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_93, NATIVE, DEEP, NF1, HIZCRx1, SAME),/* FST_SPI_MISO_IO1 */
137 PAD_NC(GPIO_94, NATIVE),/* FST_SPI_IO2 - unused */
138 PAD_NC(GPIO_95, NATIVE),/* FST_SPI_IO3 - unused */
139 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_96, NATIVE, DEEP, NF1, HIZCRx0, SAME),/* FST_SPI_CLK */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800140
141 /* PMU Signals */
142 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_98, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* PMU_PLTRST_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700143 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_99, NONE, DEEP, NF1, TxDRxE, DISPUPD),/* PMU_PWRBTN_B */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800144 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_100, NONE, DEEP, NF1),/* PMU_SLP_S0_B */
145 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_101, NONE, DEEP, NF1),/* PMU_SLP_S3_B */
146 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_102, NONE, DEEP, NF1),/* PMU_SLP_S4_B */
147 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_103, NONE, DEEP, NF1),/* SUSPWRDNACK */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700148 PAD_NC(GPIO_104, UP_20K),/* EMMC_DNX_PWR_EN_B - unused */
Furquan Shaikh6bedbd62018-10-04 11:11:49 -0700149 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),/* GPIO_105 -- TOUCHSCREEN_RST */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700150 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_106, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* PMU_BATLOW_B */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800151 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_107, NONE, DEEP, NF1, TxDRxE, DISPUPD),/* PMU_RESETBUTTON_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700152 PAD_NC(GPIO_108, NONE),/* PMU_SUSCLK -- unused */
Shamile Khan280bc302018-05-30 10:32:00 -0700153 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_109, 1, DEEP, NONE, Tx1RxDCRx1, DISPUPD),/* SUS_STAT_B -- BT_DISABLE_L */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800154
155 /* I2C5 - Audio */
156 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_110, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C5_SDA */
157 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_111, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C5_SCL */
158
159 /* I2C6 - Trackpad */
160 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_112, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C6_SDA */
161 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_113, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C6_SCL */
162
163 /* I2C7 - Touchscreen */
164 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_114, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C7_SDA */
165 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_115, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* LPSS_I2C7_SCL */
166
167 /* PCIE_WAKE[0:3]_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700168 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_116, 1, DEEP, NONE, Tx1RxDCRx1, DISPUPD), /* PCIE_WAKE0_B -- WIFI_DISABLE_L */
169 PAD_CFG_GPI_SCI_LOW(GPIO_117, NONE, DEEP, EDGE_SINGLE),/* PCIE_WAKE1_B -- LTE_WAKE_L */
170 PAD_NC(GPIO_118, UP_20K),/* PCIE_WAKE2_B -- unused */
Furquan Shaikhb41ae252018-06-04 17:10:31 -0700171 PAD_CFG_GPI_SCI_LOW(GPIO_119, NONE, DEEP, EDGE_SINGLE),/* PCIE_WAKE3_B */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800172
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700173 /*
174 * PCIE_CLKREQ[0:3]_B. For unused pins, follow the termination
175 * guideline for unused PCIE ports as described in PDG i.e. keep
176 * the pins in native mode and deploy the internal pull up.
177 */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800178 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_120, UP_20K, DEEP, NF1, HIZCRx1, ENPU),/* PCIE_CLKREQ0_B -- unused*/
179 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_121, UP_20K, DEEP, NF1, HIZCRx1, ENPU),/* PCIE_CLKREQ1_B -- unused */
Shamile Khandc3910c2018-05-22 22:24:22 -0700180 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_122, UP_20K, DEEP, NF1, HIZCRx1, ENPU),/* PCIE_CLKREQ2_B -- unused */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700181 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_123, NONE, DEEP, NF1, TxDRxE, DISPUPD), /* PCIE_CLKREQ3_B */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800182
183 /* DDI[0:1] SDA and SCL -- unused */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700184 PAD_NC(GPIO_124, UP_20K),/* HV_DDI0_DDC_SDA -- unused */
185 PAD_NC(GPIO_125, UP_20K),/* HV_DDI0_DDC_SCL -- unused */
186 PAD_NC(GPIO_126, UP_20K),/* HV_DDI1_DDC_SDA -- unused */
187 PAD_NC(GPIO_127, UP_20K),/* HV_DDI1_DDC_SCL -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800188
189 /* Panel 0 control */
Shamile Khandc3910c2018-05-22 22:24:22 -0700190 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_128, NONE, DEEP, NF1, Tx0RxDCRx0, DISPUPD),/* PANEL0_VDDEN*/
191 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_129, NONE, DEEP, NF1, Tx0RxDCRx0, DISPUPD),/* PANEL0_BKLTEN */
192 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_130, NONE, DEEP, NF1, Tx0RxDCRx0, DISPUPD),/* PANEL0_BKLTCTL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800193
194 /* Hot plug detect. */
195 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_131, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* HV_DDI0_HPD */
196 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_132, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* HV_DDI1_HPD */
197 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_133, NONE, DEEP, NF1, HIZCRx1, DISPUPD),/* HV_EDP_HPD */
198
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700199 PAD_NC(GPIO_134, NONE),/* GPIO_134 -- unused */
200 PAD_CFG_GPI_APIC_IOS(GPIO_135, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_135 -- TRACKPAD_INT1_1V8_ODL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800201 PAD_CFG_GPI_APIC_IOS(GPIO_136, NONE, DEEP, LEVEL, INVERT, TxDRxE, DISPUPD),/* GPIO_136 -- PMIC_PCH_INT_ODL */
202 PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_137 -- HP_INT_ODL */
Furquan Shaikh65161492018-06-05 17:16:11 -0700203 PAD_CFG_GPI_APIC_IOS(GPIO_138, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_138 -- PEN_PDCT_ODL */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700204 PAD_CFG_GPI_APIC_IOS(GPIO_139, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_139 -- PEN_INT_ODL */
Furquan Shaikh6bedbd62018-10-04 11:11:49 -0700205 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),/* GPIO_140 -- PEN_RESET */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800206 // Also we may be able to use eSPI WAKE# Virtual Wire instead
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700207 PAD_CFG_GPI_SCI_IOS(GPIO_141, NONE, DEEP, EDGE_SINGLE, INVERT, IGNORE, DISPUPD),/* GPIO_141 -- EC_PCH_WAKE_ODL */
Hannah Williamse7e35672018-03-28 11:09:33 -0700208 PAD_CFG_GPI_SCI_LOW(GPIO_142, NONE, DEEP, LEVEL),/* GPIO_142 -- TRACKPAD_INT2_1V8_ODL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800209 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_143, 1, DEEP, UP_20K, HIZCRx1, ENPU),/* GPIO_143 -- LTE_SAR_ODL */
Furquan Shaikh65161492018-06-05 17:16:11 -0700210 PAD_CFG_GPI_SCI_LOW(GPIO_144, NONE, DEEP, LEVEL),/* GPIO_144 -- PEN_EJECT_ODL(wake) */
211 PAD_CFG_GPI_GPIO_DRIVER(GPIO_145, NONE, DEEP),/* GPIO_145 -- PEN_EJECT_ODL(notifications) */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700212 PAD_NC(GPIO_146, UP_20K),/* GPIO_146 -- unused */
Hannah Williamscf458302018-01-09 18:23:40 -0800213
214 /*
215 * GPIO_154 - LPC_CLKRUN# has a native function for LPC but not for
216 * eSPI. Nonetheless if we use eSPI, it should be configured as a GPIO
217 * and kept unconnected to allow S0ix entry.
218 */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800219
220 /* AUDIO COMMUNITY GPIOS*/
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700221 PAD_NC(GPIO_156, DN_20K), /* AVS_I2S0_MCLK -- unused */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800222 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_157, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S0_BCLK */
223 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_158, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S0_WS_SYNC */
224 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_159, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S0_SDI */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700225 PAD_NC(GPIO_160, DN_20K), /* AVS_I2S0_SDO -- unused */
Furquan Shaikh6bedbd62018-10-04 11:11:49 -0700226 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_161, 1, DEEP, UP_20K, Tx1RxDCRx0, DISPUPD), /* AVS_I2S1_MCLK -- LTE_OFF_ODL */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800227 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_162, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S1_BCLK */
228 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_163, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S1_WS_SYNC */
Furquan Shaikhfbd6f392018-08-09 14:29:08 -0700229 PAD_CFG_GPO(GPIO_164, 0, DEEP), /* WLAN_PE_RST */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800230 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_165, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_I2S1_SDO */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700231 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_166, NONE, DEEP, NF2, HIZCRx0, DISPUPD), /* AVS_I2S2_BCLK */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800232 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_167, NONE, DEEP, NF2, HIZCRx0, DISPUPD), /* AVS_I2S2_WS_SYNC */
233 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_168, NONE, DEEP, NF2, HIZCRx0, DISPUPD), /* AVS_I2S2_SDI */
234 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_169, NONE, DEEP, NF2, HIZCRx0, DISPUPD), /* AVS_I2S2_SD0 */
235 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_170, DN_20K, DEEP, NF2, HIZCRx0, DISPUPD), /* AVS_I2S1_MCLK */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700236
237 /* Disable standby for GPIO_171 and GPIO_173 to support Wake on Voice */
Shamile Khan644b2dd2018-05-09 09:50:16 -0700238 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_171, DN_20K, DEEP, NF1), /* AVS_M_CLK_A1 -- DMIC_CLK1 */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700239 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_172, DN_20K, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_M_CLK_B1 */
Shamile Khan644b2dd2018-05-09 09:50:16 -0700240 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_173, DN_20K, DEEP, NF1), /* AVS_M_DATA_1 -- DMIC_DATA */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700241 PAD_NC(GPIO_174, DN_20K), /* AVS_M_CLK_AB2 -- unused */
242 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_175, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* AVS_M_DATA_2 */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800243
244 /* SCC COMMUNITY GPIOS */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700245 PAD_NC(GPIO_176, UP_20K), /* SMB_ALERTB -- unused */
246 PAD_NC(GPIO_177, UP_20K), /* SMB_CLK -- unused */
Furquan Shaikh6bedbd62018-10-04 11:11:49 -0700247 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_178, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD), /* EN_PP3300_WLAN */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700248 PAD_NC(GPIO_179, NONE), /* SDCARD_CLK -- unused */
249 PAD_NC(GPIO_180, NONE), /* SDCARD_CMD -- unused */
250 PAD_NC(GPIO_181, UP_20K), /* SDCARD_D0 -- unused */
251 PAD_NC(GPIO_182, UP_20K), /* SDCARD_D1 -- unused */
252 PAD_NC(GPIO_183, UP_20K), /* SDCARD_D2 -- unused */
253 PAD_NC(GPIO_184, UP_20K), /* SDCARD_D3 -- unused */
254 PAD_NC(GPIO_185, UP_20K), /* SDCARD_CMD -- unused */
255 PAD_NC(GPIO_186, UP_20K), /* SDCARD_CD_N -- unused */
256 PAD_NC(GPIO_187, NONE), /* SDCARD_LVL_WP -- unused */
257 PAD_NC(GPIO_188, UP_20K), /* SDCARD_PWR_DWN_N -- unused */
Furquan Shaikhfaad9682018-06-19 08:40:19 -0700258 PAD_CFG_GPI(GPIO_189, NONE, DEEP), /* EC_IN_RW */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700259 PAD_CFG_GPI(GPIO_190, NONE, DEEP), /* PCH_WP_OD */
260
261 /*
262 * Disable standby state for these CNVI pins to allow wake on
263 * WiFI & Bluetooth.
264 */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800265 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_191, NONE, DEEP, NF1), /* CNV_BRI_DT */
266 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_192, UP_20K, DEEP, NF1), /* CNV_BRI_RSP */
267 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_193, NONE, DEEP, NF1), /* CNV_RGI_DT */
268 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_194, UP_20K, DEEP, NF1), /* CNV_RGI_RSP */
269 PAD_CFG_NF_IOSTANDBY_IGNORE(GPIO_195, NONE, DEEP, NF1), /* CNV_RF_RESET_B */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700270 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_198, DN_20K, DEEP, NF1, HIZCRx0, ENPD), /* EMMC0_CLK */
Shaunak Sahacbedd8f2018-02-16 08:39:22 -0800271 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_200, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D0 */
272 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_201, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D1 */
273 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_202, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D2 */
274 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_203, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D3 */
275 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_204, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D4 */
276 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_205, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D5 */
277 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_206, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D6 */
278 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_207, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_D7 */
279 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_208, UP_20K, DEEP, NF1, HIZCRx1, ENPU), /* EMMC0_CMD */
Furquan Shaikhd1b482c2018-07-25 08:58:52 -0700280 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_209, NONE, DEEP, NF1, HIZCRx0, DISPUPD), /* EMMC0_STROBE */
281 PAD_NC(GPIO_210, DN_20K),
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800282};
283
Furquan Shaikh06a41f12018-07-25 14:30:59 -0700284const struct pad_config *__weak variant_base_gpio_table(size_t *num)
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800285{
286 *num = ARRAY_SIZE(gpio_table);
287 return gpio_table;
288}
289
Furquan Shaikh06a41f12018-07-25 14:30:59 -0700290const struct pad_config *__weak variant_override_gpio_table(size_t *num)
291{
292 *num = 0;
293 return NULL;
294}
295
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800296/* GPIOs needed prior to ramstage. */
297static const struct pad_config early_gpio_table[] = {
Justin TerAvestcc6953b2018-03-16 13:29:42 -0600298 PAD_CFG_GPI(GPIO_190, NONE, DEEP), /* PCH_WP_OD */
Ravi Sarawadic2934962018-02-27 13:57:01 -0800299 /* GSPI0_INT */
Furquan Shaikh2d602092018-09-05 13:59:00 -0700300 PAD_CFG_GPI_APIC_IOS(GPIO_63, NONE, DEEP, LEVEL, INVERT, TxDRxE,
Ravi Sarawadic2934962018-02-27 13:57:01 -0800301 DISPUPD), /* H1_PCH_INT_ODL */
302 /* GSPI0_CLK */
303 PAD_CFG_NF(GPIO_79, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CLK_R */
304 /* GSPI0_CS# */
305 PAD_CFG_NF(GPIO_80, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CS_L_R */
306 /* GSPI0_MISO */
307 PAD_CFG_NF(GPIO_82, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MISO */
308 /* GSPI0_MOSI */
309 PAD_CFG_NF(GPIO_83, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MOSI_R */
Furquan Shaikhade3bc52018-03-28 11:53:37 -0700310
311 /* Enable power to wifi early in bootblock and de-assert PERST#. */
312 PAD_CFG_GPO(GPIO_178, 1, DEEP), /* EN_PP3300_WLAN */
Furquan Shaikhfbd6f392018-08-09 14:29:08 -0700313 PAD_CFG_GPO(GPIO_164, 0, DEEP), /* WLAN_PE_RST */
Furquan Shaikhc0451792018-04-27 11:34:00 -0700314
315 /*
316 * ESPI_IO1 acts as ALERT# (which is open-drain) and requies a weak
317 * pull-up for proper operation. Since there is no external pull present
318 * on this platform, configure an internal weak pull-up.
319 */
320 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_151, UP_20K, DEEP, NF2, HIZCRx1,
321 ENPU), /* ESPI_IO1 */
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800322};
323
Aaron Durbin64031672018-04-21 14:45:32 -0600324const struct pad_config *__weak
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800325variant_early_gpio_table(size_t *num)
326{
327 *num = ARRAY_SIZE(early_gpio_table);
328 return early_gpio_table;
329}
330
331/* GPIO settings before entering sleep. */
332static const struct pad_config sleep_gpio_table[] = {
333};
334
Hannah Williams09b883f2018-05-11 19:14:38 -0700335/* GPIO settings before entering slp_s5. */
336static const struct pad_config sleep_s5_gpio_table[] = {
337 /* BT_DISABLE_L */
Furquan Shaikh6bedbd62018-10-04 11:11:49 -0700338 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_109, 0, DEEP, NONE, Tx0RxDCRx1, SAME),
Hannah Williams09b883f2018-05-11 19:14:38 -0700339};
340
Aaron Durbin64031672018-04-21 14:45:32 -0600341const struct pad_config *__weak
Hannah Williams09b883f2018-05-11 19:14:38 -0700342variant_sleep_gpio_table(size_t *num, int slp_typ)
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800343{
Hannah Williams09b883f2018-05-11 19:14:38 -0700344 if (slp_typ == ACPI_S5) {
345 *num = ARRAY_SIZE(sleep_s5_gpio_table);
346 return sleep_s5_gpio_table;
347 }
348
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800349 *num = ARRAY_SIZE(sleep_gpio_table);
350 return sleep_gpio_table;
351}
352
353static const struct cros_gpio cros_gpios[] = {
Hannah Williamsecef3222018-04-27 00:13:25 -0700354 CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
Hannah Williams0a2b9d42018-04-13 21:43:05 -0700355 CROS_GPIO_WP_AH(PAD_SCC(GPIO_PCH_WP), GPIO_COMM_SCC_NAME),
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800356};
357
Aaron Durbin64031672018-04-21 14:45:32 -0600358const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
Hannah Williams5e83e8b2018-02-09 18:35:17 -0800359{
360 *num = ARRAY_SIZE(cros_gpios);
361 return cros_gpios;
362}