summaryrefslogtreecommitdiff
path: root/src/soc/intel/alderlake
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2021-09-22 13:59:39 -0700
committerPaul Fagerburg <pfagerburg@chromium.org>2021-09-24 21:20:10 +0000
commiteafca1f13a7330697c23265a5e1cdb5eb14b89cf (patch)
treeb9cd7d6b74716f74883f3458d5a83d93d67eb81a /src/soc/intel/alderlake
parent20c709daade1b894ffc8559c67d35af0172efe94 (diff)
soc/intel/alderlake: Switch to using device pointers
This change replaces the device tree walks with device pointers by using alias for tcss_usb3_port* devices. Change-Id: I65d9c83a9d0aab5a42f5a7cc6df98a154e79d16a Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57848 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/soc/intel/alderlake')
-rw-r--r--src/soc/intel/alderlake/fsp_params.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/soc/intel/alderlake/fsp_params.c b/src/soc/intel/alderlake/fsp_params.c
index 541a9612d8..ec7bff6829 100644
--- a/src/soc/intel/alderlake/fsp_params.c
+++ b/src/soc/intel/alderlake/fsp_params.c
@@ -367,6 +367,13 @@ static void fill_fsps_igd_params(FSP_S_CONFIG *s_cfg,
static void fill_fsps_tcss_params(FSP_S_CONFIG *s_cfg,
const struct soc_intel_alderlake_config *config)
{
+ const struct device *tcss_port_arr[] = {
+ DEV_PTR(tcss_usb3_port1),
+ DEV_PTR(tcss_usb3_port2),
+ DEV_PTR(tcss_usb3_port3),
+ DEV_PTR(tcss_usb3_port4),
+ };
+
s_cfg->TcssAuxOri = config->TcssAuxOri;
/* Explicitly clear this field to avoid using defaults */
@@ -385,15 +392,7 @@ static void fill_fsps_tcss_params(FSP_S_CONFIG *s_cfg,
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))
+ if (is_dev_enabled(tcss_port_arr[i]))
s_cfg->UsbTcPortEn |= BIT(i);
}
}