David Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52887 )
Change subject: mb/google/dedede/var/metaknight: Update xhci device tree ......................................................................
mb/google/dedede/var/metaknight: Update xhci device tree
Update xhci device tree to fix can not observe LTE ACPI objects in the SSDT.
BUG=b:186380807 TEST=build and boot to OS.
Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com Change-Id: I857211bfc4beb36ab225f3786c1707336a34aae9 --- M src/mainboard/google/dedede/mainboard.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/dedede/variants/metaknight/variant.c 3 files changed, 44 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/52887/1
diff --git a/src/mainboard/google/dedede/mainboard.c b/src/mainboard/google/dedede/mainboard.c index 26afb69..6d544b5 100644 --- a/src/mainboard/google/dedede/mainboard.c +++ b/src/mainboard/google/dedede/mainboard.c @@ -40,10 +40,17 @@ gpio_configure_pads_with_override(base_pads, base_num, override_pads, override_num);
+ variant_devtree_update(); + if (CONFIG(BOARD_GOOGLE_BASEBOARD_DEDEDE_CR50)) mainboard_update_soc_chip_config(); }
+void __weak variant_devtree_update(void) +{ + /* Override dev tree settings per board */ +} + static void mainboard_dev_init(struct device *dev) { mainboard_ec_init(); diff --git a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h index e7bfd86..a3dcd91 100644 --- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h @@ -39,4 +39,7 @@ /* Allow each variants to customize SMI sleep flow. */ void variant_smi_sleep(u8 slp_typ);
+/* Modify devictree settings during ramstage. */ +void variant_devtree_update(void); + #endif /*__BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/google/dedede/variants/metaknight/variant.c b/src/mainboard/google/dedede/variants/metaknight/variant.c index 2540fc7..cf97496 100644 --- a/src/mainboard/google/dedede/variants/metaknight/variant.c +++ b/src/mainboard/google/dedede/variants/metaknight/variant.c @@ -3,7 +3,10 @@ #include <acpi/acpi.h> #include <baseboard/variants.h> #include <delay.h> +#include <fw_config.h> #include <gpio.h> +#include <soc/pci_devs.h> +#include <console/console.h>
static void power_off_lte_module(void) { @@ -12,6 +15,32 @@ gpio_output(GPP_A10, 0); }
+static void update_xhci_devtree(void) +{ + const struct device *xhci, *hub = NULL, *port = NULL; + const struct drivers_usb_acpi_config *config; + + xhci = pcidev_path_on_root(PCH_DEVFN_XHCI); + if (!xhci) { + printk(BIOS_ERR, "%s: Could not locate XHCI device in DT\n", __func__); + return; + } + + while ((hub = dev_bus_each_child(xhci->link_list, hub)) != NULL) { + while ((port = dev_bus_each_child(hub->link_list, port)) != NULL) { + if ((port->path.usb.port_id != 3)) + continue; + + config = config_of(port); + if (fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI))) { + /* Set 1A HDMI configuration */ + } else if (fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_LTE_HDMI))) { + /* Set LTE HDMI configuration */ + } + } + } +} + void variant_smi_sleep(u8 slp_typ) { /* @@ -21,3 +50,8 @@ if (slp_typ == ACPI_S5) power_off_lte_module(); } + +void variant_devtree_update(void) +{ + update_xhci_devtree(); +}