Subject: uhci/ehci - couldn't map interrupt
To: None <tech-kern@NetBSD.org, current-users@NetBSD.org>
From: Petar Bogdanovic <p+netbsd@2005.smokva.net>
List: tech-kern
Date: 06/01/2005 02:35:58
Hi,

at the moment, I use NetBSD 3.99.5 (i386) on a Sony VGN-S1XP laptop. 
It's a nice machine, but USB 2.0 resp. the ehci(4) driver isn't working. 
A part of dmesg says:

***
ehci0 at pci0 dev 29 function 7: Intel 82801DB USB EHCI Controller (rev. 
0x03)
pci_intr_map: no mapping for pin D (line=ff)
ehci0: couldn't map interrupt
***

And ehci is not the only driver with the map-interrupt problem:

***
uhci2 at pci0 dev 29 function 2: Intel 82801DB USB UHCI Controller (rev. 
0x03)
pci_intr_map: no mapping for pin C (line=ff)
uhci2: couldn't map interrupt
***

Which is not true for uhci0 and uhci1:

***
uhci0 at pci0 dev 29 function 0: Intel 82801DB USB UHCI Controller (rev. 
0x03)
uhci0: interrupting at irq 9
(...)
uhci1 at pci0 dev 29 function 1: Intel 82801DB USB UHCI Controller (rev. 
0x03)
uhci1: interrupting at irq 9
***

I've read about people with Sony-Laptops who did complain about the same 
issue. They were told, that it's probably because of a buggy BIOS and that:

options   PCIBIOS_ADDR_FIXUP   # fixup PCI I/O addresses
options   PCIBIOS_BUS_FIXUP    # fixup PCI bus numbering
options   PCIBIOS_INTR_FIXUP   # fixup PCI interrupt routing

should help.

Sadly, this options were not workig for me. Therefore, I wanted to play 
with the BIOS IRQ-settings.. but then I recognised, how extremely 
limited this BIOS is - you may set the date and the boot order. Nothing 
more, nothing less.


I would appreciate any sharing of experience/thoughts/hints.

With kind regards,

Petar


P.S: I've attached the dmesg-output of a - slightly modified (see diff) 
- 3.99.5 GENERIC_LAPTOP:

++++++++++++++++++++++++++DIFF++++++++++++++++++++++++++
325c325
< #options 	PCIINTR_DEBUG		# super-verbose PCI interrupt fixup
---
 > options 	PCIINTR_DEBUG		# super-verbose PCI interrupt fixup
769c769
< esl*	at pcmcia? function ?			# ESS 1688 AudioDrive
---
 > #esl*	at pcmcia? function ?			# ESS 1688 AudioDrive
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++DMESG+++++++++++++++++++++++++
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
     The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

NetBSD 3.99.5 (GENERIC_SONY) #2: Wed Jun  1 03:31:30 CEST 2005
	root@cassius.a51.ch:/build/netbsd/i386/sys/arch/i386/compile/GENERIC_SONY
total memory = 511 MB
avail memory = 496 MB
BIOS32 rev. 0 found at 0xfd751
PCI BIOS rev. 2.1 found at 0xfd9c3
pcibios: config mechanism [1][x], special cycles [x][x], last bus 2
PCI IRQ Routing Table rev. 1.0 found at 0xfdf30, size 176 bytes (9 entries)
PCI Interrupt Router at 000:31:0 (Intel 82371FB (PIIX) PCI-ISA Bridge 
compatible)
PIR Entry 0:
	Bus: 0  Device: 30
		INTA: link 0x00 bitmap 0xdef8
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 1:
	Bus: 2  Device: 4
		INTA: link 0x68 bitmap 0x0200
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 2:
	Bus: 2  Device: 8
		INTA: link 0x68 bitmap 0x0200
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 3:
	Bus: 2  Device: 2
		INTA: link 0x00 bitmap 0xdef8
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 4:
	Bus: 2  Device: 11
		INTA: link 0x63 bitmap 0x0200
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 5:
	Bus: 0  Device: 0
		INTA: link 0x00 bitmap 0xdef8
		INTB: link 0x00 bitmap 0xdef8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 6:
	Bus: 0  Device: 31
		INTA: link 0x00 bitmap 0x0000
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 7:
	Bus: 0  Device: 29
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x63 bitmap 0x0200
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
PIR Entry 8:
	Bus: 0  Device: 1
		INTA: link 0x60 bitmap 0x16f8
		INTB: link 0x61 bitmap 0x16f8
		INTC: link 0x00 bitmap 0xdef8
		INTD: link 0x00 bitmap 0xdef8
pciintr_link_fixup: PIRQ 0x00 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x03 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x04 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x01 not connected
pciintr_link_fixup (stage 2): assigning IRQ 9 to PIRQ 0x01
pciintr_link_route: route of PIRQ 0x00 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x03 -> IRQ 9 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x04 -> IRQ 9 preserved BIOS setting
------------------------------------------
   device vendor product pin PIRQ IRQ stage
------------------------------------------
000:29:0 0x8086 0x24c2   A  0x00   9  0    already assigned
000:29:1 0x8086 0x24c4   B  0x03   9  0    already assigned
002:04:0 0x104c 0xac8e   A  0x04   9  0    already assigned
002:08:0 0x8086 0x103d   A  0x04   9  0    already assigned
------------------------------------------
pciintr_irq_release: fixup pciirq level/edge map 0x0200
pciintr_irq_release: bios  pciirq level/edge map 0x0200
pciintr_irq_release: final pciirq level/edge map 0x0200
PCI fixup examining 8086:3340
PCI fixup examining 8086:3341
PCI fixup examining 1002:4e50
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI fixup examining 8086:24c2
PCI fixup examining 8086:24c4
PCI fixup examining 8086:24c7
PCI fixup examining 8086:24cd
PCI fixup examining 8086:2448
PCI fixup examining 104c:ac8e
PCI bridge 2: primary 2, secondary 3, subordinate 3
PCI fixup examining 104c:802e
PCI fixup examining 104c:ac8f
PCI fixup examining 8086:103d
PCI bridge 1: primary 0, secondary 2, subordinate 3
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 #3 is the last bus
[System BIOS Setting]-----------------------
   device vendor product
   register space address    size
--------------------------------------------
000:00:0 0x8086 0x3340
	10h mem  0xe0000000 0x10000000
		[OK]
000:01:0 0x8086 0x3341
		[OK]
000:29:0 0x8086 0x24c2
	20h port 0x00001800 0x00000020
		[OK]
000:29:1 0x8086 0x24c4
	20h port 0x00001820 0x00000020
		[OK]
000:29:2 0x8086 0x24c7
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd
	10h mem  0xd0000000 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 0x00001860 0x00000010
	24h mem  0x00000000 0x00000400
		[NG]
000:31:3 0x8086 0x24c3
	20h port 0x00001880 0x00000020
		[OK]
000:31:5 0x8086 0x24c5
	10h port 0x00001c00 0x00000100
	14h port 0x000018c0 0x00000040
	18h mem  0xd0000c00 0x00000200
	1ch mem  0xd0000800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:00:0 0x1002 0x4e50
	10h mem  0xd8000000 0x08000000
	14h port 0x00003000 0x00000100
	18h mem  0xd0100000 0x00010000
		[OK]
002:04:0 0x104c 0xac8e
	10h mem  0x00000000 0x00001000
		[NG]
002:04:2 0x104c 0x802e
	10h mem  0xd0206000 0x00000800
	14h mem  0xd0200000 0x00004000
		[OK]
002:04:3 0x104c 0xac8f
	10h mem  0xd0204000 0x00001000
		[OK]
002:08:0 0x8086 0x103d
	10h mem  0xd0205000 0x00001000
	14h port 0x00004000 0x00000040
		[OK]
--------------------------[  2 devices bogus]
  Physical memory end: 0x1ff6c000
  PCI memory mapped I/O space start: 0x20000000
[PCIBIOS fixup stage]-----------------------
   device vendor product
   register space address    size
--------------------------------------------
000:00:0 0x8086 0x3340
	10h mem  0xe0000000 0x10000000
		[OK]
000:01:0 0x8086 0x3341
		[OK]
000:29:0 0x8086 0x24c2
	20h port 0x00001800 0x00000020
		[OK]
000:29:1 0x8086 0x24c4
	20h port 0x00001820 0x00000020
		[OK]
000:29:2 0x8086 0x24c7
	20h port 0x00001840 0x00000020
		[OK]
000:29:7 0x8086 0x24cd
	10h mem  0xd0000000 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 0x00001860 0x00000010
	24h mem  0x20000000 0x00000400
		[OK]
000:31:3 0x8086 0x24c3
	20h port 0x00001880 0x00000020
		[OK]
000:31:5 0x8086 0x24c5
	10h port 0x00001c00 0x00000100
	14h port 0x000018c0 0x00000040
	18h mem  0xd0000c00 0x00000200
	1ch mem  0xd0000800 0x00000100
		[OK]
000:31:6 0x8086 0x24c6
	10h port 0x00002400 0x00000100
	14h port 0x00002000 0x00000080
		[OK]
001:00:0 0x1002 0x4e50
	10h mem  0xd8000000 0x08000000
	14h port 0x00003000 0x00000100
	18h mem  0xd0100000 0x00010000
		[OK]
002:04:0 0x104c 0xac8e
	10h mem  0x20001000 0x00001000
		[OK]
002:04:2 0x104c 0x802e
	10h mem  0xd0206000 0x00000800
	14h mem  0xd0200000 0x00004000
		[OK]
002:04:3 0x104c 0xac8f
	10h mem  0xd0204000 0x00001000
		[OK]
002:08:0 0x8086 0x103d
	10h mem  0xd0205000 0x00001000
	14h port 0x00004000 0x00000040
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium M (Dothan) (686-class), 1696.80 MHz, id 0x6d6
cpu0: features afe9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR>
cpu0: features afe9f9bf<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features afe9f9bf<FXSR,SSE,SSE2,SS,TM,SBF>
cpu0: features2 180<EST,TM2>
cpu0: "Intel(R) Pentium(R) M processor 1.70GHz"
cpu0: using thermal monitor 2
cpu0: Enhanced SpeedStep running at 1700 MHz (1340 mV)
cpu0: Enhanced SpeedStep frequencies available (MHz): 1700 1400 1200 
1000 800 600
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 82855PM MCH Host Controller (rev. 0x03)
agp0 at pchb0: aperture at 0xe0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0: Intel 82855PM Host-AGP Bridge (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: ATI Technologies product 0x4e50 (rev. 0x00)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
uhci0 at pci0 dev 29 function 0: Intel 82801DB USB UHCI Controller (rev. 
0x03)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel product 0x0000, 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 USB UHCI Controller (rev. 
0x03)
uhci1: interrupting at irq 9
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel product 0x0000, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2: Intel 82801DB USB UHCI Controller (rev. 
0x03)
pci_intr_map: no mapping for pin C (line=ff)
uhci2: couldn't map interrupt
ehci0 at pci0 dev 29 function 7: Intel 82801DB USB EHCI Controller (rev. 
0x03)
pci_intr_map: no mapping for pin D (line=ff)
ehci0: couldn't map interrupt
ppb1 at pci0 dev 30 function 0: Intel 82801BAM Hub-PCI Bridge (rev. 0x83)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
cbb0 at pci2 dev 4 function 0: Texas Instruments product 0xac8e (rev. 0x00)
Texas Instruments product 0x802e (Firewire serial bus, interface 0x10) 
at pci2 dev 4 function 2 not configured
Texas Instruments product 0xac8f (miscellaneous mass storage) at pci2 
dev 4 function 3 not configured
fxp0 at pci2 dev 8 function 0: Intel PRO/100 VE (MOB) Network 
Controller, rev 131
fxp0: interrupting at irq 9
fxp0: Ethernet address 00:01:4a:02:3a:aa
inphy0 at fxp0 phy 1: i82562ET 10/100 media interface, rev. 0
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
cbb0: interrupting at irq 9
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 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 interrupting at irq 15
atabus1 at piixide0 channel 1
Intel 82801DB 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: ac97: Analog Devices AD1981B codec; headphone, 20 bit DAC, no 3D 
stereo
auich0: ac97: ext id 601<AC97_22,AMAP,VRA>
Intel 82801DB 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
attimer0 at isa0 port 0x40-0x43: AT Timer
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
pcppi0: attached to attimer0
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
auich0: measured ac97 link rate at 48000 Hz
audio0 at auich0: full duplex, mmap, independent
Kernelized RAIDframe activated
umass0 at uhub1 port 1 configuration 1 interface 0
umass0: vendor 0x1005 product 0xb113, rev 2.00/0.50, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <, USB FLASH DRIVE, 1.01> disk removable
sd0: 124 MB, 496 cyl, 16 head, 32 sec, 512 bytes/sect x 253952 sectors
wd0 at atabus0 drive 0: <HITACHI_DK23FA-60>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 57231 MB, 116280 cyl, 16 head, 63 sec, 512 bytes/sect x 117210240 
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)
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <MATSHITAUJ-812, , K103> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(piixide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
findroot: unable to read block 40965751
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)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++