Skip to content
Permalink
Browse files

drivers/pcie: do not verify configured IRQ

Some firmwares (looking at you, slimbootloader) don't set the registers
in PCI configuration space to indicate the IRQ routing, so we remove
the check that verifies that the user and firmware agree on IRQ number.

Also eliminate the return value of pcie_irq_enable() since no one uses
it and we can't return a meaningful value any longer.

Signed-off-by: Charles Youse <charles.youse@intel.com>
  • Loading branch information...
Charles Youse authored and nashif committed May 22, 2019
1 parent c88c919 commit 629805d881ebc52c5fc7357997204d0ea6153290
Showing with 10 additions and 19 deletions.
  1. +5 −13 drivers/pcie/pcie.c
  2. +5 −6 include/drivers/pcie/pcie.h
@@ -91,20 +91,12 @@ u32_t pcie_get_iobar(pcie_bdf_t bdf, unsigned int index)
return pcie_get_bar(bdf, index, true);
}

bool pcie_irq_enable(pcie_bdf_t bdf, unsigned int irq)
void pcie_irq_enable(pcie_bdf_t bdf, unsigned int irq)
{
#if CONFIG_PCIE_MSI
if (pcie_set_msi(bdf, irq))
return true;
#endif

u32_t data;

data = pcie_conf_read(bdf, PCIE_CONF_INTR);
if (PCIE_CONF_INTR_IRQ(data) == irq) {
irq_enable(irq);
return true;
if (pcie_set_msi(bdf, irq)) {
return;
}

return false;
#endif
irq_enable(irq);
}
@@ -116,15 +116,14 @@ extern unsigned int pcie_wired_irq(pcie_bdf_t bdf);
*
* @param bdf the PCI(e) endpoint
* @param irq the IRQ to generate
* @return true if successful, false otherwise
*
* If MSI is enabled and the endpoint supports it, the endpoint will
* be configured to generate the specified IRQ via MSI. Otherwise, the
* endpoint configuration space is queried to ensure that its wired
* IRQ has been routed by the boot firmware to the specified IRQ, and
* and the IRQ is enabled (at the I/O APIC, or wherever appropriate).
* be configured to generate the specified IRQ via MSI. Otherwise, it
* is assumed that the IRQ IRQ has been routed by the boot firmware
* to the specified IRQ, and the IRQ is enabled (at the I/O APIC, or
* wherever appropriate).
*/
extern bool pcie_irq_enable(pcie_bdf_t bdf, unsigned int irq);
extern void pcie_irq_enable(pcie_bdf_t bdf, unsigned int irq);

/*
* Configuration word 0 aligns directly with pcie_id_t.

0 comments on commit 629805d

Please sign in to comment.
You can’t perform that action at this time.