Home | History | Annotate | Line # | Download | only in ic
dc21040reg.h revision 1.1.1.5
      1 /*-
      2  * Copyright (c) 1994, 1995, 1996 Matt Thomas <matt (at) 3am-software.com>
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  * 1. Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  * 2. The name of the author may not be used to endorse or promote products
     11  *    derived from this software withough specific prior written permission
     12  *
     13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     18  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     19  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     20  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     23  *
     24  * Id: dc21040.h,v 1.21 1996/09/13 19:41:03 thomas Exp
     25  */
     26 
     27 #if !defined(_DC21040_H)
     28 #define _DC21040_H
     29 
     30 #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
     31 #define	TULIP_BITFIELD2(a, b)		      b, a
     32 #define	TULIP_BITFIELD3(a, b, c)	   c, b, a
     33 #define	TULIP_BITFIELD4(a, b, c, d)	d, c, b, a
     34 #else
     35 #define	TULIP_BITFIELD2(a, b)		a, b
     36 #define	TULIP_BITFIELD3(a, b, c)	a, b, c
     37 #define	TULIP_BITFIELD4(a, b, c, d)	a, b, c, d
     38 #endif
     39 
     40 typedef struct {
     41     u_int32_t d_status;
     42     u_int32_t TULIP_BITFIELD3(d_length1 : 11,
     43 			      d_length2 : 11,
     44 			      d_flag : 10);
     45     u_int32_t d_addr1;
     46     u_int32_t d_addr2;
     47 } tulip_desc_t;
     48 
     49 #define	TULIP_DSTS_OWNER	0x80000000	/* Owner (1 = 21040) */
     50 #define	TULIP_DSTS_ERRSUM	0x00008000	/* Error Summary */
     51 /*
     52  * Transmit Status
     53  */
     54 #define	TULIP_DSTS_TxBABBLE	0x00004000	/* Transmitter Babbled */
     55 #define	TULIP_DSTS_TxCARRLOSS	0x00000800	/* Carrier Loss */
     56 #define	TULIP_DSTS_TxNOCARR	0x00000400	/* No Carrier */
     57 #define	TULIP_DSTS_TxLATECOLL	0x00000200	/* Late Collision */
     58 #define	TULIP_DSTS_TxEXCCOLL	0x00000100	/* Excessive Collisions */
     59 #define	TULIP_DSTS_TxNOHRTBT	0x00000080	/* No Heartbeat */
     60 #define	TULIP_DSTS_TxCOLLMASK	0x00000078	/* Collision Count (mask) */
     61 #define	TULIP_DSTS_V_TxCOLLCNT	0x00000003	/* Collision Count (bit) */
     62 #define	TULIP_DSTS_TxLINKFAIL	0x00000004	/* Link Failure */
     63 #define	TULIP_DSTS_TxUNDERFLOW	0x00000002	/* Underflow Error */
     64 #define	TULIP_DSTS_TxDEFERRED	0x00000001	/* Initially Deferred */
     65 /*
     66  * Receive Status
     67  */
     68 #define	TULIP_DSTS_RxBADLENGTH	0x00004000	/* Length Error */
     69 #define	TULIP_DSTS_RxDATATYPE	0x00003000	/* Data Type */
     70 #define	TULIP_DSTS_RxRUNT	0x00000800	/* Runt Frame */
     71 #define	TULIP_DSTS_RxMULTICAST	0x00000400	/* Multicast Frame */
     72 #define	TULIP_DSTS_RxFIRSTDESC	0x00000200	/* First Descriptor */
     73 #define	TULIP_DSTS_RxLASTDESC	0x00000100	/* Last Descriptor */
     74 #define	TULIP_DSTS_RxTOOLONG	0x00000080	/* Frame Too Long */
     75 #define	TULIP_DSTS_RxCOLLSEEN	0x00000040	/* Collision Seen */
     76 #define	TULIP_DSTS_RxFRAMETYPE	0x00000020	/* Frame Type */
     77 #define	TULIP_DSTS_RxWATCHDOG	0x00000010	/* Receive Watchdog */
     78 #define	TULIP_DSTS_RxDRBBLBIT	0x00000004	/* Dribble Bit */
     79 #define	TULIP_DSTS_RxBADCRC	0x00000002	/* CRC Error */
     80 #define	TULIP_DSTS_RxOVERFLOW	0x00000001	/* Overflow */
     81 
     82 
     83 #define	TULIP_DFLAG_ENDRING	0x0008		/* End of Transmit Ring */
     84 #define	TULIP_DFLAG_CHAIN	0x0004		/* Chain using d_addr2 */
     85 
     86 #define	TULIP_DFLAG_TxWANTINTR	0x0200		/* Signal Interrupt on Completion */
     87 #define	TULIP_DFLAG_TxLASTSEG	0x0100		/* Last Segment */
     88 #define	TULIP_DFLAG_TxFIRSTSEG	0x0080		/* First Segment */
     89 #define	TULIP_DFLAG_TxINVRSFILT	0x0040		/* Inverse Filtering */
     90 #define	TULIP_DFLAG_TxSETUPPKT	0x0020		/* Setup Packet */
     91 #define	TULIP_DFLAG_TxHASCRC	0x0010		/* Don't Append the CRC */
     92 #define	TULIP_DFLAG_TxNOPADDING	0x0002		/* Don't AutoPad */
     93 #define	TULIP_DFLAG_TxHASHFILT	0x0001		/* Hash/Perfect Filtering */
     94 
     95 /*
     96  * The 21040 Registers (IO Space Addresses)
     97  */
     98 #define	TULIP_REG_BUSMODE	0x00	/* CSR0  -- Bus Mode */
     99 #define	TULIP_REG_TXPOLL	0x08	/* CSR1  -- Transmit Poll Demand */
    100 #define	TULIP_REG_RXPOLL	0x10	/* CSR2  -- Receive Poll Demand */
    101 #define	TULIP_REG_RXLIST	0x18	/* CSR3  -- Receive List Base Addr */
    102 #define	TULIP_REG_TXLIST	0x20	/* CSR4  -- Transmit List Base Addr */
    103 #define	TULIP_REG_STATUS	0x28	/* CSR5  -- Status */
    104 #define	TULIP_REG_CMD		0x30	/* CSR6  -- Command */
    105 #define	TULIP_REG_INTR		0x38	/* CSR7  -- Interrupt Control */
    106 #define	TULIP_REG_MISSES	0x40	/* CSR8  -- Missed Frame Counter */
    107 #define	TULIP_REG_ADDRROM	0x48	/* CSR9  -- ENET ROM Register */
    108 #define	TULIP_REG_RSRVD		0x50	/* CSR10 -- Reserved */
    109 #define	TULIP_REG_FULL_DUPLEX	0x58	/* CSR11 -- Full Duplex */
    110 #define	TULIP_REG_SIA_STATUS	0x60	/* CSR12 -- SIA Status */
    111 #define	TULIP_REG_SIA_CONN	0x68	/* CSR13 -- SIA Connectivity */
    112 #define	TULIP_REG_SIA_TXRX	0x70	/* CSR14 -- SIA Tx Rx */
    113 #define	TULIP_REG_SIA_GEN	0x78	/* CSR15 -- SIA General */
    114 
    115 /*
    116  * CSR5 -- Status Register
    117  * CSR7 -- Interrupt Control
    118  */
    119 #define	TULIP_STS_ERRORMASK	0x03800000L		/* ( R)  Error Bits (Valid when SYSERROR is set) */
    120 #define	TULIP_STS_ERR_PARITY	0x00000000L		/*        000 - Parity Error (Perform Reset) */
    121 #define	TULIP_STS_ERR_MASTER	0x00800000L		/*        001 - Master Abort */
    122 #define	TULIP_STS_ERR_TARGET	0x01000000L		/*        010 - Target Abort */
    123 #define	TULIP_STS_ERR_SHIFT	23
    124 #define	TULIP_STS_TXSTATEMASK	0x00700000L		/* ( R)  Transmission Process State */
    125 #define	TULIP_STS_TXS_RESET	0x00000000L		/*        000 - Rset or transmit jabber expired */
    126 #define	TULIP_STS_TXS_FETCH	0x00100000L		/*        001 - Fetching transmit descriptor */
    127 #define	TULIP_STS_TXS_WAITEND	0x00200000L		/*        010 - Wait for end of transmission */
    128 #define	TULIP_STS_TXS_READING	0x00300000L		/*        011 - Read buffer and enqueue data */
    129 #define	TULIP_STS_TXS_RSRVD	0x00400000L		/*        100 - Reserved */
    130 #define	TULIP_STS_TXS_SETUP	0x00500000L		/*        101 - Setup Packet */
    131 #define	TULIP_STS_TXS_SUSPEND	0x00600000L		/*        110 - Transmit FIFO underflow or an
    132 								  unavailable transmit descriptor */
    133 #define	TULIP_STS_TXS_CLOSE	0x00700000L		/*        111 - Close transmit descriptor */
    134 #define	TULIP_STS_RXSTATEMASK	0x000E0000L		/* ( R)  Receive Process State*/
    135 #define	TULIP_STS_RXS_STOPPED	0x00000000L		/*        000 - Stopped */
    136 #define	TULIP_STS_RXS_FETCH	0x00020000L		/*        001 - Running -- Fetch receive descriptor */
    137 #define	TULIP_STS_RXS_ENDCHECK	0x00040000L		/*        010 - Running -- Check for end of receive
    138 								  packet before prefetch of next descriptor */
    139 #define	TULIP_STS_RXS_WAIT	0x00060000L		/*        011 - Running -- Wait for receive packet */
    140 #define	TULIP_STS_RXS_SUSPEND	0x00080000L		/*        100 - Suspended -- As a result of
    141 								  unavailable receive buffers */
    142 #define	TULIP_STS_RXS_CLOSE	0x000A0000L		/*        101 - Running -- Close receive descriptor */
    143 #define	TULIP_STS_RXS_FLUSH	0x000C0000L		/*        110 - Running -- Flush the current frame
    144 								  from the receive FIFO as a result of
    145 								  an unavailable receive buffer */
    146 #define	TULIP_STS_RXS_DEQUEUE	0x000E0000L		/*        111 - Running -- Dequeue the receive frame
    147 								  from the receive FIFO into the receive
    148 								  buffer. */
    149 #define	TULIP_STS_NORMALINTR	0x00010000L		/* (RW)  Normal Interrupt */
    150 #define	TULIP_STS_ABNRMLINTR	0x00008000L		/* (RW)  Abnormal Interrupt */
    151 #define	TULIP_STS_SYSERROR	0x00002000L		/* (RW)  System Error */
    152 #define	TULIP_STS_LINKFAIL	0x00001000L		/* (RW)  Link Failure (21040) */
    153 #define	TULIP_STS_FULDPLXSHRT	0x00000800L		/* (RW)  Full Duplex Short Fram Rcvd (21040) */
    154 #define	TULIP_STS_GPTIMEOUT	0x00000800L		/* (RW)  General Purpose Timeout (21140) */
    155 #define	TULIP_STS_AUI		0x00000400L		/* (RW)  AUI/TP Switch (21040) */
    156 #define	TULIP_STS_RXTIMEOUT	0x00000200L		/* (RW)  Receive Watchbog Timeout */
    157 #define	TULIP_STS_RXSTOPPED	0x00000100L		/* (RW)  Receive Process Stopped */
    158 #define	TULIP_STS_RXNOBUF	0x00000080L		/* (RW)  Receive Buffer Unavailable */
    159 #define	TULIP_STS_RXINTR	0x00000040L		/* (RW)  Receive Interrupt */
    160 #define	TULIP_STS_TXUNDERFLOW	0x00000020L		/* (RW)  Transmit Underflow */
    161 #define	TULIP_STS_LINKPASS	0x00000010L		/* (RW)  LinkPass (21041) */
    162 #define	TULIP_STS_TXBABBLE	0x00000008L		/* (RW)  Transmit Jabber Timeout */
    163 #define	TULIP_STS_TXNOBUF	0x00000004L		/* (RW)  Transmit Buffer Unavailable */
    164 #define	TULIP_STS_TXSTOPPED	0x00000002L		/* (RW)  Transmit Process Stopped */
    165 #define	TULIP_STS_TXINTR	0x00000001L		/* (RW)  Transmit Interrupt */
    166 
    167 /*
    168  * CSR6 -- Command (Operation Mode) Register
    169  */
    170 #define	TULIP_CMD_MUSTBEONE	0x02000000L		/* (RW)  Must Be One (21140) */
    171 #define	TULIP_CMD_SCRAMBLER	0x01000000L		/* (RW)  Scrambler Mode (21140) */
    172 #define	TULIP_CMD_PCSFUNCTION	0x00800000L		/* (RW)  PCS Function (21140) */
    173 #define	TULIP_CMD_TXTHRSHLDCTL	0x00400000L		/* (RW)  Transmit Threshold Mode (21140) */
    174 #define	TULIP_CMD_STOREFWD	0x00200000L		/* (RW)  Store and Foward (21140) */
    175 #define	TULIP_CMD_NOHEARTBEAT	0x00080000L		/* (RW)  No Heartbeat (21140) */
    176 #define	TULIP_CMD_PORTSELECT	0x00040000L		/* (RW)  Post Select (100Mb) (21140) */
    177 #define	TULIP_CMD_ENHCAPTEFFCT	0x00040000L		/* (RW)  Enhanced Capture Effecty (21041) */
    178 #define	TULIP_CMD_CAPTREFFCT	0x00020000L		/* (RW)  Capture Effect (!802.3) */
    179 #define	TULIP_CMD_BACKPRESSURE	0x00010000L		/* (RW)  Back Pressure (!802.3) (21040) */
    180 #define	TULIP_CMD_THRESHOLDCTL	0x0000C000L		/* (RW)  Threshold Control */
    181 #define	TULIP_CMD_THRSHLD72	0x00000000L		/*       00 - 72 Bytes */
    182 #define	TULIP_CMD_THRSHLD96	0x00004000L		/*       01 - 96 Bytes */
    183 #define	TULIP_CMD_THRSHLD128	0x00008000L		/*       10 - 128 bytes */
    184 #define	TULIP_CMD_THRSHLD160	0x0000C000L		/*       11 - 160 Bytes */
    185 #define	TULIP_CMD_TXRUN 	0x00002000L		/* (RW)  Start/Stop Transmitter */
    186 #define	TULIP_CMD_FORCECOLL	0x00001000L		/* (RW)  Force Collisions */
    187 #define	TULIP_CMD_OPERMODE	0x00000C00L		/* (RW)  Operating Mode */
    188 #define	TULIP_CMD_FULLDUPLEX	0x00000200L		/* (RW)  Full Duplex Mode */
    189 #define	TULIP_CMD_FLAKYOSCDIS	0x00000100L		/* (RW)  Flakey Oscillator Disable */
    190 #define	TULIP_CMD_ALLMULTI	0x00000080L		/* (RW)  Pass All Multicasts */
    191 #define	TULIP_CMD_PROMISCUOUS	0x00000040L		/* (RW)  Promiscuous Mode */
    192 #define	TULIP_CMD_BACKOFFCTR	0x00000020L		/* (RW)  Start/Stop Backoff Counter (!802.3) */
    193 #define	TULIP_CMD_INVFILTER	0x00000010L		/* (R )  Inverse Filtering */
    194 #define	TULIP_CMD_PASSBADPKT	0x00000008L		/* (RW)  Pass Bad Frames  */
    195 #define	TULIP_CMD_HASHONLYFLTR	0x00000004L		/* (R )  Hash Only Filtering */
    196 #define	TULIP_CMD_RXRUN		0x00000002L		/* (RW)  Start/Stop Receive Filtering */
    197 #define	TULIP_CMD_HASHPRFCTFLTR	0x00000001L		/* (R )  Hash/Perfect Receive Filtering */
    198 
    199 #define TULIP_SIASTS_OTHERRXACTIVITY	0x00000200L
    200 #define TULIP_SIASTS_RXACTIVITY		0x00000100L
    201 #define	TULIP_SIASTS_LINKFAIL		0x00000004L
    202 #define	TULIP_SIACONN_RESET		0x00000000L
    203 
    204 /*
    205  * 21040 SIA definitions
    206  */
    207 #define	TULIP_21040_PROBE_10BASET_TIMEOUT	2500
    208 #define	TULIP_21040_PROBE_AUIBNC_TIMEOUT	300
    209 #define	TULIP_21040_PROBE_EXTSIA_TIMEOUT	300
    210 
    211 #define	TULIP_21040_SIACONN_10BASET	0x00008F01L
    212 #define	TULIP_21040_SIATXRX_10BASET	0x0000FFFFL
    213 #define	TULIP_21040_SIAGEN_10BASET	0x00000000L
    214 
    215 #define	TULIP_21040_SIACONN_10BASET_FD	0x00008F01L
    216 #define	TULIP_21040_SIATXRX_10BASET_FD	0x0000FFFDL
    217 #define	TULIP_21040_SIAGEN_10BASET_FD	0x00000000L
    218 
    219 #define	TULIP_21040_SIACONN_AUIBNC	0x00008F09L
    220 #define	TULIP_21040_SIATXRX_AUIBNC	0x00000705L
    221 #define	TULIP_21040_SIAGEN_AUIBNC	0x00000006L
    222 
    223 #define	TULIP_21040_SIACONN_EXTSIA	0x00003041L
    224 #define	TULIP_21040_SIATXRX_EXTSIA	0x00000000L
    225 #define	TULIP_21040_SIAGEN_EXTSIA	0x00000006L
    226 
    227 /*
    228  * 21041 SIA definitions
    229  */
    230 
    231 #define	TULIP_21041_PROBE_10BASET_TIMEOUT	2500
    232 #define	TULIP_21041_PROBE_AUIBNC_TIMEOUT	300
    233 
    234 #define	TULIP_21041_SIACONN_10BASET		0x0000EF01L
    235 #define	TULIP_21041_SIATXRX_10BASET		0x0000FF3FL
    236 #define	TULIP_21041_SIAGEN_10BASET		0x00000000L
    237 
    238 #define	TULIP_21041P2_SIACONN_10BASET		0x0000EF01L
    239 #define	TULIP_21041P2_SIATXRX_10BASET		0x0000FFFFL
    240 #define	TULIP_21041P2_SIAGEN_10BASET		0x00000000L
    241 
    242 #define	TULIP_21041_SIACONN_10BASET_FD		0x0000EF01L
    243 #define	TULIP_21041_SIATXRX_10BASET_FD		0x0000FF3DL
    244 #define	TULIP_21041_SIAGEN_10BASET_FD		0x00000000L
    245 
    246 #define	TULIP_21041P2_SIACONN_10BASET_FD	0x0000EF01L
    247 #define	TULIP_21041P2_SIATXRX_10BASET_FD	0x0000FFFFL
    248 #define	TULIP_21041P2_SIAGEN_10BASET_FD		0x00000000L
    249 
    250 #define	TULIP_21041_SIACONN_AUI			0x0000EF09L
    251 #define	TULIP_21041_SIATXRX_AUI			0x0000F73DL
    252 #define	TULIP_21041_SIAGEN_AUI			0x0000000EL
    253 
    254 #define	TULIP_21041P2_SIACONN_AUI		0x0000EF09L
    255 #define	TULIP_21041P2_SIATXRX_AUI		0x0000F7FDL
    256 #define	TULIP_21041P2_SIAGEN_AUI		0x0000000EL
    257 
    258 #define	TULIP_21041_SIACONN_BNC			0x0000EF09L
    259 #define	TULIP_21041_SIATXRX_BNC			0x0000F73DL
    260 #define	TULIP_21041_SIAGEN_BNC			0x00000006L
    261 
    262 #define	TULIP_21041P2_SIACONN_BNC		0x0000EF09L
    263 #define	TULIP_21041P2_SIATXRX_BNC		0x0000F7FDL
    264 #define	TULIP_21041P2_SIAGEN_BNC		0x00000006L
    265 
    266 /*
    267  * 21142 SIA definitions
    268  */
    269 
    270 #define	TULIP_21142_PROBE_10BASET_TIMEOUT	2500
    271 #define	TULIP_21142_PROBE_AUIBNC_TIMEOUT	300
    272 
    273 #define	TULIP_21142_SIACONN_10BASET		0x00000001L
    274 #define	TULIP_21142_SIATXRX_10BASET		0x0000F3FFL
    275 #define	TULIP_21142_SIAGEN_10BASET		0x00000000L
    276 
    277 #define	TULIP_21142_SIACONN_10BASET_FD		0x00000001L
    278 #define	TULIP_21142_SIATXRX_10BASET_FD		0x0000F3FDL
    279 #define	TULIP_21142_SIAGEN_10BASET_FD		0x00000000L
    280 
    281 #define	TULIP_21142_SIACONN_AUI			0x00000009L
    282 #define	TULIP_21142_SIATXRX_AUI			0x0000F3FDL
    283 #define	TULIP_21142_SIAGEN_AUI			0x0000000EL
    284 
    285 #define	TULIP_21142_SIACONN_BNC			0x00000009L
    286 #define	TULIP_21142_SIATXRX_BNC			0x0000F3FDL
    287 #define	TULIP_21142_SIAGEN_BNC			0x00000006L
    288 
    289 
    290 
    291 
    292 #define	TULIP_WATCHDOG_TXDISABLE	0x00000001L
    293 #define	TULIP_WATCHDOG_RXDISABLE	0x00000010L
    294 
    295 #define	TULIP_BUSMODE_SWRESET		0x00000001L
    296 #define	TULIP_BUSMODE_DESCSKIPLEN_MASK	0x0000007CL
    297 #define	TULIP_BUSMODE_BIGENDIAN		0x00000080L
    298 #define	TULIP_BUSMODE_BURSTLEN_MASK	0x00003F00L
    299 #define	TULIP_BUSMODE_BURSTLEN_DEFAULT	0x00000000L
    300 #define	TULIP_BUSMODE_BURSTLEN_1LW	0x00000100L
    301 #define	TULIP_BUSMODE_BURSTLEN_2LW	0x00000200L
    302 #define	TULIP_BUSMODE_BURSTLEN_4LW	0x00000400L
    303 #define	TULIP_BUSMODE_BURSTLEN_8LW	0x00000800L
    304 #define	TULIP_BUSMODE_BURSTLEN_16LW	0x00001000L
    305 #define	TULIP_BUSMODE_BURSTLEN_32LW	0x00002000L
    306 #define	TULIP_BUSMODE_CACHE_NOALIGN	0x00000000L
    307 #define	TULIP_BUSMODE_CACHE_ALIGN8	0x00004000L
    308 #define	TULIP_BUSMODE_CACHE_ALIGN16	0x00008000L
    309 #define	TULIP_BUSMODE_CACHE_ALIGN32	0x0000C000L
    310 #define	TULIP_BUSMODE_TXPOLL_NEVER	0x00000000L
    311 #define	TULIP_BUSMODE_TXPOLL_200000ns	0x00020000L
    312 #define	TULIP_BUSMODE_TXPOLL_800000ns	0x00040000L
    313 #define	TULIP_BUSMODE_TXPOLL_1600000ns	0x00060000L
    314 #define	TULIP_BUSMODE_TXPOLL_12800ns	0x00080000L	/* 21041 only */
    315 #define	TULIP_BUSMODE_TXPOLL_25600ns	0x000A0000L	/* 21041 only */
    316 #define	TULIP_BUSMODE_TXPOLL_51200ns	0x000C0000L	/* 21041 only */
    317 #define	TULIP_BUSMODE_TXPOLL_102400ns	0x000E0000L	/* 21041 only */
    318 #define	TULIP_BUSMODE_DESC_BIGENDIAN	0x00100000L	/* 21041 only */
    319 #define	TULIP_BUSMODE_READMULTIPLE	0x00200000L	/* */
    320 
    321 #define	TULIP_REG_CFDA			0x40
    322 #define	TULIP_CFDA_SLEEP		0x80000000L
    323 #define	TULIP_CFDA_SNOOZE		0x40000000L
    324 
    325 #define	TULIP_GP_PINSET			0x00000100L
    326 /*
    327  * These are the defintitions used for the DEC 21140
    328  * evaluation board.
    329  */
    330 #define	TULIP_GP_EB_PINS		0x0000011F	/* General Purpose Pin directions */
    331 #define	TULIP_GP_EB_OK10		0x00000080	/* 10 Mb/sec Signal Detect gep<7> */
    332 #define	TULIP_GP_EB_OK100		0x00000040	/* 100 Mb/sec Signal Detect gep<6> */
    333 #define	TULIP_GP_EB_INIT		0x0000000B	/* No loopback --- point-to-point */
    334 
    335 /*
    336  * These are the defintitions used for the SMC9332 (21140) board.
    337  */
    338 #define	TULIP_GP_SMC_9332_PINS		0x0000013F	/* General Purpose Pin directions */
    339 #define	TULIP_GP_SMC_9332_OK10		0x00000080	/* 10 Mb/sec Signal Detect gep<7> */
    340 #define	TULIP_GP_SMC_9332_OK100		0x00000040	/* 100 Mb/sec Signal Detect gep<6> */
    341 #define	TULIP_GP_SMC_9332_INIT		0x00000009	/* No loopback --- point-to-point */
    342 
    343 #define	TULIP_OUI_SMC_0			0x00
    344 #define	TULIP_OUI_SMC_1			0x00
    345 #define	TULIP_OUI_SMC_2			0xC0
    346 
    347 /*
    348  * There are the definitions used for the DEC DE500
    349  * 10/100 family of boards
    350  */
    351 #define	TULIP_GP_DE500_PINS		0x0000011FL
    352 #define	TULIP_GP_DE500_LINK_PASS	0x00000080L
    353 #define	TULIP_GP_DE500_SYM_LINK		0x00000040L
    354 #define	TULIP_GP_DE500_SIGNAL_DETECT	0x00000020L
    355 #define	TULIP_GP_DE500_PHY_RESET	0x00000010L
    356 #define	TULIP_GP_DE500_HALFDUPLEX	0x00000008L
    357 #define	TULIP_GP_DE500_PHY_LOOPBACK	0x00000004L
    358 #define	TULIP_GP_DE500_FORCE_LED	0x00000002L
    359 #define	TULIP_GP_DE500_FORCE_100	0x00000001L
    360 
    361 /*
    362  * These are the defintitions used for the Cogent EM100
    363  * 21140 board.
    364  */
    365 #define	TULIP_GP_EM100_PINS		0x0000013F	/* General Purpose Pin directions */
    366 #define	TULIP_GP_EM100_INIT		0x00000009	/* No loopback --- point-to-point */
    367 #define	TULIP_OUI_COGENT_0		0x00
    368 #define	TULIP_OUI_COGENT_1		0x00
    369 #define	TULIP_OUI_COGENT_2		0x92
    370 #define	TULIP_COGENT_EM100_ID		0x12
    371 
    372 
    373 /*
    374  * These are the defintitions used for the Znyx ZX342
    375  * 10/100 board
    376  */
    377 #define	TULIP_OUI_ZNYX_0		0x00
    378 #define	TULIP_OUI_ZNYX_1		0xC0
    379 #define	TULIP_OUI_ZNYX_2		0x95
    380 
    381 #define	TULIP_ZNYX_ID_ZX312		0x0602
    382 #define	TULIP_ZNYX_ID_ZX312T		0x0622
    383 #define	TULIP_ZNYX_ID_ZX314_INTA	0x0701
    384 #define	TULIP_ZNYX_ID_ZX314		0x0711
    385 #define	TULIP_ZNYX_ID_ZX315_INTA	0x0801
    386 #define	TULIP_ZNYX_ID_ZX315		0x0811
    387 #define	TULIP_ZNYX_ID_ZX342		0x0901
    388 #define	TULIP_ZNYX_ID_ZX342B		0x0921
    389 #define	TULIP_ZNYX_ID_ZX342_X3		0x0902
    390 #define	TULIP_ZNYX_ID_ZX342_X4		0x0903
    391 #define	TULIP_ZNYX_ID_ZX344		0x0A01
    392 #define	TULIP_ZNYX_ID_ZX351		0x0B01
    393 #define	TULIP_ZNYX_ID_ZX345		0x0C01
    394 #define	TULIP_ZNYX_ID_ZX311		0x0D01
    395 #define	TULIP_ZNYX_ID_ZX346		0x0E01
    396 
    397 #define	TULIP_GP_ZX34X_PINS		0x0000011F	/* General Purpose Pin directions */
    398 #define	TULIP_GP_ZX344_PINS		0x0000010B	/* General Purpose Pin directions */
    399 #define	TULIP_GP_ZX345_PINS		0x00000103	/* General Purpose Pin directions */
    400 #define	TULIP_GP_ZX346_PINS		0x00000143	/* General Purpose Pin directions */
    401 #define	TULIP_GP_ZX34X_LNKFAIL		0x00000080	/* 10Mb/s Link Failure */
    402 #define	TULIP_GP_ZX34X_SYMDET		0x00000040	/* 100Mb/s Symbol Detect */
    403 #define	TULIP_GP_ZX345_PHYACT		0x00000040	/* PHY Activity */
    404 #define	TULIP_GP_ZX34X_SIGDET		0x00000020	/* 100Mb/s Signal Detect */
    405 #define	TULIP_GP_ZX346_AUTONEG_ENABLED	0x00000020	/* 802.3u autoneg enabled */
    406 #define	TULIP_GP_ZX342_COLENA		0x00000008	/* 10t Ext LB */
    407 #define	TULIP_GP_ZX344_ROTINT		0x00000008	/* PPB IRQ rotation */
    408 #define	TULIP_GP_ZX345_SPEED10		0x00000008	/* 10Mb speed detect */
    409 #define	TULIP_GP_ZX346_SPEED100		0x00000008	/* 100Mb speed detect */
    410 #define	TULIP_GP_ZX34X_NCOLENA		0x00000004	/* 10t Int LB */
    411 #define	TULIP_GP_ZX34X_RXMATCH		0x00000004	/* RX Match */
    412 #define	TULIP_GP_ZX346_FULLDUPLEX	0x00000004	/* Full Duplex Sensed */
    413 #define	TULIP_GP_ZX34X_LB102		0x00000002	/* 100tx twister LB */
    414 #define	TULIP_GP_ZX34X_NLB101		0x00000001	/* PDT/PDR LB */
    415 #define	TULIP_GP_ZX34X_INIT		0x00000009
    416 
    417 /*
    418  * Compex's OUI.  We need to twiddle a bit on their 21041 card.
    419  */
    420 #define	TULIP_OUI_COMPEX_0		0x00
    421 #define	TULIP_OUI_COMPEX_1		0x80
    422 #define	TULIP_OUI_COMPEX_2		0x48
    423 #define	TULIP_21041_COMPEX_XREGDATA	1
    424 /*
    425  * SROM definitions for the 21140 and 21041.
    426  */
    427 #define	SROMXREG	0x0400
    428 #define SROMSEL         0x0800
    429 #define SROMRD          0x4000
    430 #define SROMWR          0x2000
    431 #define SROMDIN         0x0008
    432 #define SROMDOUT        0x0004
    433 #define SROMDOUTON      0x0004
    434 #define SROMDOUTOFF     0x0004
    435 #define SROMCLKON       0x0002
    436 #define SROMCLKOFF      0x0002
    437 #define SROMCSON        0x0001
    438 #define SROMCSOFF       0x0001
    439 #define SROMCS          0x0001
    440 
    441 #define	SROMCMD_MODE	4
    442 #define	SROMCMD_WR	5
    443 #define	SROMCMD_RD	6
    444 
    445 #define	SROM_BITWIDTH	6
    446 
    447 /*
    448  * MII Definitions for the 21041 and 21140/21140A/21142
    449  */
    450 #define	MII_PREAMBLE		(~0)
    451 #define	MII_TEST		0xAAAAAAAA
    452 #define	MII_RDCMD		0xF6		/* 1111.0110 */
    453 #define	MII_WRCMD		0xF5		/* 1111.0101 */
    454 #define	MII_DIN			0x00080000
    455 #define	MII_RD			0x00040000
    456 #define	MII_WR			0x00000000
    457 #define	MII_DOUT		0x00020000
    458 #define	MII_CLK			0x00010000
    459 #define	MII_CLKON		MII_CLK
    460 #define	MII_CLKOFF		MII_CLK
    461 
    462 #define	PHYREG_CONTROL			0
    463 #define	PHYREG_STATUS			1
    464 #define	PHYREG_IDLOW			2
    465 #define	PHYREG_IDHIGH			3
    466 #define	PHYREG_AUTONEG_ADVERTISEMENT	4
    467 #define	PHYREG_AUTONEG_ABILITIES	5
    468 #define	PHYREG_AUTONEG_EXPANSION	6
    469 #define	PHYREG_AUTONEG_NEXTPAGE		7
    470 
    471 #define	PHYSTS_100BASET4	0x8000
    472 #define	PHYSTS_100BASETX_FD	0x4000
    473 #define	PHYSTS_100BASETX	0x2000
    474 #define	PHYSTS_10BASET_FD	0x1000
    475 #define	PHYSTS_10BASET		0x0800
    476 #define	PHYSTS_AUTONEG_DONE	0x0020
    477 #define	PHYSTS_REMOTE_FAULT	0x0010
    478 #define	PHYSTS_CAN_AUTONEG	0x0008
    479 #define	PHYSTS_LINK_UP		0x0004
    480 #define	PHYSTS_JABBER_DETECT	0x0002
    481 #define	PHYSTS_EXTENDED_REGS	0x0001
    482 
    483 #define	PHYCTL_RESET		0x8000
    484 #define	PHYCTL_SELECT_100MB	0x2000
    485 #define	PHYCTL_AUTONEG_ENABLE	0x1000
    486 #define	PHYCTL_ISOLATE		0x0400
    487 #define	PHYCTL_AUTONEG_RESTART	0x0200
    488 #define	PHYCTL_FULL_DUPLEX	0x0100
    489 
    490 
    491 #define MII_RD          0x00040000
    492 #define MII_WR          0x00000000
    493 #define MII_DIN         0x00080000
    494 #define MII_DOUT        0x00020000
    495 #define MII_DOUTON      MII_DOUT
    496 #define MII_DOUTOFF     MII_DOUT
    497 #define MII_CLK		0x00010000
    498 #define MII_CLKON       MII_CLK
    499 #define MII_CLKOFF      MII_CLK
    500 
    501 /*
    502  * Definitions for the DE425.
    503  */
    504 #define	DE425_CFID		0x08	/* Configuration Id */
    505 #define	DE425_CFCS		0x0C	/* Configuration Command-Status */
    506 #define	DE425_CFRV		0x18	/* Configuration Revision */
    507 #define	DE425_CFLT		0x1C	/* Configuration Latency Timer */
    508 #define	DE425_CBIO		0x28	/* Configuration Base IO Address */
    509 #define	DE425_CFDA		0x2C	/* Configuration Driver Area */
    510 #define	DE425_ENETROM_OFFSET	0xC90	/* Offset in I/O space for ENETROM */
    511 #define	DE425_CFG0		0xC88	/* IRQ register */
    512 #define	DE425_EISAID		0x10a34250 /* EISA device id */
    513 #define	DE425_EISA_IOSIZE	0x100
    514 
    515 #define	DEC_VENDORID		0x1011
    516 #define	CHIPID_21040		0x0002
    517 #define	CHIPID_21140		0x0009
    518 #define	CHIPID_21041		0x0014
    519 #define	CHIPID_21142		0x0019
    520 #define	PCI_VENDORID(x)		((x) & 0xFFFF)
    521 #define	PCI_CHIPID(x)		(((x) >> 16) & 0xFFFF)
    522 
    523 /*
    524  * Generic SROM Format
    525  *
    526  *
    527  */
    528 
    529 typedef struct {
    530     u_int8_t sh_idbuf[18];
    531     u_int8_t sh_version;
    532     u_int8_t sh_adapter_count;
    533     u_int8_t sh_ieee802_address[6];
    534 } tulip_srom_header_t;
    535 
    536 typedef struct {
    537     u_int8_t sai_device;
    538     u_int8_t sai_leaf_offset_lowbyte;
    539     u_int8_t sai_leaf_offset_highbyte;
    540 } tulip_srom_adapter_info_t;
    541 
    542 typedef enum {
    543     TULIP_SROM_CONNTYPE_10BASET			=0x0000,
    544     TULIP_SROM_CONNTYPE_BNC			=0x0001,
    545     TULIP_SROM_CONNTYPE_AUI			=0x0002,
    546     TULIP_SROM_CONNTYPE_100BASETX		=0x0003,
    547     TULIP_SROM_CONNTYPE_100BASET4		=0x0006,
    548     TULIP_SROM_CONNTYPE_100BASEFX		=0x0007,
    549     TULIP_SROM_CONNTYPE_MII_10BASET		=0x0009,
    550     TULIP_SROM_CONNTYPE_MII_100BASETX		=0x000D,
    551     TULIP_SROM_CONNTYPE_MII_100BASET4		=0x000F,
    552     TULIP_SROM_CONNTYPE_MII_100BASEFX		=0x0010,
    553     TULIP_SROM_CONNTYPE_10BASET_NWAY		=0x0100,
    554     TULIP_SROM_CONNTYPE_10BASET_FD		=0x0204,
    555     TULIP_SROM_CONNTYPE_MII_10BASET_FD		=0x020A,
    556     TULIP_SROM_CONNTYPE_100BASETX_FD		=0x020E,
    557     TULIP_SROM_CONNTYPE_MII_100BASETX_FD	=0x0211,
    558     TULIP_SROM_CONNTYPE_10BASET_NOLINKPASS	=0x0400,
    559     TULIP_SROM_CONNTYPE_AUTOSENSE		=0x0800,
    560     TULIP_SROM_CONNTYPE_AUTOSENSE_POWERUP	=0x8800,
    561     TULIP_SROM_CONNTYPE_AUTOSENSE_NWAY		=0x9000,
    562     TULIP_SROM_CONNTYPE_NOT_USED		=0xFFFF
    563 } tulip_srom_connection_t;
    564 
    565 typedef enum {
    566     TULIP_SROM_MEDIA_10BASET			=0x0000,
    567     TULIP_SROM_MEDIA_BNC			=0x0001,
    568     TULIP_SROM_MEDIA_AUI			=0x0002,
    569     TULIP_SROM_MEDIA_100BASETX			=0x0003,
    570     TULIP_SROM_MEDIA_10BASET_FD			=0x0004,
    571     TULIP_SROM_MEDIA_100BASETX_FD		=0x0005,
    572     TULIP_SROM_MEDIA_100BASET4			=0x0006,
    573     TULIP_SROM_MEDIA_100BASEFX			=0x0007,
    574     TULIP_SROM_MEDIA_100BASEFX_FD		=0x0008
    575 } tulip_srom_media_t;
    576 
    577 #define	TULIP_SROM_21041_EXTENDED	0x40
    578 
    579 #define	TULIP_SROM_2114X_NOINDICATOR	0x8000
    580 #define	TULIP_SROM_2114X_DEFAULT	0x4000
    581 #define	TULIP_SROM_2114X_POLARITY	0x0080
    582 #define	TULIP_SROM_2114X_CMDBITS(n)	(((n) & 0x0071) << 18)
    583 #define	TULIP_SROM_2114X_BITPOS(b)	(1 << (((b) & 0x0E) >> 1))
    584 
    585 
    586 
    587 #endif /* !defined(_DC21040_H) */
    588