Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved Sridhar Siricilla: Looks good to me, but someone else must approve
soc/intel/alderlake: Add USB TCSS enablement

In order to detect USB Type C device port as Super Speed, we need to set
corresponding bit in UPD UsbTcPortEn. This patch will use device path
to determine which port should be enabled.

BUG=b:184324979
Test=Boot board, USB Type C must be functional and operate at Super Speed.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
Change-Id: I7da63f21d51889a888699540f780cb26b480c26d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55361
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
---
M src/soc/intel/alderlake/fsp_params.c
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/soc/intel/alderlake/fsp_params.c b/src/soc/intel/alderlake/fsp_params.c
index 783d2a9..e29133e 100644
--- a/src/soc/intel/alderlake/fsp_params.c
+++ b/src/soc/intel/alderlake/fsp_params.c
@@ -304,6 +304,20 @@
/* D3Hot and D3Cold for TCSS */
s_cfg->D3HotEnable = !config->TcssD3HotDisable;
s_cfg->D3ColdEnable = !config->TcssD3ColdDisable;
+
+ s_cfg->UsbTcPortEn = 0;
+ for (int i = 0; i < MAX_TYPE_C_PORTS; i++) {
+ /* TCSS xHCI --> Root Hub --> Type-C Port */
+ const struct device_path port_path[] = {
+ {.type = DEVICE_PATH_PCI, .pci.devfn = SA_DEVFN_TCSS_XHCI},
+ {.type = DEVICE_PATH_USB, .usb.port_type = 0, .usb.port_id = 0},
+ {.type = DEVICE_PATH_USB, .usb.port_type = 3, .usb.port_id = i} };
+ const struct device *port = find_dev_nested_path(pci_root_bus(), port_path,
+ ARRAY_SIZE(port_path));
+
+ if (is_dev_enabled(port))
+ s_cfg->UsbTcPortEn |= BIT(i);
+ }
}

static void fill_fsps_chipset_lockdown_params(FSP_S_CONFIG *s_cfg,

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7da63f21d51889a888699540f780cb26b480c26d
Gerrit-Change-Number: 55361
Gerrit-PatchSet: 11
Gerrit-Owner: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
Gerrit-Reviewer: Bora Guvendik <bora.guvendik@intel.com>
Gerrit-Reviewer: Deepti Deshatty <deepti.deshatty@intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: John Zhao <john.zhao@intel.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Sanrio Alvares <sanrio.alvares@intel.com>
Gerrit-Reviewer: Selma Bensaid <selma.bensaid@intel.com>
Gerrit-Reviewer: Shaunak Saha <shaunak.saha@intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla@intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Anil Kumar K <anil.kumar.k@intel.com>
Gerrit-CC: Balaji Manigandan <balaji.manigandan@intel.com>
Gerrit-MessageType: merged