/****************************************************************************
NAME
ip_cfg_init - Plug and Play Register initialization.
DESCRIPTION
This function initializes the PCnet-ISA II Plug and Play registers with a
predefined set of values.
In order to provide compatability with AMD device drivers, this function
writes the ASCII WW pattern in EEPROM word location 7.
INPUT
Global variable Iobase is assumed to contain the 16-bit I/O address that
will locate the target Plug and Play device in the I/O memory space.
CALLS
outport() - Outputs a word or byte to a hardware port. Function in the
(Borland) run-time library.
AROME - #define AROME Iobase+0xE
****************************************************************************/
void ip_cfg_init(void)
{
int temp;
ip_cfg_w(0x02, 0x05);
ip_cfg_w(0x03, 0x00);
ip_cfg_w(0x06, 0x01);
/* RESET command. */
/* WAKE[0] command. */
/* SET_CSN[1] command. */
ip_cfg_w(0x60, (BYTE)((Iobase & 0xFF00) >> 8)); /* I/O addr: 15:8 */
ip_cfg_w(0x61, (BYTE)(Iobase & 0x00FF));
/* I/O addr: 7:0 */
ip_cfg_w(0x70, 0x00);
/* IRQ level: 0 = no IRQ selection. */
ip_cfg_w(0x71, 0);
/* IRQ type: Edge, active low. */
ip_cfg_w(0x74, 0x00);
/* DMA 0: Channel 0. */
ip_cfg_w(0x43, 0xFE);
/* Mem Desc 0: bit0 = 0 = disable. */
ip_cfg_w(0x4B, 0xFE);
/* Mem Desc 1: bit0 = 0 = disable. */
ip_cfg_w(0xF0, 0x00);
/* Vendor (AMD) Defined Byte. */
ip_cfg_w(0x31, 0x00);
/* Disable I/O range check. */
ip_cfg_w(0x30, 0x01);
/* Activate Reg: bit0 = 1 = active. */
ip_cfg_w(0x02, 0x02);
/* Cfg Ctl: bit1 = 1 = WAIT_FOR_KEY */
/* Write ASCII WW to PCnet-ISA II internal address PROM. */
temp = ip_bcr_r(2);
/* Set APWEN bit... */
ip_bcr_w(2, (temp | 0x0100));
/* ...in ISACSR2. */
outport(AROME, 0x5757);
/* Stuff the "WW". */
temp = ip_bcr_r(2);
/* Clear APWEN bit... */
ip_bcr_w(2, (temp & 0xFEFF));
/* ...in ISACSR2. */
}
8
How to Perform Plug and Play Initiation Key with PCnet-ISA II