From 5d6355efcfc4ae1840574a5545fdbd74a16b6c6e Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 16 Oct 2024 12:14:06 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/84792 Tested-by: build bot (Jenkins) Reviewed-by: Shuo Liu --- src/mainboard/ocp/deltalake/ramstage.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/mainboard') diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c index ebb9a4b7a0..6b1863a9af 100644 --- a/src/mainboard/ocp/deltalake/ramstage.c +++ b/src/mainboard/ocp/deltalake/ramstage.c @@ -6,9 +6,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include @@ -24,7 +22,6 @@ #include #include #include - #include "ipmi.h" #include "vpd.h" @@ -186,8 +183,6 @@ static int create_smbios_type9(int *handle, unsigned long *current) uint8_t slot_usage; uint8_t pcie_config = 0; struct device *slot_dev; - unsigned int cap; - uint16_t sltcap; if (ipmi_get_pcie_config(&pcie_config) != CB_SUCCESS) printk(BIOS_ERR, "Failed to get IPMI PCIe config\n"); @@ -250,9 +245,7 @@ static int create_smbios_type9(int *handle, unsigned long *current) characteristics_2 |= SMBIOS_SLOT_PME; // PmeSiganalSupported /* Read IIO root port device CSR for slot capabilities */ - cap = pci_find_capability(slot_dev, PCI_CAP_ID_PCIE); - sltcap = pci_read_config16(slot_dev, cap + PCI_EXP_SLTCAP); - if (sltcap & PCI_EXP_SLTCAP_HPC) + if (CONFIG(PCIEXP_PLUGIN_SUPPORT) && pciexp_dev_is_slot_hot_plug_cap(slot_dev)) characteristics_2 |= SMBIOS_SLOT_HOTPLUG; const uint16_t slot_id = index + 1; -- cgit v1.2.3