Compact Flash Card in PCMCIA Adapter

Peter Stuge stuge-linux-pcmcia at cdy.org
Tue Aug 7 10:55:17 EDT 2007


On Tue, Aug 07, 2007 at 03:46:04PM +0200, Felix Brack wrote:
> I'm using a PCMCIA adapter to which I can plug CF cards. I believe
> the adapter itself consist of nothing more then 'some wires'.
> 
> Everything was working quite fine with some 2.6 kernel (I do not
> remember the exact version) and card manager. Plugging in the
> adapter (including CF card of course) loaded the memory_cs driver
> and I was able to access the card.

Really? memory_cs? How did you access the card? What kind of CF card
is it?


> Now, with kernel 2.6.20 things don't work anymore. After some
> research I found that now 'pcmciautils' is responsible for managing
> the PCMCIA adapters (16 and 32 bit?). I believe that the driver the
> kernel should load when I plug in my card is 'pcmciamtd'.

It depends on the card.

If it's a "normal" CF memory card they are usually used in an IDE
mode where they behave like a hard drive, using the driver ide_cs
(old ATA/ATAPI/MFM/RLL drivers) or pata_pcmcia. (new libata SATA/PATA
drivers)

Which to choose is mostly a matter of which other ATA drivers you are
using in the kernel. ide_cs is tried and proven while the PATA
drivers using libata are still marked experimental. (But I've used
them without problems for some time.) Both drivers should support the
same cards.


> I found the source file 'pcmciamtd.c' in the kernel source tree but
> I do not know how to enable it.

There's one sure way to enable any kernel driver and a second
option available for most drivers.

1. Compile the driver built-in to the kernel (*) in menuconfig
2. Compile the driver as a module (M) in menuconfig

Built-in drivers are loaded automatically when the kernel is loaded
and activated/bound to devices sometimes automatically, sometimes
with a little help from userspace. (udev, pcmciautils, etc)

Modules have to be loaded into the kernel after it has been started,
either manually with the modprobe command or by distribution-specific
startup scripts usually found in /etc/init.d. Modules are
activated/bound just like built-in drivers.


> I think there should be some file called 'pcmciamtd.ko' after
> kernel compilation, but there isn't. Is it possible that this
> driver always gets linked to the kernel, i.e. there is no module
> for 'pcmciamtd'?

This depends on your particular configuration. pcmciamtd may not be
built at all, or built into the kernel, or built as a module.


> I use 'make menuconfig' to configure the kernel, but as I said, I
> can't find the switch to turn 'pcmciamtd' on. Does anybody know how
> to do this;

Make sure you have enabled PCMCIA and then look in the MTD driver
section, but..


> maybe this is a very stupid configuration error on my part?

..depending on the CF card pcmciamtd isn't the best driver.


//Peter



More information about the linux-pcmcia mailing list