lancereg.h revision 1.4 1 1.4 thorpej /* $NetBSD: lancereg.h,v 1.4 2001/08/18 21:16:34 thorpej Exp $ */
2 1.2 mycroft
3 1.2 mycroft /*-
4 1.3 thorpej * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
5 1.2 mycroft * All rights reserved.
6 1.2 mycroft *
7 1.2 mycroft * This code is derived from software contributed to The NetBSD Foundation
8 1.3 thorpej * by Charles M. Hannum and Jason R. Thorpe.
9 1.2 mycroft *
10 1.2 mycroft * Redistribution and use in source and binary forms, with or without
11 1.2 mycroft * modification, are permitted provided that the following conditions
12 1.2 mycroft * are met:
13 1.2 mycroft * 1. Redistributions of source code must retain the above copyright
14 1.2 mycroft * notice, this list of conditions and the following disclaimer.
15 1.2 mycroft * 2. Redistributions in binary form must reproduce the above copyright
16 1.2 mycroft * notice, this list of conditions and the following disclaimer in the
17 1.2 mycroft * documentation and/or other materials provided with the distribution.
18 1.2 mycroft * 3. All advertising materials mentioning features or use of this software
19 1.2 mycroft * must display the following acknowledgement:
20 1.2 mycroft * This product includes software developed by the NetBSD
21 1.2 mycroft * Foundation, Inc. and its contributors.
22 1.2 mycroft * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.2 mycroft * contributors may be used to endorse or promote products derived
24 1.2 mycroft * from this software without specific prior written permission.
25 1.2 mycroft *
26 1.2 mycroft * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.2 mycroft * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.2 mycroft * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.2 mycroft * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.2 mycroft * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.2 mycroft * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.2 mycroft * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.2 mycroft * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.2 mycroft * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.2 mycroft * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.2 mycroft * POSSIBILITY OF SUCH DAMAGE.
37 1.2 mycroft */
38 1.1 drochner
39 1.1 drochner /*-
40 1.1 drochner * Copyright (c) 1992, 1993
41 1.1 drochner * The Regents of the University of California. All rights reserved.
42 1.1 drochner *
43 1.1 drochner * This code is derived from software contributed to Berkeley by
44 1.1 drochner * Ralph Campbell and Rick Macklem.
45 1.1 drochner *
46 1.1 drochner * Redistribution and use in source and binary forms, with or without
47 1.1 drochner * modification, are permitted provided that the following conditions
48 1.1 drochner * are met:
49 1.1 drochner * 1. Redistributions of source code must retain the above copyright
50 1.1 drochner * notice, this list of conditions and the following disclaimer.
51 1.1 drochner * 2. Redistributions in binary form must reproduce the above copyright
52 1.1 drochner * notice, this list of conditions and the following disclaimer in the
53 1.1 drochner * documentation and/or other materials provided with the distribution.
54 1.1 drochner * 3. All advertising materials mentioning features or use of this software
55 1.1 drochner * must display the following acknowledgement:
56 1.1 drochner * This product includes software developed by the University of
57 1.1 drochner * California, Berkeley and its contributors.
58 1.1 drochner * 4. Neither the name of the University nor the names of its contributors
59 1.1 drochner * may be used to endorse or promote products derived from this software
60 1.1 drochner * without specific prior written permission.
61 1.1 drochner *
62 1.1 drochner * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 1.1 drochner * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 1.1 drochner * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 1.1 drochner * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 1.1 drochner * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 1.1 drochner * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 1.1 drochner * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 1.1 drochner * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 1.1 drochner * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 1.1 drochner * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 1.1 drochner * SUCH DAMAGE.
73 1.1 drochner *
74 1.1 drochner * @(#)if_lereg.h 8.1 (Berkeley) 6/10/93
75 1.1 drochner */
76 1.1 drochner
77 1.3 thorpej /*
78 1.3 thorpej * Register description for the following Advanced Micro Devices
79 1.3 thorpej * Ethernet chips:
80 1.3 thorpej *
81 1.3 thorpej * - Am7990 Local Area Network Controller for Ethernet (LANCE)
82 1.3 thorpej * (and its descendent Am79c90 C-LANCE).
83 1.3 thorpej *
84 1.3 thorpej * - Am79c900 Integrated Local Area Communications Controller (ILACC)
85 1.3 thorpej *
86 1.3 thorpej * - Am79c960 PCnet-ISA Single-Chip Ethernet Controller for ISA
87 1.3 thorpej *
88 1.3 thorpej * - Am79c961 PCnet-ISA+ Jumperless Single-Chip Ethernet Controller
89 1.3 thorpej * for ISA
90 1.3 thorpej *
91 1.3 thorpej * - Am79c961A PCnet-ISA II Jumperless Full-Duplex Single-Chip
92 1.3 thorpej * Ethernet Controller for ISA
93 1.3 thorpej *
94 1.3 thorpej * - Am79c965A PCnet-32 Single-Chip 32-bit Ethernet Controller
95 1.3 thorpej * (for VESA and 486 local busses)
96 1.3 thorpej *
97 1.3 thorpej * - Am79c970 PCnet-PCI Single-Chip Ethernet Controller for PCI
98 1.3 thorpej * Local Bus
99 1.3 thorpej *
100 1.3 thorpej * - Am79c970A PCnet-PCI II Single-Chip Full-Duplex Ethernet Controller
101 1.3 thorpej * for PCI Local Bus
102 1.3 thorpej *
103 1.3 thorpej * - Am79c971 PCnet-FAST Single-Chip Full-Duplex 10/100Mbps
104 1.3 thorpej * Ethernet Controller for PCI Local Bus
105 1.3 thorpej *
106 1.3 thorpej * - Am79c972 PCnet-FAST+ Enhanced 10/100Mbps PCI Ethernet Controller
107 1.3 thorpej * with OnNow Support
108 1.3 thorpej *
109 1.3 thorpej * - Am79c973/Am79c975 PCnet-FAST III Single-Chip 10/100Mbps PCI
110 1.3 thorpej * Ethernet Controller with Integrated PHY
111 1.3 thorpej *
112 1.3 thorpej * - Am79c978 PCnet-Home Single-Chip 1/10 Mbps PCI Home
113 1.3 thorpej * Networking Controller.
114 1.3 thorpej *
115 1.3 thorpej * Initialization block, transmit descriptor, and receive descriptor
116 1.3 thorpej * formats are described in two separate files:
117 1.3 thorpej *
118 1.3 thorpej * 16-bit software model (LANCE) am7990reg.h
119 1.3 thorpej *
120 1.3 thorpej * 32-bit software model (ILACC) am79900reg.h
121 1.3 thorpej *
122 1.3 thorpej * Note that the vast majority of the registers described in this file
123 1.3 thorpej * belong to follow-on chips to the original LANCE. Only CSR0-CSR3 are
124 1.3 thorpej * valid on the LANCE.
125 1.3 thorpej */
126 1.3 thorpej
127 1.1 drochner #define LEBLEN 1536 /* ETHERMTU + header + CRC */
128 1.1 drochner #define LEMINSIZE 60 /* should be 64 if mode DTCR is set */
129 1.1 drochner
130 1.1 drochner #define LE_INITADDR(sc) (sc->sc_initaddr)
131 1.1 drochner #define LE_RMDADDR(sc, bix) (sc->sc_rmdaddr + sizeof(struct lermd) * (bix))
132 1.1 drochner #define LE_TMDADDR(sc, bix) (sc->sc_tmdaddr + sizeof(struct letmd) * (bix))
133 1.1 drochner #define LE_RBUFADDR(sc, bix) (sc->sc_rbufaddr[bix])
134 1.1 drochner #define LE_TBUFADDR(sc, bix) (sc->sc_tbufaddr[bix])
135 1.1 drochner
136 1.3 thorpej /*
137 1.3 thorpej * Control and Status Register addresses
138 1.3 thorpej */
139 1.1 drochner #define LE_CSR0 0x0000 /* Control and status register */
140 1.1 drochner #define LE_CSR1 0x0001 /* low address of init block */
141 1.1 drochner #define LE_CSR2 0x0002 /* high address of init block */
142 1.1 drochner #define LE_CSR3 0x0003 /* Bus master and control */
143 1.3 thorpej #define LE_CSR4 0x0004 /* Test and features control */
144 1.3 thorpej #define LE_CSR5 0x0005 /* Extended control and Interrupt 1 */
145 1.3 thorpej #define LE_CSR6 0x0006 /* Rx/Tx Descriptor table length */
146 1.3 thorpej #define LE_CSR7 0x0007 /* Extended control and interrupt 2 */
147 1.3 thorpej #define LE_CSR8 0x0008 /* Logical Address Filter 0 */
148 1.3 thorpej #define LE_CSR9 0x0009 /* Logical Address Filter 1 */
149 1.3 thorpej #define LE_CSR10 0x000a /* Logical Address Filter 2 */
150 1.3 thorpej #define LE_CSR11 0x000b /* Logical Address Filter 3 */
151 1.3 thorpej #define LE_CSR12 0x000c /* Physical Address 0 */
152 1.3 thorpej #define LE_CSR13 0x000d /* Physical Address 1 */
153 1.3 thorpej #define LE_CSR14 0x000e /* Physical Address 2 */
154 1.3 thorpej #define LE_CSR15 0x000f /* Mode */
155 1.3 thorpej #define LE_CSR16 0x0010 /* Initialization Block addr lower */
156 1.3 thorpej #define LE_CSR17 0x0011 /* Initialization Block addr upper */
157 1.3 thorpej #define LE_CSR18 0x0012 /* Current Rx Buffer addr lower */
158 1.3 thorpej #define LE_CSR19 0x0013 /* Current Rx Buffer addr upper */
159 1.3 thorpej #define LE_CSR20 0x0014 /* Current Tx Buffer addr lower */
160 1.3 thorpej #define LE_CSR21 0x0015 /* Current Tx Buffer addr upper */
161 1.3 thorpej #define LE_CSR22 0x0016 /* Next Rx Buffer addr lower */
162 1.3 thorpej #define LE_CSR23 0x0017 /* Next Rx Buffer addr upper */
163 1.3 thorpej #define LE_CSR24 0x0018 /* Base addr of Rx ring lower */
164 1.3 thorpej #define LE_CSR25 0x0019 /* Base addr of Rx ring upper */
165 1.3 thorpej #define LE_CSR26 0x001a /* Next Rx Desc addr lower */
166 1.3 thorpej #define LE_CSR27 0x001b /* Next Rx Desc addr upper */
167 1.3 thorpej #define LE_CSR28 0x001c /* Current Rx Desc addr lower */
168 1.3 thorpej #define LE_CSR29 0x001d /* Current Rx Desc addr upper */
169 1.3 thorpej #define LE_CSR30 0x001e /* Base addr of Tx ring lower */
170 1.3 thorpej #define LE_CSR31 0x001f /* Base addr of Tx ring upper */
171 1.3 thorpej #define LE_CSR32 0x0020 /* Next Tx Desc addr lower */
172 1.3 thorpej #define LE_CSR33 0x0021 /* Next Tx Desc addr upper */
173 1.3 thorpej #define LE_CSR34 0x0022 /* Current Tx Desc addr lower */
174 1.3 thorpej #define LE_CSR35 0x0023 /* Current Tx Desc addr upper */
175 1.3 thorpej #define LE_CSR36 0x0024 /* Next Next Rx Desc addr lower */
176 1.3 thorpej #define LE_CSR37 0x0025 /* Next Next Rx Desc addr upper */
177 1.3 thorpej #define LE_CSR38 0x0026 /* Next Next Tx Desc addr lower */
178 1.3 thorpej #define LE_CSR39 0x0027 /* Next Next Tx Desc adddr upper */
179 1.3 thorpej #define LE_CSR40 0x0028 /* Current Rx Byte Count */
180 1.3 thorpej #define LE_CSR41 0x0029 /* Current Rx Status */
181 1.3 thorpej #define LE_CSR42 0x002a /* Current Tx Byte Count */
182 1.3 thorpej #define LE_CSR43 0x002b /* Current Tx Status */
183 1.3 thorpej #define LE_CSR44 0x002c /* Next Rx Byte Count */
184 1.3 thorpej #define LE_CSR45 0x002d /* Next Rx Status */
185 1.3 thorpej #define LE_CSR46 0x002e /* Tx Poll Time Counter */
186 1.3 thorpej #define LE_CSR47 0x002f /* Tx Polling Interval */
187 1.3 thorpej #define LE_CSR48 0x0030 /* Rx Poll Time Counter */
188 1.3 thorpej #define LE_CSR49 0x0031 /* Rx Polling Interval */
189 1.3 thorpej #define LE_CSR58 0x003a /* Software Style */
190 1.3 thorpej #define LE_CSR60 0x003c /* Previous Tx Desc addr lower */
191 1.3 thorpej #define LE_CSR61 0x003d /* Previous Tx Desc addr upper */
192 1.3 thorpej #define LE_CSR62 0x003e /* Previous Tx Byte Count */
193 1.3 thorpej #define LE_CSR63 0x003f /* Previous Tx Status */
194 1.3 thorpej #define LE_CSR64 0x0040 /* Next Tx Buffer addr lower */
195 1.3 thorpej #define LE_CSR65 0x0041 /* Next Tx Buffer addr upper */
196 1.3 thorpej #define LE_CSR66 0x0042 /* Next Tx Byte Count */
197 1.3 thorpej #define LE_CSR67 0x0043 /* Next Tx Status */
198 1.3 thorpej #define LE_CSR72 0x0048 /* Receive Ring Counter */
199 1.3 thorpej #define LE_CSR74 0x004a /* Transmit Ring Counter */
200 1.3 thorpej #define LE_CSR76 0x004c /* Receive Ring Length */
201 1.3 thorpej #define LE_CSR78 0x004e /* Transmit Ring Length */
202 1.3 thorpej #define LE_CSR80 0x0050 /* DMA Transfer Counter and FIFO
203 1.3 thorpej Threshold Control */
204 1.3 thorpej #define LE_CSR82 0x0052 /* Tx Desc addr Pointer lower */
205 1.3 thorpej #define LE_CSR84 0x0054 /* DMA addr register lower */
206 1.3 thorpej #define LE_CSR85 0x0055 /* DMA addr register upper */
207 1.3 thorpej #define LE_CSR86 0x0056 /* Buffer Byte Counter */
208 1.3 thorpej #define LE_CSR88 0x0058 /* Chip ID Register lower */
209 1.3 thorpej #define LE_CSR89 0x0059 /* Chip ID Register upper */
210 1.3 thorpej #define LE_CSR92 0x005c /* Ring Length Conversion */
211 1.3 thorpej #define LE_CSR100 0x0064 /* Bus Timeout */
212 1.3 thorpej #define LE_CSR112 0x0070 /* Missed Frame Count */
213 1.3 thorpej #define LE_CSR114 0x0072 /* Receive Collision Count */
214 1.3 thorpej #define LE_CSR116 0x0074 /* OnNow Power Mode Register */
215 1.3 thorpej #define LE_CSR122 0x007a /* Advanced Feature Control */
216 1.3 thorpej #define LE_CSR124 0x007c /* Test Register 1 */
217 1.3 thorpej #define LE_CSR125 0x007d /* MAC Enhanced Configuration Control */
218 1.3 thorpej
219 1.3 thorpej /*
220 1.3 thorpej * Bus Configuration Register addresses
221 1.3 thorpej */
222 1.3 thorpej #define LE_BCR0 0x0000 /* Master Mode Read Active */
223 1.3 thorpej #define LE_BCR1 0x0001 /* Master Mode Write Active */
224 1.3 thorpej #define LE_BCR2 0x0002 /* Misc. Configuration */
225 1.3 thorpej #define LE_BCR4 0x0004 /* LED0 Status */
226 1.3 thorpej #define LE_BCR5 0x0005 /* LED1 Status */
227 1.3 thorpej #define LE_BCR6 0x0006 /* LED2 Status */
228 1.3 thorpej #define LE_BCR7 0x0007 /* LED3 Status */
229 1.3 thorpej #define LE_BCR9 0x0009 /* Full-duplex Control */
230 1.3 thorpej #define LE_BCR16 0x0010 /* I/O Base Address lower */
231 1.3 thorpej #define LE_BCR17 0x0011 /* I/O Base Address upper */
232 1.3 thorpej #define LE_BCR18 0x0012 /* Burst and Bus Control Register */
233 1.3 thorpej #define LE_BCR19 0x0013 /* EEPROM Control and Status */
234 1.3 thorpej #define LE_BCR20 0x0014 /* Software Style */
235 1.3 thorpej #define LE_BCR22 0x0016 /* PCI Latency Register */
236 1.3 thorpej #define LE_BCR23 0x0017 /* PCI Subsystem Vendor ID */
237 1.3 thorpej #define LE_BCR24 0x0018 /* PCI Subsystem ID */
238 1.3 thorpej #define LE_BCR25 0x0019 /* SRAM Size Register */
239 1.3 thorpej #define LE_BCR26 0x001a /* SRAM Boundary Register */
240 1.3 thorpej #define LE_BCR27 0x001b /* SRAM Interface Control Register */
241 1.3 thorpej #define LE_BCR28 0x001c /* Exp. Bus Port Addr lower */
242 1.3 thorpej #define LE_BCR29 0x001d /* Exp. Bus Port Addr upper */
243 1.3 thorpej #define LE_BCR30 0x001e /* Exp. Bus Data Port */
244 1.3 thorpej #define LE_BCR31 0x001f /* Software Timer Register */
245 1.3 thorpej #define LE_BCR32 0x0020 /* PHY Control and Status Register */
246 1.3 thorpej #define LE_BCR33 0x0021 /* PHY Address Register */
247 1.3 thorpej #define LE_BCR34 0x0022 /* PHY Management Data Register */
248 1.3 thorpej #define LE_BCR35 0x0023 /* PCI Vendor ID Register */
249 1.3 thorpej #define LE_BCR36 0x0024 /* PCI Power Management Cap. Alias */
250 1.3 thorpej #define LE_BCR37 0x0025 /* PCI DATA0 Alias */
251 1.3 thorpej #define LE_BCR38 0x0026 /* PCI DATA1 Alias */
252 1.3 thorpej #define LE_BCR39 0x0027 /* PCI DATA2 Alias */
253 1.3 thorpej #define LE_BCR40 0x0028 /* PCI DATA3 Alias */
254 1.3 thorpej #define LE_BCR41 0x0029 /* PCI DATA4 Alias */
255 1.3 thorpej #define LE_BCR42 0x002a /* PCI DATA5 Alias */
256 1.3 thorpej #define LE_BCR43 0x002b /* PCI DATA6 Alias */
257 1.3 thorpej #define LE_BCR44 0x002c /* PCI DATA7 Alias */
258 1.3 thorpej #define LE_BCR45 0x002d /* OnNow Pattern Matching 1 */
259 1.3 thorpej #define LE_BCR46 0x002e /* OnNow Pattern Matching 2 */
260 1.3 thorpej #define LE_BCR47 0x002f /* OnNow Pattern Matching 3 */
261 1.3 thorpej #define LE_BCR48 0x0030 /* LED4 Status */
262 1.3 thorpej #define LE_BCR49 0x0031 /* PHY Select */
263 1.1 drochner
264 1.1 drochner /* Control and status register 0 (csr0) */
265 1.1 drochner #define LE_C0_ERR 0x8000 /* error summary */
266 1.1 drochner #define LE_C0_BABL 0x4000 /* transmitter timeout error */
267 1.1 drochner #define LE_C0_CERR 0x2000 /* collision */
268 1.1 drochner #define LE_C0_MISS 0x1000 /* missed a packet */
269 1.1 drochner #define LE_C0_MERR 0x0800 /* memory error */
270 1.1 drochner #define LE_C0_RINT 0x0400 /* receiver interrupt */
271 1.1 drochner #define LE_C0_TINT 0x0200 /* transmitter interrupt */
272 1.1 drochner #define LE_C0_IDON 0x0100 /* initalization done */
273 1.1 drochner #define LE_C0_INTR 0x0080 /* interrupt condition */
274 1.1 drochner #define LE_C0_INEA 0x0040 /* interrupt enable */
275 1.1 drochner #define LE_C0_RXON 0x0020 /* receiver on */
276 1.1 drochner #define LE_C0_TXON 0x0010 /* transmitter on */
277 1.1 drochner #define LE_C0_TDMD 0x0008 /* transmit demand */
278 1.1 drochner #define LE_C0_STOP 0x0004 /* disable all external activity */
279 1.1 drochner #define LE_C0_STRT 0x0002 /* enable external activity */
280 1.1 drochner #define LE_C0_INIT 0x0001 /* begin initalization */
281 1.1 drochner
282 1.1 drochner #define LE_C0_BITS \
283 1.1 drochner "\20\20ERR\17BABL\16CERR\15MISS\14MERR\13RINT\
284 1.1 drochner \12TINT\11IDON\10INTR\07INEA\06RXON\05TXON\04TDMD\03STOP\02STRT\01INIT"
285 1.1 drochner
286 1.1 drochner /* Control and status register 3 (csr3) */
287 1.3 thorpej #define LE_C3_MISSM 0x1000 /* missed frame mask */
288 1.3 thorpej #define LE_C3_MERRM 0x0800 /* memory error mask */
289 1.3 thorpej #define LE_C3_RINTM 0x0400 /* receive interrupt mask */
290 1.3 thorpej #define LE_C3_TINTM 0x0200 /* transmit interrupt mask */
291 1.3 thorpej #define LE_C3_IDONM 0x0100 /* initialization done mask */
292 1.3 thorpej #define LE_C3_DXSUFLO 0x0040 /* disable tx stop on underflow */
293 1.3 thorpej #define LE_C3_LAPPEN 0x0020 /* look ahead packet processing enbl */
294 1.3 thorpej #define LE_C3_DXMT2PD 0x0010 /* disable tx two part deferral */
295 1.3 thorpej #define LE_C3_EMBA 0x0008 /* enable modified backoff algorithm */
296 1.1 drochner #define LE_C3_BSWP 0x0004 /* byte swap */
297 1.1 drochner #define LE_C3_ACON 0x0002 /* ALE control, eh? */
298 1.1 drochner #define LE_C3_BCON 0x0001 /* byte control */
299 1.3 thorpej
300 1.3 thorpej /* Control and status register 4 (csr4) */
301 1.3 thorpej #define LE_C4_DMAPLUS 0x4000 /* always set (PCnet-PCI) */
302 1.3 thorpej #define LE_C4_TXDPOLL 0x1000 /* disable transmit polling */
303 1.3 thorpej #define LE_C4_APAD_XMT 0x0800 /* auto pad transmit */
304 1.3 thorpej #define LE_C4_ASTRP_RCV 0x0400 /* auto strip receive */
305 1.3 thorpej #define LE_C4_MFCO 0x0200 /* missed frame counter overflow */
306 1.3 thorpej #define LE_C4_MFCOM 0x0100 /* missed frame coutner overflow mask */
307 1.3 thorpej #define LE_C4_UINTCMD 0x0080 /* user interrupt command */
308 1.3 thorpej #define LE_C4_UINT 0x0040 /* user interrupt */
309 1.3 thorpej #define LE_C4_RCVCCO 0x0020 /* receive collision counter overflow */
310 1.3 thorpej #define LE_C4_RCVCCOM 0x0010 /* receive collision counter overflow
311 1.3 thorpej mask */
312 1.3 thorpej #define LE_C4_TXSTRT 0x0008 /* transmit start status */
313 1.3 thorpej #define LE_C4_TXSTRTM 0x0004 /* transmit start mask */
314 1.3 thorpej
315 1.3 thorpej /* Control and status register 5 (csr5) */
316 1.3 thorpej #define LE_C5_TOKINTD 0x8000 /* transmit ok interrupt disable */
317 1.3 thorpej #define LE_C5_LTINTEN 0x4000 /* last transmit interrupt enable */
318 1.3 thorpej #define LE_C5_SINT 0x0800 /* system interrupt */
319 1.3 thorpej #define LE_C5_SINTE 0x0400 /* system interrupt enable */
320 1.3 thorpej #define LE_C5_EXDINT 0x0080 /* excessive deferral interrupt */
321 1.3 thorpej #define LE_C5_EXDINTE 0x0040 /* excessive deferral interrupt enbl */
322 1.3 thorpej #define LE_C5_MPPLBA 0x0020 /* magic packet physical logical
323 1.3 thorpej broadcast accept */
324 1.3 thorpej #define LE_C5_MPINT 0x0010 /* magic packet interrupt */
325 1.3 thorpej #define LE_C5_MPINTE 0x0008 /* magic packet interrupt enable */
326 1.3 thorpej #define LE_C5_MPEN 0x0004 /* magic packet enable */
327 1.3 thorpej #define LE_C5_MPMODE 0x0002 /* magic packet mode */
328 1.3 thorpej #define LE_C5_SPND 0x0001 /* suspend */
329 1.3 thorpej
330 1.3 thorpej /* Control and status register 6 (csr6) */
331 1.3 thorpej #define LE_C6_TLEN 0xf000 /* TLEN from init block */
332 1.3 thorpej #define LE_C6_RLEN 0x0f00 /* RLEN from init block */
333 1.3 thorpej
334 1.3 thorpej /* Control and status register 7 (csr7) */
335 1.3 thorpej #define LE_C7_FASTSPNDE 0x8000 /* fast suspend enable */
336 1.3 thorpej #define LE_C7_RDMD 0x2000 /* receive demand */
337 1.3 thorpej #define LE_C7_RDXPOLL 0x1000 /* receive disable polling */
338 1.3 thorpej #define LE_C7_STINT 0x0800 /* software timer interrupt */
339 1.3 thorpej #define LE_C7_STINTE 0x0400 /* software timer interrupt enable */
340 1.3 thorpej #define LE_C7_MREINT 0x0200 /* PHY management read error intr */
341 1.3 thorpej #define LE_C7_MREINTE 0x0100 /* PHY management read error intr
342 1.3 thorpej enable */
343 1.3 thorpej #define LE_C7_MAPINT 0x0080 /* PHY management auto-poll intr */
344 1.3 thorpej #define LE_C7_MAPINTE 0x0040 /* PHY management auto-poll intr
345 1.3 thorpej enable */
346 1.3 thorpej #define LE_C7_MCCINT 0x0020 /* PHY management command complete
347 1.3 thorpej interrupt */
348 1.3 thorpej #define LE_C7_MCCINTE 0x0010 /* PHY management command complete
349 1.3 thorpej interrupt enable */
350 1.3 thorpej #define LE_C7_MCCIINT 0x0008 /* PHY management command complete
351 1.3 thorpej internal interrupt */
352 1.3 thorpej #define LE_C7_MCCIINTE 0x0004 /* PHY management command complete
353 1.3 thorpej internal interrupt enable */
354 1.3 thorpej #define LE_C7_MIIPDTINT 0x0002 /* PHY management detect transition
355 1.3 thorpej interrupt */
356 1.3 thorpej #define LE_C7_MIIPDTINTE 0x0001 /* PHY management detect transition
357 1.3 thorpej interrupt enable */
358 1.3 thorpej
359 1.3 thorpej /* control and status register 80 (csr80) */
360 1.3 thorpej #define LE_C80_RCVFW1 0x2000 /* Receive FIFO Watermark 1 */
361 1.3 thorpej #define LE_C80_RCVFW0 0x1000 /* Receive FIFO Watermark 0 */
362 1.3 thorpej /* 00 16 bytes */
363 1.3 thorpej /* 01 64 bytes */
364 1.3 thorpej /* 10 112 bytes */
365 1.3 thorpej /* 11 reserved */
366 1.3 thorpej #define LE_C80_XMTSP1 0x0800 /* Transmit Start Point 1 */
367 1.3 thorpej #define LE_C80_XMTSP0 0x0400 /* Transmit Start Point 0 */
368 1.3 thorpej /* 00 0 20 bytes */
369 1.3 thorpej /* 01 0 64 bytes */
370 1.3 thorpej /* 10 0 128 bytes */
371 1.3 thorpej /* 11 0 220 max */
372 1.3 thorpej /* 00 >0 36 bytes */
373 1.3 thorpej /* 01 >0 64 bytes */
374 1.3 thorpej /* 10 >0 128 bytes */
375 1.3 thorpej /* 11 >0 store-and-fwd */
376 1.3 thorpej #define LE_C80_XMTFW1 0x0200 /* Transmit FIFO Watermark 1 */
377 1.3 thorpej #define LE_C80_XMTFW0 0x0100 /* Transmit FIFO Watermark 0 */
378 1.3 thorpej /* 00 16 bytes */
379 1.3 thorpej /* 01 64 bytes */
380 1.3 thorpej /* 10 108 bytes */
381 1.3 thorpej /* 11 reserved */
382 1.3 thorpej #define LE_C80_DMATC 0x00ff /* DMA transfer counter */
383 1.3 thorpej
384 1.3 thorpej /* control and status register 116 (csr116) */
385 1.3 thorpej #define LE_C116_PME_EN_OVR 0x0400 /* PME_EN overwrite */
386 1.3 thorpej #define LE_C116_LCDET 0x0200 /* link change detected */
387 1.3 thorpej #define LE_C116_LCMODE 0x0100 /* link change wakeup mode */
388 1.3 thorpej #define LE_C116_PMAT 0x0080 /* pattern matched */
389 1.3 thorpej #define LE_C116_EMPPLBA 0x0040 /* magic packet physical logical
390 1.3 thorpej broadcast accept */
391 1.3 thorpej #define LE_C116_MPMAT 0x0020 /* magic packet match */
392 1.3 thorpej #define LE_C116_MPPEN 0x0010 /* magic packet pin enable */
393 1.3 thorpej #define LE_C116_RST_POL 0x0001 /* PHY_RST pin polarity */
394 1.3 thorpej
395 1.3 thorpej /* control and status register 122 (csr122) */
396 1.3 thorpej #define LE_C122_RCVALGN 0x0001 /* receive packet align */
397 1.3 thorpej
398 1.3 thorpej /* control and status register 124 (csr124) */
399 1.3 thorpej #define LE_C124_RPA 0x0008 /* runt packet accept */
400 1.3 thorpej
401 1.3 thorpej /* control and status register 125 (csr125) */
402 1.3 thorpej #define LE_C125_IPG 0xff00 /* inter-packet gap */
403 1.3 thorpej #define LE_C125_IFS1 0x00ff /* inter-frame spacing part 1 */
404 1.3 thorpej
405 1.3 thorpej /* bus configuration register 0 (bcr0) */
406 1.3 thorpej #define LE_B0_MSRDA 0xffff /* reserved locations */
407 1.3 thorpej
408 1.3 thorpej /* bus configuration register 1 (bcr1) */
409 1.3 thorpej #define LE_B1_MSWRA 0xffff /* reserved locations */
410 1.3 thorpej
411 1.3 thorpej /* bus configuration register 2 (bcr2) */
412 1.3 thorpej #define LE_B2_PHYSSELEN 0x2000 /* enable writes to BCR18[4:3] */
413 1.3 thorpej #define LE_B2_LEDPE 0x1000 /* LED program enable */
414 1.3 thorpej #define LE_B2_APROMWE 0x0100 /* Address PROM Write Enable */
415 1.3 thorpej #define LE_B2_INTLEVEL 0x0080 /* 1 == edge triggered */
416 1.3 thorpej
417 1.3 thorpej /* bus configuration register 4 (bcr4) */
418 1.3 thorpej /* bus configuration register 5 (bcr5) */
419 1.3 thorpej /* bus configuration register 6 (bcr6) */
420 1.3 thorpej /* bus configuration register 7 (bcr7) */
421 1.3 thorpej /* bus configuration register 48 (bcr48) */
422 1.3 thorpej #define LE_B4_LEDOUT 0x8000 /* LED output active */
423 1.3 thorpej #define LE_B4_LEDPOL 0x4000 /* LED polarity */
424 1.3 thorpej #define LE_B4_LEDDIS 0x2000 /* LED disable */
425 1.3 thorpej #define LE_B4_100E 0x1000 /* 100Mb/s enable */
426 1.3 thorpej #define LE_B4_MPSE 0x0200 /* magic packet status enable */
427 1.3 thorpej #define LE_B4_FDLSE 0x0100 /* full-duplex link status enable */
428 1.3 thorpej #define LE_B4_PSE 0x0080 /* pulse stretcher enable */
429 1.3 thorpej #define LE_B4_LNKSE 0x0040 /* link status enable */
430 1.3 thorpej #define LE_B4_RCVME 0x0020 /* receive match status enable */
431 1.3 thorpej #define LE_B4_XMTE 0x0010 /* transmit status enable */
432 1.3 thorpej #define LE_B4_POWER 0x0008 /* power enable */
433 1.3 thorpej #define LE_B4_RCVE 0x0004 /* receive status enable */
434 1.3 thorpej #define LE_B4_SPEED 0x0002 /* high speed enable */
435 1.3 thorpej #define LE_B4_COLE 0x0001 /* collision status enable */
436 1.3 thorpej
437 1.3 thorpej /* bus configuration register 9 (bcr9) */
438 1.3 thorpej #define LE_B9_FDRPAD 0x0004 /* full-duplex runt packet accept
439 1.3 thorpej disable */
440 1.3 thorpej #define LE_B9_FDEN 0x0001 /* full-duplex enable */
441 1.3 thorpej
442 1.3 thorpej /* bus configuration register 18 (bcr18) */
443 1.3 thorpej #define LE_B18_ROMTMG 0xf000 /* expansion rom timing */
444 1.3 thorpej #define LE_B18_NOUFLO 0x0800 /* no underflow on transmit */
445 1.3 thorpej #define LE_B18_MEMCMD 0x0200 /* memory read multiple enable */
446 1.3 thorpej #define LE_B18_EXTREQ 0x0100 /* extended request */
447 1.3 thorpej #define LE_B18_DWIO 0x0080 /* double-word I/O */
448 1.3 thorpej #define LE_B18_BREADE 0x0040 /* burst read enable */
449 1.3 thorpej #define LE_B18_BWRITE 0x0020 /* burst write enable */
450 1.3 thorpej #define LE_B18_PHYSEL1 0x0010 /* PHYSEL 1 */
451 1.3 thorpej #define LE_B18_PHYSEL0 0x0008 /* PHYSEL 0 */
452 1.3 thorpej /* 00 ex ROM/Flash */
453 1.3 thorpej /* 01 EADI/MII snoop */
454 1.3 thorpej /* 10 reserved */
455 1.3 thorpej /* 11 reserved */
456 1.3 thorpej #define LE_B18_LINBC 0x0007 /* reserved locations */
457 1.3 thorpej
458 1.3 thorpej /* bus configuration register 19 (bcr19) */
459 1.3 thorpej #define LE_B19_PVALID 0x8000 /* EEPROM status valid */
460 1.3 thorpej #define LE_B19_PREAD 0x4000 /* EEPROM read command */
461 1.3 thorpej #define LE_B19_EEDET 0x2000 /* EEPROM detect */
462 1.3 thorpej #define LE_B19_EEN 0x0010 /* EEPROM port enable */
463 1.3 thorpej #define LE_B19_ECS 0x0004 /* EEPROM chip select */
464 1.3 thorpej #define LE_B19_ESK 0x0002 /* EEPROM serial clock */
465 1.3 thorpej #define LE_B19_EDI 0x0001 /* EEPROM data in */
466 1.3 thorpej #define LE_B19_EDO 0x0001 /* EEPROM data out */
467 1.3 thorpej
468 1.3 thorpej /* bus configuration register 20 (bcr20) */
469 1.3 thorpej #define LE_B20_APERREN 0x0400 /* Advanced parity error handling */
470 1.3 thorpej #define LE_B20_SSIZE32 0x0100 /* Software Size 32-bit */
471 1.3 thorpej #define LE_B20_SSTYLE 0x0007 /* Software Style */
472 1.3 thorpej #define LE_B20_SSTYLE_LANCE 0 /* LANCE/PCnet-ISA (16-bit) */
473 1.3 thorpej #define LE_B20_SSTYLE_PCNETPCI2 2 /* PCnet-PCI (32-bit) */
474 1.3 thorpej #define LE_B20_SSTYLE_PCNETPCI3 3 /* PCnet-PCI (32-bit) */
475 1.3 thorpej
476 1.3 thorpej /* bus configuration register 25 (bcr25) */
477 1.3 thorpej #define LE_B25_SRAM_SIZE 0x00ff /* SRAM size */
478 1.3 thorpej
479 1.3 thorpej /* bus configuration register 26 (bcr26) */
480 1.3 thorpej #define LE_B26_SRAM_BND 0x00ff /* SRAM boundary */
481 1.3 thorpej
482 1.3 thorpej /* bus configuration register 27 (bcr27) */
483 1.3 thorpej #define LE_B27_PTRTST 0x8000 /* reserved for manuf. tests */
484 1.3 thorpej #define LE_B27_LOLATRX 0x4000 /* low latency receive */
485 1.3 thorpej #define LE_B27_EBCS 0x0038 /* expansion bus clock source */
486 1.3 thorpej /* 000 CLK pin */
487 1.3 thorpej /* 001 time base clock */
488 1.3 thorpej /* 010 EBCLK pin */
489 1.3 thorpej /* 011 reserved */
490 1.3 thorpej /* 1xx reserved */
491 1.3 thorpej #define LE_B27_CLK_FAC 0x0007 /* clock factor */
492 1.3 thorpej /* 000 1 */
493 1.3 thorpej /* 001 1/2 */
494 1.3 thorpej /* 010 reserved */
495 1.3 thorpej /* 011 1/4 */
496 1.3 thorpej /* 1xx reserved */
497 1.3 thorpej
498 1.3 thorpej /* bus configuration register 28 (bcr28) */
499 1.3 thorpej #define LE_B28_EADDRL 0xffff /* expansion port address lower */
500 1.3 thorpej
501 1.3 thorpej /* bus configuration register 29 (bcr29) */
502 1.3 thorpej #define LE_B29_FLASH 0x8000 /* flash access */
503 1.3 thorpej #define LE_B29_LAAINC 0x4000 /* lower address auto increment */
504 1.3 thorpej #define LE_B29_EPADDRU 0x0007 /* expansion port address upper */
505 1.3 thorpej
506 1.3 thorpej /* bus configuration register 30 (bcr30) */
507 1.3 thorpej #define LE_B30_EBDATA 0xffff /* expansion bus data port */
508 1.3 thorpej
509 1.3 thorpej /* bus configuration register 31 (bcr31) */
510 1.3 thorpej #define LE_B31_STVAL 0xffff /* software timer value */
511 1.3 thorpej
512 1.3 thorpej /* bus configuration register 32 (bcr32) */
513 1.3 thorpej #define LE_B32_ANTST 0x8000 /* reserved for manuf. tests */
514 1.3 thorpej #define LE_B32_MIIPD 0x4000 /* MII PHY Detect (manuf. tests) */
515 1.3 thorpej #define LE_B32_FMDC 0x3000 /* fast management data clock */
516 1.3 thorpej #define LE_B32_APEP 0x0800 /* auto-poll PHY */
517 1.3 thorpej #define LE_B32_APDW 0x0700 /* auto-poll dwell time */
518 1.3 thorpej #define LE_B32_DANAS 0x0080 /* disable autonegotiation */
519 1.3 thorpej #define LE_B32_XPHYRST 0x0040 /* PHY reset */
520 1.3 thorpej #define LE_B32_XPHYANE 0x0020 /* PHY autonegotiation enable */
521 1.3 thorpej #define LE_B32_XPHYFD 0x0010 /* PHY full-duplex */
522 1.3 thorpej #define LE_B32_XPHYSP 0x0008 /* PHY speed */
523 1.3 thorpej #define LE_B32_MIIILP 0x0002 /* MII internal loopback */
524 1.3 thorpej
525 1.3 thorpej /* bus configuration register 33 (bcr33) */
526 1.3 thorpej #define LE_B33_SHADOW 0x8000 /* shadow enable */
527 1.3 thorpej #define LE_B33_MII_SEL 0x4000 /* MII selected */
528 1.3 thorpej #define LE_B33_ACOMP 0x2000 /* internal PHY autonegotiation comp */
529 1.3 thorpej #define LE_B33_LINK 0x1000 /* link status */
530 1.3 thorpej #define LE_B33_FDX 0x0800 /* full-duplex */
531 1.3 thorpej #define LE_B33_SPEED 0x0400 /* 1 == high speed */
532 1.3 thorpej #define LE_B33_PHYAD 0x03e0 /* PHY address */
533 1.3 thorpej #define PHYAD_SHIFT 5
534 1.3 thorpej #define LE_B33_REGAD 0x001f /* register address */
535 1.3 thorpej
536 1.3 thorpej /* bus configuration register 34 (bcr34) */
537 1.3 thorpej #define LE_B34_MIIMD 0xffff /* MII data */
538 1.3 thorpej
539 1.3 thorpej /* bus configuration register 49 (bcr49) */
540 1.3 thorpej #define LE_B49_PCNET 0x8000 /* PCnet mode - Must Be One */
541 1.3 thorpej #define LE_B49_PHYSEL_D 0x0300 /* PHY_SEL_Default */
542 1.3 thorpej #define LE_B49_PHYSEL_L 0x0010 /* PHY_SEL_Lock */
543 1.3 thorpej #define LE_B49_PHYSEL 0x0003 /* PHYSEL */
544 1.3 thorpej /* 00 10baseT PHY */
545 1.3 thorpej /* 01 HomePNA PYY */
546 1.3 thorpej /* 10 external PHY */
547 1.3 thorpej /* 11 reserved */
548 1.1 drochner
549 1.1 drochner /* Initialzation block (mode) */
550 1.1 drochner #define LE_MODE_PROM 0x8000 /* promiscuous mode */
551 1.1 drochner /* 0x7f80 reserved, must be zero */
552 1.1 drochner /* 0x4000 - 0x0080 are not available on LANCE 7990 */
553 1.1 drochner #define LE_MODE_DRCVBC 0x4000 /* disable receive brodcast */
554 1.1 drochner #define LE_MODE_DRCVPA 0x2000 /* disable physical address detection */
555 1.1 drochner #define LE_MODE_DLNKTST 0x1000 /* disable link status */
556 1.1 drochner #define LE_MODE_DAPC 0x0800 /* disable automatic polarity correction */
557 1.1 drochner #define LE_MODE_MENDECL 0x0400 /* MENDEC loopback mode */
558 1.1 drochner #define LE_MODE_LRTTSEL 0x0200 /* lower receice threshold /
559 1.1 drochner transmit mode selection */
560 1.1 drochner #define LE_MODE_PSEL1 0x0100 /* port selection bit1 */
561 1.1 drochner #define LE_MODE_PSEL0 0x0080 /* port selection bit0 */
562 1.1 drochner #define LE_MODE_INTL 0x0040 /* internal loopback */
563 1.1 drochner #define LE_MODE_DRTY 0x0020 /* disable retry */
564 1.1 drochner #define LE_MODE_COLL 0x0010 /* force a collision */
565 1.1 drochner #define LE_MODE_DTCR 0x0008 /* disable transmit CRC */
566 1.1 drochner #define LE_MODE_LOOP 0x0004 /* loopback mode */
567 1.1 drochner #define LE_MODE_DTX 0x0002 /* disable transmitter */
568 1.1 drochner #define LE_MODE_DRX 0x0001 /* disable receiver */
569 1.1 drochner #define LE_MODE_NORMAL 0 /* none of the above */
570 1.4 thorpej
571 1.4 thorpej /*
572 1.4 thorpej * Chip ID (CSR88 IDL, CSR89 IDU) values for various AMD PCnet parts.
573 1.4 thorpej */
574 1.4 thorpej #define CHIPID_MANFID(x) (((x) >> 1) & 0x3ff)
575 1.4 thorpej #define CHIPID_PARTID(x) (((x) >> 12) & 0xffff)
576 1.4 thorpej #define CHIPID_VER(x) (((x) >> 28) & 0x7)
577 1.4 thorpej
578 1.4 thorpej #define PARTID_Am79c960 0x0003
579 1.4 thorpej #deifne PARTID_Am79c961 0x2260
580 1.4 thorpej #define PARTID_Am79c961A 0x2261
581 1.4 thorpej #define PARTID_Am79c965 0x2430
582 1.4 thorpej #define PARTID_Am79c970 0x0242
583 1.4 thorpej #define PARTID_Am79c970A 0x2621
584 1.4 thorpej #define PARTID_Am79c971 0x2623
585 1.4 thorpej #define PARTID_Am79c972 0x2624
586 1.4 thorpej #define PARTID_Am79c973 0x2625
587 1.4 thorpej #define PARTID_Am79c978 0x2626
588 1.4 thorpej #define PARTID_Am79c975 0x2627
589 1.4 thorpej #define PARTID_Am79c976 0x2628
590