svn commit: r269927 - in projects/arm64/sys: arm64/arm64 dev/fdt
Andrew Turner
andrew at FreeBSD.org
Wed Aug 13 12:31:37 UTC 2014
Author: andrew
Date: Wed Aug 13 12:31:36 2014
New Revision: 269927
URL: http://svnweb.freebsd.org/changeset/base/269927
Log:
Remove the hack to map interrupts from simplebus to nexus so it can be
used with ofwbus.
Modified:
projects/arm64/sys/arm64/arm64/nexus.c
projects/arm64/sys/dev/fdt/simplebus.c
Modified: projects/arm64/sys/arm64/arm64/nexus.c
==============================================================================
--- projects/arm64/sys/arm64/arm64/nexus.c Wed Aug 13 12:04:45 2014 (r269926)
+++ projects/arm64/sys/arm64/arm64/nexus.c Wed Aug 13 12:31:36 2014 (r269927)
@@ -114,11 +114,9 @@ static device_method_t nexus_methods[] =
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
-#if 0
#ifdef FDT
DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr),
#endif
-#endif
{ 0, 0 }
};
@@ -320,36 +318,23 @@ nexus_deactivate_resource(device_t bus,
return (rman_deactivate_resource(r));
}
-#if 0
#ifdef FDT
static int
nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,
pcell_t *intr)
{
- fdt_pic_decode_t intr_decode;
- phandle_t intr_offset;
- int i, rv, interrupt, trig, pol;
-
- intr_offset = OF_xref_phandle(iparent);
- for (i = 0; i < icells; i++)
- intr[i] = cpu_to_fdt32(intr[i]);
-
- for (i = 0; fdt_pic_table[i] != NULL; i++) {
- intr_decode = fdt_pic_table[i];
- rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol);
-
- if (rv == 0) {
- /* This was recognized as our PIC and decoded. */
- interrupt = FDT_MAP_IRQ(intr_parent, interrupt);
- return (interrupt);
- }
- }
+ int irq;
- /* Not in table, so guess */
- interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(intr[0]));
+ if (icells == 3) {
+ irq = intr[1];
+ if (intr[0] == 0)
+ irq += 32; /* SPI */
+ else
+ irq += 16; /* PPI */
+ } else
+ irq = intr[0];
- return (interrupt);
+ return (irq);
}
#endif
-#endif
Modified: projects/arm64/sys/dev/fdt/simplebus.c
==============================================================================
--- projects/arm64/sys/dev/fdt/simplebus.c Wed Aug 13 12:04:45 2014 (r269926)
+++ projects/arm64/sys/dev/fdt/simplebus.c Wed Aug 13 12:31:36 2014 (r269927)
@@ -310,18 +310,10 @@ simplebus_setup_dinfo(device_t dev, phan
icells = 1;
}
for (i = 0, k = 0; i < nintr; i += icells, k++) {
- u_int irq;
-
- if (icells == 3) {
- irq = intr[i + 1];
- if (intr[i] == 0)
- irq += 32;
- } else
- irq = intr[i];
intr[i] = ofw_bus_map_intr(dev, iparent, icells,
&intr[i]);
- resource_list_add(&ndi->rl, SYS_RES_IRQ, k, irq,
- irq, 1);
+ resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i],
+ intr[i], 1);
}
free(intr, M_OFWPROP);
}
More information about the svn-src-projects
mailing list