PCI/cardbus resources (was Re: xircom_tulip_cb ...)

From: Jan Kasprzak (kas@informatics.muni.cz)
Date: Mon May 15 2000 - 03:22:37 EST


Keith Owens wrote:
: Try this patch to enable the expansion ROM. Against 2.3.99-pre8. I would like
: to see the dump_cis output after this patch.
:
: Index: 99-pre8.1/arch/i386/kernel/pci-i386.c
: - --- 99-pre8.1/arch/i386/kernel/pci-i386.c Fri, 05 May 2000 01:41:17 +1000 kaos (linux-2.3/h/c/14_pci-i386.c 1.7.1.5 644)
: +++ 99-pre8.1(w)/arch/i386/kernel/pci-i386.c Sat, 13 May 2000 22:01:42 +1000 kaos (linux-2.3/h/c/14_pci-i386.c 1.7.1.5 644)
: @@ -106,6 +106,7 @@
: reg = PCI_BASE_ADDRESS_0 + 4*resource;
: } else if (resource == PCI_ROM_RESOURCE) {
: res->flags |= PCI_ROM_ADDRESS_ENABLE;
: + new |= PCI_ROM_ADDRESS_ENABLE;
: reg = dev->rom_base_reg;
: } else {
: /* Somebody might have asked allocation of a non-standard resource */
:
        This works for me (Compaq armada M700, Xircom RBEM56G-100). I vote
for this patch to be applied to the mainstream kernel.

        Howewer, I haven't been able to make the modem part of this
card working under 2.3 (2.2 works fine). The problem seems to be that
the PCI allocation resource code fails to allocate the I/O ports resource
for the modem part. It seems it tries to allocate the I/O ports from
wrong resource root.

My /proc/ioports:
[...]
2800-28ff : PCI CardBus #02
  2800-287f : PCI device 115d:0003
    2800-287f : eth0
2c00-2cff : PCI CardBus #04
[...]

My boot messages:
[...]
cs: cb_alloc(bus 2): vendor 0x115d, device 0x0003
root:[2800:28ff] res[0:7f] min[1000] size[80] <--- ethernet
root:[10400000:107fffff] res[0:7ff] min[10000000] size[800]
root:[10400000:107fffff] res[0:7ff] min[10000000] size[800]
root:[10000000:103fffff] res[0:3fff] min[10000000] size[4000]
PCI: Enabling device 02:00.0 (0000 -> 0003)
root:[2800:28ff] res[0:7] min[1000] size[8] <--- modem
PCI: Failed to allocate resource 0 for PCI device 115d:0103
root:[10400000:107fffff] res[0:7ff] min[10000000] size[800]
root:[10400000:107fffff] res[0:7ff] min[10000000] size[800]
root:[10000000:103fffff] res[0:3fff] min[10000000] size[4000]
PCI: Enabling device 02:00.1 (0000 -> 0003)
[...]
        The "root:" lines above are debugging messages I have added to
linux/drivers/pci/setup-res.c: pci_assign_resource() just before the
allocate_resource() call).

        Note that it tries to allocate eight bytes
from the beginning of the root bus at 2800:28ff (this is already
occupied by the ethernet part above. The strange thing is that the
modem I/O ports are at 0x2c00 instead of 0x2800 according to lspci -vv:

[...]
02:00.0 Ethernet controller: Xircom Cardbus Ethernet 10/100 (rev 03)
        Subsystem: Xircom Cardbus Ethernet 10/100
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 20 min, 40 max, 64 set, cache line size 08
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at 2800 [size=128]
        Region 1: Memory at 10400000 (32-bit, non-prefetchable) [size=2K]
        Region 2: Memory at 10400800 (32-bit, non-prefetchable) [size=2K]
        Expansion ROM at 10000000 [size=16K]
        Capabilities: [dc] Power Management version 1
                Flags: PMEClk- AuxPwr+ DSI- D1+ D2+ PME+
                Status: D0 PME-Enable- DSel=0 DScale=2 PME-

02:00.1 Serial controller: Xircom Cardbus Ethernet + 56k Modem (rev 03) (prog-if 02 [16550])
        Subsystem: Xircom CBEM56G-100 Ethernet + 56k Modem
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at 2c00
        Region 1: Memory at 10401000 (32-bit, non-prefetchable) [size=2K]
        Region 2: Memory at 10401800 (32-bit, non-prefetchable) [size=2K]
        Expansion ROM at 10004000 [size=16K]
        Capabilities: [dc] Power Management version 1
                Flags: PMEClk- AuxPwr+ DSI- D1+ D2+ PME+
                Status: D0 PME-Enable- DSel=0 DScale=2 PME-
[...]
        Has anybody got both the ethernet and the modem part of the
Xircom RBEM56G-100 card working under 2.3.99 kernels?

-Yenya

-- 
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz>       http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz   0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\             Czech Linux Homepage:  http://www.linux.cz/              ///
/// Vite jak Microsoft vyrabi nezavirovana CD? ... ... ... Pouziva UNIX! \\\
//     http://support.microsoft.com/support/kb/articles/Q80/5/20.ASP      \\

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:25 EST