Won Chung has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81089?usp=email )
Change subject: drivers/intel/pmc_mux/conn: Copy ACPI _PLD property from USB port to mux ......................................................................
drivers/intel/pmc_mux/conn: Copy ACPI _PLD property from USB port to mux
Copy ACPI _PLD values from USB ports to corresponding USB muxes.
BUG=to add TEST=emerge coreboot & SSDT dump
Change-Id: If27042cc995ef188f8a3e31444e994318ff98803 Signed-off-by: Won Chung wonchung@google.com Tested-by: Emilie Roberts hadrosaur@google.com --- M src/drivers/intel/pmc_mux/conn/conn.c 1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/81089/1
diff --git a/src/drivers/intel/pmc_mux/conn/conn.c b/src/drivers/intel/pmc_mux/conn/conn.c index c2c7199..7c58f05 100644 --- a/src/drivers/intel/pmc_mux/conn/conn.c +++ b/src/drivers/intel/pmc_mux/conn/conn.c @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */
#include <acpi/acpigen.h> +#include <acpi/acpi_pld.h> +#include <acpi/acpigen.h> #include <boot/coreboot_tables.h> #include <cbmem.h> #include <console/console.h> @@ -94,12 +96,31 @@ } }
+static void get_pld_from_usb_ports(struct acpi_pld *pld, + struct device *usb2_port, struct device *usb3_port) +{ + struct drivers_usb_acpi_config *config = NULL; + + if (usb3_port) + config = usb3_port->chip_info; + else if (usb2_port) + config = usb2_port->chip_info; + + if (config) { + if (config->use_custom_pld) + *pld = config->custom_pld; + else + acpi_pld_fill_usb(pld, config->type, &config->group); + } +} + static void conn_fill_ssdt(const struct device *dev) { struct drivers_intel_pmc_mux_conn_config *config = dev->chip_info; struct acpi_dp *dsd; const char *scope; const char *name; + struct acpi_pld pld = {0};
/* Reference the existing scope and write CONx device */ scope = acpi_device_scope(dev); @@ -131,6 +152,11 @@
acpi_dp_write(dsd);
+ // Copy _PLD from USB ports + get_pld_from_usb_ports(&pld, config->usb2_port, config->usb3_port); + if (!pld) + acpigen_write_pld(&pld); + acpigen_pop_len(); /* CONx Device */ acpigen_pop_len(); /* Scope */