diff options
author | Leo Chou <leo.chou@lcfc.corp-partner.google.com> | 2023-05-19 11:42:55 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-22 12:44:58 +0000 |
commit | 4d002f356e0f00e88bf225ca6ea2453955e5093d (patch) | |
tree | 824bc7771c5ead80819497829bef3e3f26198dd1 | |
parent | efe035183a1310c3bafc1b0ce6dbb20efc4ad949 (diff) |
mb/google/nissa/var/pujjo: Add WWAN_5G power on sequence
Pujjoteen5 support WWAN 5G device, use variant.c to handle the
power on sequence.
BUG=b:279835626
TEST=Build and check WWAN 5G power on sequence.
Signed-off-by: Leo Chou <leo.chou@lcfc.corp-partner.google.com>
Change-Id: I7dc72f2c705bcb41745f4bf08bef286773fe8b13
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75327
Reviewed-by: Derek Huang <derekhuang@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/mainboard/google/brya/variants/pujjo/gpio.c | 4 | ||||
-rw-r--r-- | src/mainboard/google/brya/variants/pujjo/variant.c | 31 |
2 files changed, 33 insertions, 2 deletions
diff --git a/src/mainboard/google/brya/variants/pujjo/gpio.c b/src/mainboard/google/brya/variants/pujjo/gpio.c index 91223c30fe..fd3dca5f90 100644 --- a/src/mainboard/google/brya/variants/pujjo/gpio.c +++ b/src/mainboard/google/brya/variants/pujjo/gpio.c @@ -49,11 +49,11 @@ static const struct pad_config override_5g_gpio_table[] = { /* D17 : NC ==> SD_WAKE_N */ PAD_CFG_GPI_LOCK(GPP_D17, NONE, LOCK_CONFIG), /* F12 : WWAN_RST_L */ - PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG), + PAD_CFG_GPO(GPP_F12, 0, DEEP), /* H19 : SOC_I2C_SUB_INT_ODL */ PAD_CFG_GPI_APIC(GPP_H19, NONE, PLTRST, LEVEL, NONE), /* H21 : WCAM_MCLK_R ==> WWAN_PERST_L */ - PAD_CFG_GPO(GPP_H21, 1, DEEP), + PAD_CFG_GPO(GPP_H21, 0, DEEP), /* H22 : WCAM_MCLK_R ==> NC */ PAD_NC(GPP_H22, NONE), /* H23 : WWAN_SAR_DETECT_ODL */ diff --git a/src/mainboard/google/brya/variants/pujjo/variant.c b/src/mainboard/google/brya/variants/pujjo/variant.c index 46a167a766..97e7e557d4 100644 --- a/src/mainboard/google/brya/variants/pujjo/variant.c +++ b/src/mainboard/google/brya/variants/pujjo/variant.c @@ -2,7 +2,21 @@ #include <fw_config.h> #include <baseboard/variants.h> +#include <baseboard/gpio.h> #include <sar.h> +#include <delay.h> + +#define FM350_RST_DEALY_MS 20 +#define FM350_PERST_DEALY_MS 30 + +static const struct pad_config fm350_rst_pad[] = { + /* F12 : WWAN_RST_L */ + PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG), +}; +static const struct pad_config fm350_perst_pad[] = { + /* H21 : WWAN_PERST */ + PAD_CFG_GPO(GPP_H21, 1, DEEP), +}; void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config) { @@ -37,3 +51,20 @@ const char *get_wifi_sar_cbfs_filename(void) { return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_SAR_ID)); } + +void variant_init(void) +{ + if (fw_config_probe(FW_CONFIG(WWAN_5G, WWAN_5G_PRESENT))) { + /* + * FM350 power on seuqence: + * De-assert WWAN_EN -> 20ms -> de-assert WWAN_RST -> 30ms -> + * de-assert WWAN_PERST + * WWAN_EN is de-asserted in ramstage gpio configuration, de-assert + * WWAN_RST and WWAN_PERST here. + */ + mdelay(FM350_RST_DEALY_MS); + gpio_configure_pads(fm350_rst_pad, ARRAY_SIZE(fm350_rst_pad)); + mdelay(FM350_PERST_DEALY_MS); + gpio_configure_pads(fm350_perst_pad, ARRAY_SIZE(fm350_perst_pad)); + } +} |