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 <martinroth@chromium.org>
Change-Id: I153eb6cd7c3a0e2cc3b71c99f76db3e565173cfe
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54743
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Martin Roth 2021-05-13 14:27:47 -06:00 committed by Martin Roth
parent 3360862687
commit bdba51208a
2 changed files with 20 additions and 0 deletions

View File

@ -240,6 +240,8 @@ static const struct soc_amd_gpio early_gpio_table[] = {
static const struct soc_amd_gpio bootblock_gpio_table[] = { static const struct soc_amd_gpio bootblock_gpio_table[] = {
/* Enable WWAN & WLAN */ /* Enable WWAN & WLAN */
/* EN_PWR_WWAN_X */
PAD_GPO(GPIO_8, HIGH),
/* WWAN_RST_L */ /* WWAN_RST_L */
PAD_GPO(GPIO_24, HIGH), PAD_GPO(GPIO_24, HIGH),
/* WWAN_DISABLE */ /* WWAN_DISABLE */

View File

@ -5,6 +5,7 @@
#include <boardid.h> #include <boardid.h>
#include <gpio.h> #include <gpio.h>
#include <soc/gpio.h> #include <soc/gpio.h>
#include <baseboard/variants.h>
/* This table is used by guybrush variant with board version < 2. */ /* This table is used by guybrush variant with board version < 2. */
static const struct soc_amd_gpio bid1_gpio_table[] = { 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), 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) const struct soc_amd_gpio *variant_override_gpio_table(size_t *size)
{ {
uint32_t board_version = board_id(); 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; 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;
}