diff options
author | Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com> | 2021-03-26 16:05:47 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-04-06 07:05:41 +0000 |
commit | 0d9829dc054d2dc71e9744e85ab40185eb0c6c06 (patch) | |
tree | 54030537c31f5af5cd5df665f389d25649ac9358 /src/mainboard | |
parent | d9999e84d2cea90d759e21caafc25750f91a8570 (diff) |
mb/google/dedede/var/cret: Support LTE module
Add LTE module support into devicetree and associated GPIO configuration.
BUG=b:183774169
BRANCH=dedede
TEST=Build the cret board.
Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Change-Id: I14684bb30e46bf845a401649f56b16b60db379e8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51844
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/mainboard')
4 files changed, 40 insertions, 0 deletions
diff --git a/src/mainboard/google/dedede/variants/cret/Makefile.inc b/src/mainboard/google/dedede/variants/cret/Makefile.inc index eb2c9bc021..fd60a18b69 100644 --- a/src/mainboard/google/dedede/variants/cret/Makefile.inc +++ b/src/mainboard/google/dedede/variants/cret/Makefile.inc @@ -1,3 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-or-later ramstage-y += gpio.c + +smm-y += variant.c diff --git a/src/mainboard/google/dedede/variants/cret/gpio.c b/src/mainboard/google/dedede/variants/cret/gpio.c index cb562212ae..3dd15efaa8 100644 --- a/src/mainboard/google/dedede/variants/cret/gpio.c +++ b/src/mainboard/google/dedede/variants/cret/gpio.c @@ -5,6 +5,8 @@ /* Pad configuration in ramstage */ static const struct pad_config override_gpio_table[] = { + /* A10 : WWAN_EN */ + PAD_CFG_GPO(GPP_A10, 1, PWROK), /* C12 : AP_PEN_DET_ODL ==> NC */ PAD_NC(GPP_C12, UP_20K), /* C18 : AP_I2C_EMR_SDA */ @@ -13,6 +15,8 @@ static const struct pad_config override_gpio_table[] = { PAD_NC(GPP_C19, NONE), /* C22 : UART2_RTS_N ==> NC */ PAD_NC(GPP_C22, UP_20K), + /* D0 : WWAN_HOST_WAKE ==> WWAN_WDISABLE_L */ + PAD_CFG_GPO(GPP_D0, 1, DEEP), /* D12 : WCAM_RST_L ==> NC */ PAD_NC(GPP_D12, NONE), /* D14 : EN_PP1200_CAMERA ==> NC */ @@ -23,6 +27,8 @@ static const struct pad_config override_gpio_table[] = { PAD_NC(GPP_D19, NONE), /* D20 : WWAN_WLAN_COEX2 ==> NC */ PAD_NC(GPP_D20, NONE), + /* D21 : WWAN_WLAN_COEX3 ==> NC */ + PAD_NC(GPP_D21, NONE), /* E0 : CLK_24M_UCAM ==> NC */ PAD_NC(GPP_E0, NONE), /* E2 : CLK_24M_WCAM ==> NC */ @@ -33,6 +39,8 @@ static const struct pad_config override_gpio_table[] = { PAD_NC(GPP_H6, NONE), /* H7 : AP_I2C_CAM_SCL ==> NC */ PAD_NC(GPP_H7, NONE), + /* H17 : WWAN_RST_L */ + PAD_CFG_GPO(GPP_H17, 1, PLTRST), /* G0 : SD_CMD ==> NC */ PAD_NC(GPP_G0, NONE), /* G1 : SD_DATA0 ==> NC */ diff --git a/src/mainboard/google/dedede/variants/cret/overridetree.cb b/src/mainboard/google/dedede/variants/cret/overridetree.cb index 45e7afb8e0..0cf3bdf187 100644 --- a/src/mainboard/google/dedede/variants/cret/overridetree.cb +++ b/src/mainboard/google/dedede/variants/cret/overridetree.cb @@ -75,6 +75,13 @@ chip soc/intel/jasperlake chip drivers/usb/acpi register "desc" = ""LTE"" register "type" = "UPC_TYPE_INTERNAL" + register "has_power_resource" = "1" + register "reset_gpio" = + "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_H17)" + register "reset_off_delay_ms" = "10" + register "enable_gpio" = + "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" + register "enable_delay_ms" = "20" device usb 3.3 on end end end diff --git a/src/mainboard/google/dedede/variants/cret/variant.c b/src/mainboard/google/dedede/variants/cret/variant.c new file mode 100644 index 0000000000..2540fc7f2a --- /dev/null +++ b/src/mainboard/google/dedede/variants/cret/variant.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <acpi/acpi.h> +#include <baseboard/variants.h> +#include <delay.h> +#include <gpio.h> + +static void power_off_lte_module(void) +{ + gpio_output(GPP_H17, 0); + mdelay(10); + gpio_output(GPP_A10, 0); +} + +void variant_smi_sleep(u8 slp_typ) +{ + /* + * Once the FW_CONFIG is provisioned, power off LTE module only under + * the situation where it is stuffed. + */ + if (slp_typ == ACPI_S5) + power_off_lte_module(); +} |