Tony Huang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52204 )
Change subject: mb/google/dedede/var/kracko: Add LTE modem support ......................................................................
mb/google/dedede/var/kracko: Add LTE modem support
Add LTE modem to devicetree Configure GPIO control for LTE modem
BUG=b:178092096 TEST=Built image and verified with command modem status
Change-Id: Id8f483e1132a08500fbe950711cc84197ce40b12 Signed-off-by: Tony Huang tony-huang@quanta.corp-partner.google.com --- A src/mainboard/google/dedede/variants/kracko/Makefile.inc A src/mainboard/google/dedede/variants/kracko/gpio.c M src/mainboard/google/dedede/variants/kracko/overridetree.cb A src/mainboard/google/dedede/variants/kracko/variant.c 4 files changed, 68 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/52204/1
diff --git a/src/mainboard/google/dedede/variants/kracko/Makefile.inc b/src/mainboard/google/dedede/variants/kracko/Makefile.inc new file mode 100644 index 0000000..fd60a18 --- /dev/null +++ b/src/mainboard/google/dedede/variants/kracko/Makefile.inc @@ -0,0 +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/kracko/gpio.c b/src/mainboard/google/dedede/variants/kracko/gpio.c new file mode 100644 index 0000000..ca89730 --- /dev/null +++ b/src/mainboard/google/dedede/variants/kracko/gpio.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> + +/* Pad configuration in ramstage*/ +static const struct pad_config gpio_table[] = { + /* A10 : WWAN_EN */ + PAD_CFG_GPO(GPP_A10, 1, PWROK), + + /* B7 : PCIE_CLKREQ2_N ==> WWAN_SAR_DETECT_ODL*/ + PAD_CFG_GPO(GPP_B7, 1, DEEP), + + /* D0 : WWAN_HOST_WAKE ==> WWAN_WDISABLE_L */ + PAD_CFG_GPO(GPP_D0, 1, DEEP), + + /* H17 : WWAN_RST_L */ + PAD_CFG_GPO(GPP_H17, 0, PLTRST), +}; + +const struct pad_config *variant_override_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(gpio_table); + return gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/kracko/overridetree.cb b/src/mainboard/google/dedede/variants/kracko/overridetree.cb index 99517bd..66fb274 100644 --- a/src/mainboard/google/dedede/variants/kracko/overridetree.cb +++ b/src/mainboard/google/dedede/variants/kracko/overridetree.cb @@ -55,6 +55,16 @@ chip drivers/usb/acpi device usb 0.0 on 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" = "20" + register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" + register "enable_delay_ms" = "20" + device usb 2.3 on end + end + chip drivers/usb/acpi register "desc" = ""UFCamera"" register "type" = "UPC_TYPE_INTERNAL" device usb 2.5 on end @@ -64,6 +74,11 @@ register "type" = "UPC_TYPE_INTERNAL" device usb 2.6 on end end + chip drivers/usb/acpi + register "desc" = ""LTE"" + register "type" = "UPC_TYPE_INTERNAL" + device usb 3.3 on end + end end end end # USB xHCI diff --git a/src/mainboard/google/dedede/variants/kracko/variant.c b/src/mainboard/google/dedede/variants/kracko/variant.c new file mode 100644 index 0000000..22caa06 --- /dev/null +++ b/src/mainboard/google/dedede/variants/kracko/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(20); + 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(); +}