Home | History | Annotate | Line # | Download | only in isa
if_ecreg.h revision 1.1
      1  1.1  thorpej /*	$NetBSD: if_ecreg.h,v 1.1 1997/11/02 00:44:26 thorpej Exp $	*/
      2  1.1  thorpej 
      3  1.1  thorpej /*
      4  1.1  thorpej  * 3Com Etherlink II (3c503) register definitions.
      5  1.1  thorpej  *
      6  1.1  thorpej  * Copyright (C) 1993, David Greenman.  This software may be used, modified,
      7  1.1  thorpej  * copied, distributed, and sold, in both source and binary form provided that
      8  1.1  thorpej  * the above copyright and these terms are retained.  Under no circumstances is
      9  1.1  thorpej  * the author responsible for the proper functioning of this software, nor does
     10  1.1  thorpej  * the author assume any responsibility for damages incurred with its use.
     11  1.1  thorpej  */
     12  1.1  thorpej 
     13  1.1  thorpej #ifndef _DEV_ISA_IF_ECREG_H_
     14  1.1  thorpej #define	_DEV_ISA_IF_ECREG_H_
     15  1.1  thorpej 
     16  1.1  thorpej #define ELINK2_NIC_OFFSET	0
     17  1.1  thorpej #define ELINK2_ASIC_OFFSET	0x400	/* offset to nic i/o regs */
     18  1.1  thorpej 
     19  1.1  thorpej /*
     20  1.1  thorpej  * XXX - The I/O address range is fragmented in the 3c503; this is the
     21  1.1  thorpej  *	number of regs at iobase.
     22  1.1  thorpej  */
     23  1.1  thorpej #define ELINK2_NIC_PORTS	16
     24  1.1  thorpej #define	ELINK2_ASIC_PORTS	16
     25  1.1  thorpej 
     26  1.1  thorpej /* tx memory starts in second bank on 8bit cards */
     27  1.1  thorpej #define ELINK2_TX_PAGE_OFFSET_8BIT	0x20
     28  1.1  thorpej 
     29  1.1  thorpej /* tx memory starts in first bank on 16bit cards */
     30  1.1  thorpej #define ELINK2_TX_PAGE_OFFSET_16BIT	0x0
     31  1.1  thorpej 
     32  1.1  thorpej /* ...and rx memory starts in second bank */
     33  1.1  thorpej #define ELINK2_RX_PAGE_OFFSET_16BIT	0x20
     34  1.1  thorpej 
     35  1.1  thorpej 
     36  1.1  thorpej /*
     37  1.1  thorpej  * Page Start Register.  Must match PSTART in NIC.
     38  1.1  thorpej  */
     39  1.1  thorpej #define ELINK2_PSTR		0
     40  1.1  thorpej 
     41  1.1  thorpej /*
     42  1.1  thorpej  * Page Stop Register.  Must match PSTOP in NIC.
     43  1.1  thorpej  */
     44  1.1  thorpej #define ELINK2_PSPR		1
     45  1.1  thorpej 
     46  1.1  thorpej /*
     47  1.1  thorpej  * DrQ Timer Register.  Determines number of bytes to be transfered during a
     48  1.1  thorpej  * DMA burst.
     49  1.1  thorpej  */
     50  1.1  thorpej #define ELINK2_DQTR		2
     51  1.1  thorpej 
     52  1.1  thorpej /*
     53  1.1  thorpej  * Base Configuration Register.  Read-only register which contains the
     54  1.1  thorpej  * board-configured I/O base address of the adapter.  Bit encoded.
     55  1.1  thorpej  */
     56  1.1  thorpej #define ELINK2_BCFR		3
     57  1.1  thorpej 
     58  1.1  thorpej /*
     59  1.1  thorpej  * EPROM Configuration Register.  Read-only register which contains the
     60  1.1  thorpej  * board-configured memory base address.  Bit encoded.
     61  1.1  thorpej  */
     62  1.1  thorpej #define ELINK2_PCFR		4
     63  1.1  thorpej 
     64  1.1  thorpej /*
     65  1.1  thorpej  * GA Configuration Register.  Gate-Array Configuration Register.
     66  1.1  thorpej  *
     67  1.1  thorpej  * mbs2  mbs1  mbs0	start address
     68  1.1  thorpej  *  0     0     0	0x0000
     69  1.1  thorpej  *  0     0     1	0x2000
     70  1.1  thorpej  *  0     1     0	0x4000
     71  1.1  thorpej  *  0     1     1	0x6000
     72  1.1  thorpej  *
     73  1.1  thorpej  * Note that with adapters with only 8K, the setting for 0x2000 must always be
     74  1.1  thorpej  * used.
     75  1.1  thorpej  */
     76  1.1  thorpej #define ELINK2_GACFR		5
     77  1.1  thorpej 
     78  1.1  thorpej #define ELINK2_GACFR_MBS0	0x01
     79  1.1  thorpej #define ELINK2_GACFR_MBS1	0x02
     80  1.1  thorpej #define ELINK2_GACFR_MBS2	0x04
     81  1.1  thorpej 
     82  1.1  thorpej #define ELINK2_GACFR_RSEL	0x08	/* enable shared memory */
     83  1.1  thorpej #define ELINK2_GACFR_TEST	0x10	/* for GA testing */
     84  1.1  thorpej #define ELINK2_GACFR_OWS	0x20	/* select 0WS access to GA */
     85  1.1  thorpej #define ELINK2_GACFR_TCM	0x40	/* Mask DMA interrupts */
     86  1.1  thorpej #define ELINK2_GACFR_NIM	0x80	/* Mask NIC interrupts */
     87  1.1  thorpej 
     88  1.1  thorpej /*
     89  1.1  thorpej  * Control Register.  Miscellaneous control functions.
     90  1.1  thorpej  */
     91  1.1  thorpej #define ELINK2_CR		6
     92  1.1  thorpej 
     93  1.1  thorpej #define ELINK2_CR_RST		0x01	/* Reset GA and NIC */
     94  1.1  thorpej #define ELINK2_CR_XSEL		0x02	/* Transceiver select.  BNC=1(def) AUI=0 */
     95  1.1  thorpej #define ELINK2_CR_EALO		0x04	/* window EA PROM 0-15 to I/O base */
     96  1.1  thorpej #define ELINK2_CR_EAHI		0x08	/* window EA PROM 16-31 to I/O base */
     97  1.1  thorpej #define ELINK2_CR_SHARE		0x10	/* select interrupt sharing option */
     98  1.1  thorpej #define ELINK2_CR_DBSEL		0x20	/* Double buffer select */
     99  1.1  thorpej #define ELINK2_CR_DDIR		0x40	/* DMA direction select */
    100  1.1  thorpej #define ELINK2_CR_START		0x80	/* Start DMA controller */
    101  1.1  thorpej 
    102  1.1  thorpej /*
    103  1.1  thorpej  * Status Register.  Miscellaneous status information.
    104  1.1  thorpej  */
    105  1.1  thorpej #define ELINK2_STREG		7
    106  1.1  thorpej 
    107  1.1  thorpej #define ELINK2_STREG_REV	0x07	/* GA revision */
    108  1.1  thorpej #define ELINK2_STREG_DIP	0x08	/* DMA in progress */
    109  1.1  thorpej #define ELINK2_STREG_DTC	0x10	/* DMA terminal count */
    110  1.1  thorpej #define ELINK2_STREG_OFLW	0x20	/* Overflow */
    111  1.1  thorpej #define ELINK2_STREG_UFLW	0x40	/* Underflow */
    112  1.1  thorpej #define ELINK2_STREG_DPRDY	0x80	/* Data port ready */
    113  1.1  thorpej 
    114  1.1  thorpej /*
    115  1.1  thorpej  * Interrupt/DMA Configuration Register
    116  1.1  thorpej  */
    117  1.1  thorpej #define ELINK2_IDCFR		8
    118  1.1  thorpej 
    119  1.1  thorpej #define ELINK2_IDCFR_DRQ	0x07	/* DMA request */
    120  1.1  thorpej #define ELINK2_IDCFR_UNUSED	0x08	/* not used */
    121  1.1  thorpej #if 0
    122  1.1  thorpej #define ELINK2_IDCFR_IRQ	0xF0	/* Interrupt request */
    123  1.1  thorpej #else
    124  1.1  thorpej #define ELINK2_IDCFR_IRQ2	0x10	/* Interrupt request 2 select */
    125  1.1  thorpej #define ELINK2_IDCFR_IRQ3	0x20	/* Interrupt request 3 select */
    126  1.1  thorpej #define ELINK2_IDCFR_IRQ4	0x40	/* Interrupt request 4 select */
    127  1.1  thorpej #define ELINK2_IDCFR_IRQ5	0x80	/* Interrupt request 5 select */
    128  1.1  thorpej #endif
    129  1.1  thorpej 
    130  1.1  thorpej /*
    131  1.1  thorpej  * DMA Address Register MSB
    132  1.1  thorpej  */
    133  1.1  thorpej #define ELINK2_DAMSB		9
    134  1.1  thorpej 
    135  1.1  thorpej /*
    136  1.1  thorpej  * DMA Address Register LSB
    137  1.1  thorpej  */
    138  1.1  thorpej #define ELINK2_DALSB		0x0a
    139  1.1  thorpej 
    140  1.1  thorpej /*
    141  1.1  thorpej  * Vector Pointer Register 2
    142  1.1  thorpej  */
    143  1.1  thorpej #define ELINK2_VPTR2		0x0b
    144  1.1  thorpej 
    145  1.1  thorpej /*
    146  1.1  thorpej  * Vector Pointer Register 1
    147  1.1  thorpej  */
    148  1.1  thorpej #define ELINK2_VPTR1		0x0c
    149  1.1  thorpej 
    150  1.1  thorpej /*
    151  1.1  thorpej  * Vector Pointer Register 0
    152  1.1  thorpej  */
    153  1.1  thorpej #define ELINK2_VPTR0		0x0d
    154  1.1  thorpej 
    155  1.1  thorpej /*
    156  1.1  thorpej  * Register File Access MSB
    157  1.1  thorpej  */
    158  1.1  thorpej #define ELINK2_RFMSB		0x0e
    159  1.1  thorpej 
    160  1.1  thorpej /*
    161  1.1  thorpej  * Register File Access LSB
    162  1.1  thorpej  */
    163  1.1  thorpej #define ELINK2_RFLSB		0x0f
    164  1.1  thorpej 
    165  1.1  thorpej #endif /* _DEV_ISA_IF_ECREG_H_ */
    166