diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-12-06 04:25:12 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-12-06 04:25:12 +0000 |
commit | 7c4f1a1c5ac05474dcaf86bfd4493be02edf59ff (patch) | |
tree | 71f05d4e5df8cf46c905c208304401e9134030ba /sys/powerpc/powermac | |
parent | bdd6b77e1fbecf07a793c4d4e59337f4239c8b7a (diff) |
powerpc/powermac: Fix macgpio(4) child interrupt resource handling
The 'interrupts' property is actually 2 words, not one, on macgpio child
nodes. Open Firmware's getprop function might be returning the value
copied, not the total size of the property, but FDT's returns the total
size. Prior to this patch, this would cause the SYS_RES_IRQ resource list
to not be populated when running with the 'usefdt' loader variable set, to
convert the OFW device tree to a FDT. Since the property is always 2 words,
read both words, and ignore the second.
Tested by: Dennis Clarke (previous attempt)
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=341614
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r-- | sys/powerpc/powermac/macgpio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/powerpc/powermac/macgpio.c b/sys/powerpc/powermac/macgpio.c index 8c7c526500ac..806ff54b905a 100644 --- a/sys/powerpc/powermac/macgpio.c +++ b/sys/powerpc/powermac/macgpio.c @@ -160,7 +160,7 @@ macgpio_attach(device_t dev) struct macgpio_devinfo *dinfo; phandle_t root, child, iparent; device_t cdev; - uint32_t irq; + uint32_t irq[2]; sc = device_get_softc(dev); root = sc->sc_node = ofw_bus_get_node(dev); @@ -193,13 +193,13 @@ macgpio_attach(device_t dev) resource_list_init(&dinfo->mdi_resources); - if (OF_getencprop(child, "interrupts", &irq, sizeof(irq)) == + if (OF_getencprop(child, "interrupts", irq, sizeof(irq)) == sizeof(irq)) { OF_searchencprop(child, "interrupt-parent", &iparent, sizeof(iparent)); resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ, - 0, MAP_IRQ(iparent, irq), MAP_IRQ(iparent, irq), - 1); + 0, MAP_IRQ(iparent, irq[0]), + MAP_IRQ(iparent, irq[0]), 1); } /* Fix messed-up offsets */ |