On Thu, 7 Dec 2000, Linus Torvalds wrote:

> > btw, I'm thinking I could guess the routing from the VLSI config space,
> > but I don't have any doc's. Would it be worth to try to add some specific
> 
> Please do. You might leave them commented out right now, but this is

Ok. Apparently it's the "pirq is nibble index in config space" kind of
routing which makes guessing a change bios and lspci procedure.
patch vs. 2.4.0-t12p8 below. Tested as (in)complete as my bios permits.
Works fine for several days and correctly assigns IRQ's when unassigned 
due to "pnp os". So I feel confident enough to not leave it commented out.
Test example attached.

Regards
Martin

-----

diff -Nur linux-2.4.0-t12p8/arch/i386/kernel/pci-irq.c 
linux-2.4.0-t12p8-md/arch/i386/kernel/pci-irq.c
--- linux-2.4.0-t12p8/arch/i386/kernel/pci-irq.c        Mon Dec 11 00:29:42 2000
+++ linux-2.4.0-t12p8-md/arch/i386/kernel/pci-irq.c     Mon Dec 11 00:58:48 2000
@@ -298,6 +298,33 @@
        return 1;
 }
 
+/*
+ * VLSI: nibble offset 0x74 - educated guess due to routing table and
+ *       config space of VLSI 82C534 PCI-bridge/router (1004:0102)
+ *       Tested on HP OmniBook 800 covering PIRQ 1, 2, 4, 8 for onboard
+ *       devices, PIRQ 3 for non-pci(!) soundchip and (untested) PIRQ 6
+ *       for the busbridge to the docking station.
+ */
+
+static int pirq_vlsi_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
+{
+       if (pirq > 8) {
+               printk("VLSI router pirq escape (%d)\n", pirq);
+               return 0;
+       }
+       return read_config_nybble(router, 0x74, pirq-1);
+}
+
+static int pirq_vlsi_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int 
+irq)
+{
+       if (pirq > 8) {
+               printk("VLSI router pirq escape (%d)\n", pirq);
+               return 0;
+       }
+       write_config_nybble(router, 0x74, pirq-1, irq);
+       return 1;
+}
+                                                                
 #ifdef CONFIG_PCI_BIOS
 
 static int pirq_bios_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int 
irq)
@@ -329,6 +356,7 @@
 
        { "NatSemi", PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, pirq_cyrix_get, 
pirq_cyrix_set },
        { "SIS", PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, pirq_sis_get, pirq_sis_set },
+        { "VLSI 82C534", PCI_VENDOR_ID_VLSI, PCI_DEVICE_ID_VLSI_82C534, 
+pirq_vlsi_get, pirq_vlsi_set },
        { "default", 0, 0, NULL, NULL }
 };


PCI: BIOS32 Service Directory structure at 0xc00ec060
PCI: BIOS32 Service Directory entry at 0xeefb0
PCI: BIOS probe returned s=00 hw=11 ver=02.10 l=01
PCI: PCI BIOS revision 2.10 entry at 0xeefc2, last bus=1
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Scanning for ghost devices on bus 0
PCI: Scanning for ghost devices on bus 1
PCI: IRQ init
PCI: Interrupt Routing Table found at 0xc00f36e0
00:03 slot=00 0:00/0000 1:00/0000 2:00/0000 3:00/0000
00:04 slot=00 0:01/8eb8 1:04/8eb8 2:04/0000 3:04/0000
00:05 slot=00 0:08/8eb8 1:08/0000 2:08/0000 3:08/0000
00:06 slot=00 0:02/8eb8 1:02/0000 2:02/0000 3:02/0000
01:00 slot=00 0:08/8eb8 1:08/0000 2:08/0000 3:08/0000
01:06 slot=01 0:06/8eb8 1:06/8eb8 2:06/8eb8 3:06/8eb8
PCI: Using IRQ router VLSI 82C534 [1004/0102] at 00:01.0
PCI: IRQ fixup
00:03.0: ignoring bogus IRQ 255
00:04.0: ignoring bogus IRQ 255
00:04.1: ignoring bogus IRQ 255
IRQ for 00:03.0(0) via 00:03.0 -> not routed
IRQ for 00:04.0(0) via 00:04.0 -> PIRQ 01, mask 8eb8, excl 0000 -> newirq=0 ... failed
IRQ for 00:04.1(1) via 00:04.1 -> PIRQ 04, mask 8eb8, excl 0000 -> newirq=0 ... failed
PCI: Allocating resources
PCI: Resource c0000000-c03fffff (f=1208, d=0, p=0)
PCI: Resource 00003100-000031ff (f=101, d=0, p=0)
PCI: Resource 1fffff00-1fffffff (f=200, d=0, p=0)
PCI: Resource 00003000-0000301f (f=101, d=0, p=0)
  got res[10000000:10000fff] for resource 0 of Texas Instruments PCI1131
  got res[10001000:10001fff] for resource 0 of Texas Instruments PCI1131 (#2)
PCI: Sorting device list...

Linux PCMCIA Card Services 3.1.22
  options:  [pci] [cardbus] [pm]
PCI: Enabling device 00:04.0 (0000 -> 0002)
IRQ for 00:04.0(0) via 00:04.0 -> PIRQ 01, mask 8eb8, excl 0000 -> newirq=5 -> 
assigning IRQ 5 ... OK
PCI: Assigned IRQ 5 for device 00:04.0
PCI: Enabling device 00:04.1 (0000 -> 0002)
IRQ for 00:04.1(1) via 00:04.1 -> PIRQ 04, mask 8eb8, excl 0000 -> newirq=9 -> 
assigning IRQ 9 ... OK
PCI: Assigned IRQ 9 for device 00:04.1
Yenta IRQ list 0ad8, PCI irq5
Socket status: 30000110
Yenta IRQ list 08d8, PCI irq9
Socket status: 30000010

00:00.0 Host bridge: VLSI Technology Inc 82C535 (rev 03)
        Flags: bus master, medium devsel, latency 0

00:01.0 PCI bridge: VLSI Technology Inc 82C534 (rev 03) (prog-if 00 [Normal decode])
        Flags: bus master, medium devsel, latency 0
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 00004000-00007fff
        Memory behind bridge: 20000000-2fffffff
        Prefetchable memory behind bridge: 30000000-3fffffff
70: 08 08 08 00 a5 95 00 a0 00 00 00 00 00 00 00 3a
                ^^^^^^^^^^^

00:02.0 Class ff00: VLSI Technology Inc 82C532 (rev 02)
        Flags: medium devsel

00:03.0 VGA compatible controller: Neomagic Corporation NM2093 [MagicGraph 128ZV] (rev 
04) (prog-if 00 [VGA])
        Flags: medium devsel
        Memory at c0000000 (32-bit, prefetchable) [size=4M]

00:04.0 CardBus bridge: Texas Instruments PCI1131 (rev 01)
        Flags: bus master, medium devsel, latency 168, IRQ 5
        Memory at 10000000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=176
        Memory window 0: 10000000-103ff000 (prefetchable)
        Memory window 1: 10400000-107ff000
        I/O window 0: 00001400-000014ff
        I/O window 1: 00001800-000018ff
        16-bit legacy interface ports at 0001

00:04.1 CardBus bridge: Texas Instruments PCI1131 (rev 01)
        Flags: bus master, medium devsel, latency 168, IRQ 9
        Memory at 10001000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=06, subordinate=06, sec-latency=176
        Memory window 0: 10800000-10bff000 (prefetchable)
        Memory window 1: 10c00000-10fff000
        I/O window 0: 00001c00-00001cff
        I/O window 1: 00002000-000020ff
        16-bit legacy interface ports at 0001

00:05.0 SCSI storage controller: Symbios Logic Inc. (formerly NCR) 53c810 (rev 12)
        Flags: bus master, medium devsel, latency 128, IRQ 10
        I/O ports at 3100 [size=256]
        Memory at 1fffff00 (32-bit, non-prefetchable) [size=256]

00:06.0 IRDA controller: VLSI Technology Inc 82C147 (rev 02)
        Flags: bus master, medium devsel, latency 0, IRQ 10
        I/O ports at 3000 [size=32]

Reply via email to