1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
7 /* GPIOs needed prior to ramstage. */
8 static const struct pad_config early_gpio_table
[] = {
9 PAD_CFG_GPI(GPIO_190
, NONE
, DEEP
), /* PCH_WP_OD */
11 PAD_CFG_GPI_APIC_IOS(GPIO_63
, NONE
, DEEP
, LEVEL
, INVERT
, TxDRxE
,
12 DISPUPD
), /* H1_PCH_INT_ODL */
14 PAD_CFG_NF(GPIO_79
, NONE
, DEEP
, NF1
), /* H1_SLAVE_SPI_CLK_R */
16 PAD_CFG_NF(GPIO_80
, NONE
, DEEP
, NF1
), /* H1_SLAVE_SPI_CS_L_R */
18 PAD_CFG_NF(GPIO_82
, NONE
, DEEP
, NF1
), /* H1_SLAVE_SPI_MISO */
20 PAD_CFG_NF(GPIO_83
, NONE
, DEEP
, NF1
), /* H1_SLAVE_SPI_MOSI_R */
22 /* Enable power to wifi early in bootblock and de-assert PERST#. */
23 PAD_CFG_GPO(GPIO_178
, 1, DEEP
), /* EN_PP3300_WLAN */
24 PAD_CFG_GPO(GPIO_164
, 0, DEEP
), /* WLAN_PE_RST */
27 * ESPI_IO1 acts as ALERT# (which is open-drain) and requires a weak
28 * pull-up for proper operation. Since there is no external pull present
29 * on this platform, configure an internal weak pull-up.
31 PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_151
, UP_20K
, DEEP
, NF2
, HIZCRx1
,
35 const struct pad_config
*variant_early_gpio_table(size_t *num
)
37 *num
= ARRAY_SIZE(early_gpio_table
);
38 return early_gpio_table
;
41 static const struct pad_config default_override_table
[] = {
42 /* EN_PP3300_TOUCHSCREEN */
43 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
44 /* GPIO_105 -- TOUCHSCREEN_RST */
45 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
46 /* GPIO_140 -- PEN_RESET */
47 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
50 const struct pad_config
*variant_override_gpio_table(size_t *num
)
52 *num
= ARRAY_SIZE(default_override_table
);
53 return default_override_table
;
56 /* GPIOs needed to be set in romstage. */
57 static const struct pad_config romstage_gpio_table
[] = {
58 /* Enable touchscreen, hold in reset */
59 /* EN_PP3300_TOUCHSCREEN */
60 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
61 /* GPIO_105 -- TOUCHSCREEN_RST */
62 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 1, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
63 /* GPIO_140 -- PEN_RESET */
64 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140
, 1, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
67 const struct pad_config
*variant_romstage_gpio_table(size_t *num
)
69 *num
= ARRAY_SIZE(romstage_gpio_table
);
70 return romstage_gpio_table
;