diff --git a/sys/arm/include/fdt.h b/sys/arm/include/fdt.h index 3672dfb2b25f..c7290aca129e 100644 --- a/sys/arm/include/fdt.h +++ b/sys/arm/include/fdt.h @@ -44,6 +44,9 @@ /* Max interrupt number */ #define FDT_INTR_MAX NIRQ +/* Map phandle/intpin pair to global IRQ number */ +#define FDT_MAP_IRQ(node, pin) (pin) + /* * Bus space tag. XXX endianess info needs to be derived from the blob. */ diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c index b4e006359a8c..d25715b12410 100644 --- a/sys/dev/fdt/fdt_common.c +++ b/sys/dev/fdt/fdt_common.c @@ -480,7 +480,7 @@ fdt_intr_to_rl(phandle_t node, struct resource_list *rl, pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; - int i, intr_num, rv; + int i, intr_num, irq, rv; if (OF_getproplen(node, "interrupts") <= 0) /* Node does not have 'interrupts' property. */ @@ -532,7 +532,8 @@ fdt_intr_to_rl(phandle_t node, struct resource_list *rl, intr_sl[i].trig = trig; intr_sl[i].pol = pol; - resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); + irq = FDT_MAP_IRQ(intr_par, interrupt); + resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); } out: diff --git a/sys/powerpc/include/fdt.h b/sys/powerpc/include/fdt.h index 76ef94fc57a1..116f562af02a 100644 --- a/sys/powerpc/include/fdt.h +++ b/sys/powerpc/include/fdt.h @@ -38,6 +38,9 @@ /* Max interrupt number */ #define FDT_INTR_MAX INTR_VECTORS +/* Map phandle/intpin pair to global IRQ number */ +#define FDT_MAP_IRQ(node, pin) powerpc_get_irq(node, pin) + /* * Bus space tag. XXX endianess info needs to be derived from the blob. */