1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
6 #include <ec/google/chromeec/ec.h>
9 SKU_1_LTE
= 1, /* Wifi + LTE */
10 SKU_2_WIFI
= 2, /* Wifi */
11 SKU_3_LTE_2CAM
= 3, /* Wifi + LTE + dual camera */
12 SKU_4_WIFI_2CAM
= 4, /* Wifi + dual camera */
15 static const struct pad_config default_override_table
[] = {
16 PAD_NC(GPIO_104
, UP_20K
),
18 /* GPIO_105 -- TOUCHSCREEN_RST */
19 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
20 /* EN_PP3300_TOUCHSCREEN */
21 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
,
24 PAD_NC(GPIO_213
, DN_20K
),
27 static const struct pad_config lte_override_table
[] = {
28 /* Default override table. */
29 PAD_NC(GPIO_104
, UP_20K
),
31 /* GPIO_105 -- TOUCHSCREEN_RST */
32 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
33 /* EN_PP3300_TOUCHSCREEN */
34 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
,
37 PAD_NC(GPIO_213
, DN_20K
),
39 /* Be specific to LTE SKU */
40 /* UART2-CTS_B -- EN_PP3300_DX_LTE_SOC */
41 PAD_CFG_GPO(GPIO_67
, 1, PWROK
),
43 /* PCIE_WAKE1_B -- FULL_CARD_POWER_OFF */
44 PAD_CFG_GPO(GPIO_117
, 1, PWROK
),
46 /* AVS_I2S1_MCLK -- PLT_RST_LTE_L */
47 PAD_CFG_GPO(GPIO_161
, 1, DEEP
),
50 const struct pad_config
*variant_override_gpio_table(size_t *num
)
53 sku_id
= google_chromeec_get_board_sku();
58 *num
= ARRAY_SIZE(lte_override_table
);
59 return lte_override_table
;
61 *num
= ARRAY_SIZE(default_override_table
);
62 return default_override_table
;
66 static const struct pad_config lte_early_override_table
[] = {
67 /* UART2-CTS_B -- EN_PP3300_DX_LTE_SOC */
68 PAD_CFG_GPO(GPIO_67
, 1, PWROK
),
70 /* PCIE_WAKE1_B -- FULL_CARD_POWER_OFF */
71 PAD_CFG_GPO(GPIO_117
, 1, PWROK
),
73 /* AVS_I2S1_MCLK -- PLT_RST_LTE_L */
74 PAD_CFG_GPO(GPIO_161
, 0, DEEP
),
77 const struct pad_config
*variant_early_override_gpio_table(size_t *num
)
79 *num
= ARRAY_SIZE(lte_early_override_table
);
81 return lte_early_override_table
;
84 /* GPIOs needed to be set in romstage. */
85 static const struct pad_config romstage_gpio_table
[] = {
86 /* Enable touchscreen, hold in reset */
87 /* EN_PP3300_TOUCHSCREEN */
88 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
89 /* GPIO_105 -- TOUCHSCREEN_RST */
90 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 1, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
93 const struct pad_config
*variant_romstage_gpio_table(size_t *num
)
95 *num
= ARRAY_SIZE(romstage_gpio_table
);
96 return romstage_gpio_table
;