From bdba51208ad5b3a3cde9f137df0ea042ac0e7d25 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 13 May 2021 14:27:47 -0600 Subject: [PATCH] mb/google/guybrush: Initialize WWAN for USB if requested To set the Fibocom 850-GL module to USB mode, it needs to be disabled when PCIe training happens, or it will automatically switch to PCIe mode. This patch makes sure it's shut down when training happens in FSP-M. It will be brought up in ramstage and will be available for USB enumeration later. BUG=b:187316460 TEST=Run lsusb from the OS and see that the Fibocom module is present on USB. Signed-off-by: Martin Roth Change-Id: I153eb6cd7c3a0e2cc3b71c99f76db3e565173cfe Reviewed-on: https://review.coreboot.org/c/coreboot/+/54743 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- .../google/guybrush/variants/baseboard/gpio.c | 2 ++ .../google/guybrush/variants/guybrush/gpio.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/mainboard/google/guybrush/variants/baseboard/gpio.c b/src/mainboard/google/guybrush/variants/baseboard/gpio.c index 0b418d8b58..c73ec188fc 100644 --- a/src/mainboard/google/guybrush/variants/baseboard/gpio.c +++ b/src/mainboard/google/guybrush/variants/baseboard/gpio.c @@ -240,6 +240,8 @@ static const struct soc_amd_gpio early_gpio_table[] = { static const struct soc_amd_gpio bootblock_gpio_table[] = { /* Enable WWAN & WLAN */ + /* EN_PWR_WWAN_X */ + PAD_GPO(GPIO_8, HIGH), /* WWAN_RST_L */ PAD_GPO(GPIO_24, HIGH), /* WWAN_DISABLE */ diff --git a/src/mainboard/google/guybrush/variants/guybrush/gpio.c b/src/mainboard/google/guybrush/variants/guybrush/gpio.c index dca9c8edc7..ff8403ba7c 100644 --- a/src/mainboard/google/guybrush/variants/guybrush/gpio.c +++ b/src/mainboard/google/guybrush/variants/guybrush/gpio.c @@ -5,6 +5,7 @@ #include #include #include +#include /* This table is used by guybrush variant with board version < 2. */ static const struct soc_amd_gpio bid1_gpio_table[] = { @@ -31,6 +32,14 @@ static const struct soc_amd_gpio bid1_pcie_gpio_table[] = { PAD_GPO(GPIO_70, HIGH), }; +/* WWAN on USB or no WWAN - Disable the WWAN power line */ +static const struct soc_amd_gpio bootblock_gpio_table_pcie_wwan[] = { + /* EN_PWR_WWAN_X */ + PAD_GPO(GPIO_8, LOW), + /* WLAN_DISABLE */ + PAD_GPO(GPIO_130, LOW), +}; + const struct soc_amd_gpio *variant_override_gpio_table(size_t *size) { uint32_t board_version = board_id(); @@ -69,3 +78,12 @@ const struct soc_amd_gpio *variant_pcie_override_gpio_table(size_t *size) return NULL; } +const struct soc_amd_gpio *variant_bootblock_override_gpio_table(size_t *size) +{ + if (variant_has_pcie_wwan()) { + *size = ARRAY_SIZE(bootblock_gpio_table_pcie_wwan); + return bootblock_gpio_table_pcie_wwan; + } + + return NULL; +}