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>
diff --git a/src/mainboard/google/brya/variants/pujjo/gpio.c b/src/mainboard/google/brya/variants/pujjo/gpio.c
index 91223c3..fd3dca5 100644
--- a/src/mainboard/google/brya/variants/pujjo/gpio.c
+++ b/src/mainboard/google/brya/variants/pujjo/gpio.c
@@ -49,11 +49,11 @@
/* 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 46a167a..97e7e55 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 @@
{
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));
+ }
+}