for connected embedded systems
![]() |
![]() |
![]() |
Pcmcia.*
PCMCIA servers for various chipsets (QNX)
Syntax:
Pcmcia.generic [options]... Pcmcia.365sl [options]... Pcmcia.cirrus [options]...
Options:
- -3
- Use this option if you have a PD6729 on a PCI bus that's >= 33MHz.
- -A index
- For AMD SC400 in Standard Mode, specify the value to be
written to the PC Card Extended Features Register to
redirect memory windows from Socket A to Socket B. Here are
the possible values and corresponding allocation of windows
for Socket A and B:
Value Socket A Socket B 0 0 1 2 3 4 0 1 0 2 3 4 0 1 2 0 1 3 4 0 2 3 0 3 4 0 1 2 4 0 1 2 4 0 3 5 0 2 4 0 1 3 6 0 1 4 0 2 3 7 0 4 0-3 8 0 1 2 3 0 4 9 0 2 3 0 1 4 a 0 1 3 0 2 4 b 0 3 0 1 2 4 c 0 1 2 0 3 4 d 0 2 0 1 3 4 e 0 1 0 2 3 4 f 0 0 1 2 3 4 - -a address
- The I/O port address of the PCMCIA adapter chip, in hex. The default is 0x3E0 for Pcmcia.generic, Pcmcia.cirrus, and Pcmcia.365sl.
- -b
- The system was booted from a PCMCIA memory card. This tells the server to treat enabled memory windows as boot partitions (implies -R).
- -c "config"
- Specify configuration directly on command line. The configuration format is identical to the configuration file format, with the exception that lines are separated by semicolons (;).
- -d
- Tell the server to use DMA (if the card supports it).
- -F filename
- Read resources and card descriptions from this file. If this option isn't specified, the server will read from /etc/config/pcmcia.cards and then either /etc/config/pcmcia.node or /etc/config/pcmcia.cfg.
- -i irq
- Use this IRQ for adapter status changes. If this flag isn't supplied, the server will allocate an IRQ from the resource pool. If you specify -i0, then status changes are detected by polling -- no IRQ is used. This option is useful in cases where few IRQs are available for PCMCIA cards (e.g. on several laptop models).
- -I bitmap
- Set the routable card interrupt IRQ mask. This tells the server which host interrupts card interrupts may be programmed to be. The mask is in the same format as the -S switch.
- -Mn:bitmap
- Specify a map of available memory windows per socket in the default or previously specified adapter. The n variable is the socket number. The hexadecimal bitmap has one bit set for each available window in the adapter. Note that only the specified windows will be reset.
- -m physaddr
- Use this physical memory window (of 4K) for server usage. The address is supplied as a hex physical address. If this flag is not supplied the server will allocate a window from the resource pool.
- -n sockets
- Set the number of sockets that the server thinks are available. If no -n option is supplied the server will attempt to determine the number of sockets based upon the PCMCIA adapter chip type.
- -P
- Partially reset socket memory windows, preserving the ones that are already enabled at startup (for AMD SC400).
- -r delay
- Delay this many milliseconds before accessing a card after reset. The default value of 500 should be sufficient for most cards, but may need to be increased for cards that take a long time to reset.
- -R socket
- Forces the server to NOT reset the adapter chip upon startup. This is useful if the BIOS sets up special modes within the adapter chip, and you don't wish the defaults to be restored. Note that you can specify a particular socket (1, 2, ...).
- -S bitmap
- Set the routable status IRQ mask. This tells the server which
interrupts the status change output of the adapter chip can be
programmed to be. Each server has a default that corresponds to the
particular chip, but certain implementations may not support all of
the possible values. The value supplied is a hex number with each
bit representing a single IRQ, if the bit is set then that IRQ can
be used. This table shows the bit/IRQ correspondence:
Bit IRQ 15 15 14 14 ... ... 1 1 0 unused Note that this mask tells the server only which interrupts the hardware is connected to; the interrupt must still be present in the resource pool in order for the server to use it. For example, if your adapter supported only IRQs 12, 10, 7, and 5 you would use: -S 14A0.
- -s size
- Specify the physical memory window size (default is 4096).
- -w
- Don't insert wait states on 16-bit memory accesses.
Description:
The Pcmcia.* servers support PCMCIA I/O cards through a number of different host adapter chips, including the Intel 82365 and compatibles, and the Cirrus CL-PD67xx series. The servers also support Ricoh CardBus chips.
The servers manage host resources (memory windows, ports and IRQs) and will assign resources to PCMCIA cards as they are inserted. Utilities are provided to start and stop processes (as cards are inserted and removed), display server status, display card CIS (Card Information Structure) data, and automatically generate configuration entries for new cards.
The executables involved in PCMCIA support are:
- Pcmcia.generic server
- (PCMCIA server supporting both Intel 82365SL and Cirrus CL-PD67xx)
- Pcmcia.365sl server
- (Link to Pcmcia.generic. PCMCIA server for Intel 82365SL)
- Pcmcia.cirrus server
- (Link to Pcmcia.generic. PCMCIA server for Cirrus CL-PD67xx)
- PcmciaLaunch manager
- (Start processes as cards are inserted)
- pcmciatrap utility
- (Detect PCMCIA adapter and start appropriate server)
- pin utility
- (PCMCIA information -- CIS, cards, etc.)
- PcmciaBeep utility
- (Beep the PC speaker when PCMCIA cards are changed)
Selecting a Server
Servers are provided for several different PCMCIA adapter chips. The various servers and the chips they support are listed below:
| Use: | For: |
|---|---|
| Pcmcia.generic | Intel 82365SL and 82365SL DF; Vadem VG-365, VG-465, VG-468 and VG-469; Cirrus CL-PD6710, CL-PD6720, CL-PD6722 and CL-PD6929; Texas Instruments PCI1131 family; AMD SC400. |
| Pcmcia.365sl | Intel 82365SL and 82365SL DF and Vadem VG-365, VG-465, VG-468 and VG-469. |
| Pcmcia.cirrus | Cirrus CL-PD6710, CL-PD6720 and CL-PD6722. |
You can use the pcmciatrap utility to automatically start the correct server.
![]() |
The pcmciatrap utility determines the chip type by probing I/O ports that are likely to be associated with a PCMCIA adapter. If you have other adapters at these addresses the utility may confuse the hardware and/or any associated drivers. Some NE2000 Ethernet adapters can crash the machine if they are accessed improperly. |
Resources and Server Configuration Files
The server manages separate resource pools for memory windows, IRQs and ports. When a card is installed the server will attempt to satisfy the card's memory window, IRQ and port requirements by allocating resources from the various pools. If insufficient resources are available the server will be unable to configure the card. There is often a need to express to the server that a particular resource be used only as a last resort or if specifically requested, therefore the server allows you to tag specific resources as reserved. For instance, some PCMCIA modem cards can only be configured to use ports 0x3f8, 0x2f8, 0x3e8 and 0x2e8. If your machine already has two serial ports installed it is likely that only 0x3e8 and 0x2e8 are available for use by the modem. If your machine had several PCMCIA sockets available you would not want a card that can be configured to use any available port to use the few ports available for modem cards. In this case you would tag ports 0x3e8 and 0x2e8 as reserved; they would then be used only if a particular card (such as the modem) specifically requested them or if no other ports were available.
The PCMCIA server needs to know what resources (memory windows, IRQs and ports) are available for use. Upon startup the server will attempt to read /etc/config/pcmcia.node, where node is replaced by the node number of the machine the server is running on. If this file does not exist, then the resources will be read from /etc/config/pcmcia.cfg. A default configuration file is supplied that has resource entries that may or may not match your particular environment. You should copy the default file to the node specific file and then modify it to suit your machine.
The resource section of the configuration file must start with the line:
[resources]
and must be followed by any number of the following lines:
rports = reserved_port_list
ports = normal_port_list
rirqs = reserved_irq_list
irqs = normal_irq_list
rmemory = reserved_memory_window_list
memory = normal_memory_window_list
Each resource list consists of a number of ranges separated by commas. Ranges can appear in several different forms:
- start-end
- specifies a range of values including the start and end values.
- start+length
- specifies a range starting at start and continuing for length units.
- start
- specifies a range of length 1 starting at start.
The start, end and length components can be specified in decimal (start with 1 to 9), hexadecimal (start with 0x), or octal (start with 0). The numbers can be followed by k or M to indicate kilobytes or megabytes. Memory ranges are specified as true physical addresses (NOT paragraphs or pages) and must be aligned on 4K boundaries.
Comments may appear anywhere and must be preceded by the ; or # character, the rest of the line is ignored. Blank lines and spaces are ignored.
![]() |
Note that most adapters can utilize any memory window within the 16M
ISA-bus address space. For example on a machine with 8M of RAM the
line:
memory = 9M+1M
would describe a 1M memory window starting at the 9M boundary. For
machines with 16M of RAM installed the memory windows will most likely
be restricted to be within the 640K to 1M area. |
All adapters are restricted as to which IRQs they can use. For example, the Intel-based adapters can use only IRQs 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3. In this case there would be no restriction on entering IRQ 6 into the resource pool (if it is available), but the server would never use it.
The server itself requires a 4K memory window and a single IRQ, your resource section must include at least these two resources.
Here is an example configuration file:
[resources]
memory = 0xd4000-0xd5fff
ports = 0x320-0x33f
rports = 0x2e8+8, 0x3e8+8, 0x170+8, 0x376+2
irqs = 5,7,11,12
Card Configuration Database -- /etc/config/pcmcia.cards
The QNX PCMCIA server will automatically configure PCMCIA I/O cards as they are inserted. It will also manage computer resources such as memory windows, ports and IRQs. Resources will be allocated as cards are inserted and then freed as cards are removed. Drivers that are PCMCIA-aware can be informed of card insertions and removals based upon the type of card. These drivers can then configure themselves to use the correct ports and IRQs. The PcmciaLaunch manager will automatically start drivers and pass them command-line arguments describing the ports and IRQs used by a card, thus permitting a non-PCMCIA-aware driver to be automatically started when a card is inserted and stopped when removed.
Each I/O card must contain a CIS (Card Information Structure) that describes the resources needed and the functions provided by the card. Unfortunately, many PCMCIA card manufacturers have provided incomplete or erroneous CIS data, and for these cards it is not possible to perform fully automatic configuration based solely upon the information provided by the card. For this reason the server maintains an internal database of configuration descriptions based upon the card name and manufacturer. When a card is inserted the server will retrieve the card name and manufacturer and then search the database for a matching entry. This entry contains information that the server can use to find an appropriate configuration for the card. These configuration entries are stored in the file /etc/config/pcmcia.cards, new entries may be added to match any cards that will be used. The pin utility can create these entries automatically, but due to deviations from or misinterpretations of the PCMCIA standard by some manufacturers, they must often be manually edited.
The pin utility is invaluable for creating configuration entries for new I/O cards. The pin config command will attempt to create configuration entries for any cards currently installed. There are several situations that may require manual editing of the configuration file:
- The card does not have a valid function identification within the CIS. This will cause the generated configuration to have an invalid card type in the configuration lines. The type must be changed to reflect the actual card type.
- Some cards may require voltages other than 5V on the Vpp line. A vpp line will have to be added to the configuration entry.
- The configuration will have a register = 0,0x40,0x40 line to set the card to level interrupts. Some cards do not operate correctly with level interrupts and this line must be removed or commented out.
- The order of the configurations is incorrect. The server will attempt each configuration in the order it appears in the file, a different order may be desired in order to control the resources used by a card.
It is also useful to use the pin cis command to check the generated configuration entry against the card CIS data.
Once an appropriate configuration has been found the server will set a configuration and allocate resources for the card. The server may also inform processes that a card has been inserted.
Card Configuration Database Entries
![]() |
In the following description all numeric constants follow the same syntax: decimal numbers start with 1 to 9, hexadecimal number start with 0x and octal numbers start with 0. |
All card entries must all start with the line:
[device]
and must be followed by one or more of the following:
- manufacturer = "match-string"
product = "match-string"
info1 = "match-string"
info2 = "match-string" - match-string is a string enclosed in double quotes.
The special characters ? and * match any character and any string of
characters, respectively. Any other character will match only
itself. For example:
- abcde?gh*jk
These lines are used to specify the card that this configuration applies to. Upon card insertion the server will compare these strings with information retrieved from the CIS. At least one of these lines must be included.
- regbase = addr
- addr is a numeric constant.
This line tells the server where in the card register space the configuration registers reside. If this line is not included the server will default to 0x100.
- vcc = voltage
vpp = voltage - voltage is a numeric constant, and may have one digit after the decimal place. These lines tell the server what voltage the card expects on the Vcc and Vpp pins. The default value is 5.0 volts. Some modems require that Vpp be set to 12.0 volts for proper operation, most other cards will operate correctly with the default values. CAUTION: it is possible that some cards could be damaged by an improper setting of the vpp parameter.
- register = register, value[, mask]
- register is a card configuration register number. Register 0 is
the configuration option register, register 1 is the configuration
and status register, register 2 is the pin replacement register, and
register 3 is the socket and copy register.
value is a numeric constant and specifies the value to be written to the register.
mask is an optional numeric constant. If mask is not supplied value will be written directly to the register. If mask is specified then only bits that have a corresponding bit set in the mask will be altered by value. For instance if the register initially contains 0x35, value is 0x02, and mask is 0x12 the new register value will be 0x27.
A common use for this command is to set bit 6 of the configuration option register to place the card into level interrupt mode:
register = 0, 0x40, 0x40For more information on the definitions of the various registers, refer to the document PCMCIA PC Card Standard from the PCMCIA (Personal Computer Memory Card International Association). - config = index, type, resource[, resource]...
- index is a numeric constant that indicates the configuration index
value to be written to the card configuration register.
type is the generic card type that this configuration represents.
The high order byte is the generic type and the low order byte is
the specific subtype. The following values are defined:
Type Definition 0x0201 Serial/modem devices with 8250/16450 UARTS 0x0301 PC parallel ports 0x0401 ATA hard disk 0x0501 VGA adapter 0x0601 NE2000 compatible network card 0x0602 NCR Wavelan card 0x8001 Adaptec T340 SCSI adapter (NCR53C400) 0x8101 New Media .WAVjammer
Configuration resources are used to specify what resources a configuration requires and can be specified in the form:
- irq irq[|irq]...
- irq is a numeric constant that indicates a single IRQ level. Multiple IRQs can be specified by separating them with | characters. If this card will work with any IRQ, the string "Any" can be used. You can have only one IRQ resource per configuration line.
- io range [(iooption [,iooption]...)]
- range is a port range. It can take one of several
different forms:
- start-end
- start+length
- Any+length
iooption can be one of:
- width=8
- width=16
- offset=offset
- mem range [(memoption [,memoption]...)]
- range is a memory range, and is specified similarly to
port ranges. All memory ranges must be true physical addresses that
are aligned to 4K boundaries.
memoption can be one of:
- offset=offset
- offset is a numeric constant that specifies the base card address to which the memory window will map.
- attribute
- The default is to map common memory, but if it is desired that attribute memory be mapped, use the attribute option.
When a card with matching identification strings is inserted the server will try each configuration line until one succeeds.
Here is a sample entry for the Socket Communications EA+ Adapter (an NE2000 compatible Ethernet card):
[device] manufacturer = "Socket Communications Inc" product = "Socket EA PCMCIA LAN Adapter Revision D" regbase = 0x10000 config = 0x03, 0x0601, irq any, io 0x2a0-0x2bf (width=16) config = 0x05, 0x0601, irq any, io 0x2c0-0x2df (width=16) config = 0x07, 0x0601, irq any, io 0x2e0-0x2ff (width=16) config = 0x09, 0x0601, irq any, io 0x300-0x31f (width=16) config = 0x0b, 0x0601, irq any, io 0x320-0x33f (width=16) config = 0x0d, 0x0601, irq any, io 0x340-0x35f (width=16) config = 0x0f, 0x0601, irq any, io 0x360-0x37f (width=16) config = 0x01, 0x0601, irq any, io any+32 (width=16) register = 0, 0x40, 0x40 ; level mode interrupts
Files:
- /etc/config/pcmcia.cards
- Card descriptions and configurations
- /etc/config/pcmcia.cfg
/etc/config/pcmcia.node - Default resources
Exit status:
The Pcmcia.* servers terminate only upon encountering errors during initialization or upon getting a signal (i.e. being killed).
- 0
- The server has shut down successfully.
- >0
- An error occurred during initialization.
See also:
PcmciaBeep, PcmciaLaunch, pcmciatrap, pin
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Next]](../next.gif)

