mb/google/fatcat/var/fatcat: Refactor GPIO programming for UFS support
[coreboot.git] / src / mainboard / google / brya / variants / sundance / fw_config.c
blobf8f9a07933e65353ef70a0402ee0f888568ede2b
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <console/console.h>
6 #include <fw_config.h>
8 static const struct pad_config wwan_disable_pads[] = {
9 /* A8 : WWAN_RF_DISABLE_ODL */
10 PAD_NC(GPP_A8, NONE),
11 /* A12 : WWAN_PCIE_WAKE_ODL */
12 PAD_NC(GPP_A12, NONE),
13 /* D5 : SRCCLKREQ0# ==> WWAN_CLKREQ_ODL */
14 PAD_NC(GPP_D5, NONE),
15 /* D6 : WWAN_EN */
16 PAD_NC(GPP_D6, NONE),
17 /* D15 : EN_PP2800_WCAM_X ==> WWAN_SAR_DETECT_2_ODL */
18 PAD_NC(GPP_D15, NONE),
19 /* F12 : WWAN_RST_L */
20 PAD_NC_LOCK(GPP_F12, NONE, LOCK_CONFIG),
21 /* H19 : SOC_I2C_SUB_INT_ODL */
22 PAD_NC(GPP_H19, NONE),
23 /* H21 : WCAM_MCLK_R ==> WWAN_PERST_L */
24 PAD_NC_LOCK(GPP_H21, NONE, LOCK_CONFIG),
25 /* H23 : WWAN_SAR_DETECT_ODL */
26 PAD_NC(GPP_H23, NONE),
29 void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
31 if (fw_config_probe(FW_CONFIG(WWAN, LTE_ABSENT))) {
32 printk(BIOS_INFO, "Disable WWAN-related GPIO pins.\n");
33 gpio_padbased_override(padbased_table, wwan_disable_pads,
34 ARRAY_SIZE(wwan_disable_pads));