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