mb/starlabs/starbook/mtl: Correct USB Port Configuration
[coreboot2.git] / src / mainboard / google / octopus / variants / yorp / gpio.c
blob817661acc01df0cf50200392ae69c63c3b0a01f8
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <gpio.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 */
10 /* GSPI0_INT */
11 PAD_CFG_GPI_APIC_IOS(GPIO_63, NONE, DEEP, LEVEL, INVERT, TxDRxE,
12 DISPUPD), /* H1_PCH_INT_ODL */
13 /* GSPI0_CLK */
14 PAD_CFG_NF(GPIO_79, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CLK_R */
15 /* GSPI0_CS# */
16 PAD_CFG_NF(GPIO_80, NONE, DEEP, NF1), /* H1_SLAVE_SPI_CS_L_R */
17 /* GSPI0_MISO */
18 PAD_CFG_NF(GPIO_82, NONE, DEEP, NF1), /* H1_SLAVE_SPI_MISO */
19 /* GSPI0_MOSI */
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,
32 ENPU), /* ESPI_IO1 */
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;