Subject: port-i386/23700: Interrupt routing of PIRQ[EFGH] on ICH4 is necessary for Panasonic CF-R2
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bsh@netbsd.org>
List: netbsd-bugs
Date: 12/09/2003 22:51:36
>Number:         23700
>Category:       port-i386
>Synopsis:       Interrupt routing of PIRQ[EFGH] on ICH4 is necessary for Panasonic CF-R2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 09 14:39:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Hiroyuki Bessho
>Release:        NetBSD-1.6ZF  2003/11/22
>Organization:
	
>Environment:
NetBSD 1.6ZF (GENERIC_LAPTOP) #4: Tue Dec  9 14:06:58 JST 2003
	bsh@kuromutsu:/u0/obj/netbsd-current/sys/arch/i386/compile.i386/GENERIC_LAPTOP
Architecture: i386
Machine: i386
>Description:

  NetBSD/i386 kernel fails to configure the cardbus bridge on Panasonic
CF-R2 laptop, with the error message:

   cbb0 at pci1 dev 5 function 0: Ricoh 5C475 PCI-CardBus bridge (rev. 0x88)
   cbb0: NOT USED because of unconfigured interrupt
   Ricoh product 0x0575 (miscellaneous system) at pci1 dev 5 function 1 not configured

(see full dmesg below for detail, which is from GENERIC_LAPTOP kernel with PCIINTR_DEBUG)

  I've tried PCIBIOS related options and ACPI_PCI_FIXUP, but it didn't help.

  PCI-to-ISA bridge of ICH4 has four more interrupt lines named
PIRQ[EFGH], that are not supported by our PIIX driver.  According to
the information from the BIOS, it seems the 5C475 is connected to
PIRQ-G (link value 0x6a).  On windows it is routed to INT10.


NetBSD 1.6ZF (GENERIC_LAPTOP) #4: Tue Dec  9 14:06:58 JST 2003
	bsh@kuromutsu:/u0/obj/netbsd-current/sys/arch/i386/compile.i386/GENERIC_LAPTOP
total memory = 246 MB
avail memory = 222 MB
using 3181 buffers containing 12724 KB of memory
BIOS32 rev. 0 found at 0xfd750
PCI BIOS rev. 2.1 found at 0xfd9b2
pcibios: config mechanism [1][x], special cycles [x][x], last bus 2
PCI IRQ Routing Table rev. 1.0 found at 0xfdf40, size 160 bytes (8 entries)
PCI Interrupt Router at 000:31:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
PIR Entry 0:
	Bus: 0  Device: 30
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x63 bitmap 0x0008
PIR Entry 1:
	Bus: 1  Device: 1
		INTA: link 0x63 bitmap 0x0008
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 2:
	Bus: 1  Device: 4
		INTA: link 0x69 bitmap 0x0080
		INTB: link 0x63 bitmap 0x0008
		INTC: link 0x69 bitmap 0x0080
		INTD: link 0x63 bitmap 0x0008
PIR Entry 3:
	Bus: 1  Device: 5
		INTA: link 0x6a bitmap 0x0400
		INTB: link 0x68 bitmap 0x0020
		INTC: link 0x68 bitmap 0x0020
		INTD: link 0x00 bitmap 0x0000
PIR Entry 4:
	Bus: 0  Device: 0
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x63 bitmap 0x0008
PIR Entry 5:
	Bus: 0  Device: 31
		INTA: link 0x62 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 6:
	Bus: 0  Device: 29
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x63 bitmap 0x0008
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x6b bitmap 0x0800
PIR Entry 7:
	Bus: 0  Device: 2
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
pciintr_link_fixup: PIRQ 0x00 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x01 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x02 not connected, assigning IRQ 9
pciintr_link_fixup: PIRQ 0x03 already connected to IRQ 3
pciintr_link_fixup: PIRQ 0x02 not connected, assigning IRQ 7
pciintr_link_fixup: PIRQ 0x01 already connected to IRQ 9
pciintr_link_route: route of PIRQ 0x00 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x01 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x03 -> IRQ 3 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x01 -> IRQ 9 preserved BIOS setting
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:02:0 0x8086 0x3582   A  0x00   9  0    already assigned
000:29:0 0x8086 0x24c2   A  0x00   9  0    already assigned
000:29:1 0x8086 0x24c4   B  0x03   3  0    already assigned
pciintr_header_fixup: no entry for link 0x6b (0:29:7:D)
000:31:1 0x8086 0x24ca   A  0x02   9  1    fixed up
000:31:3 0x8086 0x24c3   B  0x01   9  0    already assigned
000:31:5 0x8086 0x24c5   B  0x01   9  0    already assigned
000:31:6 0x8086 0x24c6   B  0x01   9  0    already assigned
001:01:0 0x10ec 0x8139   A  0x03   3  0    already assigned
001:04:0 0x8086 0x1043   A  0x02   7  1    already assigned
pciintr_header_fixup: no entry for link 0x6a (1:5:0:A)
001:05:1 0x1180 0x0575   B  0x01   9  0    WARNING: preserving irq 5
------------------------------------------
PCI fixup examining 8086:3580
PCI fixup examining 8086:3584
PCI fixup examining 8086:3585
PCI fixup examining 8086:3582
PCI fixup examining 8086:3582
PCI fixup examining 8086:24c2
PCI fixup examining 8086:24c4
PCI fixup examining 8086:24cd
PCI fixup examining 8086:2448
PCI fixup examining 10ec:8139
PCI fixup examining 8086:1043
PCI fixup examining 1180:475
PCI bridge 1: primary 1, secondary 2, subordinate 2
PCI fixup examining 1180:575
PCI bridge 0: primary 0, secondary 1, subordinate 2
PCI fixup examining 8086:24cc
PCI fixup examining 8086:24ca
PCI fixup examining 8086:24c3
PCI fixup examining 8086:24c5
PCI fixup examining 8086:24c6
PCI bus #2 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x3580 
		[OK]
000:00:1 0x8086 0x3584 
		[OK]
000:00:3 0x8086 0x3585 
		[OK]
000:02:0 0x8086 0x3582 
	10h mem  0xe8000000 0x08000000
	14h mem  0xe0000000 0x00080000
	18h port 0x00001800 0x00000008
		[OK]
000:02:1 0x8086 0x3582 
	10h mem  0xf0000000 0x08000000
	14h mem  0xe0080000 0x00080000
		[OK]
000:29:0 0x8086 0x24c2 
	20h port 0x00001820 0x00000020
		[OK]
000:29:1 0x8086 0x24c4 
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd 
	10h mem  0xe0100000 0x00000400
		[OK]
000:30:0 0x8086 0x2448 
		[OK]
000:31:0 0x8086 0x24cc 
		[OK]
000:31:1 0x8086 0x24ca 
	10h port 0x00000000 0x00000008
	14h port 0x00000000 0x00000004
	18h port 0x00000000 0x00000008
	1ch port 0x00000000 0x00000004
	20h port 0x00001810 0x00000010
	24h mem  0x00000000 0x00000400
		[NG]
000:31:3 0x8086 0x24c3 
	20h port 0x00001100 0x00000020
		[OK]
000:31:5 0x8086 0x24c5 
	10h port 0x00001c00 0x00000100
	14h port 0x00001880 0x00000040
	18h mem  0xe0100c00 0x00000200
	1ch mem  0xe0100800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6 
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:01:0 0x10ec 0x8139 
	10h port 0x00003000 0x00000100
	14h mem  0xe0201000 0x00000100
		[OK]
001:04:0 0x8086 0x1043 
	10h mem  0xe0200000 0x00001000
		[OK]
001:05:0 0x1180 0x0475 
	10h mem  0x00000000 0x00001000
		[NG]
001:05:1 0x1180 0x0575 
	10h mem  0xe0201400 0x00000100
		[OK]
--------------------------[  2 devices bogus]
 Physical memory end: 0x0f6ec000
 PCI memory mapped I/O space start: 0x0f700000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x3580 
		[OK]
000:00:1 0x8086 0x3584 
		[OK]
000:00:3 0x8086 0x3585 
		[OK]
000:02:0 0x8086 0x3582 
	10h mem  0xe8000000 0x08000000
	14h mem  0xe0000000 0x00080000
	18h port 0x00001800 0x00000008
		[OK]
000:02:1 0x8086 0x3582 
	10h mem  0xf0000000 0x08000000
	14h mem  0xe0080000 0x00080000
		[OK]
000:29:0 0x8086 0x24c2 
	20h port 0x00001820 0x00000020
		[OK]
000:29:1 0x8086 0x24c4 
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd 
	10h mem  0xe0100000 0x00000400
		[OK]
000:30:0 0x8086 0x2448 
		[OK]
000:31:0 0x8086 0x24cc 
		[OK]
000:31:1 0x8086 0x24ca 
	10h port 0x00005800 0x00000008
	14h port 0x00005808 0x00000004
	18h port 0x00005810 0x00000008
	1ch port 0x0000580c 0x00000004
	20h port 0x00001810 0x00000010
	24h mem  0x0f700000 0x00000400
		[OK]
000:31:3 0x8086 0x24c3 
	20h port 0x00001100 0x00000020
		[OK]
000:31:5 0x8086 0x24c5 
	10h port 0x00001c00 0x00000100
	14h port 0x00001880 0x00000040
	18h mem  0xe0100c00 0x00000200
	1ch mem  0xe0100800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6 
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:01:0 0x10ec 0x8139 
	10h port 0x00003000 0x00000100
	14h mem  0xe0201000 0x00000100
		[OK]
001:04:0 0x8086 0x1043 
	10h mem  0xe0200000 0x00001000
		[OK]
001:05:0 0x1180 0x0475 
	10h mem  0x0f701000 0x00001000
		[OK]
001:05:1 0x1180 0x0575 
	10h mem  0xe0201400 0x00000100
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium M (Banias) (686-class), 897.80 MHz, id 0x695
cpu0: features a7e9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR>
cpu0: features a7e9f9bf<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features a7e9f9bf<FXSR,SSE,SSE2,TM,SBF>
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82855GM Host-to-Hub Controller (rev. 0x02)
agp0 at pchb0: detected 8060k stolen memory
agp0: aperture size is 128M
agp0: aperture at 0xe8000000, size 0x8000000
Intel 82855GM GMCH Memory Controller (miscellaneous system, revision 0x02) at pci0 dev 0 function 1 not configured
Intel 82855GM GMCH Configuration Process (miscellaneous system, revision 0x02) at pci0 dev 0 function 3 not configured
vga1 at pci0 dev 2 function 0: Intel 82855GM GMCH Integrated Graphics Device (rev. 0x02)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
Intel 82855GM GMCH Integrated Graphics Device (miscellaneous display, revision 0x02) at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0: Intel 82801DB/DBM USB UHCI Controller #1 (rev. 0x03)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1: Intel 82801DB/DBM USB UHCI Controller #2 (rev. 0x03)
uhci1: interrupting at irq 3
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
Intel 82801DB/DBM USB EHCI Controller (USB serial bus, interface 0x20, revision 0x03) at pci0 dev 29 function 7 not configured
ppb0 at pci0 dev 30 function 0: Intel 82801BAM Hub-to-PCI Bridge (rev. 0x83)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
rtk0 at pci1 dev 1 function 0: RealTek 8139 10/100BaseTX
rtk0: interrupting at irq 3
rtk0: Ethernet address 00:80:45:2b:22:4e
ukphy0 at rtk0 phy 7: Generic IEEE 802.3u media interface
ukphy0: OUI 0x000000, model 0x0000, rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
Intel PRO/Wireless LAN 2100 3B Mini PCI Adapter (miscellaneous network, revision 0x04) at pci1 dev 4 function 0 not configured
cbb0 at pci1 dev 5 function 0: Ricoh 5C475 PCI-CardBus bridge (rev. 0x88)
cbb0: NOT USED because of unconfigured interrupt
Ricoh product 0x0575 (miscellaneous system) at pci1 dev 5 function 1 not configured
pcib0 at pci0 dev 31 function 0
pcib0: Intel 82801DB ISA Bridge (rev. 0x03)
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801DBM IDE Controller (ICH4-M) (rev. 0x03)
piixide0: bus-master DMA support present
piixide0: primary channel wired to compatibility mode
piixide0: primary channel interrupting at irq 14
atabus0 at piixide0 channel 0
piixide0: secondary channel wired to compatibility mode
piixide0: secondary channel ignored (disabled)
Intel 82801DB/DBM SMBus Controller (SMBus serial bus, revision 0x03) at pci0 dev 31 function 3 not configured
auich0 at pci0 dev 31 function 5: i82801DB/DBM (ICH4/ICH4M) AC-97 Audio
auich0: interrupting at irq 9
auich0: The 2nd codec is ready.
auich0: ac97: SigmaTel unknown (0x83847652) codec; headphone, 20 bit DAC, 20 bit ADC, SigmaTel 3D
auich0: ac97: ext id a01<AC97_23,AMAP,VRA>
Intel 82801DB/DBM AC97 Modem Controller (modem communications, revision 0x03) at pci0 dev 31 function 6 not configured
isa0 at pcib0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0xd0000-0xdffff irq 
pcic0: controller 0 (Intel 82365SL Revision 1) has socket A only
pcmcia0 at pcic0 controller 0 socket 0
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
auich0: measured ac97 link rate at 48006 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent
pcic0: controller 0 detecting irqs with mask 0xdeb8: none
pcic0: no available irq; polling for socket events
Kernelized RAIDframe activated
wd0 at atabus0 drive 0: <TOSHIBA MK4020GLS>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 35079 MB, 71272 cyl, 16 head, 63 sec, 512 bytes/sect x 71842680 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)


>How-To-Repeat:
Run netbsd kernel on Panasonic CF-R2.
>Fix:

  Here is a quick fix for PIIX support code.  After this change,
PCMCIA on CF-R2 worked fine.  dmesg is attached following the patch.

  XXX: I haven't tested any cardbus devices.

cvs diff: Diffing .
Index: piix.c
===================================================================
RCS file: /u1/tnfcvs/src/sys/arch/i386/pci/piix.c,v
retrieving revision 1.5
diff -u -r1.5 piix.c
--- piix.c	26 Feb 2003 22:23:10 -0000	1.5
+++ piix.c	9 Dec 2003 13:48:10 -0000
@@ -92,6 +92,7 @@
 #endif
 
 int	piix_getclink __P((pciintr_icu_handle_t, int, int *));
+int	ich4_getclink __P((pciintr_icu_handle_t, int, int *));
 int	piix_get_intr __P((pciintr_icu_handle_t, int, int *));
 int	piix_set_intr __P((pciintr_icu_handle_t, int, int));
 #ifdef PIIX_DEBUG
@@ -106,6 +107,14 @@
 	piix_set_trigger,
 };
 
+const struct pciintr_icu ich4_pci_icu = {
+	ich4_getclink,
+	piix_get_intr,
+	piix_set_intr,
+	piix_get_trigger,
+	piix_set_trigger,
+};
+
 int
 piix_init(pc, iot, tag, ptagp, phandp)
 	pci_chipset_tag_t pc;
@@ -115,6 +124,7 @@
 	pciintr_icu_handle_t *phandp;
 {
 	struct piix_handle *ph;
+	pcireg_t id;
 
 	ph = malloc(sizeof(*ph), M_DEVBUF, M_NOWAIT);
 	if (ph == NULL)
@@ -124,6 +134,9 @@
 	ph->ph_pc = pc;
 	ph->ph_tag = tag;
 
+	/* read ID again to see if this is ICH4 */
+	id = pci_conf_read(ph->ph_pc, ph->ph_tag, PCI_ID_REG);
+
 	if (bus_space_map(iot, PIIX_REG_ELCR, PIIX_REG_ELCR_SIZE, 0,
 	    &ph->ph_elcr_ioh) != 0) {
 		free(ph, M_DEVBUF);
@@ -133,7 +146,15 @@
 #ifdef PIIX_DEBUG
 	piix_pir_dump(ph);
 #endif
-	*ptagp = &piix_pci_icu;
+	switch(PCI_PRODUCT(id)) {
+	case PCI_PRODUCT_INTEL_82801DB_LPC: /* ICH4 */
+	case PCI_PRODUCT_INTEL_82801DB_ISA: /* ICH4M */
+		DPRINTF(("ICH4/ICH4M LPC (%x)\n", id));
+		*ptagp = &ich4_pci_icu;
+		break;
+	default:
+		*ptagp =&piix_pci_icu;
+	}
 	*phandp = ph;
 	return (0);
 }
@@ -174,6 +195,23 @@
 }
 
 int
+ich4_getclink(v, link, clinkp)
+	pciintr_icu_handle_t v;
+	int link, *clinkp;
+{
+	/* 
+	 * configuration registers 0x68..0x6b are for PIRQ[EFGH]
+	 */
+	if (link >= 0x68 && link <= 0x6b) {
+		*clinkp = link - 0x68 + 4;
+		DPRINTF(("PIRQ %d (register offset ICH4)\n", *clinkp));
+		return (0);
+	}
+
+	return piix_getclink(v, link, clinkp);
+}
+
+int
 piix_get_intr(v, clink, irqp)
 	pciintr_icu_handle_t v;
 	int clink, *irqp;
@@ -181,10 +219,14 @@
 	struct piix_handle *ph = v;
 	int shift;
 	pcireg_t reg;
+	int cfgreg;
 
 	if (PIIX_LEGAL_LINK(clink) == 0)
 		return (1);
 
+	cfgreg= clink <= 3 ? PIIX_CFG_PIRQ : PIIX_CFG_PIRQ2;
+	clink &= 0x03;
+
 	reg = pci_conf_read(ph->ph_pc, ph->ph_tag, PIIX_CFG_PIRQ);
 	shift = clink << 3;
 	if ((reg >> shift) & PIIX_CFG_PIRQ_NONE)
@@ -195,6 +237,7 @@
 	return (0);
 }
 
+
 int
 piix_set_intr(v, clink, irq)
 	pciintr_icu_handle_t v;
@@ -203,15 +246,19 @@
 	struct piix_handle *ph = v;
 	int shift;
 	pcireg_t reg;
+	int cfgreg;
 
 	if (PIIX_LEGAL_LINK(clink) == 0 || PIIX_LEGAL_IRQ(irq) == 0)
 		return (1);
 
-	reg = pci_conf_read(ph->ph_pc, ph->ph_tag, PIIX_CFG_PIRQ);
+	cfgreg= clink <= 3 ? PIIX_CFG_PIRQ : PIIX_CFG_PIRQ2;
+	clink &= 0x03;
+
+	reg = pci_conf_read(ph->ph_pc, ph->ph_tag, cfgreg);
 	shift = clink << 3;
 	reg &= ~((PIIX_CFG_PIRQ_NONE | PIIX_CFG_PIRQ_MASK) << shift);
 	reg |= irq << shift;
-	pci_conf_write(ph->ph_pc, ph->ph_tag, PIIX_CFG_PIRQ, reg);
+	pci_conf_write(ph->ph_pc, ph->ph_tag, cfgreg, reg);
 
 	return (0);
 }
Index: piixreg.h
===================================================================
RCS file: /u1/tnfcvs/src/sys/arch/i386/pci/piixreg.h,v
retrieving revision 1.1
diff -u -r1.1 piixreg.h
--- piixreg.h	17 Nov 1999 01:21:21 -0000	1.1
+++ piixreg.h	9 Dec 2003 13:48:10 -0000
@@ -35,13 +35,14 @@
  * PCI Configuration registers 0x60, 0x61, 0x62, 0x63
  */
 
-#define	PIIX_LEGAL_LINK(link)	((link) >= 0 && (link) <= 3)
+#define	PIIX_LEGAL_LINK(link)	((link) >= 0 && (link) <= 7)
 
 #define	PIIX_PIRQ_MASK		0xdef8
 #define	PIIX_LEGAL_IRQ(irq)	((irq) >= 0 && (irq) <= 15 &&		\
 				 ((1 << (irq)) & PIIX_PIRQ_MASK) != 0)
 
 #define	PIIX_CFG_PIRQ		0x60	/* PCI configuration space */
+#define	PIIX_CFG_PIRQ2		0x68    /* PIRQ[E:H] routing control (ICH4) */
 #define	PIIX_CFG_PIRQ_NONE	0x80
 #define	PIIX_CFG_PIRQ_MASK	0x0f
 #define	PIIX_PIRQ(reg, x)	(((reg) >> ((x) << 3)) & 0xff)



----------------------------------------------------------------
NetBSD 1.6ZF (GENERIC_LAPTOP) #6: Tue Dec  9 22:46:42 JST 2003
	bsh@kuromutsu:/u1/work/netbsd/current/src/sys/arch/i386/compile/GENERIC_LAPTOP
total memory = 246 MB
avail memory = 222 MB
using 3181 buffers containing 12724 KB of memory
BIOS32 rev. 0 found at 0xfd750
PCI BIOS rev. 2.1 found at 0xfd9b2
pcibios: config mechanism [1][x], special cycles [x][x], last bus 2
PCI IRQ Routing Table rev. 1.0 found at 0xfdf40, size 160 bytes (8 entries)
PCI Interrupt Router at 000:31:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
PIR Entry 0:
	Bus: 0  Device: 30
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x63 bitmap 0x0008
PIR Entry 1:
	Bus: 1  Device: 1
		INTA: link 0x63 bitmap 0x0008
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 2:
	Bus: 1  Device: 4
		INTA: link 0x69 bitmap 0x0080
		INTB: link 0x63 bitmap 0x0008
		INTC: link 0x69 bitmap 0x0080
		INTD: link 0x63 bitmap 0x0008
PIR Entry 3:
	Bus: 1  Device: 5
		INTA: link 0x6a bitmap 0x0400
		INTB: link 0x68 bitmap 0x0020
		INTC: link 0x68 bitmap 0x0020
		INTD: link 0x00 bitmap 0x0000
PIR Entry 4:
	Bus: 0  Device: 0
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x63 bitmap 0x0008
PIR Entry 5:
	Bus: 0  Device: 31
		INTA: link 0x62 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 6:
	Bus: 0  Device: 29
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x63 bitmap 0x0008
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x6b bitmap 0x0800
PIR Entry 7:
	Bus: 0  Device: 2
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
pciintr_link_fixup: PIRQ 0x00 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x01 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x02 not connected, assigning IRQ 9
pciintr_link_fixup: PIRQ 0x03 already connected to IRQ 3
pciintr_link_fixup: PIRQ 0x05 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x06 not connected, assigning IRQ 10
pciintr_link_fixup: PIRQ 0x04 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x07 already connected to IRQ 3
pciintr_link_route: route of PIRQ 0x00 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x01 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x03 -> IRQ 3 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x05 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x04 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x07 -> IRQ 3 preserved BIOS setting
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:02:0 0x8086 0x3582   A  0x00   9  0    already assigned
000:29:0 0x8086 0x24c2   A  0x00   9  0    already assigned
000:29:1 0x8086 0x24c4   B  0x03   3  0    already assigned
000:29:7 0x8086 0x24cd   D  0x07   3  0    WARNING: preserving irq 11
000:31:1 0x8086 0x24ca   A  0x02   9  1    fixed up
000:31:3 0x8086 0x24c3   B  0x01   9  0    already assigned
000:31:5 0x8086 0x24c5   B  0x01   9  0    already assigned
000:31:6 0x8086 0x24c6   B  0x01   9  0    already assigned
001:01:0 0x10ec 0x8139   A  0x03   3  0    already assigned
001:04:0 0x8086 0x1043   A  0x05   9  0    WARNING: preserving irq 7
001:05:0 0x1180 0x0475   A  0x06  10  1    fixed up
001:05:1 0x1180 0x0575   B  0x04   9  0    WARNING: preserving irq 5
------------------------------------------
PCI fixup examining 8086:3580
PCI fixup examining 8086:3584
PCI fixup examining 8086:3585
PCI fixup examining 8086:3582
PCI fixup examining 8086:3582
PCI fixup examining 8086:24c2
PCI fixup examining 8086:24c4
PCI fixup examining 8086:24cd
PCI fixup examining 8086:2448
PCI fixup examining 10ec:8139
PCI fixup examining 8086:1043
PCI fixup examining 1180:475
PCI bridge 1: primary 1, secondary 2, subordinate 2
PCI fixup examining 1180:575
PCI bridge 0: primary 0, secondary 1, subordinate 2
PCI fixup examining 8086:24cc
PCI fixup examining 8086:24ca
PCI fixup examining 8086:24c3
PCI fixup examining 8086:24c5
PCI fixup examining 8086:24c6
PCI bus #2 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x3580 
		[OK]
000:00:1 0x8086 0x3584 
		[OK]
000:00:3 0x8086 0x3585 
		[OK]
000:02:0 0x8086 0x3582 
	10h mem  0xe8000000 0x08000000
	14h mem  0xe0000000 0x00080000
	18h port 0x00001800 0x00000008
		[OK]
000:02:1 0x8086 0x3582 
	10h mem  0xf0000000 0x08000000
	14h mem  0xe0080000 0x00080000
		[OK]
000:29:0 0x8086 0x24c2 
	20h port 0x00001820 0x00000020
		[OK]
000:29:1 0x8086 0x24c4 
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd 
	10h mem  0xe0100000 0x00000400
		[OK]
000:30:0 0x8086 0x2448 
		[OK]
000:31:0 0x8086 0x24cc 
		[OK]
000:31:1 0x8086 0x24ca 
	10h port 0x00000000 0x00000008
	14h port 0x00000000 0x00000004
	18h port 0x00000000 0x00000008
	1ch port 0x00000000 0x00000004
	20h port 0x00001810 0x00000010
	24h mem  0x00000000 0x00000400
		[NG]
000:31:3 0x8086 0x24c3 
	20h port 0x00001100 0x00000020
		[OK]
000:31:5 0x8086 0x24c5 
	10h port 0x00001c00 0x00000100
	14h port 0x00001880 0x00000040
	18h mem  0xe0100c00 0x00000200
	1ch mem  0xe0100800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6 
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:01:0 0x10ec 0x8139 
	10h port 0x00003000 0x00000100
	14h mem  0xe0201000 0x00000100
		[OK]
001:04:0 0x8086 0x1043 
	10h mem  0xe0200000 0x00001000
		[OK]
001:05:0 0x1180 0x0475 
	10h mem  0x00000000 0x00001000
		[NG]
001:05:1 0x1180 0x0575 
	10h mem  0xe0201400 0x00000100
		[OK]
--------------------------[  2 devices bogus]
 Physical memory end: 0x0f6ec000
 PCI memory mapped I/O space start: 0x0f700000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x3580 
		[OK]
000:00:1 0x8086 0x3584 
		[OK]
000:00:3 0x8086 0x3585 
		[OK]
000:02:0 0x8086 0x3582 
	10h mem  0xe8000000 0x08000000
	14h mem  0xe0000000 0x00080000
	18h port 0x00001800 0x00000008
		[OK]
000:02:1 0x8086 0x3582 
	10h mem  0xf0000000 0x08000000
	14h mem  0xe0080000 0x00080000
		[OK]
000:29:0 0x8086 0x24c2 
	20h port 0x00001820 0x00000020
		[OK]
000:29:1 0x8086 0x24c4 
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd 
	10h mem  0xe0100000 0x00000400
		[OK]
000:30:0 0x8086 0x2448 
		[OK]
000:31:0 0x8086 0x24cc 
		[OK]
000:31:1 0x8086 0x24ca 
	10h port 0x00005800 0x00000008
	14h port 0x00005808 0x00000004
	18h port 0x00005810 0x00000008
	1ch port 0x0000580c 0x00000004
	20h port 0x00001810 0x00000010
	24h mem  0x0f700000 0x00000400
		[OK]
000:31:3 0x8086 0x24c3 
	20h port 0x00001100 0x00000020
		[OK]
000:31:5 0x8086 0x24c5 
	10h port 0x00001c00 0x00000100
	14h port 0x00001880 0x00000040
	18h mem  0xe0100c00 0x00000200
	1ch mem  0xe0100800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6 
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:01:0 0x10ec 0x8139 
	10h port 0x00003000 0x00000100
	14h mem  0xe0201000 0x00000100
		[OK]
001:04:0 0x8086 0x1043 
	10h mem  0xe0200000 0x00001000
		[OK]
001:05:0 0x1180 0x0475 
	10h mem  0x0f701000 0x00001000
		[OK]
001:05:1 0x1180 0x0575 
	10h mem  0xe0201400 0x00000100
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium M (Banias) (686-class), 897.79 MHz, id 0x695
cpu0: features a7e9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR>
cpu0: features a7e9f9bf<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features a7e9f9bf<FXSR,SSE,SSE2,TM,SBF>
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82855GM Host-to-Hub Controller (rev. 0x02)
agp0 at pchb0: detected 8060k stolen memory
agp0: aperture size is 128M
agp0: aperture at 0xe8000000, size 0x8000000
Intel 82855GM GMCH Memory Controller (miscellaneous system, revision 0x02) at pci0 dev 0 function 1 not configured
Intel 82855GM GMCH Configuration Process (miscellaneous system, revision 0x02) at pci0 dev 0 function 3 not configured
vga1 at pci0 dev 2 function 0: Intel 82855GM GMCH Integrated Graphics Device (rev. 0x02)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
Intel 82855GM GMCH Integrated Graphics Device (miscellaneous display, revision 0x02) at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0: Intel 82801DB/DBM USB UHCI Controller #1 (rev. 0x03)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1: Intel 82801DB/DBM USB UHCI Controller #2 (rev. 0x03)
uhci1: interrupting at irq 3
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
Intel 82801DB/DBM USB EHCI Controller (USB serial bus, interface 0x20, revision 0x03) at pci0 dev 29 function 7 not configured
ppb0 at pci0 dev 30 function 0: Intel 82801BAM Hub-to-PCI Bridge (rev. 0x83)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
rtk0 at pci1 dev 1 function 0: RealTek 8139 10/100BaseTX
rtk0: interrupting at irq 3
rtk0: Ethernet address 00:80:45:2b:22:4e
ukphy0 at rtk0 phy 7: Generic IEEE 802.3u media interface
ukphy0: OUI 0x000000, model 0x0000, rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
Intel PRO/Wireless LAN 2100 3B Mini PCI Adapter (miscellaneous network, revision 0x04) at pci1 dev 4 function 0 not configured
cbb0 at pci1 dev 5 function 0: Ricoh 5C475 PCI-CardBus bridge (rev. 0x88)
Ricoh product 0x0575 (miscellaneous system) at pci1 dev 5 function 1 not configured
cbb0: interrupting at irq 10
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0
pcmcia0 at cardslot0
pcib0 at pci0 dev 31 function 0
pcib0: Intel 82801DB ISA Bridge (rev. 0x03)
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801DBM IDE Controller (ICH4-M) (rev. 0x03)
piixide0: bus-master DMA support present
piixide0: primary channel wired to compatibility mode
piixide0: primary channel interrupting at irq 14
atabus0 at piixide0 channel 0
piixide0: secondary channel wired to compatibility mode
piixide0: secondary channel ignored (disabled)
Intel 82801DB/DBM SMBus Controller (SMBus serial bus, revision 0x03) at pci0 dev 31 function 3 not configured
auich0 at pci0 dev 31 function 5: i82801DB/DBM (ICH4/ICH4M) AC-97 Audio
auich0: interrupting at irq 9
auich0: The 2nd codec is ready.
auich0: ac97: SigmaTel unknown (0x83847652) codec; headphone, 20 bit DAC, 20 bit ADC, SigmaTel 3D
auich0: ac97: ext id a01<AC97_23,AMAP,VRA>
Intel 82801DB/DBM AC97 Modem Controller (modem communications, revision 0x03) at pci0 dev 31 function 6 not configured
isa0 at pcib0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
auich0: measured ac97 link rate at 48006 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent
Kernelized RAIDframe activated
wd0 at atabus0 drive 0: <TOSHIBA MK4020GLS>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 35079 MB, 71272 cyl, 16 head, 63 sec, 512 bytes/sect x 71842680 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
----------------------------------------------------------------
>Release-Note:
>Audit-Trail:
>Unformatted: