Subject: Libretto L2 USB IRQ Mapping
To: None <tech-kern@netbsd.org>
From: Curt Sampson <cjs@cynic.net>
List: tech-kern
Date: 02/21/2002 14:55:56
So things are getting better on my Libretto L2. Christos found out
that the PCIBIOS IRQ table actually does exist, it just starts with
_PIR rather than $PIR. So I can boot ok with a PCIBIOS-enabled
kernel and most everything seems to work (including the sound card
and CARDBUS when I enable it).

However, the one thing that isn't working yet is USB. (Though this
does work with PCIBIOS disabled.) It seems that something is a bit
odd about the way it's being set up, comapred to other devices;
note the

    000:20:0 0x10b9 0x5237   A  0x06  10  2    WARNING: preserving irq 7

message below. (This is surely the USB controller, since it normally
uses IRQ 7 when PCIBIOS is not enabled.) In this configuration I
can plug stuff in, but the system never receives interrupts on IRQ
7.  So I added PCIBIOS_INTR_FIXUP_FORCE to my config file, which
changes the line below to

    000:20:0 0x10b9 0x5237   A  0x06  10  2    WARNING: overriding irq 7

When I boot and start X, I can plug in a USB mouse and it probes
and attaches wsmouse1. But again some weird interrupt thing seems
to happen; the mouse doesn't work, and vmstat indicates that I'm
not seeing nearly as many interrupts as I should be when I move
the mouse around. Normally several seconds of continuous mouse
movement will generate hundreds of interrupts; in this instance
over three seconds I saw three interrupts on IRQ 10, which I suspect
were all other devices (such as fxp0) on that IRQ anyway.

So I'm wondering where to go next with this? I don't really know
much about PIR setup, but I'm willing to try any ideas that anyone
has.

Note that this is all using stock kernel source as of a couple of
days ago.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC


NetBSD 1.5ZA (GENERIC_P) #0: Thu Feb 21 08:37:43 JST 2002
    cjs@angelic.cynic.net:/u/netbsd/src/sys/arch/i386/compile/GENERIC_P
cpu0: Transmeta Crusoe (586-class), 597.74 MHz
cpu0: Processor revision 1.3.1.3
cpu0: Code Morphing Software Rev: 4.2.5-8-148
cpu0: 20010503 11:00 official release 4.2.5#1
cpu0: LongRun mode: 1  <600MHz 1600mV 100%>
cpu0: features 80893f<FPU,VME,DE,PSE,TSC,MSR,CX8,SEP>
cpu0: features 80893f<CMOV,MMX>
total memory = 238 MB
avail memory = 215 MB
using 3084 buffers containing 12336 KB of memoryIt seems that something is a bit odd
about the way it's being set up, comapred to other devices; note the
BIOS32 rev. 0 found at 0xfb5bb
PCI BIOS rev. 2.1 found at 0xfcd73
pcibios: config mechanism [1][x], special cycles [x][x], last bus 1
PCI IRQ Routing Table rev. 1.0 found at 0xf01c0, size 112 bytes (5 entries)
PCI Interrupt Router at 000:07:0 (Acer Labs M1543 PCI-ISA Bridge)
PIR Entry 0:
	Bus: 0  Device: 4
		INTA: link 0x01 bitmap 0x0cf8
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 1:
	Bus: 0  Device: 18
		INTA: link 0x02 bitmap 0x0cf8
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 2:
	Bus: 0  Device: 14
		INTA: link 0x03 bitmap 0x0cf8
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 3:
	Bus: 0  Device: 20
		INTA: link 0x07 bitmap 0x0cf8
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 4:
	Bus: 0  Device: 6
		INTA: link 0x08 bitmap 0x0cf8
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
pciintr_link_fixup: PIRQ 0x00 already connected to IRQ 11
pciintr_link_fixup: PIRQ 0x01 not connected
pciintr_link_fixup: PIRQ 0x02 already connected to IRQ 10
pciintr_link_fixup: PIRQ 0x06 not connected
pciintr_link_fixup: PIRQ 0x07 not connected
pciintr_link_fixup (stage 2): assigning IRQ 10 to PIRQ 0x01
pciintr_link_fixup (stage 2): assigning IRQ 10 to PIRQ 0x06
pciintr_link_fixup (stage 2): assigning IRQ 10 to PIRQ 0x07
pciintr_link_route: route of PIRQ 0x00 -> IRQ 11 preserved BIOS setting
pciintr_link_route: route of PIRQ 0x02 -> IRQ 10 preserved BIOS setting
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:04:0 0x5333 0x8c12   A  0x00  11  0    already assigned
000:06:0 0x10b9 0x5451   A  0x07  10  2    fixed up
000:14:0 0x8086 0x1229   A  0x02  10  0    already assigned
000:18:0 0x1179 0x0617   A  0x01  10  2    fixed up
000:20:0 0x10b9 0x5237   A  0x06  10  2    WARNING: preserving irq 7
------------------------------------------
PCI fixup examining 1279:395
PCI fixup examining 1279:396
PCI fixup examining 1279:397
PCI fixup examining 5333:8c12
PCI fixup examining 10b9:5451
PCI fixup examining 10b9:1533
PCI fixup examining 8086:1229
PCI fixup examining 10b9:5229
PCI fixup examining 10b9:7101
PCI fixup examining 1179:617
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI fixup examining 10b9:5237
PCI bus #1 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x1279 0x0395
	10h mem  0xefd00000 0x00100000
		[OK]
000:00:1 0x1279 0x0396
		[OK]
000:00:2 0x1279 0x0397
		[OK]
000:04:0 0x5333 0x8c12
	10h mem  0xe0000000 0x08000000
		[OK]
000:06:0 0x10b9 0x5451
	10h port 0x00000000 0x00000100
	14h mem  0x00000000 0x00001000
		[NG]
000:07:0 0x10b9 0x1533
		[OK]
000:14:0 0x8086 0x1229
	10h mem  0xdffff000 0x00001000
	14h port 0x0000edc0 0x00000040
	18h mem  0xdfe00000 0x00100000
		[OK]
000:16:0 0x10b9 0x5229
	20h port 0x0000edb0 0x00000010
		[OK]
000:17:0 0x10b9 0x7101
		[OK]
000:18:0 0x1179 0x0617
	10h mem  0x00000000 0x00001000
		[NG]
000:20:0 0x10b9 0x5237
	10h mem  0xdfdfe000 0x00001000
		[OK]
--------------------------[  2 devices bogus]
 Physical memory end: 0x0ef5a000
 PCI memory mapped I/O space start: 0x0f000000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x1279 0x0395
	10h mem  0xefd00000 0x00100000
		[OK]
000:00:1 0x1279 0x0396
		[OK]
000:00:2 0x1279 0x0397
		[OK]
000:04:0 0x5333 0x8c12
	10h mem  0xe0000000 0x08000000
		[OK]
000:06:0 0x10b9 0x5451
	10h port 0x00005800 0x00000100
	14h mem  0x0f000000 0x00001000
		[OK]
000:07:0 0x10b9 0x1533
		[OK]
000:14:0 0x8086 0x1229
	10h mem  0xdffff000 0x00001000
	14h port 0x0000edc0 0x00000040
	18h mem  0xdfe00000 0x00100000
		[OK]
000:16:0 0x10b9 0x5229
	20h port 0x0000edb0 0x00000010
		[OK]
000:17:0 0x10b9 0x7101
		[OK]
000:18:0 0x1179 0x0617
	10h mem  0x0f001000 0x00001000
		[OK]
000:20:0 0x10b9 0x5237
	10h mem  0xdfdfe000 0x00001000
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Transmeta Corp LongRun Northbridge (rev. 0x01)
Transmeta Corp SDRAM Controller (RAM memory) at pci0 dev 0 function 1 not configured
Transmeta Corp BIOS Scratchpad (RAM memory) at pci0 dev 0 function 2 not configured
vga1 at pci0 dev 4 function 0: S3 Savage/IX+MV (rev. 0x13)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
autri0 at pci0 dev 6 function 0: Acer Labs M5451 AC-Link Controller Audio Device (rev. 0x01)
autri0: interrupting at irq 10
autri0: Asahi Kasei AK4543 codec; headphone, 18 bit DAC, 18 bit ADC, AKM 3D
audio0 at autri0: full duplex, mmap, independent
midi0 at autri0: 4DWAVE MIDI UART
pcib0 at pci0 dev 7 function 0
pcib0: Acer Labs M1543 PCI-ISA Bridge (rev. 0x00)
fxp0 at pci0 dev 14 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at irq 10
fxp0: Ethernet address 00:00:39:9d:43:99
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pciide0 at pci0 dev 16 function 0: Acer Labs M5229 UDMA IDE Controller (rev. 0xc3)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <TOSHIBA MK1016GAP>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 9590 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 19640880 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel ignored (disabled)
Acer Labs M7101 Power Management Controller (miscellaneous bridge) at pci0 dev 17 function 0 not configured
Toshiba ToPIC100 CardBus-PCI Bridge (CardBus bridge, revision 0x32) at pci0 dev 18 function 0 not configured
ohci0 at pci0 dev 20 function 0: Acer Labs M5237 USB Host Controller (rev. 0x03)
ohci0: interrupting at irq 7
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Acer Labs OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
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
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
pcppi0 at isa0 port 0x61
midi1 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
biomask ebfd netmask effd ttymask ffff
Kernelized RAIDframe activated
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)
wsdisplay0: screen 5 added (80x25, vt100 emulation)
wsdisplay0: screen 6 added (80x25, vt100 emulation)
wsdisplay0: screen 7 added (80x25, vt100 emulation)