From 81bcce9c8d526cd772e26579c1458b00e53713d2 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Wed, 23 Jun 2021 21:21:51 -0600 Subject: soc/intel/common/irq: Add function to program north PCI IRQs Because the FSP interface for PCI IRQs only includes the PCH devices, this function is the complement to that, taking the list of irq entries, and programming the PCI_INTERRUPT_LINE registers. BUG=b:130217151, b:171580862, b:176858827 TEST=boot brya with patch train, verify with `lspci -vvv` that for all the north PCI devices, their IRQ was either the one programmed by this function, or an MSI was used. Signed-off-by: Tim Wawrzynczak Change-Id: I81cf7b25f115e41deb25767669b5466b5712b177 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55817 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/include/intelblocks/irq.h | 2 ++ src/soc/intel/common/block/irq/irq.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src/soc/intel/common/block') diff --git a/src/soc/intel/common/block/include/intelblocks/irq.h b/src/soc/intel/common/block/include/intelblocks/irq.h index 727020a5df..a0cb409ec8 100644 --- a/src/soc/intel/common/block/include/intelblocks/irq.h +++ b/src/soc/intel/common/block/include/intelblocks/irq.h @@ -46,4 +46,6 @@ const struct pci_irq_entry *assign_pci_irqs(const struct slot_irq_constraints *c void generate_pin_irq_map(const struct pci_irq_entry *entries); +void irq_program_non_pch(const struct pci_irq_entry *entries); + #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 eb4daf9a14..96fd733619 100644 --- a/src/soc/intel/common/block/irq/irq.c +++ b/src/soc/intel/common/block/irq/irq.c @@ -4,9 +4,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -394,3 +396,20 @@ void generate_pin_irq_map(const struct pci_irq_entry *entries) intel_write_pci0_PRT(pin_irq_map, map_count, &pirq_map); free(pin_irq_map); } + +void irq_program_non_pch(const struct pci_irq_entry *entries) +{ + while (entries) { + if (PCI_SLOT(entries->devfn) >= MIN_PCH_SLOT) { + entries = entries->next; + continue; + } + + if (entries->irq) + pci_s_write_config8(PCI_DEV(0, PCI_SLOT(entries->devfn), + PCI_FUNC(entries->devfn)), + PCI_INTERRUPT_LINE, entries->irq); + + entries = entries->next; + } +} -- cgit v1.2.3