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_37_DROID
= 37, /* LTE */
10 SKU_38_DROID
= 38, /* LTE + Touch */
11 SKU_39_DROID
= 39, /* LTE + KB backlight*/
12 SKU_40_DROID
= 40, /* LTE + Touch + KB backlight*/
15 static const struct pad_config default_override_table
[] = {
16 PAD_NC(GPIO_104
, UP_20K
),
18 /* GPIO_137 -- HP_INT_ODL and would be amend by SSFC. */
19 PAD_CFG_GPI_APIC_IOS(GPIO_137
, NONE
, DEEP
, LEVEL
, INVERT
, HIZCRx1
,
22 /* EN_PP3300_TOUCHSCREEN */
23 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
24 /* GPIO_105 -- TOUCHSCREEN_RST */
25 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
26 /* GPIO_140 -- PEN_RESET */
27 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
29 PAD_NC(GPIO_213
, DN_20K
),
32 static const struct pad_config lte_override_table
[] = {
33 /* Default override table. */
34 PAD_NC(GPIO_104
, UP_20K
),
36 /* GPIO_137 -- HP_INT_ODL and would be amend by SSFC. */
37 PAD_CFG_GPI_APIC_IOS(GPIO_137
, NONE
, DEEP
, LEVEL
, INVERT
, HIZCRx1
,
40 /* EN_PP3300_TOUCHSCREEN */
41 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
42 /* GPIO_105 -- TOUCHSCREEN_RST */
43 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
44 /* GPIO_140 -- PEN_RESET */
45 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140
, 0, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
47 PAD_NC(GPIO_213
, DN_20K
),
49 /* Be specific to LTE SKU */
50 /* UART2-CTS_B -- EN_PP3300_DX_LTE_SOC */
51 PAD_CFG_GPO(GPIO_67
, 1, PWROK
),
53 /* PCIE_WAKE1_B -- FULL_CARD_POWER_OFF */
54 PAD_CFG_GPO(GPIO_117
, 1, PWROK
),
56 /* AVS_I2S1_MCLK -- PLT_RST_LTE_L */
57 PAD_CFG_GPO(GPIO_161
, 1, DEEP
),
60 const struct pad_config
*variant_override_gpio_table(size_t *num
)
63 sku_id
= google_chromeec_get_board_sku();
70 *num
= ARRAY_SIZE(lte_override_table
);
71 return lte_override_table
;
73 *num
= ARRAY_SIZE(default_override_table
);
74 return default_override_table
;
78 static const struct pad_config lte_early_override_table
[] = {
79 /* UART2-CTS_B -- EN_PP3300_DX_LTE_SOC */
80 PAD_CFG_GPO(GPIO_67
, 1, PWROK
),
82 /* PCIE_WAKE1_B -- FULL_CARD_POWER_OFF */
83 PAD_CFG_GPO(GPIO_117
, 1, PWROK
),
85 /* AVS_I2S1_MCLK -- PLT_RST_LTE_L */
86 PAD_CFG_GPO(GPIO_161
, 0, DEEP
),
89 const struct pad_config
*variant_early_override_gpio_table(size_t *num
)
91 *num
= ARRAY_SIZE(lte_early_override_table
);
93 return lte_early_override_table
;
96 /* GPIOs needed to be set in romstage. */
97 static const struct pad_config romstage_gpio_table
[] = {
98 /* Enable touchscreen, hold in reset */
99 /* EN_PP3300_TOUCHSCREEN */
100 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146
, 1, DEEP
, NONE
, Tx0RxDCRx0
, DISPUPD
),
101 /* GPIO_105 -- TOUCHSCREEN_RST */
102 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105
, 1, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
103 /* GPIO_140 -- PEN_RESET */
104 PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140
, 1, DEEP
, NONE
, Tx1RxDCRx0
, DISPUPD
),
107 const struct pad_config
*variant_romstage_gpio_table(size_t *num
)
109 *num
= ARRAY_SIZE(romstage_gpio_table
);
110 return romstage_gpio_table
;