From f1fbcf76479851e61d84a9e888585161c8902cb9 Mon Sep 17 00:00:00 2001 From: John Su Date: Wed, 19 Feb 2025 23:17:25 +0800 Subject: [PATCH] mb/trulo/var/uldrenite: Fix boot time caused by WWAN initialization The previous approach would increase the delay time by 50 ms. So move WWAN power sequence to GPIO control to reduce boot time caused by WWAN initialization. Additionally, add a 150ms delay to T0_OFF_MS before powering off the WWAN. This ensures that the WWAN Power OFF Sequence operates correctly during a reboot. BUG=b:383212261 BRANCH=firmware-trulo-15217.771.B TEST=Confirm the measured WWAN power sequence Change-Id: Ie01019eca7eaa4bbb34dd80aeb65b9b6b08587fd Signed-off-by: John Su Reviewed-on: https://review.coreboot.org/c/coreboot/+/86514 Reviewed-by: Eric Lai Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- .../google/brya/variants/uldrenite/gpio.c | 10 +++--- .../variants/uldrenite/include/variant/gpio.h | 1 + .../google/brya/variants/uldrenite/variant.c | 32 ------------------- src/mainboard/google/brya/wwan_power.asl | 3 ++ 4 files changed, 10 insertions(+), 36 deletions(-) diff --git a/src/mainboard/google/brya/variants/uldrenite/gpio.c b/src/mainboard/google/brya/variants/uldrenite/gpio.c index 3e11b48d0a..e8355d37e8 100644 --- a/src/mainboard/google/brya/variants/uldrenite/gpio.c +++ b/src/mainboard/google/brya/variants/uldrenite/gpio.c @@ -232,9 +232,9 @@ static const struct pad_config gpio_table[] = { /* F11 : NC */ PAD_NC_LOCK(GPP_F11, NONE, LOCK_CONFIG), /* F12 : NC ==> WWAN_RST_L */ - PAD_CFG_GPO(GPP_F12, 0, DEEP), + PAD_CFG_GPO(GPP_F12, 1, DEEP), /* F13 : NC ==> PLTRST_WWAN# */ - PAD_CFG_GPO(GPP_F13, 0, DEEP), + PAD_CFG_GPO(GPP_F13, 1, DEEP), /* F14 : NC */ PAD_NC(GPP_F14, NONE), /* F15 : NC */ @@ -303,7 +303,7 @@ static const struct pad_config gpio_table[] = { /* H22 : NC */ PAD_NC(GPP_H22, NONE), /* H23 : LTE_PWR_OFF_EN */ - PAD_CFG_GPO(GPP_H23, 0, DEEP), + PAD_CFG_GPO(GPP_H23, 1, DEEP), /* R0 : HDA_BCLK ==> HDA_BIT_CLK */ PAD_CFG_NF(GPP_R0, NONE, DEEP, NF1), @@ -435,7 +435,7 @@ static const struct pad_config early_gpio_table[] = { /* H11 : UART0_TXD ==> UART_SOC_TX_DBG_RX */ PAD_CFG_NF(GPP_H11, NONE, DEEP, NF2), /* H23 : LTE_PWR_OFF_EN */ - PAD_CFG_GPO(GPP_H23, 0, DEEP), + PAD_CFG_GPO(GPP_H23, 1, DEEP), }; /* Fill romstage gpio configuration */ @@ -445,6 +445,8 @@ static const struct pad_config romstage_gpio_table[] = { PAD_CFG_GPO(GPP_E17, 1, DEEP), /* D15 : GPP_D15 ==> SOC_TS_I2C_RST# */ PAD_CFG_GPO(GPP_D15, 0, DEEP), + /* F12 : NC ==> WWAN_RST_L */ + PAD_CFG_GPO(GPP_F12, 1, DEEP), }; const struct pad_config *variant_gpio_table(size_t *num) diff --git a/src/mainboard/google/brya/variants/uldrenite/include/variant/gpio.h b/src/mainboard/google/brya/variants/uldrenite/include/variant/gpio.h index 612ea2adbb..e7524565d0 100644 --- a/src/mainboard/google/brya/variants/uldrenite/include/variant/gpio.h +++ b/src/mainboard/google/brya/variants/uldrenite/include/variant/gpio.h @@ -10,5 +10,6 @@ #define WWAN_PERST GPP_F13 #define T1_OFF_MS 20 #define T2_OFF_MS 10 +#define T0_OFF_MS 150 #endif diff --git a/src/mainboard/google/brya/variants/uldrenite/variant.c b/src/mainboard/google/brya/variants/uldrenite/variant.c index 3620c3a0c8..421799694a 100644 --- a/src/mainboard/google/brya/variants/uldrenite/variant.c +++ b/src/mainboard/google/brya/variants/uldrenite/variant.c @@ -7,27 +7,11 @@ #include #include -#define RW350R_RST_DELAY_MS 20 -#define RW350R_PERST_DELAY_MS 30 - const char *get_wifi_sar_cbfs_filename(void) { return "wifi_sar_0.hex"; } -static const struct pad_config rw350r_en_pad[] = { - /* H23 : LTE_PWR_OFF_EN */ - PAD_CFG_GPO(GPP_H23, 1, DEEP), -}; -static const struct pad_config rw350r_rst_pad[] = { - /* F12 : WWAN_RST_L */ - PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG), -}; -static const struct pad_config rw350r_perst_pad[] = { - /* F13 : PLTRST_WWAN# */ - PAD_CFG_GPO(GPP_F13, 1, DEEP), -}; - static const struct pad_config touchscreen_disable_pads[] = { /* A21 : TCHSCR_REPORT_EN */ PAD_NC(GPP_A21, NONE), @@ -68,22 +52,6 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table) } } -void variant_init(void) -{ - if (fw_config_probe(FW_CONFIG(DB_CELLULAR, CELLULAR_ABSENT))) - return; - /* - * RW350R power on seuqence: - * De-assert WWAN_EN -> 20ms -> de-assert WWAN_RST -> 30ms -> - * de-assert WWAN_PERST - */ - gpio_configure_pads(rw350r_en_pad, ARRAY_SIZE(rw350r_en_pad)); - mdelay(RW350R_RST_DELAY_MS); - gpio_configure_pads(rw350r_rst_pad, ARRAY_SIZE(rw350r_rst_pad)); - mdelay(RW350R_PERST_DELAY_MS); - gpio_configure_pads(rw350r_perst_pad, ARRAY_SIZE(rw350r_perst_pad)); -} - void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config) { if (fw_config_probe(FW_CONFIG(EXT_VR, EXT_VR_PRESENT))) { diff --git a/src/mainboard/google/brya/wwan_power.asl b/src/mainboard/google/brya/wwan_power.asl index f19a5ef4e9..4f9b788bc5 100644 --- a/src/mainboard/google/brya/wwan_power.asl +++ b/src/mainboard/google/brya/wwan_power.asl @@ -11,4 +11,7 @@ Method (MPTS, 1) \_SB.PCI0.CTXS(WWAN_RST); Sleep(T2_OFF_MS) \_SB.PCI0.CTXS(WWAN_FCPO); +#if CONFIG(BOARD_GOOGLE_ULDRENITE) + Sleep(T0_OFF_MS) +#endif }