freebsd-dev/sys/powerpc/powermac
Marcel Moolenaar 6d2d7b8c0d Fix the interrupt code, broken 7 months ago. The interrupt framework
already supported nested PICs, but was limited to having a nested
AT-PIC only. With G5 support the need for nested OpenPIC controllers
needed to be added. This was done the wrong way and broke the MPC8555
eval system in the process.

OFW, as well as FDT, describe the interrupt routing in terms of a
controller and an interrupt pin on it. This needs to be mapped to a
flat and global resource: the IRQ. The IRQ is the same as the PCI
intline and as such needs to be representable in 8 bits. Secondly,
ISA support pretty much dictates that IRQ 0-15 should be reserved
for ISA interrupts, because of the internal workins of south bridges.
Both were broken.

This change reverts revision 209298 for a big part and re-implements
it simpler. In particular:
o   The id() method of the PIC I/F is removed again. It's not needed.
o   The openpic_attach() function has been changed to take the OFW
    or FDT phandle of the controller as a second argument. All bus
    attachments that previously used openpic_attach() as the attach
    method of the device I/F now implement as bus-specific method
    and pass the phandle_t to the renamed openpic_attach().
o   Change powerpc_register_pic() to take a few more arguments. In
    particular:
    -   Pass the number of IPIs specificly. The number of IRQs carved
	out for a PIC is the sum of the number of int. pins and IPIs.
    -   Pass a flag indicating whether the PIC is an AT-PIC or not.
	This tells the interrupt framework whether to assign IRQ 0-15
	or some other range.
o   Until we implement proper multi-pass bus enumeration, we have to
    handle the case where we need to map from PIC+pin to IRQ *before*
    the PIC gets registered. This is done in a similar way as before,
    but rather than carving out 256 IRQs per PIC, we carve out 128
    IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case,
    but should really be fixed properly using multiple passes.
o   Have the interrupt framework set root_pic in most cases and not
    put that burden in PIC drivers (for the most part).
o   Remove powerpc_ign_lookup() and replace it with powerpc_get_irq().
    Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN.

Related to the above, fix the Freescale PCI controller driver, broken
by the FDT code. Besides not attaching properly, bus numbers were
assigned improperly and enumeration was broken in general. This
prevented the AT PIC from being discovered and interrupt routing to
work properly. Consequently, the ata(4) controller stopped functioning.

Fix the driver, and FDT PCI support, enough to get the MPC8555CDS
going again. The FDT PCI code needs a whole lot more work.

No breakages are expected, but lackiong G5 hardware, it's possible
that there are unpleasant side-effects. At least MPC85xx support is
back to where it was 7 months ago -- it's amazing how badly support
can be broken in just 7 months...

Sponsored by: Juniper Networks
2011-01-29 20:58:38 +00:00
..
ata_dbdma.c Several chipset drivers alter parameters relevant for the DMA tag creation, 2010-11-30 20:54:14 +00:00
ata_dbdma.h
ata_kauai.c Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like it 2011-01-23 17:20:11 +00:00
ata_macio.c MFp4: 2009-12-06 00:10:13 +00:00
cpcht.c Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
cuda.c Restructure how reset and poweroff are handled on PowerPC systems, since 2010-08-31 15:27:46 +00:00
cudavar.h Get nexus(4) out of the RTC business. The interface used by nexus(4) 2010-03-23 03:14:44 +00:00
dbdma.c Clean up some magic numbers in the DBDMA code by replacing them with 2008-10-27 23:11:14 +00:00
dbdmavar.h Clean up some magic numbers in the DBDMA code by replacing them with 2008-10-27 23:11:14 +00:00
fcu.c Add new functions, fcu_fan_set_pwm and fcu_fan_get_pwm, to set and get 2011-01-11 21:18:29 +00:00
grackle.c Correct parsing of the grackle and uninorthpci ranges property. 2011-01-20 20:22:19 +00:00
gracklevar.h Correct parsing of the grackle and uninorthpci ranges property. 2011-01-20 20:22:19 +00:00
hrowpic.c Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
hrowpicvar.h
kiic.c Increase register access delay to deal with the high-latency I2C 2010-09-15 19:08:41 +00:00
macgpio.c Remove unused variables. Spotted by a cppcheck 2011-01-06 20:19:01 +00:00
macgpiovar.h Clean up the mac GPIO interface a little. Also remove bogus copyright 2008-12-08 03:00:45 +00:00
macio.c Provide for multiple, cascaded PICs on PowerPC systems, and extend the 2010-06-18 14:06:27 +00:00
maciovar.h
openpic_macio.c Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
platform_powermac.c Restructure how reset and poweroff are handled on PowerPC systems, since 2010-08-31 15:27:46 +00:00
pmu.c Restructure how reset and poweroff are handled on PowerPC systems, since 2010-08-31 15:27:46 +00:00
pmuvar.h Add the ability to control the sleep LED with led(4). Adding this fairly 2008-12-09 01:01:02 +00:00
pswitch.c
smu.c Disabling CPU NAP modes during SMU commands is a hack needed only on U3 2010-11-10 20:09:05 +00:00
smusat.c Add a driver for the CPU temperature sensors attached over I2C on the 2010-06-05 17:51:37 +00:00
uninorth.c Remove unused variables. Spotted by a cppcheck 2011-01-06 20:19:01 +00:00
uninorthpci.c Correct parsing of the grackle and uninorthpci ranges property. 2011-01-20 20:22:19 +00:00
uninorthvar.h Correct parsing of the grackle and uninorthpci ranges property. 2011-01-20 20:22:19 +00:00
vcoregpio.c Introduce support for cpufreq on PowerPC with the dynamic frequency 2009-05-31 09:01:23 +00:00
viareg.h Add ADB support. This provides support for the external ADB bus on the PowerMac 2008-10-26 19:37:38 +00:00