freebsd-skq/sys
marcel d129fb0e44 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
..
amd64 My style(9) bug. 2011-01-29 07:22:33 +00:00
arm Introduce macro FDT_MAP_IRQ to map from an interrupt controller and 2011-01-29 20:25:20 +00:00
boot Add kern.msgbufsize default setting to /boot/defaults/loader.conf. 2011-01-21 12:15:21 +00:00
bsm
cam In addition to r217444 ignore also ATA status errors on DMA Auto-Activation 2011-01-26 06:57:48 +00:00
cddl CDDL fixes for MIPS n32. 2011-01-28 06:12:59 +00:00
compat Style(9) fixes. 2011-01-28 19:04:15 +00:00
conf Migrate the TX path code out of if_ath and into a separate source file. 2011-01-29 11:35:23 +00:00
contrib Correct bogus initialization. It should be noted that this change 2011-01-14 04:24:53 +00:00
crypto Remove DEBUG sections. 2010-11-27 15:41:44 +00:00
ddb sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:54:19 +00:00
dev Introduce macro FDT_MAP_IRQ to map from an interrupt controller and 2011-01-29 20:25:20 +00:00
fs Quick fix to a comment. 2011-01-27 03:32:16 +00:00
gdb there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order 2010-09-30 17:05:23 +00:00
geom Add new user-friendly aliases for partition types for the MBR and 2011-01-28 11:13:01 +00:00
gnu Remove prtactive variable and related printf()s in the vop_inactive 2010-11-19 21:17:34 +00:00
i386 Implement a variation of the linux_common_wait() which should 2011-01-28 18:47:07 +00:00
ia64 Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. 2011-01-21 10:26:26 +00:00
isa bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
kern If more than one thread allocated sf buffers for sendfile(2), and 2011-01-28 17:37:09 +00:00
kgssapi
libkern Add support for asterisk characters when filling in the GELI password 2010-11-14 14:12:43 +00:00
mips Implement sf_buf using direct map (XKPHYS) in MIPS n64. 2011-01-27 14:49:22 +00:00
modules Migrate the TX path code out of if_ath and into a separate source file. 2011-01-29 11:35:23 +00:00
net Fix a LOR by dropping the global ifnet locks while allocating a new ifnet 2011-01-24 22:21:58 +00:00
net80211 Jump to the next element and not to an arbitrary point. frm[1] contains 2011-01-19 17:40:58 +00:00
netatalk
netgraph sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:53:39 +00:00
netinet Fixes to ECN in SCTP. 2011-01-29 19:55:29 +00:00
netinet6 Improve plausibility check in sctp_handle_sack(). 2010-12-22 17:59:38 +00:00
netipsec After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
netipx
netnatm
netncp
netsmb Change some variables from int to size_t. This is more accurate since 2011-01-08 23:06:54 +00:00
nfs Modify the experimental NFSv4 server so that it posts a SIGUSR2 2011-01-14 23:30:35 +00:00
nfsclient Fix the nlm so that it no longer depends on the regular 2011-01-03 20:37:31 +00:00
nfsserver ZFS might not return monotonically increasing directory offset cookies, 2010-12-28 21:12:15 +00:00
nlm sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:54:19 +00:00
opencrypto Let cryptosoft(4) add its pseudo-device with a specific unit number and its 2010-11-14 13:09:32 +00:00
pc98 Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. 2011-01-21 10:26:26 +00:00
pci Add support for RTL8105E PCIe Fast Ethernet controller. It seems 2011-01-26 21:14:20 +00:00
powerpc Fix the interrupt code, broken 7 months ago. The interrupt framework 2011-01-29 20:58:38 +00:00
rpc sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:54:19 +00:00
security sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly. 2011-01-12 19:54:14 +00:00
sparc64 Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. 2011-01-21 10:26:26 +00:00
sun4v Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. 2011-01-21 10:26:26 +00:00
sys Add new user-friendly aliases for partition types for the MBR and 2011-01-28 11:13:01 +00:00
teken Use proper bounds checking on VPA. 2010-12-05 10:15:23 +00:00
tools Add an extra comment to the SDT probes definition. This allows us to get 2010-08-22 11:18:57 +00:00
ufs Embed a quota error message (C string) into uprintf() fmt. 2011-01-13 16:29:27 +00:00
vm Reenable the call to vm_map_simplify_entry() from vm_map_insert() for non- 2011-01-29 15:23:02 +00:00
x86 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming 2011-01-19 23:00:25 +00:00
xdr
xen Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
Makefile Add lex and yacc sources to things cscope'd. 2010-11-21 03:58:11 +00:00