Home - Products - Buy - About Us - Support - Custom - SiteMap

Linux, PCI-PCMCIA Adapters, PCMCIA Cards and Cardbus Cards

PCMCIA Card Services

The Linux software that deals with pcmcia cards is "pcmcia-cs" available from http://pcmcia-cs.sourceforge.net/ as download file "pcmcia-cs-3.1.22.tar.gz"

At Elan, the PCMCIA Card Services 3.1.19 is the version that has been most extensively tested against, but we have every reason the believe that later versions also function correctly.

Linux Kernel

The implementation model of linux pcmcia is changing:

2.2.13+ Kernels

The pcmcia-cs standalone package as suppported by David Hinds

2.4.1+ Kernels

Now there is limited kernel support for pcmcia, basically for the "yenta_socket".
However Elan's adapter cards all use controllers that are (more or less) compatable with the i82365, so it is neccessary to continue to use the standalone package.

Known Problems

Shared Interrupts

Some of the pcmcia card drivers don't properly support the sharing of interrupts. One particular example is the ide driver for flash-ATA cards. The observed effect is that a single flash card works fine no matter which slot on a P423 or P222 (for example) it is inserted into. However the act of inserting a second flash/ATA card is to lock-up the LINUX kernel, at which point one of the diagnostic LEDs on the adaptor card will show that an interrupt is active.

Texas Instruments Controllers

Adaptors featuring TI controller chips include:

Fron Linux's point of view only the controller chip is significant, all models using a TI chip are expected to behave in the same way.

The PCIC type is i82365 and the necessary PCIC options are:

"irq_mode=0 pci_csc=0 poll_interval=100"

and are unfortunately set in different configuration files depending on the distribution. Some of the major distributions are listed below with the configuration filenames.

The effect of these options are:

The reason for polling the controller for Card Status Changes is that some drivers do not seem to be able to share interrupts, the example that we at Elan found was the "ide_cs" module. It is the driver used for ATA flash cards. And since doing a poll is unlikely to strain your PC, it is easier to just always do it.

Slackware 7.1

The configuration file is:

/etc/rc.d/rc.pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=0 pci_csc=0 poll_interval=100"

Debian 2.2

The configuration file is:

/etc/pcmcia.conf OR /etc/init.d/pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=0 pci_csc=0 poll_interval=100"

SuSE 7.0

The configuration file is:

/etc/rc.config

The options are:

PCMCIA="i82365"
PCMCIA_PCIC_OPTS="irq_mode=0 pci_csc=0 poll_interval=100"

Red Hat 7.0

The configuration file is:

/etc/sysconfig/pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=0 pci_csc=0 poll_interval=100"

Cirrus Logic Controllers

Models featuring a CL controller include:

From Linux's point of view, only the controller chip is significant, so all CL models would be expected to behave in the same way.

The PCIC type is i82365 and the necessary PCIC options are:

irq_mode=1 pci_csc=0 poll_interval=100"

and are unfortunately set in different configuration files depending on the distribution. Some of the major distributions are listed below with the configuration filenames.

Please note that the irq_mode parameter setting required is different to that in the Texas Instrument controller.

The effect of these options are:

The reason for polling the controller for Card Status Changes is that some drivers do not seem to be able to share interrupts, the example that we at Elan found was the "ide_cs" module. It is the driver used for ATA flash cards. And since doing a poll is unlikely to strain your PC, it is easier to just always do it.

Slackware 7.1

The configuration file is:

/etc/rc.d/rc.pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=1 pci_csc=0 poll_interval=100"

Debian 2.2

The configuration file is:

/etc/pcmcia.conf OR /etc/init.d/pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=1 pci_csc=0 poll_interval=100"

SuSE 7.0

The configuration file is:

/etc/rc.config

The options are:

PCMCIA="i82365"
PCMCIA_PCIC_OPTS="irq_mode=1 pci_csc=0 poll_interval=100"

Red Hat 7.0

The configuration file is:

/etc/sysconfig/pcmcia

The options are:

PCIC=i82365
PCIC_OPTS="irq_mode=1 pci_csc=0 poll_interval=100"

Modules Installed

Before a pcmcia card is inserted a module listing using "lsmod" should show
ds 6088 1
i82365 21340 1
pcmcia_core 48448 0   [ds i82365]

though the module sizes might be different in different versions

Card Manager

The daemon "cardmgr" should have been started at boot time, but check the output of "ps faxw". It is the program that checks the card status and subsequently loads and configures drivers as and when pccards are inserted or removed.

Interrupts

Check "/proc/interrupts" to ensure that your card is actually working in interrupt mode and not polling. Check that the interrupt count is incrementing:

0: 60331887 XT-PIC timer
1: 24 XT-PIC keyboard
2: 0 XT-PIC cascade
3: 95839 XT-PIC wvlan_cs
4: 113 XT-PIC serial
8: 1 XT-PIC rtc
9: 1779 XT-PIC eth0
10: 274972 XT-PIC WD8013
13: 0 XT-PIC fpu
14: 1413563 XT-PIC ide0
15: 526115 XT-PIC ide1
NMI: 0

P111 example

Various pcmcia cards have been tested running with our P111 card, and here are two example "dmesg" listings to show what you should see if all is working

Kernel - 1

[snip]
Linux PCMCIA Card Services 3.1.19
  kernel build: 2.2.16 #10 Fri Jul 21 14:27:25 BST 2000
  options:  [pci] [cardbus] [pnp]
PnP: PNP BIOS installation structure at 0xc00fc4c0
PnP: PNP BIOS version 1.0, entry at f0000:c4e8, dseg at f0000
Intel PCIC probe:
  TI 1211 rev 00 PCI-to-CardBus at slot 00:11, mem 0x68000000
    host opts [0]: [pci only] [pci irq 3] [lat 32/176] [bus 32/34]
    PCI card interrupts, PCI status changes
[snip]

Kernel - 2

[snip]
Linux PCMCIA Card Services 3.1.19
  kernel build: 2.2.13 #24 Fri Jul 21 15:37:31 BST 2000
  options:  [pci] [cardbus] [pnp]
PCI routing table version 1.0 at 0xfdbd0
PnP: PNP BIOS installation structure at 0xc00fbd80
PnP: PNP BIOS version 1.0, entry at f0000:bda8, dseg at f0000
Intel PCIC probe:
  TI 1410 rev 01 PCI-to-CardBus at slot 00:0c, mem 0xe9001000
    host opts [0]: [pci only] [pci irq 5] [lat 64/176] [bus 236/0]
    PCI card interrupts, PCI status changes

[snip]

P222 example

A 32bit single function Ethernet Cardbus-card and a 6bit dual function Ethernet and modem card have been tested simultaneously in this adaptor.
Here are some diagnostics:

PCI Bus

First verify that the P222 is visible to the kernel via the PCI bus.

The output of the linux command "lspci" should look something like:

00:00.0 Host bridge: VIA Technologies, Inc. VT82C691 [Apollo PRO] (rev 44)
00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3 AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C596 ISA [Apollo PRO] (rev 23)
00:07.1 IDE interface: VIA Technologies, Inc. VT82C586 IDE [Apollo] (rev 10)
00:07.3 Host bridge: VIA Technologies, Inc.: Unknown device 3050 (rev 30)
00:09.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 20)
00:0a.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 20)
00:0c.0 CardBus bridge: Texas Instruments PCI1420
00:0c.1 CardBus bridge: Texas Instruments PCI1420
01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage LT Pro AGP-133 (rev dc)

The important bit being two entries for "CardBus bridge", because it's got two slots

Kernel - example

Check that Card Services are operating by viewing the output of the "dmesg" linux command:

Linux version 2.2.16 (root@olech) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #5 Mon Sep 25 10:13:10 /etc/localtime 2000
Detected 601367 kHz processor.
Console: colour VGA+ 132x44
Calibrating delay loop... 1199.31 BogoMIPS
[snip]
Linux PCMCIA Card Services 3.1.20
  kernel build: 2.2.16 #5 Mon Sep 25 10:13:10 /etc/localtime 2000
  options:  [pci] [cardbus]
PCI routing table version 1.0 at 0xfdbd0
  00:0c.0 -> irq 5
   00:0c.1 -> irq 5
Intel PCIC probe:
   TI 1420 rev 00 PCI-to-CardBus at slot 00:0c, mem 0xea002000
    host opts [0]: [pci only] [pci irq 5] [lat 64/176] [bus 224/0]
    host opts [1]: [pci only] [pci irq 5] [lat 64/176] [bus 228/0]
    PCI card interrupts, polling interval = 1000 ms

cs: cb_alloc(bus 224): vendor 0x1011, device 0x0019
cs: IO port probe 0x0100-0x02ff: clean.
cs: IO port probe 0x0330-0x04ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0a00-0x0aff: clean.
cs: IO port probe 0x0c00-0x0cff: excluding 0xcf8-0xcff
cs: cb_config(bus 224)
  fn 0 bar 1: io 0x200-0x27f
  fn 0 bar 2: mem 0x600c0000-0x600c03ff
  fn 0 rom: mem 0x60080000-0x600bffff
  irq 5
cs: cb_enable(bus 224)
  bridge io map 0 (flags 0x21): 0x200-0x27f
  bridge mem map 0 (flags 0x1): 0x60080000-0x600c0fff
tulip_attach(device e0:00.0)
tulip.c:v0.91g-ppc 7/16/99 becker@cesdis.gsfc.nasa.gov (modified by danilo@cs.uni-magdeburg.de for XIRCOM CBE, fixed by Doug Ledford)
eth3: Digital DS21143 Tulip rev 65 at 0x200, 00:E0:98:76:1F:5F, IRQ 5.
eth3:  EEPROM default media type Autosense.
eth3:  Index #0 - Media MII (#11) described by a 21142 MII PHY (3) block.
eth3:  MII transceiver #0 config 3000 status 7809 advertising 01e1.
cs: memory probe 0xa0000000-0xa0ffffff: clean.
3c574_cs.c v1.08 9/24/98 Donald Becker/David Hinds, becker@cesdis.gsfc.nasa.gov.
eth4: 3Com 3c574 at io 0x340, irq 5, hw_addr 00:00:86:34:B1:BF.
  ASIC rev 10, 64K FIFO split 1:1 Rx:Tx, autoselect MII interface.
tty00 at 0x03f8 (irq = 5) is a 16550A
[snip]

The pcmcia cards here are 32bit single function Ethernet(eth3) Cardbus-card and a 6bit dual function Ethernet(eth4) and modem (tty00) card. The drivers managed to share successfully and the modem and 32but ethernet card were working at the same time.

P116 example

A 32bit single function Ethernet Cardbus-card and a 6bit dual function Ethernet and modem card  have been tested simultaneously in this adaptor.
Here are some diagnostics:

Kernel - example

Check that Card Services are operating by viewing the output of the "dmesg" linux command:

[snip]
Starting PCMCIA services: modulesLinux PCMCIA Card Services 3.1.20
  kernel build: 2.2.16 #5 Mon Sep 25 10:13:10 /etc/localtime 2000
  options:  [pci] [cardbus]
PCI routing table version 1.0 at 0xfdbd0
Intel PCIC probe:
  Cirrus PD6729 rev 00 PCI-to-PCMCIA at slot 00:0b, port 0xe000
    host opts [0]: [pci only] [pci irq 5] [1/5/0] [1/20/0]
    host opts [1]: [pci only] [pci irq 5] [1/5/0] [1/20/0]
    PCI card interrupts, polling interval = 1000 ms
cardmgr.
cardmgr[57]: starting, version is 3.1.20
[snip]
cardmgr[57]: watching 2 sockets
cs: IO port probe 0x0100-0x02ff: clean.
cs: IO port probe 0x0330-0x04ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0a00-0x0aff: clean.
cs: IO port probe 0x0c00-0x0cff: excluding 0xcf8-0xcff
[snip]

Diagnostics

The most useful diagnostic tools are:

Problems

Typically most problems come from not getting the configuration parameters right

Examples of Incorrect Configuration

Here the P111 has been configured for ISA interrupts, and the card might appear to work if the pcmcia driver has a fall back option of using polling. But by repeatedly looking at /proc/interrupts it will be seen that the interrupt count is not incrementing. The "dmesg" output will show that pci interrupts are not configured:

[snip]
Linux PCMCIA Card Services 3.0.14
   kernel build: 2.2.13 #3 Thu Jun 15 11:10:29 BST 2000
   options:  [pci] [cardbus]
Intel PCIC probe:
   Unknown [0x104c 0xac1e] PCI-to-CardBus at bus 0 slot 17, mem 0x68000000, 1 socket
     host opts [0]: [no pci irq] [lat 32/176] [bus 32/34]
     ISA irqs (default) = 3,4,5,7,11,12 polling interval = 1000 ms
[snip]

A customer example

One of our customers managed to get a P011 adapter card working with a 2.1.18 kernel and pcmcia 3.1.22. He reports that PCIC_OPTS="irq_mode=0" alone did not work, giving:

[snip]
Intel PCIC probe:
TI 1211 rev 00 PCI-to-CardBus at slot 00:11, mem 0x68000000
host opts [0]: [pci only] [pci irq 3] [lat 32/176] [bus 32/34]
*NO* card interrupts, polling interval = 1000ms
[snip]

However using pcmcia-cs-3.1.22/debug-tools/dump_pirq to identify the correct IRQ number (11 in his case), he found that PCIC_OPTS="irq_mode=0 pci_irq_list=11,11" worked!
I have not verified that, but maybe it's something to try when all else fails!

If you are using Wireless LAN equipment with Linux there is lots more information on  Jean Tourrilhes' page about the "Wireless LAN Howto".

Tony Olech
Elan Digital Systems Limited