mb/google/brox/jubilant: Modify WWAN Rolling RW101R-GL power sequence

There is no ACPI power resource for LTE module Rolling RW101R-GL,
therefore implement the power sequence of power-on, power-off, and
reset timing from GPIO init, bootstate init callbacks, and smihandler
function.

BUG=b:368450447
BRANCH=None
TEST= Build firmware and verify on jubilant with LTE:RW101R-GL.
      Measure the power on, power off, and reset timing.
      Run warm boot, cold boot and suspend/resume to make sure
      WWAN devcie is workable.

Change-Id: I4a205e3db777c7c225d31b6cc802883fd7167089
Signed-off-by: Ren Kuo <ren.kuo@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84689
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Ren Kuo 2024-10-07 16:42:54 +08:00 committed by Subrata Banik
commit 4ef7c4602b
4 changed files with 42 additions and 3 deletions

View file

@ -9,3 +9,5 @@ ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
ramstage-$(CONFIG_FW_CONFIG) += variant.c
ramstage-y += gpio.c
ramstage-y += ramstage.c
smm-y += smihandler.c

View file

@ -28,9 +28,10 @@ static const struct pad_config override_gpio_table[] = {
*/
PAD_CFG_GPO_LOCK(GPP_A12, 1, LOCK_CONFIG),
/* GPP_H23 : SRCCLKREQ5_L ==> WWAN_RST_L */
PAD_CFG_GPO_LOCK(GPP_H23, 1, LOCK_CONFIG),
PAD_CFG_GPO_LOCK(GPP_H23, 0, LOCK_CONFIG),
/* GPP_F21 : [NF1: Reserved NF6: USB_C_GPP_F21] ==> WWAN_FCPO_L */
PAD_CFG_GPO_LOCK(GPP_F21, 1, LOCK_CONFIG),
PAD_CFG_GPO_LOCK(GPP_F21, 0, LOCK_CONFIG),
/* GPP_H19 : SRCCLKREQ4_L ==> SAR1_INT_L */
PAD_CFG_GPI_APIC_LOCK(GPP_H19, NONE, LEVEL, NONE, LOCK_CONFIG),
@ -193,7 +194,7 @@ static const struct pad_config romstage_gpio_table[] = {
/* GPP_H23 : SRCCLKREQ5_L ==> WWAN_RST_L */
PAD_CFG_GPO_LOCK(GPP_H23, 0, LOCK_CONFIG),
/* GPP_F21 : [NF1: Reserved NF6: USB_C_GPP_F21] ==> WWAN_FCPO_L */
PAD_CFG_GPO_LOCK(GPP_F21, 1, LOCK_CONFIG),
PAD_CFG_GPO_LOCK(GPP_F21, 0, LOCK_CONFIG),
/* GPP_E15 : SRCCLK_OE8_L ==> MEM_STRAP_0 */
PAD_CFG_GPI(GPP_E15, NONE, PLTRST),

View file

@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
#include <baseboard/variants.h>
#include <delay.h>
#include "gpio.h"
#define WWAN_FCPO_L GPP_F21
#define WWAN_RSL_L GPP_H23
#define WWAN_TOFF 15
void variant_smi_sleep(u8 slp_typ)
{
if (slp_typ == ACPI_S5) {
/* WWAN RW101R-GL power off sequence */
gpio_set(WWAN_RSL_L, 0);
mdelay(WWAN_TOFF);
gpio_set(WWAN_FCPO_L, 0);
}
}

View file

@ -1,12 +1,18 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h>
#include <bootstate.h>
#include <baseboard/variants.h>
#include <chip.h>
#include <device/device.h>
#include <fw_config.h>
#include <sar.h>
#include "gpio.h"
#define WWAN_RSL_L GPP_H23
#define WWAN_FCPO_L GPP_F21
void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config)
{
if (fw_config_probe(FW_CONFIG(WIFI_BT, WIFI_BT_CNVI)) || (!fw_config_is_provisioned())) {
@ -24,3 +30,12 @@ const char *get_wifi_sar_cbfs_filename(void)
{
return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_BT));
}
static void wwan_out_of_reset(void *unused)
{
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1A_LTE))) {
gpio_set(WWAN_FCPO_L, 1);
gpio_set(WWAN_RSL_L, 1);
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, wwan_out_of_reset, NULL);