Subject: Re: Before and after the 1.1 release: pcmcia
To: None <rvb@IGW.TRUST.CS.CMU.EDU>
From: Stefan Grefen <grefen@convex.com>
List: port-i386
Date: 10/11/1995 06:19:44
In message <199510110245.WAA02149@pain.lcs.mit.edu>  rvb@IGW.TRUST.CS.CMU.EDU wrote:
> ------- Start of forwarded message -------
> 
> 
> A few comments about the pcmcia interface discussions:
> 

[...]

> 
> 	2. "The pcic-chip can have only 2 devices. 
> 	    And unless I goofed somewhere the limit is on the chip-driver and n
> ot
> 	    in the pcmciabus framework."
> 	   This statement is incorrect.  The Intel 82365 architecture
> 	   was setup to support 8 slots.  I believe that you are
> 	   correct, that an individual chip only supports 2 slots.
> 	   There is also some magic on how you address the device
> 	   registers for a slot.  The first 4 slots are accessed thru
> 	   ports 0x3e0 & 0x3e1.  The second 4 slots are accessed thru
> 	   ports 0x3e2 and 0x3e3.  (For the curious each slots has 0x40
> 	   devices registers; 4*0x40 = 256)  The bottom line is that
> 	   an IBM 701C (or 755) has two pcmcia slots (the first two
> 	   addressed at 0x3e0 & 0x3e1).  The IBM Dock II also has two
> 	   pcmcia slots (these are addressed as the first two slots at
> 	   0x3e0 & 0x3e1).  So I would say that slots 0, and 1 and 4
> 	   and 5 are available.

I said a pcic-chip can have only 2 devices, you you can add up do four chips 
to a 'virtual'  pcmciabus or create more than one pcmciabus as you like it.

You just have to configure all those chips. 
The 2'nd and 4'th one need a flag to tell them that they are the 2'nd one on 
the same io-address. Slots would be numbered sequentially for the existing chips
on a bus.

> 
> 
> 	3. ... The main reason for it's absence is, that you need to modify all
>  drivers
> 	   used with PCMCIA, to not crash or hang the system if the card is rem
> oved.
> 	   This is going to be pretty near impossible.  You have to
> 	   guard every port reference that is used anywhere in the
> 	   driver to accept the possibility that the card was pulled
> 	   out and the value is bogus.  You then have to get out of
> 	   whatever nesting of routines the code is in.

But you need this to avoid problems later on. If you tell your
innocent user he can hot-swap, and it crashes the machine he'll come
to you and blame you. 
Thats why I decided not to implement hot-plugging to avoid these problem.
You can still do it with a short notice to the system that the card is
going away.

> 
> 
> 	4. Last point.  If a user level program is necessary to
> 	   turn on pcmcia ethernet cards, (I got this impression from
> 	   previous comments.) please don't forget to put this program
> 	   on the install floppy.

This is only necessary for cards not configured or automagicly detected.
I put auto-detection in the kernel to be able to boot diskless or from
a pcmcia hard-drive.
I'm still hoping to  get one of the small hp 486 machines in my hands,
where the hard-drive is on the pcmcia-bus. You need autodetection in
the kernel to boot such a guy ...


Stefan

--
Stefan Grefen                          Convex Computer GmbH, Frankfurt, Germany
grefen@convex.com		       Phone: +49-69-665270
fortune: "You can't make a program without broken egos."