tulipreg.h revision 1.20 1 /* $NetBSD: tulipreg.h,v 1.20 2000/05/25 22:50:11 thorpej Exp $ */
2
3 /*-
4 * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40 #ifndef _DEV_IC_TULIPREG_H_
41 #define _DEV_IC_TULIPREG_H_
42
43 /*
44 * Register description for the Digital Semiconductor ``Tulip'' (21x4x)
45 * Ethernet controller family, and a variety of clone chips, including:
46 *
47 * - Macronix 98713, 98713A, 98715, 98715A, 98725 (PMAC):
48 *
49 * These chips are fairly straight-forward Tulip clones.
50 * The 98713 is a very close 21140A clone. It has GPR
51 * and MII media, and a GPIO facility, and uses the ISV
52 * SROM format (or, at least, should, because of the GPIO
53 * facility). The 98713A has MII, no GPIO facility, and
54 * an internal NWay block. The 98715, 98715A, and 98725
55 * have only GPR media and the NWay block. The 98715,
56 * 98715A, and 98725 support power management.
57 *
58 * - Lite-On 82C115 (PNIC II):
59 *
60 * A clone of the Macronix MX98725, with the following differences:
61 *
62 * - Wake-On-LAN support
63 * - 128-bit multicast hash table rather than the
64 * standard 512-bit hash table
65 * - 802.3x flow control
66 *
67 * - Lite-On 82C168, 82C169 (PNIC):
68 *
69 * Pretty close, with only a few minor differences:
70 *
71 * - EEPROM is accessed completely differently.
72 * - MII is accessed completely differently.
73 * - No SIO facility (due to the above two differences).
74 * - GPIO interface is different than the 21140's.
75 * - Boards that lack PHYs use the internal NWay block
76 * and transciever.
77 *
78 * - Winbond 89C840F
79 *
80 * Less similar, but still roughly compatible (enough so
81 * that the driver can be adapted, at least):
82 *
83 * - Registers lack the pad word between them.
84 * - Instead of a setup frame, there are two station
85 * address registers and two multicast hash table
86 * registers (64-bit multicast hash table).
87 * - Only supported media interface is MII-over-SIO.
88 * - Different OPMODE register bits for various things
89 * (mostly media related).
90 *
91 * - ADMtek AL981
92 *
93 * Another pretty-close clone:
94 *
95 * - Wake-On-LAN support
96 * - Instead of a setup frame, there are two station
97 * address registers and two multicast hash table
98 * registers (64-bit multicast hash table).
99 * - 802.3x flow control
100 * - Only supported media interface is built-in PHY
101 * which is accessed through a set of special registers.
102 * - Not all registers have the pad word between them,
103 * but luckily, there are all AL981-specific registers,
104 * so this is easy to deal with.
105 *
106 * - Xircom X3201-3
107 *
108 * CardBus 21143 clone, with a few differences:
109 *
110 * - No MicroWire SROM; Ethernet address must come
111 * from CIS.
112 * - Transmit buffers must also be 32-bit aligned.
113 * - The BUSMODE_SWR bit is not self-clearing.
114 * - Must include FS|LS in setup packet descriptor.
115 * - SIA is not 21143-like, and all media attachments
116 * are MII-on-SIO.
117 *
118 * - Davicom DM9102 and DM9102A
119 *
120 * Pretty similar to the 21140A, with a few differences:
121 *
122 * - Wake-On-LAN support
123 * - DM9102 has built-in 10/100 PHY on MII interface.
124 * - DM9102A has built-in 10/100 PHY on MII interface,
125 * as well as a HomePNA 1 PHY on an alternate MII
126 * interface (selected by clearing OPMODE_PS).
127 * - The chip has a bug in the transmit DMA logic,
128 * requiring that the packet be comprised of only
129 * one DMA segment.
130 * - The bus interface is buggy, and the BUSMODE register
131 * must be initialized to 0.
132 * - There seems to be an interrupt logic bug, requiring
133 * that interrupts be disabled on the chip during the
134 * interrupt handler.
135 *
136 * Some of the clone chips have different registers, and some have
137 * different bits in the same registers. These will be denoted by
138 * PMAC, PNICII, PNIC, DM, WINB, and ADM in the register/bit names.
139 */
140
141 /*
142 * Tulip buffer descriptor. Must be 4-byte aligned.
143 *
144 * Note for receive descriptors, the byte count fields must
145 * be a multiple of 4.
146 */
147 struct tulip_desc {
148 __volatile u_int32_t td_status; /* Status */
149 __volatile u_int32_t td_ctl; /* Control and Byte Counts */
150 __volatile u_int32_t td_bufaddr1; /* Buffer Address 1 */
151 __volatile u_int32_t td_bufaddr2; /* Buffer Address 2 */
152 };
153
154 /*
155 * Descriptor Status bits common to transmit and receive.
156 */
157 #define TDSTAT_OWN 0x80000000 /* Tulip owns descriptor */
158 #define TDSTAT_ES 0x00008000 /* Error Summary */
159
160 /*
161 * Descriptor Status bits for Receive Descriptor.
162 */
163 #define TDSTAT_Rx_FF 0x40000000 /* Filtering Fail */
164 #define TDSTAT_WINB_Rx_RCMP 0x40000000 /* Receive Complete */
165 #define TDSTAT_Rx_FL 0x3fff0000 /* Frame Length including CRC */
166 #define TDSTAT_Rx_DE 0x00004000 /* Descriptor Error */
167 #define TDSTAT_Rx_DT 0x00003000 /* Data Type */
168 #define TDSTAT_Rx_RF 0x00000800 /* Runt Frame */
169 #define TDSTAT_Rx_MF 0x00000400 /* Multicast Frame */
170 #define TDSTAT_Rx_FS 0x00000200 /* First Descriptor */
171 #define TDSTAT_Rx_LS 0x00000100 /* Last Descriptor */
172 #define TDSTAT_Rx_TL 0x00000080 /* Frame Too Long */
173 #define TDSTAT_Rx_CS 0x00000040 /* Collision Seen */
174 #define TDSTAT_Rx_RT 0x00000020 /* Frame Type */
175 #define TDSTAT_Rx_RW 0x00000010 /* Receive Watchdog */
176 #define TDSTAT_Rx_RE 0x00000008 /* Report on MII Error */
177 #define TDSTAT_Rx_DB 0x00000004 /* Dribbling Bit */
178 #define TDSTAT_Rx_CE 0x00000002 /* CRC Error */
179 #define TDSTAT_Rx_ZER 0x00000001 /* Zero (always 0) */
180
181 #define TDSTAT_Rx_LENGTH(x) (((x) & TDSTAT_Rx_FL) >> 16)
182
183 #define TDSTAT_Rx_DT_SR 0x00000000 /* Serial Received Frame */
184 #define TDSTAT_Rx_DT_IL 0x00001000 /* Internal Loopback Frame */
185 #define TDSTAT_Rx_DT_EL 0x00002000 /* External Loopback Frame */
186 #define TDSTAT_Rx_DT_r 0x00003000 /* Reserved */
187
188 /*
189 * Descriptor Status bits for Transmit Descriptor.
190 */
191 #define TDSTAT_WINB_Tx_TE 0x00008000 /* Transmit Error */
192 #define TDSTAT_Tx_TO 0x00004000 /* Transmit Jabber Timeout */
193 #define TDSTAT_Tx_LO 0x00000800 /* Loss of Carrier */
194 #define TDSTAT_Tx_NC 0x00000400 /* No Carrier */
195 #define TDSTAT_Tx_LC 0x00000200 /* Late Collision */
196 #define TDSTAT_Tx_EC 0x00000100 /* Excessive Collisions */
197 #define TDSTAT_Tx_HF 0x00000080 /* Heartbeat Fail */
198 #define TDSTAT_Tx_CC 0x00000078 /* Collision Count */
199 #define TDSTAT_Tx_LF 0x00000004 /* Link Fail */
200 #define TDSTAT_Tx_UF 0x00000002 /* Underflow Error */
201 #define TDSTAT_Tx_DE 0x00000001 /* Deferred */
202
203 #define TDSTAT_Tx_COLLISIONS(x) (((x) & TDSTAT_Tx_CC) >> 3)
204
205 /*
206 * Descriptor Control bits common to transmit and receive.
207 */
208 #define TDCTL_SIZE1 0x000007ff /* Size of buffer 1 */
209 #define TDCTL_SIZE1_SHIFT 0
210
211 #define TDCTL_SIZE2 0x003ff800 /* Size of buffer 2 */
212 #define TDCTL_SIZE2_SHIFT 11
213
214 #define TDCTL_ER 0x02000000 /* End of Ring */
215 #define TDCTL_CH 0x01000000 /* Second Address Chained */
216
217 /*
218 * Descriptor Control bits for Transmit Descriptor.
219 */
220 #define TDCTL_Tx_IC 0x80000000 /* Interrupt on Completion */
221 #define TDCTL_Tx_LS 0x40000000 /* Last Segment */
222 #define TDCTL_Tx_FS 0x20000000 /* First Segment */
223 #define TDCTL_Tx_FT1 0x10000000 /* Filtering Type 1 */
224 #define TDCTL_Tx_SET 0x08000000 /* Setup Packet */
225 #define TDCTL_Tx_AC 0x04000000 /* Add CRC Disable */
226 #define TDCTL_Tx_DPD 0x00800000 /* Disabled Padding */
227 #define TDCTL_Tx_FT0 0x00400000 /* Filtering Type 0 */
228
229 /*
230 * The Tulip filter is programmed by "transmitting" a Setup Packet
231 * (indicated by TDCTL_Tx_SET). The filtering type is indicated
232 * as follows:
233 *
234 * FT1 FT0 Description
235 * --- --- -----------
236 * 0 0 Perfect Filtering: The Tulip interprets the
237 * descriptor buffer as a table of 16 MAC addresses
238 * that the Tulip should receive.
239 *
240 * 0 1 Hash Filtering: The Tulip interprets the
241 * descriptor buffer as a 512-bit hash table
242 * plus one perfect address. If the incoming
243 * address is Multicast, the hash table filters
244 * the address, else the address is filtered by
245 * the perfect address.
246 *
247 * 1 0 Inverse Filtering: Like Perfect Filtering, except
248 * the table is addresses that the Tulip does NOT
249 * receive.
250 *
251 * 1 1 Hash-only Filtering: Like Hash Filtering, but
252 * physical addresses are matched by the hash table
253 * as well, and not by matching a single perfect
254 * address.
255 *
256 * A Setup Packet must always be 192 bytes long. The Tulip can store
257 * 16 MAC addresses. If not all 16 are specified in Perfect Filtering
258 * or Inverse Filtering mode, then unused entries should duplicate
259 * one of the valid entries.
260 */
261 #define TDCTL_Tx_FT_PERFECT 0
262 #define TDCTL_Tx_FT_HASH TDCTL_Tx_FT0
263 #define TDCTL_Tx_FT_INVERSE TDCTL_Tx_FT1
264 #define TDCTL_Tx_FT_HASHONLY (TDCTL_Tx_FT1|TDCTL_Tx_FT0)
265
266 #define TULIP_SETUP_PACKET_LEN 192
267 #define TULIP_MAXADDRS 16
268 #define TULIP_MCHASHSIZE 512
269 #define TULIP_PNICII_HASHSIZE 128
270
271 /*
272 * Maximum size of a Tulip Ethernet Address ROM or SROM.
273 */
274 #define TULIP_ROM_SIZE(bits) (2 << (bits))
275 #define TULIP_MAX_ROM_SIZE 512
276
277 /*
278 * Format of the standard Tulip SROM information:
279 *
280 * Byte offset Size Usage
281 * 0 18 reserved
282 * 18 1 SROM Format Version
283 * 19 1 Chip Count
284 * 20 6 IEEE Network Address
285 * 26 1 Chip 0 Device Number
286 * 27 2 Chip 0 Info Leaf Offset
287 * 29 1 Chip 1 Device Number
288 * 30 2 Chip 1 Info Leaf Offset
289 * 32 1 Chip 2 Device Number
290 * 33 2 Chip 2 Info Leaf Offset
291 * ... 1 Chip n Device Number
292 * ... 2 Chip n Info Leaf Offset
293 * ... ... ...
294 * Chip Info Leaf Information
295 * ...
296 * ...
297 * ...
298 * 126 2 CRC32 checksum
299 */
300 #define TULIP_ROM_SROM_FORMAT_VERION 18 /* B */
301 #define TULIP_ROM_CHIP_COUNT 19 /* B */
302 #define TULIP_ROM_IEEE_NETWORK_ADDRESS 20
303 #define TULIP_ROM_CHIPn_DEVICE_NUMBER(n) (26 + ((n) * 3))/* B */
304 #define TULIP_ROM_CHIPn_INFO_LEAF_OFFSET(n) (27 + ((n) * 3))/* W */
305 #define TULIP_ROM_CRC32_CHECKSUM 126 /* W */
306 #define TULIP_ROM_CRC32_CHECKSUM1 94 /* W */
307
308 #define TULIP_ROM_IL_SELECT_CONN_TYPE 0 /* W */
309 #define TULIP_ROM_IL_MEDIA_COUNT 2 /* B */
310 #define TULIP_ROM_IL_MEDIAn_BLOCK_BASE 3
311
312 #define SELECT_CONN_TYPE_TP 0x0000
313 #define SELECT_CONN_TYPE_BNC 0x0001
314 #define SELECT_CONN_TYPE_AUI 0x0002
315 #define SELECT_CONN_TYPE_100TX 0x0003
316 #define SELECT_CONN_TYPE_100T4 0x0006
317 #define SELECT_CONN_TYPE_100FX 0x0007
318 #define SELECT_CONN_TYPE MII_10T 0x0009
319 #define SELECT_CONN_TYPE_MII_100TX 0x000d
320 #define SELECT_CONN_TYPE_MII_100T4 0x000f
321 #define SELECT_CONN_TYPE_MII_100FX 0x0010
322 #define SELECT_CONN_TYPE_TP_AUTONEG 0x0100
323 #define SELECT_CONN_TYPE_TP_FDX 0x0204
324 #define SELECT_CONN_TYPE_MII_10T_FDX 0x020a
325 #define SELECT_CONN_TYPE_100TX_FDX 0x020e
326 #define SELECT_CONN_TYPE_MII_100TX_FDX 0x0211
327 #define SELECT_CONN_TYPE_TP_NOLINKPASS 0x0400
328 #define SELECT_CONN_TYPE_ASENSE 0x0800
329 #define SELECT_CONN_TYPE_ASENSE_POWERUP 0x8800
330 #define SELECT_CONN_TYPE_ASENSE_AUTONEG 0x0900
331
332 #define TULIP_ROM_MB_MEDIA_CODE 0x3f
333 #define TULIP_ROM_MB_MEDIA_TP 0x00
334 #define TULIP_ROM_MB_MEDIA_BNC 0x01
335 #define TULIP_ROM_MB_MEDIA_AUI 0x02
336 #define TULIP_ROM_MB_MEDIA_100TX 0x03
337 #define TULIP_ROM_MB_MEDIA_TP_FDX 0x04
338 #define TULIP_ROM_MB_MEDIA_100TX_FDX 0x05
339 #define TULIP_ROM_MB_MEDIA_100T4 0x06
340 #define TULIP_ROM_MB_MEDIA_100FX 0x07
341 #define TULIP_ROM_MB_MEDIA_100FX_FDX 0x08
342
343 #define TULIP_ROM_MB_EXT 0x40
344
345 #define TULIP_ROM_MB_CSR13 1 /* W */
346 #define TULIP_ROM_MB_CSR14 3 /* W */
347 #define TULIP_ROM_MB_CSR15 5 /* W */
348
349 #define TULIP_ROM_MB_SIZE(mc) (((mc) & TULIP_ROM_MB_EXT) ? 7 : 1)
350
351 #define TULIP_ROM_MB_NOINDICATOR 0x8000
352 #define TULIP_ROM_MB_DEFAULT 0x4000
353 #define TULIP_ROM_MB_POLARITY 0x0080
354 #define TULIP_ROM_MB_OPMODE(x) (((x) & 0x71) << 18)
355 #define TULIP_ROM_MB_BITPOS(x) (1 << (((x) & 0x0e) >> 1))
356
357 #define TULIP_ROM_MB_21140_GPR 0 /* 21140[A] GPR block */
358 #define TULIP_ROM_MB_21140_MII 1 /* 21140[A] MII block */
359 #define TULIP_ROM_MB_21142_SIA 2 /* 2114[23] SIA block */
360 #define TULIP_ROM_MB_21142_MII 3 /* 2114[23] MII block */
361 #define TULIP_ROM_MB_21143_SYM 4 /* 21143 SYM block */
362 #define TULIP_ROM_MB_21143_RESET 5 /* 21143 reset block */
363
364 #define TULIP_ROM_GETW(data, off) ((data)[(off)] | ((data)[(off) + 1]) << 8)
365
366 /*
367 * Tulip control registers.
368 */
369
370 #define TULIP_CSR0 0x00
371 #define TULIP_CSR1 0x08
372 #define TULIP_CSR2 0x10
373 #define TULIP_CSR3 0x18
374 #define TULIP_CSR4 0x20
375 #define TULIP_CSR5 0x28
376 #define TULIP_CSR6 0x30
377 #define TULIP_CSR7 0x38
378 #define TULIP_CSR8 0x40
379 #define TULIP_CSR9 0x48
380 #define TULIP_CSR10 0x50
381 #define TULIP_CSR11 0x58
382 #define TULIP_CSR12 0x60
383 #define TULIP_CSR13 0x68
384 #define TULIP_CSR14 0x70
385 #define TULIP_CSR15 0x78
386 #define TULIP_CSR16 0x80
387 #define TULIP_CSR17 0x88
388 #define TULIP_CSR18 0x90
389 #define TULIP_CSR19 0x98
390 #define TULIP_CSR20 0xa0
391 #define TULIP_CSR21 0xa8
392 #define TULIP_CSR22 0xb0
393 #define TULIP_CSR23 0xb8
394 #define TULIP_CSR24 0xc0
395 #define TULIP_CSR25 0xc8
396 #define TULIP_CSR26 0xd0
397 #define TULIP_CSR27 0xd8
398 #define TULIP_CSR28 0xe0
399 #define TULIP_CSR29 0xe8
400 #define TULIP_CSR30 0xf0
401 #define TULIP_CSR31 0xf8
402
403 #define TULIP_CSR_INDEX(csr) ((csr) >> 3)
404
405 /* CSR0 - Bus Mode */
406 #define CSR_BUSMODE TULIP_CSR0
407 #define BUSMODE_SWR 0x00000001 /* software reset */
408 #define BUSMODE_BAR 0x00000002 /* bus arbitration */
409 #define BUSMODE_DSL 0x0000007c /* descriptor skip length */
410 #define BUSMODE_BLE 0x00000080 /* big endian */
411 /* programmable burst length */
412 #define BUSMODE_PBL_DEFAULT 0x00000000 /* default value */
413 #define BUSMODE_PBL_1LW 0x00000100 /* 1 longword */
414 #define BUSMODE_PBL_2LW 0x00000200 /* 2 longwords */
415 #define BUSMODE_PBL_4LW 0x00000400 /* 4 longwords */
416 #define BUSMODE_PBL_8LW 0x00000800 /* 8 longwords */
417 #define BUSMODE_PBL_16LW 0x00001000 /* 16 longwords */
418 #define BUSMODE_PBL_32LW 0x00002000 /* 32 longwords */
419 /* cache alignment */
420 #define BUSMODE_CAL_NONE 0x00000000 /* no alignment */
421 #define BUSMODE_CAL_8LW 0x00004000 /* 8 longwords */
422 #define BUSMODE_CAL_16LW 0x00008000 /* 16 longwords */
423 #define BUSMODE_CAL_32LW 0x0000c000 /* 32 longwords */
424 #define BUSMODE_DAS 0x00010000 /* diagnostic address space */
425 /* must be zero on most */
426 /* transmit auto-poll */
427 /*
428 * Transmit auto-polling not supported on:
429 * Winbond 89C040F
430 * Xircom X3201-3
431 * Davicom DM9102 (buggy BUSMODE register)
432 */
433 #define BUSMODE_TAP_NONE 0x00000000 /* no auto-polling */
434 #define BUSMODE_TAP_200us 0x00020000 /* 200 uS */
435 #define BUSMODE_TAP_800us 0x00040000 /* 400 uS */
436 #define BUSMODE_TAP_1_6ms 0x00060000 /* 1.6 mS */
437 #define BUSMODE_TAP_12_8us 0x00080000 /* 12.8 uS (21041+) */
438 #define BUSMODE_TAP_25_6us 0x000a0000 /* 25.6 uS (21041+) */
439 #define BUSMODE_TAP_51_2us 0x000c0000 /* 51.2 uS (21041+) */
440 #define BUSMODE_TAP_102_4us 0x000e0000 /* 102.4 uS (21041+) */
441 #define BUSMODE_DBO 0x00100000 /* desc-only b/e (21041+) */
442 #define BUSMODE_RME 0x00200000 /* rd/mult enab (21140+) */
443 #define BUSMODE_WINB_WAIT 0x00200000 /* wait state insertion */
444 #define BUSMODE_RLE 0x00800000 /* rd/line enab (21140+) */
445 #define BUSMODE_WLE 0x01000000 /* wt/line enab (21140+) */
446 #define BUSMODE_PNIC_MBO 0x04000000 /* magic `must be one' bit */
447 /* on Lite-On PNIC */
448
449
450 /* CSR1 - Transmit Poll Demand */
451 #define CSR_TXPOLL TULIP_CSR1
452 #define TXPOLL_TPD 0x00000001 /* transmit poll demand */
453
454
455 /* CSR2 - Receive Poll Demand */
456 #define CSR_RXPOLL TULIP_CSR2
457 #define RXPOLL_RPD 0x00000001 /* receive poll demand */
458
459
460 /* CSR3 - Receive List Base Address */
461 #define CSR_RXLIST TULIP_CSR3
462
463 /* CSR4 - Transmit List Base Address */
464 #define CSR_TXLIST TULIP_CSR4
465
466 /* CSR5 - Status */
467 #define CSR_STATUS TULIP_CSR5
468 #define STATUS_TI 0x00000001 /* transmit interrupt */
469 #define STATUS_TPS 0x00000002 /* transmit process stopped */
470 #define STATUS_TU 0x00000004 /* transmit buffer unavail */
471 #define STATUS_TJT 0x00000008 /* transmit jabber timeout */
472 #define STATUS_WINB_REI 0x00000008 /* receive early interrupt */
473 #define STATUS_LNPANC 0x00000010 /* link pass (21041) */
474 #define STATUS_WINB_RERR 0x00000010 /* receive error */
475 #define STATUS_UNF 0x00000020 /* transmit underflow */
476 #define STATUS_RI 0x00000040 /* receive interrupt */
477 #define STATUS_RU 0x00000080 /* receive buffer unavail */
478 #define STATUS_RPS 0x00000100 /* receive process stopped */
479 #define STATUS_RWT 0x00000200 /* receive watchdog timeout */
480 #define STATUS_AT 0x00000400 /* SIA AUI/TP pin changed
481 (21040) */
482 #define STATUS_ETI 0x00000400 /* early transmit interrupt
483 (21142/PMAC/Winbond) */
484 #define STATUS_FD 0x00000800 /* full duplex short frame
485 received (21040) */
486 #define STATUS_TM 0x00000800 /* timer expired (21041) */
487 #define STATUS_LNF 0x00001000 /* link fail (21040) */
488 #define STATUS_SE 0x00002000 /* system error */
489 #define STATUS_ER 0x00004000 /* early receive (21041) */
490 #define STATUS_AIS 0x00008000 /* abnormal interrupt summary */
491 #define STATUS_NIS 0x00010000 /* normal interrupt summary */
492 #define STATUS_RS 0x000e0000 /* receive process state */
493 #define STATUS_RS_STOPPED 0x00000000 /* Stopped */
494 #define STATUS_RS_FETCH 0x00020000 /* Running - fetch receive
495 descriptor */
496 #define STATUS_RS_CHECK 0x00040000 /* Running - check for end
497 of receive */
498 #define STATUS_RS_WAIT 0x00060000 /* Running - wait for packet */
499 #define STATUS_RS_SUSPENDED 0x00080000 /* Suspended */
500 #define STATUS_RS_CLOSE 0x000a0000 /* Running - close receive
501 descriptor */
502 #define STATUS_RS_FLUSH 0x000c0000 /* Running - flush current
503 frame from FIFO */
504 #define STATUS_RS_QUEUE 0x000e0000 /* Running - queue current
505 frame from FIFO into
506 buffer */
507 #define STATUS_DM_RS_STOPPED 0x00000000 /* Stopped */
508 #define STATUS_DM_RS_FETCH 0x00020000 /* Running - fetch receive
509 descriptor */
510 #define STATUS_DM_RS_WAIT 0x00040000 /* Running - wait for packet */
511 #define STATUS_DM_RS_QUEUE 0x00060000 /* Running - queue current
512 frame from FIFO into
513 buffer */
514 #define STATUS_DM_RS_CLOSE_OWN 0x00080000 /* Running - close receive
515 descriptor, clear own */
516 #define STATUS_DM_RS_CLOSE_ST 0x000a0000 /* Running - close receive
517 descriptor, write status */
518 #define STATUS_DM_RS_SUSPENDED 0x000c0000 /* Suspended */
519 #define STATUS_DM_RS_FLUSH 0x000e0000 /* Running - flush current
520 frame from FIFO */
521 #define STATUS_TS 0x00700000 /* transmit process state */
522 #define STATUS_TS_STOPPED 0x00000000 /* Stopped */
523 #define STATUS_TS_FETCH 0x00100000 /* Running - fetch transmit
524 descriptor */
525 #define STATUS_TS_WAIT 0x00200000 /* Running - wait for end
526 of transmission */
527 #define STATUS_TS_READING 0x00300000 /* Running - read buffer from
528 memory and queue into
529 FIFO */
530 #define STATUS_TS_RESERVED 0x00400000 /* RESERVED */
531 #define STATUS_TS_SETUP 0x00500000 /* Running - Setup packet */
532 #define STATUS_TS_SUSPENDED 0x00600000 /* Suspended */
533 #define STATUS_TS_CLOSE 0x00700000 /* Running - close transmit
534 descriptor */
535 #define STATUS_DM_TS_STOPPED 0x00000000 /* Stopped */
536 #define STATUS_DM_TS_FETCH 0x00100000 /* Running - fetch transmit
537 descriptor */
538 #define STATUS_DM_TS_SETUP 0x00200000 /* Running - Setup packet */
539 #define STATUS_DM_TS_READING 0x00300000 /* Running - read buffer from
540 memory and queue into
541 FIFO */
542 #define STATUS_DM_TS_CLOSE_OWN 0x00400000 /* Running - close transmit
543 descriptor, clear own */
544 #define STATUS_DM_TS_WAIT 0x00500000 /* Running - wait for end
545 of transmission */
546 #define STATUS_DM_TS_CLOSE_ST 0x00600000 /* Running - close transmit
547 descriptor, write status */
548 #define STATUS_DM_TS_SUSPENDED 0x00700000 /* Suspended */
549 #define STATUS_EB 0x03800000 /* error bits */
550 #define STATUS_EB_PARITY 0x00000000 /* parity errror */
551 #define STATUS_EB_MABT 0x00800000 /* master abort */
552 #define STATUS_EB_TABT 0x01000000 /* target abort */
553 #define STATUS_GPPI 0x04000000 /* GPIO interrupt (21142) */
554 #define STATUS_PNIC_TXABORT 0x04000000 /* transmit aborted */
555 #define STATUS_LC 0x08000000 /* 100baseTX link change
556 (21142/PMAC) */
557 #define STATUS_PMAC_WKUPI 0x10000000 /* wake up event */
558 #define STATUS_X3201_PMEIS 0x10000000 /* power management event
559 interrupt summary */
560 #define STATUS_X3201_SFIS 0x80000000 /* second function (Modem)
561 interrupt status */
562
563
564 /* CSR6 - Operation Mode */
565 #define CSR_OPMODE TULIP_CSR6
566 #define OPMODE_HP 0x00000001 /* hash/perfect mode (ro) */
567 #define OPMODE_SR 0x00000002 /* start receive */
568 #define OPMODE_HO 0x00000004 /* hash only mode (ro) */
569 #define OPMODE_PB 0x00000008 /* pass bad frames */
570 #define OPMODE_WINB_APP 0x00000008 /* accept all physcal packet */
571 #define OPMODE_IF 0x00000010 /* inverse filter mode (ro) */
572 #define OPMODE_WINB_AMP 0x00000010 /* accept multicast packet */
573 #define OPMODE_SB 0x00000020 /* start backoff counter */
574 #define OPMODE_WINB_ABP 0x00000020 /* accept broadcast packet */
575 #define OPMODE_PR 0x00000040 /* promiscuous mode */
576 #define OPMODE_WINB_ARP 0x00000040 /* accept runt packet */
577 #define OPMODE_PM 0x00000080 /* pass all multicast */
578 #define OPMODE_WINB_AEP 0x00000080 /* accept error packet */
579 #define OPMODE_FKD 0x00000100 /* flaky oscillator disable */
580 #define OPMODE_FD 0x00000200 /* full-duplex mode */
581 #define OPMODE_OM 0x00000c00 /* operating mode */
582 #define OPMODE_OM_NORMAL 0x00000000 /* normal mode */
583 #define OPMODE_OM_INTLOOP 0x00000400 /* internal loopback */
584 #define OPMODE_OM_EXTLOOP 0x00000800 /* external loopback */
585 #define OPMODE_FC 0x00001000 /* force collision */
586 #define OPMODE_ST 0x00002000 /* start transmitter */
587 #define OPMODE_TR 0x0000c000 /* threshold control */
588 #define OPMODE_TR_72 0x00000000 /* 72 bytes */
589 #define OPMODE_TR_96 0x00004000 /* 96 bytes */
590 #define OPMODE_TR_128 0x00008000 /* 128 bytes */
591 #define OPMODE_TR_160 0x0000c000 /* 160 bytes */
592 #define OPMODE_WINB_TTH 0x001fc000 /* transmit threshold */
593 #define OPMODE_WINB_TTH_SHIFT 14
594 #define OPMODE_BP 0x00010000 /* backpressure enable */
595 #define OPMODE_CA 0x00020000 /* capture effect enable */
596 #define OPMODE_PNIC_TBEN 0x00020000 /* Tx backoff offset enable */
597 /*
598 * On Davicom DM9102, OPMODE_PS and OPMODE_HBD must
599 * always be set.
600 */
601 #define OPMODE_PS 0x00040000 /* port select:
602 1 = MII/SYM, 0 = SRL
603 (21140) */
604 #define OPMODE_HBD 0x00080000 /* heartbeat disable:
605 set in MII/SYM 100mbps,
606 set according to PHY
607 in MII 10mbps mode
608 (21140) */
609 #define OPMODE_PNIC_IT 0x00100000 /* immediate transmit */
610 #define OPMODE_SF 0x00200000 /* store and forward mode
611 (21140) */
612 #define OPMODE_WINB_REIT 0x1fe00000 /* receive eartly intr thresh */
613 #define OPMODE_WINB_REIT_SHIFT 21
614 #define OPMODE_TTM 0x00400000 /* Transmit Threshold Mode:
615 1 = 10mbps, 0 = 100mbps
616 (21140) */
617 #define OPMODE_PCS 0x00800000 /* PCS function (21140) */
618 #define OPMODE_SCR 0x01000000 /* scrambler mode (21140) */
619 #define OPMODE_MBO 0x02000000 /* must be one (21140,
620 DM9102) */
621 #define OPMODE_IDAMSB 0x04000000 /* ignore dest addr MSB
622 (21142) */
623 #define OPMODE_PNIC_DRC 0x20000000 /* don't include CRC in Rx
624 frames (PNIC) */
625 #define OPMODE_WINB_FES 0x20000000 /* fast ethernet select */
626 #define OPMODE_RA 0x40000000 /* receive all (21140) */
627 #define OPMODE_PNIC_EED 0x40000000 /* 1 == ext, 0 == int ENDEC
628 (PNIC) */
629 #define OPMODE_WINB_TEIO 0x40000000 /* transmit early intr on */
630 #define OPMODE_SC 0x80000000 /* special capture effect
631 enable (21041+) */
632 #define OPMODE_WINB_REIO 0x80000000 /* receive early intr on */
633
634 /* Shorthand for media-related OPMODE bits */
635 #define OPMODE_MEDIA_BITS (OPMODE_FD|OPMODE_PS|OPMODE_PCS|OPMODE_SCR)
636
637 /* CSR7 - Interrupt Enable */
638 #define CSR_INTEN TULIP_CSR7
639 /* See bits for CSR5 -- Status */
640
641
642 /* CSR8 - Missed Frames */
643 #define CSR_MISSED TULIP_CSR8
644 #define MISSED_MFC 0x0000ffff /* missed packet count */
645 #define MISSED_MFO 0x00010000 /* missed packet count
646 overflowed */
647 #define MISSED_FOC 0x0ffe0000 /* fifo overflow counter
648 (21140) */
649 #define MISSED_OCO 0x10000000 /* overflow counter overflowed
650 (21140) */
651
652 #define MISSED_GETMFC(x) ((x) & MISSED_MFC)
653 #define MISSED_GETFOC(x) (((x) & MISSED_FOC) >> 17)
654
655
656 /* CSR9 - MII, SROM, Boot ROM, Ethernet Address ROM register. */
657 #define CSR_MIIROM TULIP_CSR9
658 #define MIIROM_DATA 0x000000ff /* byte of data from
659 Ethernet Address ROM
660 (21040), byte of data
661 to/from Boot ROM (21041+) */
662 #define MIIROM_SROMCS 0x00000001 /* SROM chip select */
663 #define MIIROM_SROMSK 0x00000002 /* SROM clock */
664 #define MIIROM_SROMDI 0x00000004 /* SROM data in (to) */
665 #define MIIROM_SROMDO 0x00000008 /* SROM data out (from) */
666 #define MIIROM_REG 0x00000400 /* external register select */
667 #define MIIROM_SR 0x00000800 /* SROM select */
668 #define MIIROM_BR 0x00001000 /* boot ROM select */
669 #define MIIROM_WR 0x00002000 /* write to boot ROM */
670 #define MIIROM_RD 0x00004000 /* read from boot ROM */
671 #define MIIROM_MOD 0x00008000 /* mode select (ro) (21041) */
672 #define MIIROM_MDC 0x00010000 /* MII clock */
673 #define MIIROM_MDO 0x00020000 /* MII data out */
674 #define MIIROM_MIIDIR 0x00040000 /* MII direction mode
675 1 = PHY in read,
676 0 = PHY in write */
677 #define MIIROM_MDI 0x00080000 /* MII data in */
678 #define MIIROM_DN 0x80000000 /* data not valid (21040) */
679
680 #define MIIROM_PMAC_LED0SEL 0x10000000 /* 0 == LED0 activity (def)
681 1 == LED0 speed */
682 #define MIIROM_PMAC_LED1SEL 0x20000000 /* 0 == LED1 link (def)
683 1 == LED1 link/act */
684 #define MIIROM_PMAC_LED2SEL 0x40000000 /* 0 == LED2 speed (def)
685 1 == LED2 collision */
686 #define MIIROM_PMAC_LED3SEL 0x80000000 /* 0 == LED3 receive (def)
687 1 == LED3 full duplex */
688
689 /* SROM opcodes */
690 #define TULIP_SROM_OPC_ERASE 0x04
691 #define TULIP_SROM_OPC_WRITE 0x05
692 #define TULIP_SROM_OPC_READ 0x06
693
694 /* The Lite-On PNIC does this completely differently */
695 #define PNIC_MIIROM_DATA 0x0000ffff /* mask of data bits ??? */
696 #define PNIC_MIIROM_BUSY 0x80000000 /* EEPROM is busy */
697
698
699 /* CSR10 - Boot ROM address register (21041+). */
700 #define CSR_ROMADDR TULIP_CSR10
701 #define ROMADDR_MASK 0x000003ff /* boot rom address */
702
703
704 /* CSR11 - General Purpose Timer (21041+). */
705 #define CSR_GPT TULIP_CSR11
706 #define GPT_VALUE 0x0000ffff /* timer value */
707 #define GPT_CON 0x00010000 /* continuous mode */
708 /* 21143-PD and 21143-TD Interrupt Mitigation bits */
709 #define GPT_NRX 0x000e0000 /* number of Rx packets */
710 #define GPT_RXT 0x00f00000 /* Rx timer */
711 #define GPT_NTX 0x07000000 /* number of Tx packets */
712 #define GPT_TXT 0x78000000 /* Tx timer */
713 #define GPT_CYCLE 0x80000000 /* cycle size */
714
715
716 /* CSR12 - SIA Status Register. */
717 #define CSR_SIASTAT TULIP_CSR12
718 #define SIASTAT_PAUI 0x00000001 /* pin AUI/TP indication
719 (21040) */
720 #define SIASTAT_MRA 0x00000001 /* MII receive activity
721 (21142) */
722 #define SIASTAT_NCR 0x00000002 /* network connection error */
723 #define SIASTAT_LS100 0x00000002 /* 100baseT link status
724 0 == pass (21142) */
725 #define SIASTAT_LKF 0x00000004 /* link fail status */
726 #define SIASTAT_LS10 0x00000004 /* 10baseT link status
727 0 == pass (21142) */
728 #define SIASTAT_APS 0x00000008 /* auto polarity status */
729 #define SIASTAT_DSD 0x00000010 /* PLL self test done */
730 #define SIASTAT_DSP 0x00000020 /* PLL self test pass */
731 #define SIASTAT_DAZ 0x00000040 /* PLL all zero */
732 #define SIASTAT_DAO 0x00000080 /* PLL all one */
733 #define SIASTAT_SRA 0x00000100 /* selected port receive
734 activity (21041) */
735 #define SIASTAT_ARA 0x00000100 /* AUI receive activity
736 (21142) */
737 #define SIASTAT_NRA 0x00000200 /* non-selected port
738 receive activity (21041) */
739 #define SIASTAT_TRA 0x00000200 /* 10base-T receive activity
740 (21142) */
741 #define SIASTAT_NSN 0x00000400 /* non-stable NLPs detected
742 (21041) */
743 #define SIASTAT_TRF 0x00000800 /* transmit remote fault
744 (21041) */
745 #define SIASTAT_ANS 0x00007000 /* autonegotiation state
746 (21041) */
747 #define SIASTAT_ANS_DIS 0x00000000 /* disabled */
748 #define SIASTAT_ANS_TXDIS 0x00001000 /* transmit disabled */
749 #define SIASTAT_ANS_ABD 0x00002000 /* ability detect */
750 #define SIASTAT_ANS_ACKD 0x00003000 /* acknowledge detect */
751 #define SIASTAT_ANS_ACKC 0x00004000 /* complete acknowledge */
752 #define SIASTAT_ANS_FLPGOOD 0x00005000 /* FLP link good */
753 #define SIASTAT_ANS_LINKCHECK 0x00006000 /* link check */
754 #define SIASTAT_LPN 0x00008000 /* link partner negotiable
755 (21041) */
756 #define SIASTAT_LPC 0xffff0000 /* link partner code word */
757
758 #define SIASTAT_GETLPC(x) (((x) & SIASTAT_LPC) >> 16)
759
760
761 /* CSR13 - SIA Connectivity Register. */
762 #define CSR_SIACONN TULIP_CSR13
763 #define SIACONN_SRL 0x00000001 /* SIA reset
764 (0 == reset) */
765 #define SIACONN_PS 0x00000002 /* pin AUI/TP selection
766 (21040) */
767 #define SIACONN_CAC 0x00000004 /* CSR autoconfiguration */
768 #define SIACONN_AUI 0x00000008 /* select AUI (0 = TP) */
769 #define SIACONN_EDP 0x00000010 /* SIA PLL external input
770 enable (21040) */
771 #define SIACONN_ENI 0x00000020 /* encoder input multiplexer
772 (21040) */
773 #define SIACONN_SIM 0x00000040 /* serial interface input
774 multiplexer (21040) */
775 #define SIACONN_ASE 0x00000080 /* APLL start enable
776 (21040) */
777 #define SIACONN_SEL 0x00000f00 /* external port output
778 multiplexer select
779 (21040) */
780 #define SIACONN_IE 0x00001000 /* input enable (21040) */
781 #define SIACONN_OE1_3 0x00002000 /* output enable 1, 3
782 (21040) */
783 #define SIACONN_OE2_4 0x00004000 /* output enable 2, 4
784 (21040) */
785 #define SIACONN_OE5_6_7 0x00008000 /* output enable 5, 6, 7
786 (21040) */
787 #define SIACONN_SDM 0x0000ef00 /* SIA diagnostic mode;
788 always set to this value
789 for normal operation
790 (21041) */
791
792
793 /* CSR14 - SIA Transmit Receive Register. */
794 #define CSR_SIATXRX TULIP_CSR14
795 #define SIATXRX_ECEN 0x00000001 /* encoder enable */
796 #define SIATXRX_LBK 0x00000002 /* loopback enable */
797 #define SIATXRX_DREN 0x00000004 /* driver enable */
798 #define SIATXRX_LSE 0x00000008 /* link pulse send enable */
799 #define SIATXRX_CPEN 0x00000030 /* compensation enable */
800 #define SIATXRX_CPEN_DIS0 0x00000000 /* disabled */
801 #define SIATXRX_CPEN_DIS1 0x00000010 /* disabled */
802 #define SIATXRX_CPEN_HIGHPWR 0x00000020 /* high power */
803 #define SIATXRX_CPEN_NORMAL 0x00000030 /* normal */
804 #define SIATXRX_MBO 0x00000040 /* must be one (21041 pass 2) */
805 #define SIATXRX_TH 0x00000040 /* 10baseT HDX enable (21142) */
806 #define SIATXRX_ANE 0x00000080 /* autonegotiation enable
807 (21041/21142) */
808 #define SIATXRX_RSQ 0x00000100 /* receive squelch enable */
809 #define SIATXRX_CSQ 0x00000200 /* collision squelch enable */
810 #define SIATXRX_CLD 0x00000400 /* collision detect enable */
811 #define SIATXRX_SQE 0x00000800 /* signal quality generation
812 enable */
813 #define SIATXRX_LTE 0x00001000 /* link test enable */
814 #define SIATXRX_APE 0x00002000 /* auto-polarity enable */
815 #define SIATXRX_SPP 0x00004000 /* set plarity plus */
816 #define SIATXRX_TAS 0x00008000 /* 10base-T/AUI autosensing
817 enable (21041/21142) */
818 #define SIATXRX_THX 0x00010000 /* 100baseTX-HDX (21142) */
819 #define SIATXRX_TXF 0x00020000 /* 100baseTX-FDX (21142) */
820 #define SIATXRX_T4 0x00040000 /* 100baseT4 (21142) */
821
822
823 /* CSR15 - SIA General Register. */
824 #define CSR_SIAGEN TULIP_CSR15
825 #define SIAGEN_JBD 0x00000001 /* jabber disable */
826 #define SIAGEN_HUJ 0x00000002 /* host unjab */
827 #define SIAGEN_JCK 0x00000004 /* jabber clock */
828 #define SIAGEN_ABM 0x00000008 /* BNC select (21041) */
829 #define SIAGEN_RWD 0x00000010 /* receive watchdog disable */
830 #define SIAGEN_RWR 0x00000020 /* receive watchdog release */
831 #define SIAGEN_LE1 0x00000040 /* LED 1 enable (21041) */
832 #define SIAGEN_LV1 0x00000080 /* LED 1 value (21041) */
833 #define SIAGEN_TSCK 0x00000100 /* test clock */
834 #define SIAGEN_FUSQ 0x00000200 /* force unsquelch */
835 #define SIAGEN_FLF 0x00000400 /* force link fail */
836 #define SIAGEN_LSD 0x00000800 /* LED stretch disable
837 (21041) */
838 #define SIAGEN_LEE 0x00000800 /* Link extend enable (21142) */
839 #define SIAGEN_DPST 0x00001000 /* PLL self-test start */
840 #define SIAGEN_FRL 0x00002000 /* force receiver low */
841 #define SIAGEN_LE2 0x00004000 /* LED 2 enable (21041) */
842 #define SIAGEN_RMP 0x00004000 /* received magic packet
843 (21143) */
844 #define SIAGEN_LV2 0x00008000 /* LED 2 value (21041) */
845 #define SIAGEN_HCKR 0x00008000 /* hacker (21143) */
846 #define SIAGEN_MD 0x000f0000 /* general purpose mode/data */
847 #define SIAGEN_LGS0 0x00100000 /* LED/GEP 0 select */
848 #define SIAGEN_LGS1 0x00200000 /* LED/GEP 1 select */
849 #define SIAGEN_LGS2 0x00400000 /* LED/GEP 2 select */
850 #define SIAGEN_LGS3 0x00800000 /* LED/GEP 3 select */
851 #define SIAGEN_GEI0 0x01000000 /* GEP pin 0 intr enable */
852 #define SIAGEN_GEI1 0x02000000 /* GEP pin 1 intr enable */
853 #define SIAGEN_RME 0x04000000 /* receive match enable */
854 #define SIAGEN_CWE 0x08000000 /* control write enable */
855 #define SIAGEN_GI0 0x10000000 /* GEP pin 0 interrupt */
856 #define SIAGEN_GI1 0x20000000 /* GEP pin 1 interrupt */
857 #define SIAGEN_RMI 0x40000000 /* receive match interrupt */
858
859
860 /* CSR12 - General Purpose Port (21140+). */
861 #define CSR_GPP TULIP_CSR12
862 #define GPP_MD 0x000000ff /* general purpose mode/data */
863 #define GPP_GPC 0x00000100 /* general purpose control */
864 #define GPP_PNIC_GPD 0x0000000f /* general purpose data */
865 #define GPP_PNIC_GPC 0x000000f0 /* general purpose control */
866
867 #define GPP_PNIC_IN(x) (1 << (x))
868 #define GPP_PNIC_OUT(x, on) (((on) << (x)) | (1 << ((x) + 4)))
869
870 /*
871 * The Lite-On PNIC manual recommends the following for the General Purpose
872 * I/O pins:
873 *
874 * 0 Speed Relay 1 == 100mbps
875 * 1 100mbps loopback 1 == loopback
876 * 2 BNC DC-DC converter 1 == select BNC
877 * 3 Link 100 1 == 100baseTX link status
878 */
879 #define GPP_PNIC_PIN_SPEED_RLY 0
880 #define GPP_PNIC_PIN_100M_LPKB 1
881 #define GPP_PNIC_PIN_BNC_XMER 2
882 #define GPP_PNIC_PIN_LNK100X 3
883
884
885 /*
886 * Digital Semiconductor 21040 registers.
887 */
888
889 /* CSR11 - Full Duplex Register */
890 #define CSR_21040_FDX TULIP_CSR11
891 #define FDX21040_FDXACV 0x0000ffff /* full duplex
892 autoconfiguration value */
893
894
895 /* SIA configuration for 10base-T (from the 21040 manual) */
896 #define SIACONN_21040_10BASET 0x0000ef01
897 #define SIATXRX_21040_10BASET 0x0000ffff
898 #define SIAGEN_21040_10BASET 0x00000000
899
900
901 /* SIA configuration for 10base-T full-duplex (from the 21040 manual) */
902 #define SIACONN_21040_10BASET_FDX 0x0000ef01
903 #define SIATXRX_21040_10BASET_FDX 0x0000fffd
904 #define SIAGEN_21040_10BASET_FDX 0x00000000
905
906
907 /* SIA configuration for 10base-5 (from the 21040 manual) */
908 #define SIACONN_21040_AUI 0x0000ef09
909 #define SIATXRX_21040_AUI 0x00000705
910 #define SIAGEN_21040_AUI 0x00000006
911
912
913 /* SIA configuration for External SIA (from the 21040 manual) */
914 #define SIACONN_21040_EXTSIA 0x00003041
915 #define SIATXRX_21040_EXTSIA 0x00000000
916 #define SIAGEN_21040_EXTSIA 0x00000006
917
918
919 /*
920 * Digital Semiconductor 21041 registers.
921 */
922
923 /* SIA configuration for 10base-T (from the 21041 manual) */
924 #define SIACONN_21041_10BASET 0x0000ef01
925 #define SIATXRX_21041_10BASET 0x0000ff3f
926 #define SIAGEN_21041_10BASET 0x00000000
927
928 #define SIACONN_21041P2_10BASET SIACONN_21041_10BASET
929 #define SIATXRX_21041P2_10BASET 0x0000ffff
930 #define SIAGEN_21041P2_10BASET SIAGEN_21041_10BASET
931
932
933 /* SIA configuration for 10base-T full-duplex (from the 21041 manual) */
934 #define SIACONN_21041_10BASET_FDX 0x0000ef01
935 #define SIATXRX_21041_10BASET_FDX 0x0000ff3d
936 #define SIAGEN_21041_10BASET_FDX 0x00000000
937
938 #define SIACONN_21041P2_10BASET_FDX SIACONN_21041_10BASET_FDX
939 #define SIATXRX_21041P2_10BASET_FDX 0x0000ffff
940 #define SIAGEN_21041P2_10BASET_FDX SIAGEN_21041_10BASET_FDX
941
942
943 /* SIA configuration for 10base-5 (from the 21041 manual) */
944 #define SIACONN_21041_AUI 0x0000ef09
945 #define SIATXRX_21041_AUI 0x0000f73d
946 #define SIAGEN_21041_AUI 0x0000000e
947
948 #define SIACONN_21041P2_AUI SIACONN_21041_AUI
949 #define SIATXRX_21041P2_AUI 0x0000f7fd
950 #define SIAGEN_21041P2_AUI SIAGEN_21041_AUI
951
952
953 /* SIA configuration for 10base-2 (from the 21041 manual) */
954 #define SIACONN_21041_BNC 0x0000ef09
955 #define SIATXRX_21041_BNC 0x0000f73d
956 #define SIAGEN_21041_BNC 0x00000006
957
958 #define SIACONN_21041P2_BNC SIACONN_21041_BNC
959 #define SIATXRX_21041P2_BNC 0x0000f7fd
960 #define SIAGEN_21041P2_BNC SIAGEN_21041_BNC
961
962
963 /*
964 * Digital Semiconductor 21142/21143 registers.
965 */
966
967 /* SIA configuration for 10baseT (from the 21143 manual) */
968 #define SIACONN_21142_10BASET 0x00000001
969 #define SIATXRX_21142_10BASET 0x00007f3f
970 #define SIAGEN_21142_10BASET 0x00000008
971
972
973 /* SIA configuration for 10baseT full-duplex (from the 21143 manual) */
974 #define SIACONN_21142_10BASET_FDX 0x00000001
975 #define SIATXRX_21142_10BASET_FDX 0x00007f3d
976 #define SIAGEN_21142_10BASET_FDX 0x00000008
977
978
979 /* SIA configuration for 10base5 (from the 21143 manual) */
980 #define SIACONN_21142_AUI 0x00000009
981 #define SIATXRX_21142_AUI 0x00004705
982 #define SIAGEN_21142_AUI 0x0000000e
983
984
985 /* SIA configuration for 10base2 (from the 21143 manual) */
986 #define SIACONN_21142_BNC 0x00000009
987 #define SIATXRX_21142_BNC 0x00004705
988 #define SIAGEN_21142_BNC 0x00000006
989
990
991 /*
992 * Lite-On 82C168/82C169 registers.
993 */
994
995 /* ENDEC General Register */
996 #define CSR_PNIC_ENDEC 0x78
997 #define PNIC_ENDEC_JDIS 0x00000001 /* jabber disable */
998
999 /* SROM Power Register */
1000 #define CSR_PNIC_SROMPWR 0x90
1001 #define PNIC_SROMPWR_MRLE 0x00000001 /* Memory-Read-Line enable */
1002 #define PNIC_SROMPWR_CB 0x00000002 /* cache boundary alignment
1003 burst type; 1 == burst to
1004 boundary, 0 == single-cycle
1005 to boundary */
1006
1007 /* SROM Control Register */
1008 #define CSR_PNIC_SROMCTL 0x98
1009 #define PNIC_SROMCTL_addr 0x0000003f /* mask of address bits */
1010 /* XXX THESE ARE WRONG ACCORDING TO THE MANUAL! */
1011 #define PNIC_SROMCTL_READ 0x00000600 /* read command */
1012
1013 /* MII Access Register */
1014 #define CSR_PNIC_MII 0xa0
1015 #define PNIC_MII_DATA 0x0000ffff /* mask of data bits */
1016 #define PNIC_MII_REG 0x007c0000 /* register mask */
1017 #define PNIC_MII_REGSHIFT 18
1018 #define PNIC_MII_PHY 0x0f800000 /* phy mask */
1019 #define PNIC_MII_PHYSHIFT 23
1020 #define PNIC_MII_OPCODE 0x30000000 /* opcode mask */
1021 #define PNIC_MII_RESERVED 0x00020000 /* must be one/must be zero;
1022 2 bits are described here */
1023 #define PNIC_MII_MBO 0x40000000 /* must be one */
1024 #define PNIC_MII_BUSY 0x80000000 /* MII is busy */
1025
1026 #define PNIC_MII_WRITE 0x10000000 /* write PHY command */
1027 #define PNIC_MII_READ 0x20000000 /* read PHY command */
1028
1029 /* NWAY Register */
1030 #define CSR_PNIC_NWAY 0xb8
1031 #define PNIC_NWAY_RS 0x00000001 /* reset NWay block */
1032 #define PNIC_NWAY_PD 0x00000002 /* power down NWay block */
1033 #define PNIC_NWAY_BX 0x00000004 /* bypass transciever */
1034 #define PNIC_NWAY_LC 0x00000008 /* AUI low current mode */
1035 #define PNIC_NWAY_UV 0x00000010 /* low squelch voltage */
1036 #define PNIC_NWAY_DX 0x00000020 /* disable TP pol. correction */
1037 #define PNIC_NWAY_TW 0x00000040 /* select TP (0 == AUI) */
1038 #define PNIC_NWAY_AF 0x00000080 /* AUI full/half step input
1039 voltage */
1040 #define PNIC_NWAY_FD 0x00000100 /* full duplex mode */
1041 #define PNIC_NWAY_DL 0x00000200 /* disable link integrity
1042 test */
1043 #define PNIC_NWAY_DM 0x00000400 /* disable AUI/TP autodetect */
1044 #define PNIC_NWAY_100 0x00000800 /* 1 == 100mbps, 0 == 10mbps */
1045 #define PNIC_NWAY_NW 0x00001000 /* enable NWay block */
1046 #define PNIC_NWAY_CAP10T 0x00002000 /* adv. 10baseT */
1047 #define PNIC_NWAY_CAP10TFDX 0x00004000 /* adv. 10baseT-FDX */
1048 #define PNIC_NWAY_CAP100TXFDX 0x00008000 /* adv. 100baseTX-FDX */
1049 #define PNIC_NWAY_CAP100TX 0x00010000 /* adv. 100baseTX */
1050 #define PNIC_NWAY_CAP100T4 0x00020000 /* adv. 100base-T4 */
1051 #define PNIC_NWAY_RN 0x02000000 /* re-negotiate enable */
1052 #define PNIC_NWAY_RF 0x04000000 /* remote fault detected */
1053 #define PNIC_NWAY_LPAR10T 0x08000000 /* link part. 10baseT */
1054 #define PNIC_NWAY_LPAR10TFDX 0x10000000 /* link part. 10baseT-FDX */
1055 #define PNIC_NWAY_LPAR100TXFDX 0x20000000 /* link part. 100baseTX-FDX */
1056 #define PNIC_NWAY_LPAR100TX 0x40000000 /* link part. 100baseTX */
1057 #define PNIC_NWAY_LPAR100T4 0x80000000 /* link part. 100base-T4 */
1058 #define PNIC_NWAY_LPAR_MASK 0xf8000000
1059
1060
1061 /*
1062 * Macronix 98713, 98713A, 98715, 98715A, 98725 and
1063 * Lite-On 82C115 registers.
1064 */
1065
1066 /*
1067 * Note, the MX98713 is very Tulip-like:
1068 *
1069 * CSR12 General Purpose Port (like 21140)
1070 * CSR13 reserved
1071 * CSR14 reserved
1072 * CSR15 Watchdog Timer (like 21140)
1073 *
1074 * The Macronix CSR12, CSR13, CSR14, and CSR15 exist only
1075 * on the MX98713A and higher.
1076 */
1077
1078 /* CSR12 - 10base-T Status Port (similar to SIASTAT) */
1079 /* See SIASTAT 21142/21143 bits */
1080 #define CSR_PMAC_10TSTAT TULIP_CSR12
1081 #define PMAC_SIASTAT_MASK (SIASTAT_LS100|SIASTAT_LS10| \
1082 SIASTAT_APS|SIASTAT_TRF|SIASTAT_ANS| \
1083 SIASTAT_LPN|SIASTAT_LPC)
1084
1085
1086 /* CSR13 - NWAY Reset Register */
1087 #define CSR_PMAC_NWAYRESET TULIP_CSR13
1088 /* See SIACONN 21142/21143 bits */
1089 #define PMAC_SIACONN_MASK (SIACONN_SRL)
1090 #define PMAC_NWAYRESET_100TXRESET 0x00000002 /* 100base PMD reset */
1091
1092
1093 /* CSR14 - 10base-T Control Port */
1094 #define CSR_PMAC_10TCTL TULIP_CSR14
1095 /* See SIATXRX 21142/21143 bits */
1096 #define PMAC_SIATXRX_MASK (SIATXRX_LBK|SIATXRX_DREN|SIATXRX_TH| \
1097 SIATXRX_ANE|SIATXRX_RSQ|SIATXRX_LTE| \
1098 SIATXRX_THX|SIATXRX_TXF|SIATXRX_T4)
1099
1100
1101 /* CSR15 - Watchdog Timer Register */
1102 /* MX98713: see 21140 CSR15 */
1103 /* others: see SIAGEN 21142/21143 bits */
1104 #define PMAC_SIAGEN_MASK (SIAGEN_JBD|SIAGEN_HUJ|SIAGEN_JCK| \
1105 SIAGEN_RWD|SIAGEN_RWR)
1106
1107
1108 /* CSR16 - Test Operation Register (a.k.a. Magic Packet Register) */
1109 #define CSR_PMAC_TOR TULIP_CSR16
1110 #define PMAC_TOR_98713 0x0F370000
1111 #define PMAC_TOR_98715 0x0B3C0000
1112
1113
1114 /* CSR20 - NWAY Status */
1115 #define CSR_PMAC_NWAYSTAT TULIP_CSR20
1116 /*
1117 * Note: the MX98715A manual claims that EQTEST and PCITEST
1118 * must be set to 1 by software for normal operation, but
1119 * this does not appear to be necessary. This is probably
1120 * one of the things that frobbing the Test Operation Register
1121 * does.
1122 */
1123 #define PMAC_NWAYSTAT_EQTEST 0x00001000 /* EQ test */
1124 #define PMAC_NWAYSTAT_PCITEST 0x00010000 /* PCI test */
1125 #define PMAC_NWAYSTAT_10TXH 0x08000000 /* 10t accepted */
1126 #define PMAC_NWAYSTAT_10TXF 0x10000000 /* 10t-fdx accepted */
1127 #define PMAC_NWAYSTAT_100TXH 0x20000000 /* 100tx accepted */
1128 #define PMAC_NWAYSTAT_100TXF 0x40000000 /* 100tx-fdx accepted */
1129 #define PMAC_NWAYSTAT_T4 0x80000000 /* 100t4 accepted */
1130
1131
1132 /* CSR21 - Flow Control Register */
1133 #define CSR_PNICII_FLOWCTL TULIP_CSR21
1134 #define PNICII_FLOWCTL_WKFCATEN 0x00000010 /* enable wake-up frame
1135 catenation feature */
1136 #define PNICII_FLOWCTL_NFCE 0x00000020 /* accept flow control result
1137 from NWay */
1138 #define PNICII_FLOWCTL_FCTH0 0x00000040 /* rx flow control thresh 0 */
1139 #define PNICII_FLOWCTL_FCTH1 0x00000080 /* rx flow control thresh 1 */
1140 #define PNICII_FLOWCTL_REJECTFC 0x00000100 /* abort rx flow control */
1141 #define PNICII_FLOWCTL_STOPTX 0x00000200 /* tx flow stopped */
1142 #define PNICII_FLOWCTL_RUFCEN 0x00000400 /* send flow control when
1143 RU interrupt occurs */
1144 #define PNICII_FLOWCTL_RXFCEN 0x00000800 /* rx flow control enable */
1145 #define PNICII_FLOWCTL_TXFCEN 0x00001000 /* tx flow control enable */
1146 #define PNICII_FLOWCTL_RESTOP 0x00002000 /* restop mode */
1147 #define PNICII_FLOWCTL_RESTART 0x00004000 /* restart mode */
1148 #define PNICII_FLOWCTL_TEST 0x00008000 /* test flow control timer */
1149 #define PNICII_FLOWCTL_TMVAL 0xffff0000 /* timer value in flow
1150 control frame */
1151
1152 #define PNICII_FLOWCTL_TH_512 (PNICII_FLOWCTL_FCTH0|PNICII_FLOWCTL_FCTH1)
1153 #define PNICII_FLOWCTL_TH_256 (PNICII_FLOWCTL_FCTH1)
1154 #define PNICII_FLOWCTL_TH_128 (PNICII_FLOWCTL_FCTH0)
1155 #define PNICII_FLOWCTL_TH_OVFLW (0)
1156
1157
1158 /* CSR22 - MAC ID Byte 3-0 Register */
1159 #define CSR_PNICII_MACID0 TULIP_CSR22
1160 #define PNICII_MACID_1 0 /* shift */
1161 #define PNICII_MACID_0 8 /* shift */
1162 #define PNICII_MACID_3 16 /* shift */
1163 #define PNICII_MACID_2 24 /* shift */
1164
1165
1166 /* CSR23 - Magic ID Byte 5,4/MACID Byte 5,4 Register */
1167 #define PNICII_MACID_5 0 /* shift */
1168 #define PNICII_MACID_4 8 /* shift */
1169 #define PNICII_MAGID_5 16 /* shift */
1170 #define PNICII_MAGIC_4 24 /* shift */
1171
1172
1173 /* CSR24 - Magic ID Byte 3-0 Register */
1174 #define PNICII_MAGID_1 0 /* shift */
1175 #define PNICII_MAGID_0 8 /* shift */
1176 #define PNICII_MAGID_3 16 /* shift */
1177 #define PNICII_MAGID_2 24 /* shift */
1178
1179
1180 /* CSR25 - CSR28 - Filter Byte Mask Registers */
1181 #define CSR_PNICII_MASK0 TULIP_CSR25
1182
1183 #define CSR_PNICII_MASK1 TULIP_CSR26
1184
1185 #define CSR_PNICII_MASK2 TULIP_CSR27
1186
1187 #define CSR_PNICII_MASK3 TULIP_CSR28
1188
1189
1190 /* CSR29 - Filter Offset Register */
1191 #define CSR_PNICII_FILOFF TULIP_CSR29
1192 #define PNICII_FILOFF_PAT0 0x0000007f /* pattern 0 offset */
1193 #define PNICII_FILOFF_EN0 0x00000080 /* enable pattern 0 */
1194 #define PNICII_FILOFF_PAT1 0x00007f00 /* pattern 1 offset */
1195 #define PNICII_FILOFF_EN1 0x00008000 /* enable pattern 1 */
1196 #define PNICII_FILOFF_PAT2 0x007f0000 /* pattern 2 offset */
1197 #define PNICII_FILOFF_EN2 0x00800000 /* enable pattern 2 */
1198 #define PNICII_FILOFF_PAT3 0x7f000000 /* pattern 3 offset */
1199 #define PNICII_FILOFF_EN3 0x80000000 /* enable pattern 3 */
1200
1201
1202 /* CSR30 - Filter 1 and 0 CRC-16 Register */
1203 #define CSR_PNICII_FIL01 TULIP_CSR30
1204 #define PNICII_FIL01_CRC0 0x0000ffff /* CRC-16 of pattern 0 */
1205 #define PNICII_FIL01_CRC1 0xffff0000 /* CRC-16 of pattern 1 */
1206
1207
1208 /* CSR31 = Filter 3 and 2 CRC-16 Register */
1209 #define CSR_PNICII_FIL23 TULIP_CSR31
1210 #define PNICII_FIL23_CRC2 0x0000ffff /* CRC-16 of pattern 2 */
1211 #define PNICII_FIL23_CRC3 0xffff0000 /* CRC-16 of pattern 3 */
1212
1213
1214 /*
1215 * Winbond 89C840F registers.
1216 */
1217
1218 /* CSR12 - Current Receive Descriptor Register */
1219 #define CSR_WINB_CRDAR TULIP_CSR12
1220
1221
1222 /* CSR13 - Current Receive Buffer Register */
1223 #define CSR_WINB_CCRBAR TULIP_CSR13
1224
1225
1226 /* CSR14 - Multicast Address Register 0 */
1227 #define CSR_WINB_CMA0 TULIP_CSR14
1228
1229
1230 /* CSR15 - Multicast Address Register 1 */
1231 #define CSR_WINB_CMA1 TULIP_CSR15
1232
1233
1234 /* CSR16 - Physical Address Register 0 */
1235 #define CSR_WINB_CPA0 TULIP_CSR16
1236
1237
1238 /* CSR17 - Physical Address Register 1 */
1239 #define CSR_WINB_CPA1 TULIP_CSR17
1240
1241
1242 /* CSR18 - Boot ROM Size Register */
1243 #define CSR_WINB_CBRCR TULIP_CSR18
1244 #define WINB_CBRCR_NONE 0x00000000 /* no boot rom */
1245 /* 0x00000001 also no boot rom */
1246 #define WINB_CBRCR_8K 0x00000002 /* 8k */
1247 #define WINB_CBRCR_16K 0x00000003 /* 16k */
1248 #define WINB_CBRCR_32K 0x00000004 /* 32k */
1249 #define WINB_CBRCR_64K 0x00000005 /* 64k */
1250 #define WINB_CBRCR_128K 0x00000006 /* 128k */
1251 #define WINB_CBRCR_256K 0x00000007
1252
1253
1254 /* CSR19 - Current Transmit Descriptor Register */
1255 #define CSR_WINB_CTDAR TULIP_CSR19
1256
1257
1258 /* CSR20 - Current Transmit Buffer Register */
1259 #define CSR_WINB_CTBAR TULIP_CSR20
1260
1261
1262 /*
1263 * ADMtek AL981 registers
1264 *
1265 * We define these as strict byte offsets into PCI space, since
1266 * not all of them have consistent access rules.
1267 */
1268
1269 /* CSR13 - Wake-up Control/Status Register */
1270 #define CSR_ADM_WCSR 0x68
1271 #define ADM_WCSR_LSC 0x00000001 /* link status changed */
1272 #define ADM_WCSR_MPR 0x00000002 /* magic packet received */
1273 #define ADM_WCSR_WFR 0x00000004 /* wake up frame received */
1274 #define ADM_WCSR_LSCE 0x00000100 /* link status changed en. */
1275 #define ADM_WCSR_MPRE 0x00000200 /* magic packet receive en. */
1276 #define ADM_WCSR_WFRE 0x00000400 /* wake up frame receive en. */
1277 #define ADM_WCSR_LINKON 0x00010000 /* link-on detect en. */
1278 #define ADM_WCSR_LINKOFF 0x00020000 /* link-off detect en. */
1279 #define ADM_WCSR_WP5E 0x02000000 /* wake up pat. 5 en. */
1280 #define ADM_WCSR_WP4E 0x04000000 /* wake up pat. 4 en. */
1281 #define ADM_WCSR_WP3E 0x08000000 /* wake up pat. 3 en. */
1282 #define ADM_WCSR_WP2E 0x10000000 /* wake up pat. 2 en. */
1283 #define ADM_WCSR_WP1E 0x20000000 /* wake up pat. 1 en. */
1284 #define ADM_WCSR_CRCT 0x40000000 /* CRC-16 type:
1285 0 == 0000 initial
1286 1 == ffff initial */
1287
1288
1289 /* CSR14 - Wake-up Pattern Data Register */
1290 #define CSR_ADM_WPDR 0x70
1291
1292 /*
1293 * 25 consecutive longword writes are issued to WPDR to
1294 * program the wake-up pattern filter. The data written
1295 * is as follows:
1296 *
1297 * XXX
1298 */
1299
1300
1301 /* CSR15 - see 21140 CSR15 (Watchdog Timer) */
1302
1303
1304 /* CSR16 - Assistant CSR5 (Status Register 2) */
1305 #define CSR_ADM_ASR 0x80
1306 /* 0 - 14: same as CSR5 */
1307 #define ADM_ASR_AAISS 0x00080000 /* added abnormal int. sum. */
1308 #define ADM_ASR_ANISS 0x00010000 /* added normal int. sum. */
1309 /* XXX Receive state */
1310 /* XXX Transmit state */
1311 #define ADM_ASR_BET 0x03800000 /* bus error type */
1312 #define ADM_ASR_BET_PERR 0x00000000 /* parity error */
1313 #define ADM_ASR_BET_MABT 0x00800000 /* master abort */
1314 #define ADM_ASR_BET_TABT 0x01000000 /* target abort */
1315 #define ADM_ASR_PFR 0x04000000 /* PAUSE frame received */
1316 #define ADM_ASR_TDIS 0x10000000 /* transmit def. int. status */
1317 #define ADM_ASR_XIS 0x20000000 /* xcvr int. status */
1318 #define ADM_ASR_REIS 0x40000000 /* receive early int. status */
1319 #define ADM_ASR_TEIS 0x80000000 /* transmit early int. status */
1320
1321
1322 /* CSR17 - Assistant CSR7 (Interrupt Enable Register 2) */
1323 #define CSR_ADM_AIE 0x84
1324 /* See CSR16 for valid bits */
1325
1326
1327 /* CSR18 - Command Register */
1328 #define CSR_ADM_CR 0x88
1329 #define ADM_CR_ATUR 0x00000001 /* auto. tx underrun recover */
1330 #define ADM_CR_SINT 0x00000002 /* software interrupt */
1331 #define ADM_CR_DRT 0x0000000c /* drain recieve threshold */
1332 #define ADM_CR_DRT_8LW 0x00000000 /* 8 longwords */
1333 #define ADM_CR_DRT_16LW 0x00000004 /* 16 longwords */
1334 #define ADM_CR_DRT_SF 0x00000008 /* store-and-forward */
1335 #define ADM_CR_RTE 0x00000010 /* receive threshold enable */
1336 #define ADM_CR_PAUSE 0x00000020 /* enable PAUSE function */
1337 #define ADM_CR_RWP 0x00000040 /* reset wake-up pattern
1338 data register pointer */
1339 /* 16 - 31 are automatically recalled from the EEPROM */
1340 #define ADM_CR_WOL 0x00040000 /* wake-on-lan enable */
1341 #define ADM_CR_PM 0x00080000 /* power management enable */
1342 #define ADM_CR_RFS 0x00600000 /* Receive FIFO size */
1343 #define ADM_CR_RFS_1K 0x00600000 /* 1K FIFO */
1344 #define ADM_CR_RFS_2K 0x00400000 /* 2K FIFO */
1345 #define ADM_CR_LEDMODE 0x00800000 /* LED mode */
1346 #define ADM_CR_AUXCL 0x30000000 /* aux current load */
1347 #define ADM_CR_D3CS 0x80000000 /* D3 cold wake up enable */
1348
1349
1350 /* CSR19 - PCI bus performance counter */
1351 #define CSR_ADM_PCIC 0x8c
1352 #define ADM_PCIC_DWCNT 0x000000ff /* double-word count of
1353 last bus-master
1354 transaction */
1355 #define ADM_PCIC_CLKCNT 0xffff0000 /* number of PCI clocks
1356 between read request
1357 and access completed */
1358
1359 /* CSR20 - Power Management Control/Status Register */
1360 #define CSR_ADM_PMCSR 0x90
1361 /*
1362 * This register is also mapped into the PCI configuration
1363 * space as the PMCSR.
1364 */
1365
1366
1367 /* CSR23 - Transmit Burst Count/Time Out Register */
1368 #define CSR_ADM_TXBR 0x9c
1369 #define ADM_TXBR_TTO 0x00000fff /* transmit timeout */
1370 #define ADM_TXBR_TBCNT 0x001f0000 /* transmit burst count */
1371
1372
1373 /* CSR24 - Flash ROM Port Register */
1374 #define CSR_ADM_FROM 0xa0
1375 #define ADM_FROM_DATA 0x000000ff /* data to/from Flash */
1376 #define ADM_FROM_ADDR 0x01ffff00 /* Flash address */
1377 #define ADM_FROM_ADDR_SHIFT 8
1378 #define ADM_FROM_WEN 0x04000000 /* write enable */
1379 #define ADM_FROM_REN 0x08000000 /* read enable */
1380 #define ADM_FROM_bra16on 0x80000000 /* pin 87 is brA16, else
1381 pin 87 is fd/col LED pin */
1382
1383
1384 /* CSR25 - Physical Address Register 0 */
1385 #define CSR_ADM_PAR0 0xa4
1386
1387
1388 /* CSR26 - Physical Address Register 1 */
1389 #define CSR_ADM_PAR1 0xa8
1390
1391
1392 /* CSR27 - Multicast Address Register 0 */
1393 #define CSR_ADM_MAR0 0xac
1394
1395
1396 /* CSR28 - Multicast Address Register 1 */
1397 #define CSR_ADM_MAR1 0xb0
1398
1399
1400 /* Internal PHY registers are mapped here (lower 16 bits valid) */
1401
1402 #define CSR_ADM_BMCR 0xb4
1403 #define CSR_ADM_BMSR 0xb8
1404 #define CSR_ADM_PHYIDR1 0xbc
1405 #define CSR_ADM_PHYIDR2 0xc0
1406 #define CSR_ADM_ANAR 0xc4
1407 #define CSR_ADM_ANLPAR 0xc8
1408 #define CSR_ADM_ANER 0xcc
1409
1410 /* XCVR Mode Control Register */
1411 #define CSR_ADM_XMC 0xd0
1412 #define ADM_XMC_LD 0x00000800 /* long distance mode
1413 (low squelch enable) */
1414
1415
1416 /* XCVR Configuration Information and Interrupt Status Register */
1417 #define CSR_ADM_XCIIS 0xd4
1418 #define ADM_XCIIS_REF 0x0001 /* 64 error packets received */
1419 #define ADM_XCIIS_ANPR 0x0002 /* autoneg page received */
1420 #define ADM_XCIIS_PDF 0x0004 /* parallel detection fault */
1421 #define ADM_XCIIS_ANAR 0x0008 /* autoneg ACK */
1422 #define ADM_XCIIS_LS 0x0010 /* link status (1 == fail) */
1423 #define ADM_XCIIS_RFD 0x0020 /* remote fault */
1424 #define ADM_XCIIS_ANC 0x0040 /* autoneg completed */
1425 #define ADM_XCIIS_PAUSE 0x0080 /* PAUSE enabled */
1426 #define ADM_XCIIS_DUPLEX 0x0100 /* full duplex */
1427 #define ADM_XCIIS_SPEED 0x0200 /* 100Mb/s */
1428
1429
1430 /* XCVR Interrupt Enable Register */
1431 #define CSR_ADM_XIE 0xd8
1432 /* Bits are as for XCIIS */
1433
1434
1435 /* XCVR 100baseTX PHY Control/Status Register */
1436 #define CSR_ADM_100CTR 0xdc
1437 #define ADM_100CTR_DISCRM 0x0001 /* disable scrambler */
1438 #define ADM_100CTR_DISMLT 0x0002 /* disable MLT3 ENDEC */
1439 #define ADM_100CTR_CMODE 0x001c /* current operating mode */
1440 #define ADM_100CTR_CMODE_AUTO 0x0000 /* in autoneg */
1441 #define ADM_100CTR_CMODE_10 0x0004 /* 10baseT */
1442 #define ADM_100CTR_CMODE_100 0x0008 /* 100baseTX */
1443 /* 0x000c reserved */
1444 /* 0x0010 reserved */
1445 #define ADM_100CTR_CMODE_10FD 0x0014 /* 10baseT-FDX */
1446 #define ADM_100CTR_CMODE_100FD 0x0018 /* 100baseTX-FDX */
1447 #define ADM_100CTR_CMODE_ISO 0x001c /* isolated */
1448 #define ADM_100CTR_ISOTX 0x0020 /* transmit isolation */
1449 #define ADM_100CTR_ENRZI 0x0080 /* enable NRZ <> NRZI conv. */
1450 #define ADM_100CTR_ENDCR 0x0100 /* enable DC restoration */
1451 #define ADM_100CTR_ENRLB 0x0200 /* enable remote loopback */
1452 #define ADM_100CTR_RXVPP 0x0800 /* peak Rx voltage:
1453 0 == 1.0 VPP
1454 1 == 1.4 VPP */
1455 #define ADM_100CTR_ANC 0x1000 /* autoneg completed */
1456 #define ADM_100CTR_DISRER 0x2000 /* disable Rx error counter */
1457
1458 /*
1459 * Xircom X3201-3 registers
1460 */
1461
1462 /* Power Management Register */
1463 #define CSR_X3201_PMR TULIP_CSR16
1464 #define X3201_PMR_EDINT 0x0000000f /* energy detect interval */
1465 #define X3201_PMR_EDEN 0x00000100 /* energy detect enable */
1466 #define X3201_PMR_MPEN 0x00000200 /* magic packet enable */
1467 #define X3201_PMR_WOLEN 0x00000400 /* Wake On Lan enable */
1468 #define X3201_PMR_PMGP0EN 0x00001000 /* GP0 change enable */
1469 #define X3201_PMR_PMLCEN 0x00002000 /* link change enable */
1470 #define X3201_PMR_WOLTMEN 0x00008000 /* WOL template mem enable */
1471 #define X3201_PMR_EP 0x00010000 /* energy present */
1472 #define X3201_PMR_LP 0x00200000 /* link present */
1473 #define X3201_PMR_EDES 0x01000000 /* ED event status */
1474 #define X3201_PMR_MPES 0x02000000 /* MP event status */
1475 #define X3201_PMR_WOLES 0x04000000 /* WOL event status */
1476 #define X3201_PMR_WOLPS 0x08000000 /* WOL process status */
1477 #define X3201_PMR_GP0ES 0x10000000 /* GP0 event status */
1478 #define X3201_PMR_LCES 0x20000000 /* LC event status */
1479
1480 /*
1481 * Davicom DM9102 registers.
1482 */
1483
1484 /* PHY Status Register */
1485 #define CSR_DM_PHYSTAT TULIP_CSR12
1486 #define DM_PHYSTAT_10 0x00000001 /* 10Mb/s */
1487 #define DM_PHYSTAT_100 0x00000002 /* 100Mb/s */
1488 #define DM_PHYSTAT_FDX 0x00000004 /* full-duplex */
1489 #define DM_PHYSTAT_LINK 0x00000008 /* link up */
1490 #define DM_PHYSTAT_RXLOCK 0x00000010 /* RX-lock */
1491 #define DM_PHYSTAT_SIGNAL 0x00000020 /* signal detection */
1492 #define DM_PHYSTAT_UTPSIG 0x00000040 /* UTP SIG */
1493 #define DM_PHYSTAT_GPED 0x00000080 /* general PHY reset control */
1494 #define DM_PHYSTAT_GEPC 0x00000100 /* GPED bits control */
1495
1496
1497 /* Sample Frame Access Register */
1498 #define CSR_DM_SFAR TULIP_CSR13
1499
1500
1501 /* Sample Frame Data Register */
1502 #define CSR_DM_SFDR TULIP_CSR14
1503 /* See 21143 SIAGEN register */
1504
1505 #endif /* _DEV_IC_TULIPREG_H_ */
1506