diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2024-10-16 12:14:06 +0200 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-10-23 11:49:30 +0000 |
commit | 5d6355efcfc4ae1840574a5545fdbd74a16b6c6e (patch) | |
tree | b40742e7c76f6651de2e6f6bbc6aef7bdd4cd283 /src/soc | |
parent | 407799f8792cb1cc8b3beedee2418df2b53f14fb (diff) |
device/pciexp: Add hot-plug capable helper function
Add and use a new helper function to determine if a device is
1) a PCIe device
2) it's mark hot-plug capable
Change-Id: I61cc013844024b43808cd2f054310cb6676ba69e
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84792
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/xeon_sp/pcie_root_port.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/soc/intel/xeon_sp/pcie_root_port.c b/src/soc/intel/xeon_sp/pcie_root_port.c index 6ecbcecb59..8085b3e437 100644 --- a/src/soc/intel/xeon_sp/pcie_root_port.c +++ b/src/soc/intel/xeon_sp/pcie_root_port.c @@ -19,14 +19,9 @@ static const char *pcie_device_get_acpi_name(const struct device *dev) static void soc_pciexp_scan_bridge(struct device *dev) { - if (CONFIG(PCIEXP_HOTPLUG)) { - unsigned int pciexpos = pci_find_capability(dev, PCI_CAP_ID_PCIE); - u16 sltcap = pci_read_config16(dev, pciexpos + PCI_EXP_SLTCAP); - if (sltcap & PCI_EXP_SLTCAP_HPC) { - pciexp_hotplug_scan_bridge(dev); - return; - } - } else + if (CONFIG(PCIEXP_HOTPLUG) && pciexp_dev_is_slot_hot_plug_cap(dev)) + pciexp_hotplug_scan_bridge(dev); + else pciexp_scan_bridge(dev); } |