From c7cfe0ba54bd280b8c4a5079bb2f6e19334f6dea Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 23 Jun 2021 12:39:22 +0200 Subject: soc/intel: Refactor `xdci_can_enable()` function The same pattern appears on all `xdci_can_enable()` call sites. Move the logic inside the function and take the xDCI devfn as parameter. Change-Id: I94c24c10c7fc7c5b4938cffca17bdfb853c7bd59 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/55790 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Tim Wawrzynczak --- src/soc/intel/cannonlake/fsp_params.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/soc/intel/cannonlake') diff --git a/src/soc/intel/cannonlake/fsp_params.c b/src/soc/intel/cannonlake/fsp_params.c index c3989e50a6..9d2d7220ac 100644 --- a/src/soc/intel/cannonlake/fsp_params.c +++ b/src/soc/intel/cannonlake/fsp_params.c @@ -497,10 +497,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) } } - /* Enable xDCI controller if enabled in devicetree and allowed */ - if (!xdci_can_enable()) - devfn_disable(pci_root_bus(), PCH_DEVFN_USBOTG); - params->XdciEnable = is_devfn_enabled(PCH_DEVFN_USBOTG); + params->XdciEnable = xdci_can_enable(PCH_DEVFN_USBOTG); /* Set Debug serial port */ params->SerialIoDebugUartNumber = CONFIG_UART_FOR_CONSOLE; -- cgit v1.2.3