1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <commonlib/helpers.h>
8 /* Pad configuration in ramstage */
9 static const struct pad_config override_gpio_table
[] = {
10 /* A8 : WWAN_RF_DISABLE_ODL */
11 PAD_CFG_GPO(GPP_A8
, 1, DEEP
),
12 /* A18 : NC ==> HDMI_HPD_SRC */
13 PAD_CFG_NF(GPP_A18
, NONE
, DEEP
, NF1
),
14 /* A21 : GPP_A21 ==> USB_C1_AUX_DC_P */
15 PAD_CFG_GPO(GPP_A21
, 0, DEEP
),
16 /* A22 : GPP_A22 ==> USB_C1_AUX_DC_N */
17 PAD_CFG_GPO(GPP_A22
, 1, DEEP
),
20 PAD_CFG_GPO(GPP_D6
, 1, DEEP
),
21 /* D8 : SD_CLKREQ_ODL ==> NC */
24 /* F6 : CNV_PA_BLANKING ==> NC */
26 /* F12 : WWAN_RST_ODL */
27 PAD_CFG_GPO_LOCK(GPP_F12
, 1, LOCK_CONFIG
),
28 /* F23 : V1P05EXT_CTRL ==> NC */
29 PAD_NC(GPP_F23
, NONE
),
31 /* H8 : CNV_MFUART2_RXD ==> NC */
33 /* H9 : CNV_MFUART2_TXD ==> NC */
35 /* H12 : SD_PERST_L ==> NC */
36 PAD_NC(GPP_H12
, NONE
),
37 /* H13 : EN_PP3300_SD_X ==> NC */
38 PAD_NC(GPP_H13
, NONE
),
39 /* H15 : HDMI_SRC_SCL */
40 PAD_CFG_NF(GPP_H15
, NONE
, DEEP
, NF1
),
41 /* H17 : HDMI_SRC_SDA */
42 PAD_CFG_NF(GPP_H17
, NONE
, DEEP
, NF1
),
43 /* H19 : SRCCLKREQ4# ==> NC */
44 PAD_NC(GPP_H19
, NONE
),
45 /* H23 : WWAN_SAR_DETECT_ODL */
46 PAD_CFG_GPO(GPP_H23
, 1, DEEP
),
50 /* Early pad configuration in bootblock */
51 static const struct pad_config early_gpio_table
[] = {
53 PAD_CFG_GPO(GPP_D6
, 0, DEEP
),
54 /* H20 : IMGCLKOUT1 ==> WLAN_PERST_L */
55 PAD_CFG_GPO(GPP_H20
, 0, DEEP
),
56 /* A13 : GPP_A13 ==> GSC_SOC_INT_ODL */
57 PAD_CFG_GPI_APIC(GPP_A13
, NONE
, PLTRST
, LEVEL
, INVERT
),
58 /* E12 : THC0_SPI1_IO1 ==> SOC_WP_OD */
59 PAD_CFG_GPI_GPIO_DRIVER(GPP_E12
, NONE
, DEEP
),
60 /* F18 : THC1_SPI2_INT# ==> EC_IN_RW_OD */
61 PAD_CFG_GPI(GPP_F18
, NONE
, DEEP
),
62 /* H4 : I2C0_SDA ==> SOC_I2C_GSC_SDA */
63 PAD_CFG_NF(GPP_H4
, NONE
, DEEP
, NF1
),
64 /* H5 : I2C0_SCL ==> SOC_I2C_GSC_SCL */
65 PAD_CFG_NF(GPP_H5
, NONE
, DEEP
, NF1
),
66 /* H10 : UART0_RXD ==> UART_SOC_RX_DBG_TX */
67 PAD_CFG_NF(GPP_H10
, NONE
, DEEP
, NF2
),
68 /* H11 : UART0_TXD ==> UART_SOC_TX_DBG_RX */
69 PAD_CFG_NF(GPP_H11
, NONE
, DEEP
, NF2
),
70 /* B11 : PMCALERT# ==> EN_PP3300_WLAN_X */
71 PAD_CFG_GPO(GPP_B11
, 1, DEEP
),
72 /* F12 : WWAN_RST_ODL */
73 PAD_CFG_GPO(GPP_F12
, 0, DEEP
),
76 static const struct pad_config romstage_gpio_table
[] = {
77 /* Enable touchscreen, hold in reset */
78 /* C0 : SMBCLK ==> EN_PP3300_TCHSCR */
79 PAD_CFG_GPO(GPP_C0
, 1, DEEP
),
80 /* C1 : SMBDATA ==> USI_RST_L */
81 PAD_CFG_GPO(GPP_C1
, 0, DEEP
),
83 /* H20 : IMGCLKOUT1 ==> WLAN_PERST_L */
84 PAD_CFG_GPO(GPP_H20
, 1, DEEP
),
87 const struct pad_config
*variant_gpio_override_table(size_t *num
)
89 *num
= ARRAY_SIZE(override_gpio_table
);
90 return override_gpio_table
;
93 const struct pad_config
*variant_early_gpio_table(size_t *num
)
95 *num
= ARRAY_SIZE(early_gpio_table
);
96 return early_gpio_table
;
99 const struct pad_config
*variant_romstage_gpio_table(size_t *num
)
101 *num
= ARRAY_SIZE(romstage_gpio_table
);
102 return romstage_gpio_table
;