Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Karthik Ramasubramanian: Looks good to me, approved
mb/google/dedede/var/storo: Support LTE module

Add LTE module support into devicetree and associated GPIO configuartion.

BUG=b:177955524
BRANCH=dedede
TEST=LTE function is OK

Change-Id: I9aff9608e08eae00ab5ac8547f63bc83b62fea78
Signed-off-by: Zanxi Chen <chenzanxi@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
---
M src/mainboard/google/dedede/variants/storo/Makefile.inc
M src/mainboard/google/dedede/variants/storo/gpio.c
M src/mainboard/google/dedede/variants/storo/overridetree.cb
A src/mainboard/google/dedede/variants/storo/variant.c
4 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/mainboard/google/dedede/variants/storo/Makefile.inc b/src/mainboard/google/dedede/variants/storo/Makefile.inc
index eb2c9bc..fd60a18 100644
--- a/src/mainboard/google/dedede/variants/storo/Makefile.inc
+++ b/src/mainboard/google/dedede/variants/storo/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/storo/gpio.c b/src/mainboard/google/dedede/variants/storo/gpio.c
index 0f5b6d2..d9b1307 100644
--- a/src/mainboard/google/dedede/variants/storo/gpio.c
+++ b/src/mainboard/google/dedede/variants/storo/gpio.c
@@ -5,8 +5,17 @@

/* 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_GPI_IRQ_WAKE(GPP_B7, NONE, DEEP, LEVEL, INVERT),
+
/* D15 : EN_PP3300_CAMERA */
PAD_CFG_GPO(GPP_D15, 1, PLTRST),
+
+ /* H17 : WWAN_RST_L */
+ PAD_CFG_GPO(GPP_H17, 0, PLTRST),
};

const struct pad_config *variant_override_gpio_table(size_t *num)
diff --git a/src/mainboard/google/dedede/variants/storo/overridetree.cb b/src/mainboard/google/dedede/variants/storo/overridetree.cb
index f9655d4..a600381 100644
--- a/src/mainboard/google/dedede/variants/storo/overridetree.cb
+++ b/src/mainboard/google/dedede/variants/storo/overridetree.cb
@@ -78,6 +78,16 @@
register "enable_delay_ms" = "20"
device usb 2.5 on end
end
+ 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
end
end # USB xHCI
diff --git a/src/mainboard/google/dedede/variants/storo/variant.c b/src/mainboard/google/dedede/variants/storo/variant.c
new file mode 100644
index 0000000..2540fc7
--- /dev/null
+++ b/src/mainboard/google/dedede/variants/storo/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();
+}

To view, visit change 51017. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9aff9608e08eae00ab5ac8547f63bc83b62fea78
Gerrit-Change-Number: 51017
Gerrit-PatchSet: 6
Gerrit-Owner: zanxi chen <chenzanxi@huaqin.corp-partner.google.com>
Gerrit-Reviewer: Henry Sun <henrysun@google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Tao Xia <xiatao5@huaqin.corp-partner.google.com>
Gerrit-Reviewer: Weimin Wu <wuweimin@huaqin.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged