PCMCIA servers for various chipsets (QNX)
Pcmcia.generic [options]... Pcmcia.365sl [options]... Pcmcia.cirrus [options]...
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 |
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.
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:
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. |
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:
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+1Mwould 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
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:
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.
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:
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.
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.
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).
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:
iooption can be one of:
memoption can be one of:
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
The Pcmcia.* servers terminate only upon encountering errors during initialization or upon getting a signal (i.e. being killed).
PcmciaBeep, PcmciaLaunch, pcmciatrap, pin