Attention is currently required from: Tarun Tuli, Kapil Porwal.
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/70229 )
Change subject: mb/google/rex: Add MPTS method for WWAN over PCIe ......................................................................
mb/google/rex: Add MPTS method for WWAN over PCIe
This patch generates the following for the mainboard:
Scope (_SB) { Method (MPTS, 1, Serialized) { Local0 = _SB.PCI0.RP06.RTD3._STA () If ((Local0 == One)) { _SB.PCI0.RP06.PXSX.DPTS (Arg0) } } }
Change-Id: I27ade63cfe0586aee9f03ba816b2590f14dcb610 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/mainboard/google/rex/mainboard.c M src/mainboard/google/rex/variants/rex0/overridetree.cb 2 files changed, 58 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/70229/1
diff --git a/src/mainboard/google/rex/mainboard.c b/src/mainboard/google/rex/mainboard.c index f61af2c..bb64c63 100644 --- a/src/mainboard/google/rex/mainboard.c +++ b/src/mainboard/google/rex/mainboard.c @@ -5,10 +5,13 @@ #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <device/device.h> +#include <drivers/wwan/fm/chip.h> #include <ec/ec.h> #include <fw_config.h> #include <vendorcode/google/chromeos/chromeos.h>
+WEAK_DEV_PTR(rp6_wwan); + static void mainboard_init(void *chip_info) { const struct pad_config *pads; @@ -47,8 +50,38 @@ acpigen_write_if_end(); }
+static void mainboard_generate_wwan_shutdown(const struct device *dev) +{ + const struct drivers_wwan_fm_config *config = config_of(dev); + const struct device *parent = dev->bus->dev; + + if (!config) + return; + if (config->rtd3dev) { + acpigen_write_store(); + acpigen_emit_namestring(acpi_device_path_join(parent, "RTD3._STA")); + acpigen_emit_byte(LOCAL0_OP); + acpigen_write_if_lequal_op_int(LOCAL0_OP, ONE_OP); + { + acpigen_emit_namestring(acpi_device_path_join(dev, "DPTS")); + acpigen_emit_byte(ARG0_OP); + } + acpigen_write_if_end(); + } +} + static void mainboard_fill_ssdt(const struct device *dev) { + const struct device *wwan = DEV_PTR(rp6_wwan); + + if (wwan) { + acpigen_write_scope("\_SB"); + acpigen_write_method_serialized("MPTS", 1); + mainboard_generate_wwan_shutdown(wwan); + acpigen_write_method_end(); /* Method */ + acpigen_write_scope_end(); /* Scope */ + } + acpigen_write_scope("\_SB"); acpigen_write_method_serialized("MS0X", 1); mainboard_generate_s0ix_hook(); diff --git a/src/mainboard/google/rex/variants/rex0/overridetree.cb b/src/mainboard/google/rex/variants/rex0/overridetree.cb index 8d1d528..97b8b84 100644 --- a/src/mainboard/google/rex/variants/rex0/overridetree.cb +++ b/src/mainboard/google/rex/variants/rex0/overridetree.cb @@ -468,7 +468,7 @@ register "wake_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_F10)" register "add_acpi_dma_property" = "true" use rp6_rtd3 as rtd3dev - device generic 0 on end + device generic 0 alias rp6_wwan on end end end #PCIE6 WWAN card device ref gspi1 on