freebsd-dev/sys/powerpc/include
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
..
_align.h MFppc64: 2010-07-13 05:32:19 +00:00
_bus.h MFppc64: 2010-07-13 05:32:19 +00:00
_inttypes.h White space changes to align comments. The mips and powerpc _inttypes.h 2011-01-08 18:02:46 +00:00
_limits.h On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather than 2011-01-08 12:43:05 +00:00
_stdint.h On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather than 2011-01-08 12:43:05 +00:00
_types.h On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather than 2011-01-08 12:43:05 +00:00
altivec.h Handle vector assist traps without a kernel panic, by setting denormalized 2010-10-05 18:08:07 +00:00
asm.h MFppc64: 2010-07-13 05:32:19 +00:00
atomic.h MFppc64: 2010-07-13 05:32:19 +00:00
bat.h
bus_dma.h Provide a simple IOMMU framework on PowerPC, which is required to support 2010-12-03 16:37:37 +00:00
bus.h Revert r216134. This checkin broke platforms where bus_space are macros: 2010-12-03 07:09:23 +00:00
clock.h
cpu.h
cpufunc.h Add CPU support code for the IBM Cell Broadband Engine. 2010-11-12 15:20:10 +00:00
db_machdep.h MFppc64: 2010-07-13 05:32:19 +00:00
dbdma.h
elf.h Add AT_STACKPROT elf aux vector. Will be used to inform rtld about the 2011-01-07 14:22:34 +00:00
endian.h Define bswap macros for constants to allow the compiler to pre-compute 2010-12-02 15:10:27 +00:00
exec.h
fdt.h Introduce macro FDT_MAP_IRQ to map from an interrupt controller and 2011-01-29 20:25:20 +00:00
float.h We don't support any floating point types larger than double on 2011-01-09 06:05:22 +00:00
floatingpoint.h
fpu.h
frame.h MFppc64: 2010-07-13 05:32:19 +00:00
gdb_machdep.h
hid.h MFppc64: 2010-07-13 05:32:19 +00:00
ieee.h
ieeefp.h
in_cksum.h
intr_machdep.h Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
kdb.h
limits.h
md_var.h Update PowerPC event timer code to use new event timers infrastructure. 2010-09-11 04:45:51 +00:00
memdev.h Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set(). 2011-01-17 22:58:28 +00:00
metadata.h Don't redefine MODINFOMD_BOOTINFO as MODINFOMD_DTBP. This 2011-01-15 20:18:08 +00:00
mmuvar.h Introduce inheritance into the PowerPC MMU kobj interface. 2010-09-15 00:17:52 +00:00
ofw_machdep.h Restructure how reset and poweroff are handled on PowerPC systems, since 2010-08-31 15:27:46 +00:00
openpicreg.h
openpicvar.h Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
param.h - Bump MAXCPU to 4. Tested on a quad G5 with both 32 and 64-bit kernels. 2010-09-03 03:56:09 +00:00
pcb.h Restructure the way the copyin/copyout segment is stored to prevent a 2010-10-30 23:07:30 +00:00
pcpu.h Split the SLB mirror cache into two kinds of object, one for kernel maps 2010-09-16 03:46:17 +00:00
pio.h
platform.h Add some platform KOBJ extensions and continue integrating PowerPC 2010-11-12 04:18:19 +00:00
platformvar.h
pmap.h Add an abstraction layer to the 64-bit AIM MMU's page table manipulation 2010-12-04 02:42:52 +00:00
pmc_mdep.h
proc.h MFppc64: 2010-07-13 05:32:19 +00:00
profile.h MFppc64: 2010-07-13 05:32:19 +00:00
psl.h MFppc64: 2010-07-13 05:32:19 +00:00
pte.h Import support for the Sony Playstation 3 using the OtherOS feature 2011-01-06 04:12:29 +00:00
ptrace.h
reg.h MFppc64: 2010-07-13 05:32:19 +00:00
reloc.h
resource.h
runq.h MFppc64: 2010-07-13 05:32:19 +00:00
sc_machdep.h
setjmp.h
sf_buf.h
sigframe.h
signal.h
slb.h Restructure the way the copyin/copyout segment is stored to prevent a 2010-10-30 23:07:30 +00:00
smp.h Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
spr.h Fix handling of NX pages on capable CPUs. Thanks to kib for prodding me 2011-01-13 04:37:48 +00:00
sr.h Restructure the way the copyin/copyout segment is stored to prevent a 2010-10-30 23:07:30 +00:00
stack.h
stdarg.h
sysarch.h
tlb.h Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trap 2010-11-11 13:35:23 +00:00
trap_aim.h Handle vector assist traps without a kernel panic, by setting denormalized 2010-10-05 18:08:07 +00:00
trap_booke.h
trap.h
ucontext.h MFppc64: 2010-07-13 05:32:19 +00:00
varargs.h
vm.h Add support for memory attributes (pmap_mapdev_attr() and friends) on 2010-09-30 18:14:12 +00:00
vmparam.h Enable shared page for the signal trampolines on PowerPC. 2011-01-14 11:36:44 +00:00