diff options
author | Reka Norman <rekanorman@google.com> | 2022-02-04 11:17:32 +1100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-02-11 14:11:07 +0000 |
commit | 457d98d130c8fd0f447030196e9c104298f32a8f (patch) | |
tree | d47d465afe98292727f674c9c832ea6e7c476eca /src/mainboard/google/brya | |
parent | 8d6ebe9d31746607cd53f8e91debf90edb7a3714 (diff) |
mb/google/brya/var/nivviks: Disable LTE-related GPIOs based on fw_config
If the LTE USB DB is not connected, disable the LTE-related GPIOs.
BUG=b:197479026
TEST=abuild -a -x -c max -p none -t google/brya -b nivviks
Signed-off-by: Reka Norman <rekanorman@google.com>
Change-Id: I86251d8ad58d82ff2112ac5f2dfafdabbff4c76f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61614
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Diffstat (limited to 'src/mainboard/google/brya')
-rw-r--r-- | src/mainboard/google/brya/variants/nivviks/Makefile.inc | 1 | ||||
-rw-r--r-- | src/mainboard/google/brya/variants/nivviks/fw_config.c | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/nivviks/Makefile.inc b/src/mainboard/google/brya/variants/nivviks/Makefile.inc index defb592f2f..4e128435f7 100644 --- a/src/mainboard/google/brya/variants/nivviks/Makefile.inc +++ b/src/mainboard/google/brya/variants/nivviks/Makefile.inc @@ -4,4 +4,5 @@ bootblock-y += gpio.c romstage-y += gpio.c romstage-y += memory.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += gpio.c diff --git a/src/mainboard/google/brya/variants/nivviks/fw_config.c b/src/mainboard/google/brya/variants/nivviks/fw_config.c new file mode 100644 index 0000000000..c475ca3fe2 --- /dev/null +++ b/src/mainboard/google/brya/variants/nivviks/fw_config.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <bootstate.h> +#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(GPP_F12, NONE), + /* H19 : SOC_I2C_SUB_INT_ODL */ + PAD_NC(GPP_H19, NONE), + /* H23 : WWAN_SAR_DETECT_ODL */ + PAD_NC(GPP_H23, NONE), +}; + +static void fw_config_handle(void *unused) +{ + if (!fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) { + printk(BIOS_INFO, "Disable LTE-related GPIO pins.\n"); + gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads)); + } +} +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); |