From 0dba17da0c9b885c4c8fa3f4afa3bb7ef3ab12ca Mon Sep 17 00:00:00 2001 From: John Su Date: Mon, 9 Dec 2024 16:39:02 +0800 Subject: [PATCH] mb/google/brya/uldrenite: Add WWAN RW350R-GL power on sequence Uldrenite supports the WWAN 5G device and uses variant.c to handle the power-on sequence according to the Rolling Wireless_RW350R-GL_Hardware Guide_Generic_V1.1. Due to no hardware access, the boot time is estimated to increase by 50 ms. At this stage, we do not yet have the board or key parts for verification. However, I still need to merge the CL to ensure that the WWAN functionality works. Once the motherboard is available, I will make adjustments to optimize and reduce the boot time. BUG=b:381393809, b:383212261 BRANCH=None TEST=emerge-nissa coreboot Change-Id: If8695920c2b3d2a27da62afcbe75e70d1ea09792 Signed-off-by: John Su Reviewed-on: https://review.coreboot.org/c/coreboot/+/85537 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Dinesh Gehlot Reviewed-by: Kapil Porwal Reviewed-by: Dtrain Hsu --- .../brya/variants/uldrenite/Makefile.mk | 1 + .../google/brya/variants/uldrenite/variant.c | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/mainboard/google/brya/variants/uldrenite/variant.c diff --git a/src/mainboard/google/brya/variants/uldrenite/Makefile.mk b/src/mainboard/google/brya/variants/uldrenite/Makefile.mk index 87f515acad..c31fa307d0 100644 --- a/src/mainboard/google/brya/variants/uldrenite/Makefile.mk +++ b/src/mainboard/google/brya/variants/uldrenite/Makefile.mk @@ -5,4 +5,5 @@ romstage-y += gpio.c romstage-y += memory.c ramstage-y += gpio.c +ramstage-$(CONFIG_FW_CONFIG) += variant.c ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HDA_VERB) += hda_verb.c diff --git a/src/mainboard/google/brya/variants/uldrenite/variant.c b/src/mainboard/google/brya/variants/uldrenite/variant.c new file mode 100644 index 0000000000..753abb6d02 --- /dev/null +++ b/src/mainboard/google/brya/variants/uldrenite/variant.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +#define RW350R_RST_DELAY_MS 20 +#define RW350R_PERST_DELAY_MS 30 + +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), +}; + +void variant_init(void) +{ + /* + * 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)); +}