Port-sparc64 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Removing duplicated pyro interrupt logic
Hi,
I am working on adding interrupts to the Fire/MICV I2C controller on the
U45, V245 and similar. In OFW, the controller parent is mainbus, but the
interrupts are routed through one of the pyro leaves. This is similar to
ebus@mainbus interrupt routing.
Comparing the pyro_intr_establish() code:
https://nxr.netbsd.org/xref/src/sys/arch/sparc64/dev/pyro.c#574
with the part of ebus_mainbus_intr_establish() that sets up the pyro intr:
https://nxr.netbsd.org/xref/src/sys/arch/sparc64/dev/ebus_mainbus.c#347
it looks to me that the code is basically the same.
For the fire_i2c code, I thought that it would be better to reuse the pyro
code rather than have a third copy:
https://ftp.netbsd.org/pub/NetBSD/misc/jdc/sparc64/fire_i2c.diff
I split pyro_intr_establish() into a stub which locates the softc from the
pdb and then pyro_intr_establish_sc() which does the work. In pyro_softc,
I keep a pointer to pyro_intr_establish_sc(). This means that we can find
the correct pyro leaf and call its pyro_intr_establish_sc() directly - I
do this in firei2c_intr_establish().
This works for fire_i2c (I haven't yet made the changes to ebus_mainbus).
Does it seem sensible, or could there be a better way to do it?
Regards,
Julian
--
Home |
Main Index |
Thread Index |
Old Index