Linear Flash and PCMCIA
andrew at ebertech.ca
Wed Dec 19 08:28:01 EST 2012
For anyone who cares here's the solution. It turns out that for some
reason this memory card interacts badly with TI-based chipsets wherein
it sets the VS1 signal implying a low-voltage key X.XV card (which is
physically impossible). The Ricoh chipset for some reason doesn't set
it and whether that's a bug with the card or a bug with the chipset I
have no idea. Either way, the TI chipsets have a feature to prevent a
Vcc that is "sensed" (via the VS1, VS2 signals) to be invalid.
Fortunately, you can turn off this feature by flipping a bit in the
system control register. Once you do that, you have to recompile the
yenta_socket module to ignore the XV bit in the present state register
so that pcmcia_core says
is this a 3.3V card? no!
is it NOT an XV card? yes!
apply vcc 5v.
The reason this didn't work before was I hadn't flipped the VCCPROT bit
so when I tried to apply 5V I'd get a BADVCC request back. The
pcmcia_core driver doesn't report this, unfortunately, because it just
tries to do a reset and times out.
I've put a forked version on github
Just a warning: if you do this and you put in a card that can't do 5V
and it somehow reports the wrong voltage you will most likely fry your
On Mon Dec 17 14:28:12 2012, Andrew Eberbach wrote:
> I've been trying to get various versions of linux > 2.6 to read a linear flash pcmcia card. I've
> been having mixed success and I'm trying to figure out if what I'm doing is just bridge-dependent
> or if there's a setting I can use to make this work.
> So far I've tried various chipsets (Ricoh, TI, Enne, O2) on various machines and what I've found
> is the following:
> I've gotten a Ricoh-based chipset to read the card in question, get its CIS, fire up pcmciamtd and
> let me read and write to it.
> On ALL other chipsets what I keep getting is
> unsupported voltage key
> I dug through the code, did some experimenting and research and as far as I can tell this message
> happens because
> 1. The card gets inserted
> 2. The code in cs.c tries to figure out what voltage the card wants
> 3. yenta_socket looks at the status register and sees that the card wants X.XV which means voltage
> < 3.3V which will be defined later on somewhere.
> 4. This isn't supported so it craps out and since we're not even accepting the card it never gets
> to loading pcmciamtd.
> The only thing is, I know for a *fact* that this card wants Vcc 5 and Vpp 12 to write. On the
> Ricoh card it works without a hitch. On all the other cards the status register keeps reporting
> X.XV. I even looked at the output of the status register reads on Ricoh vs TI and on Ricoh it
> comes back as having the 5V bit set, on TI it's not.
> I've tried turning off pnpbios, pci=assign-busses, turning off acpi, every combination of
> pcmcia_core, pcmcia_rsrc, pcmcia and yenta_socket parameters I could think of (increasing the
> settle time, setup time, etc. etc.). I've dropped back to 2.6.30-something. And it's always the
> same. Excluding IRQs from /etc/pcmcia/config.opts.
> The only other thing I've found in digging through mailing lists is that it could be a resource
> conflict of some sort. I guess that would make some sense except that if I cat the yenta_registers
> in /sys/... for that bridge when I take the card out it changes so to me that would say that the
> resources are there and it's not just reading a default.
> Here's the really maddening part. If I put in another PCMCIA card, say, a wireless ethernet card
> into the non-ricoh systems those cards get recognized without an issue. But just with this linear
> flash card (and I've tried several just to be sure it wasn't a one-off bad card), it keeps
> thinking it's a low-voltage card.
> I've also tried recompiling the module to just have it force the voltage to be 5.0 and ignore the
> status register as well as force the status register to be a certain value to no avail. I've gone
> through a bunch of datasheets for the chipsets as well and everything seems to make sense... I
> mean the code works on Ricoh and it's all using the yenta interface and registers.
> I realize that I haven't provided exact chipsets and linux versions and everything for the 5
> machines, but I figured I'd at least put this out there first and see if anyone is even available
> to help. If so, let me know what details you'd need (dmesg, lspci, dynamic printks from
> drivers/pcmcia/* and so on).
More information about the linux-pcmcia