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/mainboard/ocp | |
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/mainboard/ocp')
-rw-r--r-- | src/mainboard/ocp/deltalake/ramstage.c | 11 |
1 files changed, 2 insertions, 9 deletions
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 <cpu/cpu.h> #include <cpu/x86/smm.h> #include <cpxsp_dl_gpio.h> -#include <device/device.h> -#include <device/pci_def.h> -#include <device/pci_ops.h> +#include <device/pciexp.h> #include <drivers/ipmi/ipmi_ops.h> #include <drivers/ocp/dmi/ocp_dmi.h> #include <drivers/vpd/vpd.h> @@ -24,7 +22,6 @@ #include <stdio.h> #include <string.h> #include <types.h> - #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; |