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