summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/cse/cse.c18
-rw-r--r--src/soc/intel/common/block/include/intelblocks/cse.h6
2 files changed, 18 insertions, 6 deletions
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 471bc1b341a8..e41e3375501b 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -581,23 +581,29 @@ int heci_reset(void)
return 0;
}
-bool is_cse_enabled(void)
+bool is_cse_devfn_visible(unsigned int devfn)
{
- const struct device *cse_dev = pcidev_path_on_root(PCH_DEVFN_CSE);
+ int slot = PCI_SLOT(devfn);
+ int func = PCI_FUNC(devfn);
- if (!cse_dev || !cse_dev->enabled) {
- printk(BIOS_WARNING, "HECI: No CSE device\n");
+ if (!is_devfn_enabled(devfn)) {
+ printk(BIOS_WARNING, "HECI: CSE device %02x.%01x is disabled\n", slot, func);
return false;
}
- if (pci_read_config16(PCH_DEV_CSE, PCI_VENDOR_ID) == 0xFFFF) {
- printk(BIOS_WARNING, "HECI: CSE device is hidden\n");
+ if (pci_read_config16(PCI_DEV(0, slot, func), PCI_VENDOR_ID) == 0xFFFF) {
+ printk(BIOS_WARNING, "HECI: CSE device %02x.%01x is hidden\n", slot, func);
return false;
}
return true;
}
+bool is_cse_enabled(void)
+{
+ return is_cse_devfn_visible(PCH_DEVFN_CSE);
+}
+
uint32_t me_read_config32(int offset)
{
return pci_read_config32(PCH_DEV_CSE, offset);
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 076f29465c3e..f162d485fde0 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -153,6 +153,12 @@ void heci_disable(void);
uint32_t me_read_config32(int offset);
/*
+ * Check if the CSE device as per function argument `devfn` is enabled in device tree
+ * and also visible on the PCI bus.
+ */
+bool is_cse_devfn_visible(unsigned int devfn);
+
+/*
* Check if the CSE device is enabled in device tree. Also check if the device
* is visible on the PCI bus by reading config space.
* Return true if device present and config space enabled, else return false.