Skip to content

Commit

Permalink
drivers: pcie: add prt support for pci legacy interrupt
Browse files Browse the repository at this point in the history
add support for obtain irq number from pci irq routing table

Signed-off-by: Najumon Ba <[email protected]>
  • Loading branch information
najumon1980 authored and jhedberg committed Jun 30, 2023
1 parent f25dfcf commit a72271f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/pcie/host/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LOG_MODULE_REGISTER(pcie, LOG_LEVEL_ERR);
#include <stdbool.h>
#include <zephyr/drivers/pcie/pcie.h>
#include <zephyr/sys/iterable_sections.h>
#include <zephyr/acpi/acpi.h>

#if CONFIG_PCIE_MSI
#include <zephyr/drivers/pcie/msi.h>
Expand Down Expand Up @@ -285,7 +286,13 @@ unsigned int pcie_alloc_irq(pcie_bdf_t bdf)
if (irq == PCIE_CONF_INTR_IRQ_NONE ||
irq >= CONFIG_MAX_IRQ_LINES ||
arch_irq_is_used(irq)) {
irq = arch_irq_allocate();

if (IS_ENABLED(CONFIG_ACPI)) {
irq = acpi_legacy_irq_get(bdf);
} else {
irq = arch_irq_allocate();
}

if (irq == UINT_MAX) {
return PCIE_CONF_INTR_IRQ_NONE;
}
Expand Down

0 comments on commit a72271f

Please sign in to comment.