Attention is currently required from: Maulik V Vaghela, Paul Menzel. Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/55945 )
Change subject: drivers/intel/usb4/retimer: Update code to assign correct port number ......................................................................
Patch Set 3:
(3 comments)
File src/drivers/intel/usb4/retimer/chip.h:
https://review.coreboot.org/c/coreboot/+/55945/comment/5518ea1a_4b2390b3 PS3, Line 17: /* _PLD setting */ : struct acpi_pld_group group; This isn't necessary, it can be retrieved from the typec_port as well, see below
File src/drivers/intel/usb4/retimer/retimer.c:
https://review.coreboot.org/c/coreboot/+/55945/comment/7b25e6c0_71525857 PS3, Line 364: usb_port = config->dfp[dfp_port].typec_port->path.usb.port_id; should probably ensure that the device has the correct type first, e.g.: ``` if (config->dfp[dfp_port].typec_port->path.type != DEVICE_PATH_USB)) { printk(BIOS_ERR, "ERROR: typec_port for %s is not a USB device\n", dev_path(dev)); return; } ```
https://review.coreboot.org/c/coreboot/+/55945/comment/4539b1cc_cd049622 PS3, Line 373: acpi_pld_fill_usb(&pld, UPC_TYPE_PROPRIETARY, &config->dfp[dfp_port].group); : pld.shape = PLD_SHAPE_OVAL; : pld.visible = 1; : acpigen_write_pld(&pld); This can also be retrieved from the `typec_port` if you do the following: 1) Add a CL that looks like this: ``` diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index 73c69cc89f..8526541bcc 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -68,4 +68,6 @@ struct drivers_usb_acpi_config { struct acpi_gpio privacy_gpio; };
+const struct acpi_pld *usb_acpi_get_pld(const struct device *usb_port); + #endif /* __USB_ACPI_CHIP_H__ */ diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index 9d68d0a923..3c8e531ee1 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -126,3 +126,23 @@ struct chip_operations drivers_usb_acpi_ops = { CHIP_NAME("USB ACPI Device") .enable_dev = usb_acpi_enable }; + +const struct acpi_pld *usb_acpi_get_pld(const struct device *usb_port) +{ + static struct acpi_pld pld; + const struct drivers_usb_acpi_config *config; + + if (!usb_port || !usb_port->chip_info || usb_port->chip_ops != &drivers_usb_acpi_ops) + return NULL; + + config = usb_port->chip_info; + if (config->use_custom_pld) { + acpigen_write_pld(&config->custom_pld); + return &config->custom_pld; + } else { + /* Fill PLD structure based on port type */ + acpi_pld_fill_usb(&pld, config->type, &config->group); + acpigen_write_pld(&pld); + return &pld; + } +}
``` 2) #include <drivers/usb/acpi/chip.h> here 3) change this section to: ``` if (CONFIG(DRIVERS_USB_ACPI)) { const struct acpi_pld *pld = usb_acpi_get_pld(config->dfp[dfp_port].typec_port); if (pld) acpigen_write_pld(pld); else printk(BIOS_ERR, "Error retrieving PLD from USB Type-C port %u\n", usb_port); } ```