John Su has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85537?usp=email )
Change subject: mb/google/brya/uldrenite: Add WWAN RW350R-GL power on sequence ......................................................................
mb/google/brya/uldrenite: Add WWAN RW350R-GL power on sequence
Uldrenite support WWAN 5G device, use variant.c to handle the power on sequence for WWAN RW350R-GL.
BUG=b:381393809 BRANCH=None TEST=emerge-nissa coreboot
Change-Id: If8695920c2b3d2a27da62afcbe75e70d1ea09792 Signed-off-by: John Su john_su@compal.corp-partner.google.com --- M src/mainboard/google/brya/variants/uldrenite/Makefile.mk A src/mainboard/google/brya/variants/uldrenite/variant.c 2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/85537/1
diff --git a/src/mainboard/google/brya/variants/uldrenite/Makefile.mk b/src/mainboard/google/brya/variants/uldrenite/Makefile.mk index 91f031e..b8b2532 100644 --- a/src/mainboard/google/brya/variants/uldrenite/Makefile.mk +++ b/src/mainboard/google/brya/variants/uldrenite/Makefile.mk @@ -3,3 +3,5 @@ bootblock-y += gpio.c romstage-y += gpio.c ramstage-y += gpio.c + +ramstage-$(CONFIG_FW_CONFIG) += variant.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 0000000..25e0076 --- /dev/null +++ b/src/mainboard/google/brya/variants/uldrenite/variant.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <console/console.h> +#include <delay.h> + +#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)); +}