Linux Step By Steps
ISAPNP-Programming-Interface

UP

ISOLATION
SERIAL NUMBER
RECORDS
DECODES
REGISTERS



 
 
I/O Addresses are not particularly scarce in an IBM pc. There are in fact 1024 of them using a 10bit bus. Logically, no two devices could use the same address to connect to the cpu. For this reason, fixed IO addresses have been assigned to many peripherals, largely for historic reasons.. Just as a printer port uses a  fixed  IO address like 0x378, the ISA PNP channel also uses 3 fixed addresses. These addresses are actually registers present on all ISA PNP cards in the system.
  • 0x279  The Address Register.
  • 0x2A9 The Write Data Register
  • 0x???? The Read Data Register.
This register set, these io addresses, have nothing to do with your soundblaster or your ne2000 card. They are the io addresses that these cards will respond to with their ISA pnp componentry. 

Irrespective of how many pnp cards are in a system, all respond to these addresses as if they were a single unit.

The Address Register

The write-only pnp address register shares it's space with the read only printer status port. 

All pnp components have fixed functionality. You set the address register to specify which function on the pnp card you wish to operate on. The addresses (functions) sent to the address register are:
 

WRITE ADDRESS WRITE DATA
00 Set Read Port  port*
01 SERIAL ISOLATION
02 CONFIG CONTROL
 
1 RESET
2 WAIT_FOR_KEY (normal state after poweron)
4 RESET_CSN
7 RESET_DRV (combination of above)
03 WAKEUP  >logical card number (0 = all reset cards)
04 RESOURCE DATA  <read
05 STATUS  <read
06 SET CARD NUMBER >logical card number
07 SET DEVICE NUMBER >logical device number 
30 ACTIVATE   ADDRESS
31 IO RANGECHECK

*The port address in function code 0 is a 6 bit value. Write data = port>>2. The resulting read address is always port | 0x03

The Write Data Register.

The write data register is used to provide addtional information to a 'function; Thus, to wakep logical card 1, C code would look as follows

    outp(0x279,0x03);    // set the address register to the wake function
    outp(0x2A9,1);         // select logical board 1
 

The READ Data Register.

Sending a write command to all boards with the same address (0x279,or 0x2A9) presents no problem. Each board simply latches the incoming data with no ill affect.  Reading data from the same address on all cards is impossible. All cards would respond, and all data would be corrupted on the common bus. There is no problem electronically, doing this, just the data will be garbaged. All cards initially have no specific read address. It is up to the controlling software to tell them which address they should use to send their data.  This can be done by;

  • Giving a separate read address for each logical card, OR
  • Provide a common address and specify which logical card should respond.
Normally, the latter is employed and a read address is selected by software and lies somewhere between IO address 0x203 and 0x3FF.   When told to do so, all cards will respond to every 8th address beginning with 0x203. As in 203, 20D, 213, 21D etc. Initialisation software assumes that other - non pnp cards will utilise some of these address regions and so keeps looking until only pnp cards respond in their unique manner. Once software determines that only pnp cards are responding to a specific read address it sets all of them to use that address and gives each card a unique logical card number.