Home | History | Annotate | Line # | Download | only in ic
i82595reg.h revision 1.1
      1 /*	$NetBSD: i82595reg.h,v 1.1 1996/05/06 21:36:51 is Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1996, Ignatios Souvatzis.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by Ignatios Souvatzis
     18  *	for the NetBSD project.
     19  * 4. The name of the author may not be used to endorse or promote products
     20  *    derived from this software without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     26  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     27  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  * SUCH DAMAGE.
     33  */
     34 
     35 /*
     36  * Intel 82595 Ethernet chip register, bit, and structure definitions.
     37  *
     38  * Written by is with reference to Intel's i82595FX data sheet, with some
     39  * clarification coming from looking at the Clarkson Packet Driver code for this
     40  * chip written by Russ Nelson and others;
     41  *
     42  * and
     43  *
     44  * configuration EEPROM layout. Written with reference to Intels
     45  * public "LAN595 Hardware and Software Specifications" document.
     46  */
     47 
     48 /* registers */
     49 
     50 /* bank0 */
     51 
     52 #define COMMAND_REG 0	/* available in any bank */
     53 
     54 #define		MC_SETUP_CMD	0x03
     55 #define		XMT_CMD		0x04
     56 #define		TDR_CMD		0x05
     57 #define		DUMP_CMD	0x06
     58 #define		DIAG_CMD	0x07
     59 #define		RCV_ENABLE_CMD	0x08
     60 #define		RCV_DISABLE_CMD	0x0a
     61 #define		RCV_STOP_CMD	0x0b
     62 #define		RESET_CMD	0x0e
     63 #define		TRISTATE_CMD	0x16
     64 #define		NO_TRISTATE_CMD	0x17
     65 #define		POWER_DOWN_CMD	0x18
     66 #define		SLEEP_MODE_CMD	0x19
     67 #define		NEGOTIATE_CMD	0x1a
     68 #define		RESUME_XMT_CMD	0x1c
     69 #define		SEL_RESET_CMD	0x1e
     70 #define		BANK_SEL(n)	(n<<6)	/* 0, 1, 2 */
     71 
     72 #define STATUS_REG 1
     73 
     74 #define		RX_STP_INT	0x01
     75 #define		RX_INT		0x02
     76 #define		TX_INT		0x04
     77 #define		EXEC_INT	0x08
     78 #define		EXEC_STATUS	0x30
     79 
     80 #define ID_REG 2
     81 
     82 #define		ID_REG_MASK	0x2c
     83 #define		ID_REG_SIG	0x24
     84 #define		R_ROBIN_BITS	0xc0
     85 #define		R_ROBIN_SHIFT	6
     86 #define		AUTO_ENABLE	0x10
     87 
     88 #define INT_MASK_REG 3
     89 
     90 #define		RX_STOP_BIT	0x01
     91 #define		RX_BIT		0x02
     92 #define		TX_BIT		0x04
     93 #define		EXEC_BIT	0x08
     94 #define		ALL_INTS	0x0f
     95 
     96 #define RCV_START_LOW 4
     97 #define RCV_START_HIGH 5
     98 
     99 #define RCV_STOP_LOW 6
    100 #define RCV_STOP_HIGH 7
    101 
    102 #define XMT_ADDR_REG 0x0a
    103 #define HOST_ADDR_REG 0x0c
    104 #define MEM_PORT_REG 0x0e
    105 
    106 /* -------------------- bank1 -------------------- */
    107 
    108 #define REG1 1
    109 
    110 #define		WORD_WIDTH	0x02
    111 #define		INT_ENABLE	0x80
    112 
    113 #define INT_NO_REG 2
    114 
    115 #define RCV_LOWER_LIMIT_REG 8
    116 #define RCV_UPPER_LIMIT_REG 9
    117 
    118 #define XMT_LOWER_LIMIT_REG 10
    119 #define XMT_UPPER_LIMIT_REG 11
    120 
    121 /* bank2 */
    122 
    123 /* reg1, apparently */
    124 
    125 #define		XMT_CHAIN_INT	0x20	/* interupt at end of xmt chain */
    126 #define		XMT_CHAIN_ERRSTOP 0x40	/* int at end of chain even if err */
    127 #define		RCV_DISCARD_BAD	0x80	/* Throw bad frames away and continue */
    128 
    129 #define RECV_MODES_REG 2
    130 
    131 #define		PROMISC_MODE	0x01
    132 #define		NO_RX_CRC	0x04
    133 #define		NO_ADD_INS	0x10
    134 #define		MULTI_IA	0x20
    135 
    136 #define		MATCH_ID	(NO_ADD_INS | NO_RX_CRC | 0x02)
    137 #define		MATCH_ALL	(NO_ADD_INS | NO_RX_CRC | 0x01)
    138 #define		MATCH_BRDCST	(NO_ADD_INS | NO_RX_CRC)
    139 
    140 #define MEDIA_SELECT 3
    141 
    142 #define		TPE_BIT		0x04
    143 #define		BNC_BIT		0x20
    144 #define		TEST_MODE_MASK	0x3f
    145 
    146 #define I_ADD(n) (n+4)	/* 0..5 -> 4..9 */
    147 
    148 #define EEPROM_REG 10
    149 
    150 #define		EEDO 8
    151 #define		EEDI 4
    152 #define		EECS 2
    153 #define		EESK 1
    154 
    155 /*
    156  * EEPROM layout. Written with reference to Intels public "LAN595 Hardware and
    157  * Software Specifications" document.
    158  */
    159 
    160 #define EEPPW0		0
    161 #define		EEPP_BusWidth	0x0004
    162 #define		EEPP_FlashAdrs	0x0038
    163 #define		EEPP_FLASHTRANSFORM {-1, -1, 0xC8000, 0xCC000, 0xD0000, \
    164 					0xD4000, 0xD8000, 0xDC000}
    165 #define		EEPP_AutoIO	0x0040
    166 #define		EEPP_IOMapping	0xfc00
    167 
    168 #define EEPPW1		1
    169 #define		EEPP_Int	0x0007
    170 #define		EEPP_INTMAP	{3, 5, 9, 10, 11, -1, -1, -1}
    171 #define		EEPP_RINTMAP	{0xff, 0xff, 0x02, 0x00, 0xff, 0x01, 0xff, \
    172 				 0xff, 0xff, 0x02, 0x03, 0x04 }
    173 
    174 #define		EEPP_LinkInteg	0x0008
    175 #define		EEPP_PolarCorr	0x0010
    176 #define		EEPP_AuiTpe	0x0020
    177 #define		EEPP_Jabber	0x0040
    178 #define		EEPP_AutoPort	0x0080
    179 #define		EEPP_SmOut	0x0100
    180 #define		EEPP_BootFls	0x0200
    181 #define		EEPP_DramSize	0x1000
    182 #define		EEPP_AltReady	0x2000
    183 
    184 #define EEPPEther2	2
    185 #define EEPPEther1	3
    186 #define EEPPEther0	4
    187 
    188 #define EEPPEther2a	0x3c
    189 #define EEPPEther1a	0x3d
    190 #define EEPPEther0a	0x3e
    191 
    192 #define EEPPW5		5
    193 #define		EEPP_BncTpe	0x0001
    194 #define		EEPP_RomSlct	0x0006	/* none, NetWare, NDIS, rsrvd. */
    195 #define		EEPP_NumConn	0x0008	/* 0=2, 1=3 */
    196 
    197 #define EEPW6		6
    198 #define EEPP_BoardRev	0x00FF
    199 
    200 #define EEPP_LENGTH 0x40
    201 #define EEPP_CHKSUM 0xBABA /* Intel claim 0x0, but this seems to be wrong */
    202 
    203 #define I595_XMT_HDRLEN	8
    204 
    205 #define CMD_MASK	0x001f
    206 #define TX_DONE		0x0080
    207 #define CHAIN		0x8000
    208 
    209 #define XMT_STATUS	0x02
    210 #define XMT_CHAIN	0x04
    211 #define XMT_COUNT	0x06
    212 
    213 #define I595_RCV_HDRLEN	8
    214 
    215 #define RCV_DONE	0x0008
    216 #define RX_OK		0x2000
    217 #define RX_ERR		0x0d81
    218 
    219 
    220