summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/alderlake/fsp_params.c4
-rw-r--r--src/soc/intel/cannonlake/fsp_params.c4
-rw-r--r--src/soc/intel/common/block/include/intelblocks/irq.h6
-rw-r--r--src/soc/intel/common/block/irq/irq.c9
-rw-r--r--src/soc/intel/tigerlake/fsp_params.c4
5 files changed, 20 insertions, 7 deletions
diff --git a/src/soc/intel/alderlake/fsp_params.c b/src/soc/intel/alderlake/fsp_params.c
index 08108f4f19..7c3ad912d9 100644
--- a/src/soc/intel/alderlake/fsp_params.c
+++ b/src/soc/intel/alderlake/fsp_params.c
@@ -429,7 +429,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
/* Count PCH devices */
while (entry) {
- if (PCI_SLOT(entry->devfn) >= MIN_PCH_SLOT)
+ if (is_pch_slot(entry->devfn))
++pch_total;
entry = entry->next;
}
@@ -438,7 +438,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
config = calloc(pch_total, sizeof(*config));
entry = get_cached_pci_irqs();
while (entry) {
- if (PCI_SLOT(entry->devfn) < MIN_PCH_SLOT) {
+ if (!is_pch_slot(entry->devfn)) {
entry = entry->next;
continue;
}
diff --git a/src/soc/intel/cannonlake/fsp_params.c b/src/soc/intel/cannonlake/fsp_params.c
index 7051f513bd..c9ef548c08 100644
--- a/src/soc/intel/cannonlake/fsp_params.c
+++ b/src/soc/intel/cannonlake/fsp_params.c
@@ -298,7 +298,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
/* Count PCH devices */
while (entry) {
- if (PCI_SLOT(entry->devfn) >= MIN_PCH_SLOT)
+ if (is_pch_slot(entry->devfn))
++pch_total;
entry = entry->next;
}
@@ -307,7 +307,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
config = calloc(pch_total, sizeof(*config));
entry = get_cached_pci_irqs();
while (entry) {
- if (PCI_SLOT(entry->devfn) < MIN_PCH_SLOT) {
+ if (!is_pch_slot(entry->devfn)) {
entry = entry->next;
continue;
}
diff --git a/src/soc/intel/common/block/include/intelblocks/irq.h b/src/soc/intel/common/block/include/intelblocks/irq.h
index 33c9b7e7ac..3945e3e7d7 100644
--- a/src/soc/intel/common/block/include/intelblocks/irq.h
+++ b/src/soc/intel/common/block/include/intelblocks/irq.h
@@ -66,4 +66,10 @@ const struct pci_irq_entry *get_cached_pci_irqs(void);
return the corresponding IRQ, or INVALID_IRQ if not found. */
int get_pci_devfn_irq(unsigned int devfn);
+/* Check if a given slot is a PCH slot.
+ * Note: For PCH less SoC platforms, like MeteorLake and onwards, this function
+ * can be utilized to check if a slot belongs to the SoC or IOE die.
+ */
+bool is_pch_slot(unsigned int devfn);
+
#endif /* SOC_INTEL_COMMON_IRQ_H */
diff --git a/src/soc/intel/common/block/irq/irq.c b/src/soc/intel/common/block/irq/irq.c
index 8b0642f149..724061ee8c 100644
--- a/src/soc/intel/common/block/irq/irq.c
+++ b/src/soc/intel/common/block/irq/irq.c
@@ -404,6 +404,13 @@ bool generate_pin_irq_map(void)
return true;
}
+bool __weak is_pch_slot(unsigned int devfn)
+{
+ if (PCI_SLOT(devfn) >= MIN_PCH_SLOT)
+ return true;
+ return false;
+}
+
bool irq_program_non_pch(void)
{
const struct pci_irq_entry *entry = cached_entries;
@@ -412,7 +419,7 @@ bool irq_program_non_pch(void)
return false;
while (entry) {
- if (PCI_SLOT(entry->devfn) >= MIN_PCH_SLOT) {
+ if (is_pch_slot(entry->devfn)) {
entry = entry->next;
continue;
}
diff --git a/src/soc/intel/tigerlake/fsp_params.c b/src/soc/intel/tigerlake/fsp_params.c
index 13c5fc0996..f67e205652 100644
--- a/src/soc/intel/tigerlake/fsp_params.c
+++ b/src/soc/intel/tigerlake/fsp_params.c
@@ -269,7 +269,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
/* Count PCH devices */
while (entry) {
- if (PCI_SLOT(entry->devfn) >= MIN_PCH_SLOT)
+ if (is_pch_slot(entry->devfn))
++pch_total;
entry = entry->next;
}
@@ -278,7 +278,7 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
config = calloc(pch_total, sizeof(*config));
entry = get_cached_pci_irqs();
while (entry) {
- if (PCI_SLOT(entry->devfn) < MIN_PCH_SLOT) {
+ if (!is_pch_slot(entry->devfn)) {
entry = entry->next;
continue;
}