From d6d87767cbf65f0da46bff32534b9718adcc332b Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 18 Jun 2021 12:13:43 +0530 Subject: [PATCH] soc/intel/apollolake: Use devfn_disable() function Use devfn_disable() for disabling a PCI device rather than using `dev->enabled = 0`. Also, use is_devfn_enabled() to get the device current state prior updating the FSP-S UPD for XDCI. TEST=FSP-S disabled XDCI when `xdci_can_enable` returns 0 and XDCI is disabled at PCI enumeration `PCI: 00:15.1: enabled 0`. Change-Id: I449beae59d2f578c027d8110c03fa79f516c3fe9 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/55666 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak Reviewed-by: Angel Pons --- src/soc/intel/apollolake/chip.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c index 9694c67fc6..b9f007db36 100644 --- a/src/soc/intel/apollolake/chip.c +++ b/src/soc/intel/apollolake/chip.c @@ -681,10 +681,9 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *silupd) apl_fsp_silicon_init_params_cb(cfg, silconfig); /* Enable xDCI controller if enabled in devicetree and allowed */ - dev = pcidev_path_on_root(PCH_DEVFN_XDCI); if (!xdci_can_enable()) - dev->enabled = 0; - silconfig->UsbOtg = dev->enabled; + devfn_disable(pci_root_bus(), PCH_DEVFN_XDCI); + silconfig->UsbOtg = is_devfn_enabled(PCH_DEVFN_XDCI); silconfig->VmxEnable = CONFIG(ENABLE_VMX);