BMAC Ethernet Driver
Nathan Whitehorn
nathanw at uchicago.edu
Wed Apr 9 16:00:19 UTC 2008
Peter Grehan wrote:
> Hi Nathan,
>
>> Apple PMU and SMU devices, probably among others, use macio gpio
lines for interrupts instead of the IRQs listed in the OF interrupts
property. These lines aren't children of the devices, and so their
interrupts are not associated with them by the regular probes.
>>
>> Is the correct way to handle this:
> ...
>> b) Having a macgpio device like NetBSD has that collects these and
forwards them to the appropriate handlers?
>
> This would get my vote. I would think the gpio device would register
itself, perhaps with it's macio parent, and clients would access it
through kobj methods. These would include interrupt forwarding, and GPIO
toggling.
The trouble here is that SMU isn't a macio child, so it wouldn't pick up
the GPIO kobj methods.
> How does the SMU use the GPIO's ? Just toggling ?
Yeah. It also reads them from time to time, which the onboard audio
stuff does too (to sense headphone connections and the like).
>> This would involve the gpio device and remote interrupt handler
>> knowing about one another.
>
> Hopefully it is a one-way path with the gpio device knowing nothing
about the users that call it.
Yes, I think that would be ideal. I'm not quite sure how to do it
though. Having a second gpio driver for each device that attaches to
macgpio and can find its partner by internal logic could work. Or global
calls into macgpio.
Also, is there a way to find a FreeBSD device given an OF phandle? For
SMU, the GPIO lines it needs to care about are listed as device handles
under /smu. So an SMU attachment would need to figure out the macgpio
device and GPIO line to watch from the OF handle. I don't know how this
works for PMU.
-Nathan
More information about the freebsd-ppc
mailing list