aboutsummaryrefslogtreecommitdiff
path: root/sys/mips/mips/nexus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/mips/mips/nexus.c')
-rw-r--r--sys/mips/mips/nexus.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/mips/mips/nexus.c b/sys/mips/mips/nexus.c
index a253b7e006a8..c1bcedd01c8f 100644
--- a/sys/mips/mips/nexus.c
+++ b/sys/mips/mips/nexus.c
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
#endif
#ifdef FDT
+#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/openfirm.h>
#include "ofw_bus_if.h"
#endif
@@ -429,6 +430,10 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
}
rman_set_virtual(r, vaddr);
rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr);
+ } else if (type == SYS_RES_IRQ) {
+#ifdef INTRNG
+ intr_activate_irq(child, r);
+#endif
}
return (rman_activate_resource(r));
@@ -448,6 +453,10 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,
bus_space_unmap(rman_get_bustag(r), vaddr, psize);
rman_set_virtual(r, NULL);
rman_set_bushandle(r, 0);
+ } else if (type == SYS_RES_IRQ) {
+#ifdef INTRNG
+ intr_deactivate_irq(child, r);
+#endif
}
return (rman_deactivate_resource(r));
@@ -523,12 +532,18 @@ static int
nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,
pcell_t *intr)
{
-
-#ifdef INTRNG
- return (INTR_IRQ_INVALID);
-#else
- return (intr_fdt_map_irq(iparent, intr, icells));
-#endif
+ u_int irq;
+ struct intr_map_data_fdt *fdt_data;
+ size_t len;
+
+ len = sizeof(*fdt_data) + icells * sizeof(pcell_t);
+ fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data(
+ INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO);
+ fdt_data->iparent = iparent;
+ fdt_data->ncells = icells;
+ memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t));
+ irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data);
+ return (irq);
}
#endif
#endif /* INTRNG */