PCMCIA fun

Richard Zidlicky rz at linux-m68k.org
Fri Mar 19 19:11:34 GMT 2004


On Fri, Mar 19, 2004 at 10:06:59AM +0100, Kars de Jong wrote:

> No, the 32-bit PCMCIA interface is called CardBus and Gayle doesn't
> support it.

ok, everything else would have stunned me :)

> After talking to some people at work, it seems that the Intel CPUs (or
> bus interfaces) just do 2 atomic 16-bit transfers when a 32-bit transfer
> is requested on a 16-bit bus.

Older x86 machines had 16 bit busees and they handled 32 bit
transfers to memory.. not sure whether it was the CPU or some
memory/bus controller actually.

I am cautios to conclude from this that the same works on ISA.
Are you aware of any ISA driver that would use readl()?
rsrc_mgr.c is not a good example because the comment above
explicitly says it doesn't care to read every word and it
would obviously work with both possible readl() behaviours.

> Gayle probably does this too. It also doesn't have a split view of the
> memory space for 8 or 16 bit accesses, it's one contiguous area (hence
> the fact that the Gayle versions of isa_mt{wbl} don't do anything).

that seems reasonable.

> I suppose this is why memcpy_{to,from}io() exist, so this stuff can be
> handled there. I suppose on Q40 and GG2 these need to be modified to do
> the correct kind of memory accesses. The same goes for {read,write}l().
> 
> I have no idea how to handle this when a program does a mmap() from
> user-space (XFree86?), since that expects to be able to just consider
> the mapped area as memory. I suppose you'd have to let the processor
> take a bus error and then do the transfer manually on the Q40 and GG2. I
> wouldn't want to use a VGA card on such a beast :-P.

that would require quite some work on XFree86.
 
> After reading what David Hinds had to say on the subject I guess I have
> to conclude that the Gayle PCMCIA bus is not an ISA bus after all. It's
> just a 16 bit bus which supports Intel-style I/O and memory cycles.
> Hence the need for in{bw}()/out{bw}() support. Using the isa_*
> definitions is actually wrong for PCMCIA drivers.

in{bw}()/out{bw}() is ok for both ISA and PCMCIA.

> That does leave the fact that we need to solve ioremap() of ISA memory
> on m68k.

which of the drivers actually do call ioremap()? What args?

> I thing the best way to do it is to make it behave like on
> other architectures: if an ioremap() is done on an address < 16MB,
> assume it's ISA.

iirc you can't address >1MB on ISA so that would be the limit.

> This does pose a nice problem on the Amiga which has
> non-ISA resources in this range. On the other hand, that range is
> always-mapped, so ioremap() and the drivers using those resources could
> be made to detect this (call ioremap() with the always-mapped virtual
> address instead of the physical address in drivers/video/amifb.c and
> others).

not sure about this.

Richard



More information about the linux-pcmcia mailing list