diff options
author | David Wu <david_wu@quanta.corp-partner.google.com> | 2024-06-13 13:46:08 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-06-18 22:03:18 +0000 |
commit | c295d01451f2dedf0f9ea9f0e138beba55f48e51 (patch) | |
tree | 7d6a4c2083a6c0bf6af2b1e3b4060f43af7e6918 /src/mainboard/google/brya | |
parent | 9abc91cc451af09dc90505ae9be2d4f43f796373 (diff) |
mb/google/nissa/var/riven: Disable unused GPIOs based on fw_config
Disable LTE, stylus and WFC related GPIOs based on fw_config.
BUG=b:337169542
TEST=Local build successfully.
Change-Id: I91adc4e70d0d23b737d4fa6725cd96e63108f874
Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83062
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src/mainboard/google/brya')
-rw-r--r-- | src/mainboard/google/brya/variants/riven/fw_config.c | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/src/mainboard/google/brya/variants/riven/fw_config.c b/src/mainboard/google/brya/variants/riven/fw_config.c index 678d87ed1b..7967282c00 100644 --- a/src/mainboard/google/brya/variants/riven/fw_config.c +++ b/src/mainboard/google/brya/variants/riven/fw_config.c @@ -5,6 +5,39 @@ #include <console/console.h> #include <fw_config.h> +static const struct pad_config lte_disable_pads[] = { + /* A8 : WWAN_RF_DISABLE_ODL */ + PAD_NC(GPP_A8, NONE), + /* D6 : WWAN_EN */ + PAD_NC(GPP_D6, NONE), + /* F12 : WWAN_RST_L */ + PAD_NC_LOCK(GPP_F12, NONE, LOCK_CONFIG), + /* H23 : WWAN_SAR_DETECT_ODL */ + PAD_NC(GPP_H23, NONE), +}; + +static const struct pad_config wfc_disable_pads[] = { + /* D3 : WCAM_RST_L */ + PAD_NC_LOCK(GPP_D3, NONE, LOCK_CONFIG), + /* D15 : EN_PP2800_WCAM_X */ + PAD_NC_LOCK(GPP_D15, NONE, LOCK_CONFIG), + /* D16 : EN_PP1800_PP1200_WCAM_X */ + PAD_NC_LOCK(GPP_D16, NONE, LOCK_CONFIG), + /* H22 : WCAM_MCLK_R */ + PAD_NC(GPP_H22, NONE), + /* R6 : DMIC_WCAM_CLK_R */ + PAD_NC(GPP_R6, NONE), + /* R7 : DMIC_WCAM_DATA */ + PAD_NC(GPP_R7, NONE), +}; + +static const struct pad_config stylus_disable_pads[] = { + /* F13 : SOC_PEN_DETECT_R_ODL */ + PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG), + /* F15 : SOC_PEN_DETECT_ODL */ + PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG), +}; + static const struct pad_config emmc_disable_pads[] = { /* I7 : EMMC_CMD */ PAD_NC(GPP_I7, NONE), @@ -34,7 +67,30 @@ static const struct pad_config emmc_disable_pads[] = { void fw_config_gpio_padbased_override(struct pad_config *padbased_table) { - if (fw_config_is_provisioned() && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) { + if (!fw_config_is_provisioned()) { + printk(BIOS_WARNING, "FW_CONFIG is not provisioned. Exiting...\n"); + return; + } + + if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) { + printk(BIOS_INFO, "Disable LTE-related GPIO pins on Riven.\n"); + gpio_padbased_override(padbased_table, lte_disable_pads, + ARRAY_SIZE(lte_disable_pads)); + } + + if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) { + printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n"); + gpio_padbased_override(padbased_table, wfc_disable_pads, + ARRAY_SIZE(wfc_disable_pads)); + } + + if (fw_config_probe(FW_CONFIG(STYLUS, STYLUS_ABSENT))) { + printk(BIOS_INFO, "Disable Stylus GPIO pins.\n"); + gpio_padbased_override(padbased_table, stylus_disable_pads, + ARRAY_SIZE(stylus_disable_pads)); + } + + if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) { printk(BIOS_INFO, "Disable eMMC GPIO pins.\n"); gpio_padbased_override(padbased_table, emmc_disable_pads, ARRAY_SIZE(emmc_disable_pads)); |