xref: /dflybsd-src/sys/dev/netif/lnc/lancereg.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*	$NetBSD: lancereg.h,v 1.12 2005/12/11 12:21:27 christos Exp $	*/
286d7f5d3SJohn Marino /*	$FreeBSD: src/sys/dev/le/lancereg.h,v 1.2 2006/05/16 21:04:01 marius Exp $	*/
386d7f5d3SJohn Marino /*	$DragonFly: src/sys/dev/netif/lnc/lancereg.h,v 1.1 2006/07/07 14:16:29 sephe Exp $	*/
486d7f5d3SJohn Marino 
586d7f5d3SJohn Marino /*-
686d7f5d3SJohn Marino  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
786d7f5d3SJohn Marino  * All rights reserved.
886d7f5d3SJohn Marino  *
986d7f5d3SJohn Marino  * This code is derived from software contributed to The NetBSD Foundation
1086d7f5d3SJohn Marino  * by Charles M. Hannum and Jason R. Thorpe.
1186d7f5d3SJohn Marino  *
1286d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
1386d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
1486d7f5d3SJohn Marino  * are met:
1586d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
1686d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
1786d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
1886d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
1986d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
2086d7f5d3SJohn Marino  * 3. All advertising materials mentioning features or use of this software
2186d7f5d3SJohn Marino  *    must display the following acknowledgement:
2286d7f5d3SJohn Marino  *        This product includes software developed by the NetBSD
2386d7f5d3SJohn Marino  *        Foundation, Inc. and its contributors.
2486d7f5d3SJohn Marino  * 4. Neither the name of The NetBSD Foundation nor the names of its
2586d7f5d3SJohn Marino  *    contributors may be used to endorse or promote products derived
2686d7f5d3SJohn Marino  *    from this software without specific prior written permission.
2786d7f5d3SJohn Marino  *
2886d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2986d7f5d3SJohn Marino  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
3086d7f5d3SJohn Marino  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
3186d7f5d3SJohn Marino  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
3286d7f5d3SJohn Marino  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3386d7f5d3SJohn Marino  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3486d7f5d3SJohn Marino  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3586d7f5d3SJohn Marino  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3686d7f5d3SJohn Marino  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3786d7f5d3SJohn Marino  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3886d7f5d3SJohn Marino  * POSSIBILITY OF SUCH DAMAGE.
3986d7f5d3SJohn Marino  */
4086d7f5d3SJohn Marino 
4186d7f5d3SJohn Marino /*-
4286d7f5d3SJohn Marino  * Copyright (c) 1992, 1993
4386d7f5d3SJohn Marino  *	The Regents of the University of California.  All rights reserved.
4486d7f5d3SJohn Marino  *
4586d7f5d3SJohn Marino  * This code is derived from software contributed to Berkeley by
4686d7f5d3SJohn Marino  * Ralph Campbell and Rick Macklem.
4786d7f5d3SJohn Marino  *
4886d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
4986d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
5086d7f5d3SJohn Marino  * are met:
5186d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
5286d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
5386d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
5486d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
5586d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
5686d7f5d3SJohn Marino  * 3. Neither the name of the University nor the names of its contributors
5786d7f5d3SJohn Marino  *    may be used to endorse or promote products derived from this software
5886d7f5d3SJohn Marino  *    without specific prior written permission.
5986d7f5d3SJohn Marino  *
6086d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
6186d7f5d3SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
6286d7f5d3SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
6386d7f5d3SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
6486d7f5d3SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
6586d7f5d3SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
6686d7f5d3SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
6786d7f5d3SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
6886d7f5d3SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
6986d7f5d3SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
7086d7f5d3SJohn Marino  * SUCH DAMAGE.
7186d7f5d3SJohn Marino  *
7286d7f5d3SJohn Marino  *	@(#)if_lereg.h	8.1 (Berkeley) 6/10/93
7386d7f5d3SJohn Marino  */
7486d7f5d3SJohn Marino 
7586d7f5d3SJohn Marino /*
7686d7f5d3SJohn Marino  * Register description for the following Advanced Micro Devices
7786d7f5d3SJohn Marino  * Ethernet chips:
7886d7f5d3SJohn Marino  *
7986d7f5d3SJohn Marino  *	- Am7990 Local Area Network Controller for Ethernet (LANCE)
8086d7f5d3SJohn Marino  *	  (and its descendent Am79c90 C-LANCE).
8186d7f5d3SJohn Marino  *
8286d7f5d3SJohn Marino  *	- Am79c900 Integrated Local Area Communications Controller (ILACC)
8386d7f5d3SJohn Marino  *
8486d7f5d3SJohn Marino  *	- Am79c960 PCnet-ISA Single-Chip Ethernet Controller for ISA
8586d7f5d3SJohn Marino  *
8686d7f5d3SJohn Marino  *	- Am79c961 PCnet-ISA+ Jumperless Single-Chip Ethernet Controller
8786d7f5d3SJohn Marino  *	  for ISA
8886d7f5d3SJohn Marino  *
8986d7f5d3SJohn Marino  *	- Am79c961A PCnet-ISA II Jumperless Full-Duplex Single-Chip
9086d7f5d3SJohn Marino  *	  Ethernet Controller for ISA
9186d7f5d3SJohn Marino  *
9286d7f5d3SJohn Marino  *	- Am79c965A PCnet-32 Single-Chip 32-bit Ethernet Controller
9386d7f5d3SJohn Marino  *	  (for VESA and 486 local busses)
9486d7f5d3SJohn Marino  *
9586d7f5d3SJohn Marino  *	- Am79c970 PCnet-PCI Single-Chip Ethernet Controller for PCI
9686d7f5d3SJohn Marino  *	  Local Bus
9786d7f5d3SJohn Marino  *
9886d7f5d3SJohn Marino  *	- Am79c970A PCnet-PCI II Single-Chip Full-Duplex Ethernet Controller
9986d7f5d3SJohn Marino  *	  for PCI Local Bus
10086d7f5d3SJohn Marino  *
10186d7f5d3SJohn Marino  *	- Am79c971 PCnet-FAST Single-Chip Full-Duplex 10/100Mbps
10286d7f5d3SJohn Marino  *	  Ethernet Controller for PCI Local Bus
10386d7f5d3SJohn Marino  *
10486d7f5d3SJohn Marino  *	- Am79c972 PCnet-FAST+ Enhanced 10/100Mbps PCI Ethernet Controller
10586d7f5d3SJohn Marino  *	  with OnNow Support
10686d7f5d3SJohn Marino  *
10786d7f5d3SJohn Marino  *	- Am79c973/Am79c975 PCnet-FAST III Single-Chip 10/100Mbps PCI
10886d7f5d3SJohn Marino  *	  Ethernet Controller with Integrated PHY
10986d7f5d3SJohn Marino  *
11086d7f5d3SJohn Marino  *	- Am79c978 PCnet-Home Single-Chip 1/10 Mbps PCI Home
11186d7f5d3SJohn Marino  *	  Networking Controller.
11286d7f5d3SJohn Marino  *
11386d7f5d3SJohn Marino  * Initialization block, transmit descriptor, and receive descriptor
11486d7f5d3SJohn Marino  * formats are described in two separate files:
11586d7f5d3SJohn Marino  *
11686d7f5d3SJohn Marino  *	16-bit software model (LANCE)		am7990reg.h
11786d7f5d3SJohn Marino  *
11886d7f5d3SJohn Marino  *	32-bit software model (ILACC)		am79900reg.h
11986d7f5d3SJohn Marino  *
12086d7f5d3SJohn Marino  * Note that the vast majority of the registers described in this file
12186d7f5d3SJohn Marino  * belong to follow-on chips to the original LANCE.  Only CSR0-CSR3 are
12286d7f5d3SJohn Marino  * valid on the LANCE.
12386d7f5d3SJohn Marino  */
12486d7f5d3SJohn Marino 
12586d7f5d3SJohn Marino #ifndef _DEV_LE_LANCEREG_H_
12686d7f5d3SJohn Marino #define	_DEV_LE_LANCEREG_H_
12786d7f5d3SJohn Marino 
12886d7f5d3SJohn Marino #ifndef ETHER_VLAN_ENCAP_LEN
12986d7f5d3SJohn Marino #define ETHER_VLAN_ENCAP_LEN   4
13086d7f5d3SJohn Marino #endif
13186d7f5d3SJohn Marino 
13286d7f5d3SJohn Marino #define	LEBLEN		(ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN)
13386d7f5d3SJohn Marino /* LEMINSIZE should be ETHER_MIN_LEN when LE_MODE_DTCR is set. */
13486d7f5d3SJohn Marino #define	LEMINSIZE	(ETHER_MIN_LEN - ETHER_CRC_LEN)
13586d7f5d3SJohn Marino 
13686d7f5d3SJohn Marino #define	LE_INITADDR(sc)		(sc->sc_initaddr)
13786d7f5d3SJohn Marino #define	LE_RMDADDR(sc, bix)	(sc->sc_rmdaddr + sizeof(struct lermd) * (bix))
13886d7f5d3SJohn Marino #define	LE_TMDADDR(sc, bix)	(sc->sc_tmdaddr + sizeof(struct letmd) * (bix))
13986d7f5d3SJohn Marino #define	LE_RBUFADDR(sc, bix)	(sc->sc_rbufaddr + LEBLEN * (bix))
14086d7f5d3SJohn Marino #define	LE_TBUFADDR(sc, bix)	(sc->sc_tbufaddr + LEBLEN * (bix))
14186d7f5d3SJohn Marino 
14286d7f5d3SJohn Marino /*
14386d7f5d3SJohn Marino  * The byte count fields in descriptors are in two's complement.
14486d7f5d3SJohn Marino  * This macro does the conversion for us on unsigned numbers.
14586d7f5d3SJohn Marino  */
14686d7f5d3SJohn Marino #define	LE_BCNT(x)	(~(x) + 1)
14786d7f5d3SJohn Marino 
14886d7f5d3SJohn Marino /*
14986d7f5d3SJohn Marino  * Control and Status Register addresses
15086d7f5d3SJohn Marino  */
15186d7f5d3SJohn Marino #define	LE_CSR0		0x0000		/* Control and status register */
15286d7f5d3SJohn Marino #define	LE_CSR1		0x0001		/* low address of init block */
15386d7f5d3SJohn Marino #define	LE_CSR2		0x0002		/* high address of init block */
15486d7f5d3SJohn Marino #define	LE_CSR3		0x0003		/* Bus master and control */
15586d7f5d3SJohn Marino #define	LE_CSR4		0x0004		/* Test and features control */
15686d7f5d3SJohn Marino #define	LE_CSR5		0x0005		/* Extended control and Interrupt 1 */
15786d7f5d3SJohn Marino #define	LE_CSR6		0x0006		/* Rx/Tx Descriptor table length */
15886d7f5d3SJohn Marino #define	LE_CSR7		0x0007		/* Extended control and interrupt 2 */
15986d7f5d3SJohn Marino #define	LE_CSR8		0x0008		/* Logical Address Filter 0 */
16086d7f5d3SJohn Marino #define	LE_CSR9		0x0009		/* Logical Address Filter 1 */
16186d7f5d3SJohn Marino #define	LE_CSR10	0x000a		/* Logical Address Filter 2 */
16286d7f5d3SJohn Marino #define	LE_CSR11	0x000b		/* Logical Address Filter 3 */
16386d7f5d3SJohn Marino #define	LE_CSR12	0x000c		/* Physical Address 0 */
16486d7f5d3SJohn Marino #define	LE_CSR13	0x000d		/* Physical Address 1 */
16586d7f5d3SJohn Marino #define	LE_CSR14	0x000e		/* Physical Address 2 */
16686d7f5d3SJohn Marino #define	LE_CSR15	0x000f		/* Mode */
16786d7f5d3SJohn Marino #define	LE_CSR16	0x0010		/* Initialization Block addr lower */
16886d7f5d3SJohn Marino #define	LE_CSR17	0x0011		/* Initialization Block addr upper */
16986d7f5d3SJohn Marino #define	LE_CSR18	0x0012		/* Current Rx Buffer addr lower */
17086d7f5d3SJohn Marino #define	LE_CSR19	0x0013		/* Current Rx Buffer addr upper */
17186d7f5d3SJohn Marino #define	LE_CSR20	0x0014		/* Current Tx Buffer addr lower */
17286d7f5d3SJohn Marino #define	LE_CSR21	0x0015		/* Current Tx Buffer addr upper */
17386d7f5d3SJohn Marino #define	LE_CSR22	0x0016		/* Next Rx Buffer addr lower */
17486d7f5d3SJohn Marino #define	LE_CSR23	0x0017		/* Next Rx Buffer addr upper */
17586d7f5d3SJohn Marino #define	LE_CSR24	0x0018		/* Base addr of Rx ring lower */
17686d7f5d3SJohn Marino #define	LE_CSR25	0x0019		/* Base addr of Rx ring upper */
17786d7f5d3SJohn Marino #define	LE_CSR26	0x001a		/* Next Rx Desc addr lower */
17886d7f5d3SJohn Marino #define	LE_CSR27	0x001b		/* Next Rx Desc addr upper */
17986d7f5d3SJohn Marino #define	LE_CSR28	0x001c		/* Current Rx Desc addr lower */
18086d7f5d3SJohn Marino #define	LE_CSR29	0x001d		/* Current Rx Desc addr upper */
18186d7f5d3SJohn Marino #define	LE_CSR30	0x001e		/* Base addr of Tx ring lower */
18286d7f5d3SJohn Marino #define	LE_CSR31	0x001f		/* Base addr of Tx ring upper */
18386d7f5d3SJohn Marino #define	LE_CSR32	0x0020		/* Next Tx Desc addr lower */
18486d7f5d3SJohn Marino #define	LE_CSR33	0x0021		/* Next Tx Desc addr upper */
18586d7f5d3SJohn Marino #define	LE_CSR34	0x0022		/* Current Tx Desc addr lower */
18686d7f5d3SJohn Marino #define	LE_CSR35	0x0023		/* Current Tx Desc addr upper */
18786d7f5d3SJohn Marino #define	LE_CSR36	0x0024		/* Next Next Rx Desc addr lower */
18886d7f5d3SJohn Marino #define	LE_CSR37	0x0025		/* Next Next Rx Desc addr upper */
18986d7f5d3SJohn Marino #define	LE_CSR38	0x0026		/* Next Next Tx Desc addr lower */
19086d7f5d3SJohn Marino #define	LE_CSR39	0x0027		/* Next Next Tx Desc adddr upper */
19186d7f5d3SJohn Marino #define	LE_CSR40	0x0028		/* Current Rx Byte Count */
19286d7f5d3SJohn Marino #define	LE_CSR41	0x0029		/* Current Rx Status */
19386d7f5d3SJohn Marino #define	LE_CSR42	0x002a		/* Current Tx Byte Count */
19486d7f5d3SJohn Marino #define	LE_CSR43	0x002b		/* Current Tx Status */
19586d7f5d3SJohn Marino #define	LE_CSR44	0x002c		/* Next Rx Byte Count */
19686d7f5d3SJohn Marino #define	LE_CSR45	0x002d		/* Next Rx Status */
19786d7f5d3SJohn Marino #define	LE_CSR46	0x002e		/* Tx Poll Time Counter */
19886d7f5d3SJohn Marino #define	LE_CSR47	0x002f		/* Tx Polling Interval */
19986d7f5d3SJohn Marino #define	LE_CSR48	0x0030		/* Rx Poll Time Counter */
20086d7f5d3SJohn Marino #define	LE_CSR49	0x0031		/* Rx Polling Interval */
20186d7f5d3SJohn Marino #define	LE_CSR58	0x003a		/* Software Style */
20286d7f5d3SJohn Marino #define	LE_CSR60	0x003c		/* Previous Tx Desc addr lower */
20386d7f5d3SJohn Marino #define	LE_CSR61	0x003d		/* Previous Tx Desc addr upper */
20486d7f5d3SJohn Marino #define	LE_CSR62	0x003e		/* Previous Tx Byte Count */
20586d7f5d3SJohn Marino #define	LE_CSR63	0x003f		/* Previous Tx Status */
20686d7f5d3SJohn Marino #define	LE_CSR64	0x0040		/* Next Tx Buffer addr lower */
20786d7f5d3SJohn Marino #define	LE_CSR65	0x0041		/* Next Tx Buffer addr upper */
20886d7f5d3SJohn Marino #define	LE_CSR66	0x0042		/* Next Tx Byte Count */
20986d7f5d3SJohn Marino #define	LE_CSR67	0x0043		/* Next Tx Status */
21086d7f5d3SJohn Marino #define	LE_CSR72	0x0048		/* Receive Ring Counter */
21186d7f5d3SJohn Marino #define	LE_CSR74	0x004a		/* Transmit Ring Counter */
21286d7f5d3SJohn Marino #define	LE_CSR76	0x004c		/* Receive Ring Length */
21386d7f5d3SJohn Marino #define	LE_CSR78	0x004e		/* Transmit Ring Length */
21486d7f5d3SJohn Marino #define	LE_CSR80	0x0050		/* DMA Transfer Counter and FIFO
21586d7f5d3SJohn Marino 					   Threshold Control */
21686d7f5d3SJohn Marino #define	LE_CSR82	0x0052		/* Tx Desc addr Pointer lower */
21786d7f5d3SJohn Marino #define	LE_CSR84	0x0054		/* DMA addr register lower */
21886d7f5d3SJohn Marino #define	LE_CSR85	0x0055		/* DMA addr register upper */
21986d7f5d3SJohn Marino #define	LE_CSR86	0x0056		/* Buffer Byte Counter */
22086d7f5d3SJohn Marino #define	LE_CSR88	0x0058		/* Chip ID Register lower */
22186d7f5d3SJohn Marino #define	LE_CSR89	0x0059		/* Chip ID Register upper */
22286d7f5d3SJohn Marino #define	LE_CSR92	0x005c		/* Ring Length Conversion */
22386d7f5d3SJohn Marino #define	LE_CSR100	0x0064		/* Bus Timeout */
22486d7f5d3SJohn Marino #define	LE_CSR112	0x0070		/* Missed Frame Count */
22586d7f5d3SJohn Marino #define	LE_CSR114	0x0072		/* Receive Collision Count */
22686d7f5d3SJohn Marino #define	LE_CSR116	0x0074		/* OnNow Power Mode Register */
22786d7f5d3SJohn Marino #define	LE_CSR122	0x007a		/* Advanced Feature Control */
22886d7f5d3SJohn Marino #define	LE_CSR124	0x007c		/* Test Register 1 */
22986d7f5d3SJohn Marino #define	LE_CSR125	0x007d		/* MAC Enhanced Configuration Control */
23086d7f5d3SJohn Marino 
23186d7f5d3SJohn Marino /*
23286d7f5d3SJohn Marino  * Bus Configuration Register addresses
23386d7f5d3SJohn Marino  */
23486d7f5d3SJohn Marino #define	LE_BCR0		0x0000		/* Master Mode Read Active */
23586d7f5d3SJohn Marino #define	LE_BCR1		0x0001		/* Master Mode Write Active */
23686d7f5d3SJohn Marino #define	LE_BCR2		0x0002		/* Misc. Configuration */
23786d7f5d3SJohn Marino #define	LE_BCR4		0x0004		/* LED0 Status */
23886d7f5d3SJohn Marino #define	LE_BCR5		0x0005		/* LED1 Status */
23986d7f5d3SJohn Marino #define	LE_BCR6		0x0006		/* LED2 Status */
24086d7f5d3SJohn Marino #define	LE_BCR7		0x0007		/* LED3 Status */
24186d7f5d3SJohn Marino #define	LE_BCR9		0x0009		/* Full-duplex Control */
24286d7f5d3SJohn Marino #define	LE_BCR16	0x0010		/* I/O Base Address lower */
24386d7f5d3SJohn Marino #define	LE_BCR17	0x0011		/* I/O Base Address upper */
24486d7f5d3SJohn Marino #define	LE_BCR18	0x0012		/* Burst and Bus Control Register */
24586d7f5d3SJohn Marino #define	LE_BCR19	0x0013		/* EEPROM Control and Status */
24686d7f5d3SJohn Marino #define	LE_BCR20	0x0014		/* Software Style */
24786d7f5d3SJohn Marino #define	LE_BCR22	0x0016		/* PCI Latency Register */
24886d7f5d3SJohn Marino #define	LE_BCR23	0x0017		/* PCI Subsystem Vendor ID */
24986d7f5d3SJohn Marino #define	LE_BCR24	0x0018		/* PCI Subsystem ID */
25086d7f5d3SJohn Marino #define	LE_BCR25	0x0019		/* SRAM Size Register */
25186d7f5d3SJohn Marino #define	LE_BCR26	0x001a		/* SRAM Boundary Register */
25286d7f5d3SJohn Marino #define	LE_BCR27	0x001b		/* SRAM Interface Control Register */
25386d7f5d3SJohn Marino #define	LE_BCR28	0x001c		/* Exp. Bus Port Addr lower */
25486d7f5d3SJohn Marino #define	LE_BCR29	0x001d		/* Exp. Bus Port Addr upper */
25586d7f5d3SJohn Marino #define	LE_BCR30	0x001e		/* Exp. Bus Data Port */
25686d7f5d3SJohn Marino #define	LE_BCR31	0x001f		/* Software Timer Register */
25786d7f5d3SJohn Marino #define	LE_BCR32	0x0020		/* PHY Control and Status Register */
25886d7f5d3SJohn Marino #define	LE_BCR33	0x0021		/* PHY Address Register */
25986d7f5d3SJohn Marino #define	LE_BCR34	0x0022		/* PHY Management Data Register */
26086d7f5d3SJohn Marino #define	LE_BCR35	0x0023		/* PCI Vendor ID Register */
26186d7f5d3SJohn Marino #define	LE_BCR36	0x0024		/* PCI Power Management Cap. Alias */
26286d7f5d3SJohn Marino #define	LE_BCR37	0x0025		/* PCI DATA0 Alias */
26386d7f5d3SJohn Marino #define	LE_BCR38	0x0026		/* PCI DATA1 Alias */
26486d7f5d3SJohn Marino #define	LE_BCR39	0x0027		/* PCI DATA2 Alias */
26586d7f5d3SJohn Marino #define	LE_BCR40	0x0028		/* PCI DATA3 Alias */
26686d7f5d3SJohn Marino #define	LE_BCR41	0x0029		/* PCI DATA4 Alias */
26786d7f5d3SJohn Marino #define	LE_BCR42	0x002a		/* PCI DATA5 Alias */
26886d7f5d3SJohn Marino #define	LE_BCR43	0x002b		/* PCI DATA6 Alias */
26986d7f5d3SJohn Marino #define	LE_BCR44	0x002c		/* PCI DATA7 Alias */
27086d7f5d3SJohn Marino #define	LE_BCR45	0x002d		/* OnNow Pattern Matching 1 */
27186d7f5d3SJohn Marino #define	LE_BCR46	0x002e		/* OnNow Pattern Matching 2 */
27286d7f5d3SJohn Marino #define	LE_BCR47	0x002f		/* OnNow Pattern Matching 3 */
27386d7f5d3SJohn Marino #define	LE_BCR48	0x0030		/* LED4 Status */
27486d7f5d3SJohn Marino #define	LE_BCR49	0x0031		/* PHY Select */
27586d7f5d3SJohn Marino 
27686d7f5d3SJohn Marino /* Control and status register 0 (csr0) */
27786d7f5d3SJohn Marino #define	LE_C0_ERR	0x8000		/* error summary */
27886d7f5d3SJohn Marino #define	LE_C0_BABL	0x4000		/* transmitter timeout error */
27986d7f5d3SJohn Marino #define	LE_C0_CERR	0x2000		/* collision */
28086d7f5d3SJohn Marino #define	LE_C0_MISS	0x1000		/* missed a packet */
28186d7f5d3SJohn Marino #define	LE_C0_MERR	0x0800		/* memory error */
28286d7f5d3SJohn Marino #define	LE_C0_RINT	0x0400		/* receiver interrupt */
28386d7f5d3SJohn Marino #define	LE_C0_TINT	0x0200		/* transmitter interrupt */
28486d7f5d3SJohn Marino #define	LE_C0_IDON	0x0100		/* initialization done */
28586d7f5d3SJohn Marino #define	LE_C0_INTR	0x0080		/* interrupt condition */
28686d7f5d3SJohn Marino #define	LE_C0_INEA	0x0040		/* interrupt enable */
28786d7f5d3SJohn Marino #define	LE_C0_RXON	0x0020		/* receiver on */
28886d7f5d3SJohn Marino #define	LE_C0_TXON	0x0010		/* transmitter on */
28986d7f5d3SJohn Marino #define	LE_C0_TDMD	0x0008		/* transmit demand */
29086d7f5d3SJohn Marino #define	LE_C0_STOP	0x0004		/* disable all external activity */
29186d7f5d3SJohn Marino #define	LE_C0_STRT	0x0002		/* enable external activity */
29286d7f5d3SJohn Marino #define	LE_C0_INIT	0x0001		/* begin initialization */
29386d7f5d3SJohn Marino 
29486d7f5d3SJohn Marino #define	LE_C0_BITS \
29586d7f5d3SJohn Marino     "\20\20ERR\17BABL\16CERR\15MISS\14MERR\13RINT\
29686d7f5d3SJohn Marino \12TINT\11IDON\10INTR\07INEA\06RXON\05TXON\04TDMD\03STOP\02STRT\01INIT"
29786d7f5d3SJohn Marino 
29886d7f5d3SJohn Marino /* Control and status register 3 (csr3) */
29986d7f5d3SJohn Marino #define	LE_C3_BABLM	0x4000		/* babble mask */
30086d7f5d3SJohn Marino #define	LE_C3_MISSM	0x1000		/* missed frame mask */
30186d7f5d3SJohn Marino #define	LE_C3_MERRM	0x0800		/* memory error mask */
30286d7f5d3SJohn Marino #define	LE_C3_RINTM	0x0400		/* receive interrupt mask */
30386d7f5d3SJohn Marino #define	LE_C3_TINTM	0x0200		/* transmit interrupt mask */
30486d7f5d3SJohn Marino #define	LE_C3_IDONM	0x0100		/* initialization done mask */
30586d7f5d3SJohn Marino #define	LE_C3_DXSUFLO	0x0040		/* disable tx stop on underflow */
30686d7f5d3SJohn Marino #define	LE_C3_LAPPEN	0x0020		/* look ahead packet processing enbl */
30786d7f5d3SJohn Marino #define	LE_C3_DXMT2PD	0x0010		/* disable tx two part deferral */
30886d7f5d3SJohn Marino #define	LE_C3_EMBA	0x0008		/* enable modified backoff algorithm */
30986d7f5d3SJohn Marino #define	LE_C3_BSWP	0x0004		/* byte swap */
31086d7f5d3SJohn Marino #define	LE_C3_ACON	0x0002		/* ALE control, eh? */
31186d7f5d3SJohn Marino #define	LE_C3_BCON	0x0001		/* byte control */
31286d7f5d3SJohn Marino 
31386d7f5d3SJohn Marino /* Control and status register 4 (csr4) */
31486d7f5d3SJohn Marino #define	LE_C4_EN124	0x8000		/* enable CSR124 */
31586d7f5d3SJohn Marino #define	LE_C4_DMAPLUS	0x4000		/* always set (PCnet-PCI) */
31686d7f5d3SJohn Marino #define	LE_C4_TIMER	0x2000		/* enable bus activity timer */
31786d7f5d3SJohn Marino #define	LE_C4_TXDPOLL	0x1000		/* disable transmit polling */
31886d7f5d3SJohn Marino #define	LE_C4_APAD_XMT	0x0800		/* auto pad transmit */
31986d7f5d3SJohn Marino #define	LE_C4_ASTRP_RCV	0x0400		/* auto strip receive */
32086d7f5d3SJohn Marino #define	LE_C4_MFCO	0x0200		/* missed frame counter overflow */
32186d7f5d3SJohn Marino #define	LE_C4_MFCOM	0x0100		/* missed frame coutner overflow mask */
32286d7f5d3SJohn Marino #define	LE_C4_UINTCMD	0x0080		/* user interrupt command */
32386d7f5d3SJohn Marino #define	LE_C4_UINT	0x0040		/* user interrupt */
32486d7f5d3SJohn Marino #define	LE_C4_RCVCCO	0x0020		/* receive collision counter overflow */
32586d7f5d3SJohn Marino #define	LE_C4_RCVCCOM	0x0010		/* receive collision counter overflow
32686d7f5d3SJohn Marino 					   mask */
32786d7f5d3SJohn Marino #define	LE_C4_TXSTRT	0x0008		/* transmit start status */
32886d7f5d3SJohn Marino #define	LE_C4_TXSTRTM	0x0004		/* transmit start mask */
32986d7f5d3SJohn Marino 
33086d7f5d3SJohn Marino /* Control and status register 5 (csr5) */
33186d7f5d3SJohn Marino #define	LE_C5_TOKINTD	0x8000		/* transmit ok interrupt disable */
33286d7f5d3SJohn Marino #define	LE_C5_LTINTEN	0x4000		/* last transmit interrupt enable */
33386d7f5d3SJohn Marino #define	LE_C5_SINT	0x0800		/* system interrupt */
33486d7f5d3SJohn Marino #define	LE_C5_SINTE	0x0400		/* system interrupt enable */
33586d7f5d3SJohn Marino #define	LE_C5_EXDINT	0x0080		/* excessive deferral interrupt */
33686d7f5d3SJohn Marino #define	LE_C5_EXDINTE	0x0040		/* excessive deferral interrupt enbl */
33786d7f5d3SJohn Marino #define	LE_C5_MPPLBA	0x0020		/* magic packet physical logical
33886d7f5d3SJohn Marino 					   broadcast accept */
33986d7f5d3SJohn Marino #define	LE_C5_MPINT	0x0010		/* magic packet interrupt */
34086d7f5d3SJohn Marino #define	LE_C5_MPINTE	0x0008		/* magic packet interrupt enable */
34186d7f5d3SJohn Marino #define	LE_C5_MPEN	0x0004		/* magic packet enable */
34286d7f5d3SJohn Marino #define	LE_C5_MPMODE	0x0002		/* magic packet mode */
34386d7f5d3SJohn Marino #define	LE_C5_SPND	0x0001		/* suspend */
34486d7f5d3SJohn Marino 
34586d7f5d3SJohn Marino /* Control and status register 6 (csr6) */
34686d7f5d3SJohn Marino #define	LE_C6_TLEN	0xf000		/* TLEN from init block */
34786d7f5d3SJohn Marino #define	LE_C6_RLEN	0x0f00		/* RLEN from init block */
34886d7f5d3SJohn Marino 
34986d7f5d3SJohn Marino /* Control and status register 7 (csr7) */
35086d7f5d3SJohn Marino #define	LE_C7_FASTSPNDE	0x8000		/* fast suspend enable */
35186d7f5d3SJohn Marino #define	LE_C7_RDMD	0x2000		/* receive demand */
35286d7f5d3SJohn Marino #define	LE_C7_RDXPOLL	0x1000		/* receive disable polling */
35386d7f5d3SJohn Marino #define	LE_C7_STINT	0x0800		/* software timer interrupt */
35486d7f5d3SJohn Marino #define	LE_C7_STINTE	0x0400		/* software timer interrupt enable */
35586d7f5d3SJohn Marino #define	LE_C7_MREINT	0x0200		/* PHY management read error intr */
35686d7f5d3SJohn Marino #define	LE_C7_MREINTE	0x0100		/* PHY management read error intr
35786d7f5d3SJohn Marino 					   enable */
35886d7f5d3SJohn Marino #define	LE_C7_MAPINT	0x0080		/* PHY management auto-poll intr */
35986d7f5d3SJohn Marino #define	LE_C7_MAPINTE	0x0040		/* PHY management auto-poll intr
36086d7f5d3SJohn Marino 					   enable */
36186d7f5d3SJohn Marino #define	LE_C7_MCCINT	0x0020		/* PHY management command complete
36286d7f5d3SJohn Marino 					   interrupt */
36386d7f5d3SJohn Marino #define	LE_C7_MCCINTE	0x0010		/* PHY management command complete
36486d7f5d3SJohn Marino 					   interrupt enable */
36586d7f5d3SJohn Marino #define	LE_C7_MCCIINT	0x0008		/* PHY management command complete
36686d7f5d3SJohn Marino 					   internal interrupt */
36786d7f5d3SJohn Marino #define	LE_C7_MCCIINTE	0x0004		/* PHY management command complete
36886d7f5d3SJohn Marino 					   internal interrupt enable */
36986d7f5d3SJohn Marino #define	LE_C7_MIIPDTINT	0x0002		/* PHY management detect transition
37086d7f5d3SJohn Marino 					   interrupt */
37186d7f5d3SJohn Marino #define	LE_C7_MIIPDTINTE 0x0001		/* PHY management detect transition
37286d7f5d3SJohn Marino 					   interrupt enable */
37386d7f5d3SJohn Marino 
37486d7f5d3SJohn Marino /* Control and status register 15 (csr15) */
37586d7f5d3SJohn Marino #define	LE_C15_PROM	0x8000		/* promiscuous mode */
37686d7f5d3SJohn Marino #define	LE_C15_DRCVBC	0x4000		/* disable Rx of broadcast */
37786d7f5d3SJohn Marino #define	LE_C15_DRCVPA	0x2000		/* disable Rx of physical address */
37886d7f5d3SJohn Marino #define	LE_C15_DLNKTST	0x1000		/* disable link status */
37986d7f5d3SJohn Marino #define	LE_C15_DAPC	0x0800		/* disable auto-polarity correction */
38086d7f5d3SJohn Marino #define	LE_C15_MENDECL	0x0400		/* MENDEC Loopback mode */
38186d7f5d3SJohn Marino #define	LE_C15_LRT	0x0200		/* low receive threshold (TMAU) */
38286d7f5d3SJohn Marino #define	LE_C15_TSEL	0x0200		/* transmit mode select (AUI) */
38386d7f5d3SJohn Marino #define	LE_C15_PORTSEL(x) ((x) << 7)	/* port select */
38486d7f5d3SJohn Marino #define	LE_C15_INTL	0x0040		/* internal loopback */
38586d7f5d3SJohn Marino #define	LE_C15_DRTY	0x0020		/* disable retry */
38686d7f5d3SJohn Marino #define	LE_C15_FCOLL	0x0010		/* force collision */
38786d7f5d3SJohn Marino #define	LE_C15_DXMTFCS	0x0008		/* disable Tx FCS (ADD_FCS overrides) */
38886d7f5d3SJohn Marino #define	LE_C15_LOOP	0x0004		/* loopback enable */
38986d7f5d3SJohn Marino #define	LE_C15_DTX	0x0002		/* disable transmit */
39086d7f5d3SJohn Marino #define	LE_C15_DRX	0x0001		/* disable receiver */
39186d7f5d3SJohn Marino 
39286d7f5d3SJohn Marino #define	LE_PORTSEL_AUI	0
39386d7f5d3SJohn Marino #define	LE_PORTSEL_10T	1
39486d7f5d3SJohn Marino #define	LE_PORTSEL_GPSI	2
39586d7f5d3SJohn Marino #define	LE_PORTSEL_MII	3
39686d7f5d3SJohn Marino #define	LE_PORTSEL_MASK	3
39786d7f5d3SJohn Marino 
39886d7f5d3SJohn Marino /* control and status register 80 (csr80) */
39986d7f5d3SJohn Marino #define	LE_C80_RCVFW(x)	((x) << 12)	/* Receive FIFO Watermark */
40086d7f5d3SJohn Marino #define	LE_C80_RCVFW_MAX 3
40186d7f5d3SJohn Marino #define	LE_C80_XMTSP(x)	((x) << 10)	/* Transmit Start Point */
40286d7f5d3SJohn Marino #define	LE_C80_XMTSP_MAX 3
40386d7f5d3SJohn Marino #define	LE_C80_XMTFW(x)	((x) << 8)	/* Transmit FIFO Watermark */
40486d7f5d3SJohn Marino #define	LE_C80_XMTFW_MAX 3
40586d7f5d3SJohn Marino #define	LE_C80_DMATC	0x00ff		/* DMA transfer counter */
40686d7f5d3SJohn Marino 
40786d7f5d3SJohn Marino /* control and status register 116 (csr116) */
40886d7f5d3SJohn Marino #define	LE_C116_PME_EN_OVR 0x0400	/* PME_EN overwrite */
40986d7f5d3SJohn Marino #define	LE_C116_LCDET	   0x0200	/* link change detected */
41086d7f5d3SJohn Marino #define	LE_C116_LCMODE	   0x0100	/* link change wakeup mode */
41186d7f5d3SJohn Marino #define	LE_C116_PMAT	   0x0080	/* pattern matched */
41286d7f5d3SJohn Marino #define	LE_C116_EMPPLBA	   0x0040	/* magic packet physical logical
41386d7f5d3SJohn Marino 					   broadcast accept */
41486d7f5d3SJohn Marino #define	LE_C116_MPMAT	   0x0020	/* magic packet match */
41586d7f5d3SJohn Marino #define	LE_C116_MPPEN	   0x0010	/* magic packet pin enable */
41686d7f5d3SJohn Marino #define	LE_C116_RST_POL	   0x0001	/* PHY_RST pin polarity */
41786d7f5d3SJohn Marino 
41886d7f5d3SJohn Marino /* control and status register 122 (csr122) */
41986d7f5d3SJohn Marino #define	LE_C122_RCVALGN	0x0001		/* receive packet align */
42086d7f5d3SJohn Marino 
42186d7f5d3SJohn Marino /* control and status register 124 (csr124) */
42286d7f5d3SJohn Marino #define	LE_C124_RPA	0x0008		/* runt packet accept */
42386d7f5d3SJohn Marino 
42486d7f5d3SJohn Marino /* control and status register 125 (csr125) */
42586d7f5d3SJohn Marino #define	LE_C125_IPG	0xff00		/* inter-packet gap */
42686d7f5d3SJohn Marino #define	LE_C125_IFS1	0x00ff		/* inter-frame spacing part 1 */
42786d7f5d3SJohn Marino 
42886d7f5d3SJohn Marino /* bus configuration register 0 (bcr0) */
42986d7f5d3SJohn Marino #define	LE_B0_MSRDA	0xffff		/* reserved locations */
43086d7f5d3SJohn Marino 
43186d7f5d3SJohn Marino /* bus configuration register 1 (bcr1) */
43286d7f5d3SJohn Marino #define	LE_B1_MSWRA	0xffff		/* reserved locations */
43386d7f5d3SJohn Marino 
43486d7f5d3SJohn Marino /* bus configuration register 2 (bcr2) */
43586d7f5d3SJohn Marino #define	LE_B2_PHYSSELEN	0x2000		/* enable writes to BCR18[4:3] */
43686d7f5d3SJohn Marino #define	LE_B2_LEDPE	0x1000		/* LED program enable */
43786d7f5d3SJohn Marino #define	LE_B2_APROMWE	0x0100		/* Address PROM Write Enable */
43886d7f5d3SJohn Marino #define	LE_B2_INTLEVEL	0x0080		/* 1 == edge triggered */
43986d7f5d3SJohn Marino #define	LE_B2_DXCVRCTL	0x0020		/* DXCVR control */
44086d7f5d3SJohn Marino #define	LE_B2_DXCVRPOL	0x0010		/* DXCVR polarity */
44186d7f5d3SJohn Marino #define	LE_B2_EADISEL	0x0008		/* EADI select */
44286d7f5d3SJohn Marino #define	LE_B2_AWAKE	0x0004		/* power saving mode select */
44386d7f5d3SJohn Marino #define	LE_B2_ASEL	0x0002		/* auto-select PORTSEL */
44486d7f5d3SJohn Marino #define	LE_B2_XMAUSEL	0x0001		/* reserved location */
44586d7f5d3SJohn Marino 
44686d7f5d3SJohn Marino /* bus configuration register 4 (bcr4) */
44786d7f5d3SJohn Marino /* bus configuration register 5 (bcr5) */
44886d7f5d3SJohn Marino /* bus configuration register 6 (bcr6) */
44986d7f5d3SJohn Marino /* bus configuration register 7 (bcr7) */
45086d7f5d3SJohn Marino /* bus configuration register 48 (bcr48) */
45186d7f5d3SJohn Marino #define	LE_B4_LEDOUT	0x8000		/* LED output active */
45286d7f5d3SJohn Marino #define	LE_B4_LEDPOL	0x4000		/* LED polarity */
45386d7f5d3SJohn Marino #define	LE_B4_LEDDIS	0x2000		/* LED disable */
45486d7f5d3SJohn Marino #define	LE_B4_100E	0x1000		/* 100Mb/s enable */
45586d7f5d3SJohn Marino #define	LE_B4_MPSE	0x0200		/* magic packet status enable */
45686d7f5d3SJohn Marino #define	LE_B4_FDLSE	0x0100		/* full-duplex link status enable */
45786d7f5d3SJohn Marino #define	LE_B4_PSE	0x0080		/* pulse stretcher enable */
45886d7f5d3SJohn Marino #define	LE_B4_LNKSE	0x0040		/* link status enable */
45986d7f5d3SJohn Marino #define	LE_B4_RCVME	0x0020		/* receive match status enable */
46086d7f5d3SJohn Marino #define	LE_B4_XMTE	0x0010		/* transmit status enable */
46186d7f5d3SJohn Marino #define	LE_B4_POWER	0x0008		/* power enable */
46286d7f5d3SJohn Marino #define	LE_B4_RCVE	0x0004		/* receive status enable */
46386d7f5d3SJohn Marino #define	LE_B4_SPEED	0x0002		/* high speed enable */
46486d7f5d3SJohn Marino #define	LE_B4_COLE	0x0001		/* collision status enable */
46586d7f5d3SJohn Marino 
46686d7f5d3SJohn Marino /* bus configuration register 9 (bcr9) */
46786d7f5d3SJohn Marino #define	LE_B9_FDRPAD	0x0004		/* full-duplex runt packet accept
46886d7f5d3SJohn Marino 					   disable */
46986d7f5d3SJohn Marino #define	LE_B9_AUIFD	0x0002		/* AUI full-duplex */
47086d7f5d3SJohn Marino #define	LE_B9_FDEN	0x0001		/* full-duplex enable */
47186d7f5d3SJohn Marino 
47286d7f5d3SJohn Marino /* bus configuration register 18 (bcr18) */
47386d7f5d3SJohn Marino #define	LE_B18_ROMTMG	0xf000		/* expansion rom timing */
47486d7f5d3SJohn Marino #define	LE_B18_NOUFLO	0x0800		/* no underflow on transmit */
47586d7f5d3SJohn Marino #define	LE_B18_MEMCMD	0x0200		/* memory read multiple enable */
47686d7f5d3SJohn Marino #define	LE_B18_EXTREQ	0x0100		/* extended request */
47786d7f5d3SJohn Marino #define	LE_B18_DWIO	0x0080		/* double-word I/O */
47886d7f5d3SJohn Marino #define	LE_B18_BREADE	0x0040		/* burst read enable */
47986d7f5d3SJohn Marino #define	LE_B18_BWRITE	0x0020		/* burst write enable */
48086d7f5d3SJohn Marino #define	LE_B18_PHYSEL1	0x0010		/* PHYSEL 1 */
48186d7f5d3SJohn Marino #define	LE_B18_PHYSEL0	0x0008		/* PHYSEL 0 */
48286d7f5d3SJohn Marino 					/*	00	ex ROM/Flash	*/
48386d7f5d3SJohn Marino 					/*	01	EADI/MII snoop	*/
48486d7f5d3SJohn Marino 					/*	10	reserved	*/
48586d7f5d3SJohn Marino 					/*	11	reserved	*/
48686d7f5d3SJohn Marino #define	LE_B18_LINBC	0x0007		/* reserved locations */
48786d7f5d3SJohn Marino 
48886d7f5d3SJohn Marino /* bus configuration register 19 (bcr19) */
48986d7f5d3SJohn Marino #define	LE_B19_PVALID	0x8000		/* EEPROM status valid */
49086d7f5d3SJohn Marino #define	LE_B19_PREAD	0x4000		/* EEPROM read command */
49186d7f5d3SJohn Marino #define	LE_B19_EEDET	0x2000		/* EEPROM detect */
49286d7f5d3SJohn Marino #define	LE_B19_EEN	0x0010		/* EEPROM port enable */
49386d7f5d3SJohn Marino #define	LE_B19_ECS	0x0004		/* EEPROM chip select */
49486d7f5d3SJohn Marino #define	LE_B19_ESK	0x0002		/* EEPROM serial clock */
49586d7f5d3SJohn Marino #define	LE_B19_EDI	0x0001		/* EEPROM data in */
49686d7f5d3SJohn Marino #define	LE_B19_EDO	0x0001		/* EEPROM data out */
49786d7f5d3SJohn Marino 
49886d7f5d3SJohn Marino /* bus configuration register 20 (bcr20) */
49986d7f5d3SJohn Marino #define	LE_B20_APERREN	0x0400		/* Advanced parity error handling */
50086d7f5d3SJohn Marino #define	LE_B20_CSRPCNET	0x0200		/* PCnet-style CSRs (0 = ILACC) */
50186d7f5d3SJohn Marino #define	LE_B20_SSIZE32	0x0100		/* Software Size 32-bit */
50286d7f5d3SJohn Marino #define	LE_B20_SSTYLE	0x0007		/* Software Style */
50386d7f5d3SJohn Marino #define	LE_B20_SSTYLE_LANCE	0	/* LANCE/PCnet-ISA (16-bit) */
50486d7f5d3SJohn Marino #define	LE_B20_SSTYLE_ILACC	1	/* ILACC (32-bit) */
50586d7f5d3SJohn Marino #define	LE_B20_SSTYLE_PCNETPCI2	2	/* PCnet-PCI (32-bit) */
50686d7f5d3SJohn Marino #define	LE_B20_SSTYLE_PCNETPCI3	3	/* PCnet-PCI II (32-bit) */
50786d7f5d3SJohn Marino 
50886d7f5d3SJohn Marino /* bus configuration register 25 (bcr25) */
50986d7f5d3SJohn Marino #define	LE_B25_SRAM_SIZE  0x00ff	/* SRAM size */
51086d7f5d3SJohn Marino 
51186d7f5d3SJohn Marino /* bus configuration register 26 (bcr26) */
51286d7f5d3SJohn Marino #define	LE_B26_SRAM_BND	  0x00ff	/* SRAM boundary */
51386d7f5d3SJohn Marino 
51486d7f5d3SJohn Marino /* bus configuration register 27 (bcr27) */
51586d7f5d3SJohn Marino #define	LE_B27_PTRTST	0x8000		/* reserved for manuf. tests */
51686d7f5d3SJohn Marino #define	LE_B27_LOLATRX	0x4000		/* low latency receive */
51786d7f5d3SJohn Marino #define	LE_B27_EBCS	0x0038		/* expansion bus clock source */
51886d7f5d3SJohn Marino 					/*	000	CLK pin		*/
51986d7f5d3SJohn Marino 					/*	001	time base clock	*/
52086d7f5d3SJohn Marino 					/*	010	EBCLK pin	*/
52186d7f5d3SJohn Marino 					/*	011	reserved	*/
52286d7f5d3SJohn Marino 					/*	1xx	reserved	*/
52386d7f5d3SJohn Marino #define	LE_B27_CLK_FAC	0x0007		/* clock factor */
52486d7f5d3SJohn Marino 					/*	000	1		*/
52586d7f5d3SJohn Marino 					/*	001	1/2		*/
52686d7f5d3SJohn Marino 					/*	010	reserved	*/
52786d7f5d3SJohn Marino 					/*	011	1/4		*/
52886d7f5d3SJohn Marino 					/*	1xx	reserved	*/
52986d7f5d3SJohn Marino 
53086d7f5d3SJohn Marino /* bus configuration register 28 (bcr28) */
53186d7f5d3SJohn Marino #define	LE_B28_EADDRL	0xffff		/* expansion port address lower */
53286d7f5d3SJohn Marino 
53386d7f5d3SJohn Marino /* bus configuration register 29 (bcr29) */
53486d7f5d3SJohn Marino #define	LE_B29_FLASH	0x8000		/* flash access */
53586d7f5d3SJohn Marino #define	LE_B29_LAAINC	0x4000		/* lower address auto increment */
53686d7f5d3SJohn Marino #define	LE_B29_EPADDRU	0x0007		/* expansion port address upper */
53786d7f5d3SJohn Marino 
53886d7f5d3SJohn Marino /* bus configuration register 30 (bcr30) */
53986d7f5d3SJohn Marino #define	LE_B30_EBDATA	0xffff		/* expansion bus data port */
54086d7f5d3SJohn Marino 
54186d7f5d3SJohn Marino /* bus configuration register 31 (bcr31) */
54286d7f5d3SJohn Marino #define	LE_B31_STVAL	0xffff		/* software timer value */
54386d7f5d3SJohn Marino 
54486d7f5d3SJohn Marino /* bus configuration register 32 (bcr32) */
54586d7f5d3SJohn Marino #define	LE_B32_ANTST	0x8000		/* reserved for manuf. tests */
54686d7f5d3SJohn Marino #define	LE_B32_MIIPD	0x4000		/* MII PHY Detect (manuf. tests) */
54786d7f5d3SJohn Marino #define	LE_B32_FMDC	0x3000		/* fast management data clock */
54886d7f5d3SJohn Marino #define	LE_B32_APEP	0x0800		/* auto-poll PHY */
54986d7f5d3SJohn Marino #define	LE_B32_APDW	0x0700		/* auto-poll dwell time */
55086d7f5d3SJohn Marino #define	LE_B32_DANAS	0x0080		/* disable autonegotiation */
55186d7f5d3SJohn Marino #define	LE_B32_XPHYRST	0x0040		/* PHY reset */
55286d7f5d3SJohn Marino #define	LE_B32_XPHYANE	0x0020		/* PHY autonegotiation enable */
55386d7f5d3SJohn Marino #define	LE_B32_XPHYFD	0x0010		/* PHY full-duplex */
55486d7f5d3SJohn Marino #define	LE_B32_XPHYSP	0x0008		/* PHY speed */
55586d7f5d3SJohn Marino #define	LE_B32_MIIILP	0x0002		/* MII internal loopback */
55686d7f5d3SJohn Marino 
55786d7f5d3SJohn Marino /* bus configuration register 33 (bcr33) */
55886d7f5d3SJohn Marino #define	LE_B33_SHADOW	0x8000		/* shadow enable */
55986d7f5d3SJohn Marino #define	LE_B33_MII_SEL	0x4000		/* MII selected */
56086d7f5d3SJohn Marino #define	LE_B33_ACOMP	0x2000		/* internal PHY autonegotiation comp */
56186d7f5d3SJohn Marino #define	LE_B33_LINK	0x1000		/* link status */
56286d7f5d3SJohn Marino #define	LE_B33_FDX	0x0800		/* full-duplex */
56386d7f5d3SJohn Marino #define	LE_B33_SPEED	0x0400		/* 1 == high speed */
56486d7f5d3SJohn Marino #define	LE_B33_PHYAD	0x03e0		/* PHY address */
56586d7f5d3SJohn Marino #define	PHYAD_SHIFT	5
56686d7f5d3SJohn Marino #define	LE_B33_REGAD	0x001f		/* register address */
56786d7f5d3SJohn Marino 
56886d7f5d3SJohn Marino /* bus configuration register 34 (bcr34) */
56986d7f5d3SJohn Marino #define	LE_B34_MIIMD	0xffff		/* MII data */
57086d7f5d3SJohn Marino 
57186d7f5d3SJohn Marino /* bus configuration register 49 (bcr49) */
57286d7f5d3SJohn Marino #define	LE_B49_PCNET	0x8000		/* PCnet mode - Must Be One */
57386d7f5d3SJohn Marino #define	LE_B49_PHYSEL_D	0x0300		/* PHY_SEL_Default */
57486d7f5d3SJohn Marino #define	LE_B49_PHYSEL_L	0x0010		/* PHY_SEL_Lock */
57586d7f5d3SJohn Marino #define	LE_B49_PHYSEL	0x0003		/* PHYSEL */
57686d7f5d3SJohn Marino 					/*	00	10baseT PHY	*/
57786d7f5d3SJohn Marino 					/*	01	HomePNA PHY	*/
57886d7f5d3SJohn Marino 					/*	10	external PHY	*/
57986d7f5d3SJohn Marino 					/*	11	reserved	*/
58086d7f5d3SJohn Marino 
58186d7f5d3SJohn Marino /* Initialization block (mode) */
58286d7f5d3SJohn Marino #define	LE_MODE_PROM	0x8000		/* promiscuous mode */
58386d7f5d3SJohn Marino /*			0x7f80		   reserved, must be zero */
58486d7f5d3SJohn Marino /* 0x4000 - 0x0080 are not available on LANCE 7990. */
58586d7f5d3SJohn Marino #define	LE_MODE_DRCVBC	0x4000		/* disable receive brodcast */
58686d7f5d3SJohn Marino #define	LE_MODE_DRCVPA	0x2000		/* disable physical address detection */
58786d7f5d3SJohn Marino #define	LE_MODE_DLNKTST	0x1000		/* disable link status */
58886d7f5d3SJohn Marino #define	LE_MODE_DAPC	0x0800		/* disable automatic polarity correction */
58986d7f5d3SJohn Marino #define	LE_MODE_MENDECL	0x0400		/* MENDEC loopback mode */
59086d7f5d3SJohn Marino #define	LE_MODE_LRTTSEL	0x0200		/* lower receive threshold /
59186d7f5d3SJohn Marino 					   transmit mode selection */
59286d7f5d3SJohn Marino #define	LE_MODE_PSEL1	0x0100		/* port selection bit1 */
59386d7f5d3SJohn Marino #define	LE_MODE_PSEL0	0x0080		/* port selection bit0 */
59486d7f5d3SJohn Marino #define	LE_MODE_INTL	0x0040		/* internal loopback */
59586d7f5d3SJohn Marino #define	LE_MODE_DRTY	0x0020		/* disable retry */
59686d7f5d3SJohn Marino #define	LE_MODE_COLL	0x0010		/* force a collision */
59786d7f5d3SJohn Marino #define	LE_MODE_DTCR	0x0008		/* disable transmit CRC */
59886d7f5d3SJohn Marino #define	LE_MODE_LOOP	0x0004		/* loopback mode */
59986d7f5d3SJohn Marino #define	LE_MODE_DTX	0x0002		/* disable transmitter */
60086d7f5d3SJohn Marino #define	LE_MODE_DRX	0x0001		/* disable receiver */
60186d7f5d3SJohn Marino #define	LE_MODE_NORMAL	0		/* none of the above */
60286d7f5d3SJohn Marino 
60386d7f5d3SJohn Marino /*
60486d7f5d3SJohn Marino  * Chip ID (CSR88 IDL, CSR89 IDU) values for various AMD PCnet parts
60586d7f5d3SJohn Marino  */
60686d7f5d3SJohn Marino #define	CHIPID_MANFID(x)	(((x) >> 1) & 0x3ff)
60786d7f5d3SJohn Marino #define	CHIPID_PARTID(x)	(((x) >> 12) & 0xffff)
60886d7f5d3SJohn Marino #define	CHIPID_VER(x)		(((x) >> 28) & 0x7)
60986d7f5d3SJohn Marino 
61086d7f5d3SJohn Marino #define	PARTID_Am79c960		0x0003
61186d7f5d3SJohn Marino #define	PARTID_Am79c961		0x2260
61286d7f5d3SJohn Marino #define	PARTID_Am79c961A	0x2261
61386d7f5d3SJohn Marino #define	PARTID_Am79c965		0x2430	/* yes, these... */
61486d7f5d3SJohn Marino #define	PARTID_Am79c970		0x2430	/* ...are the same */
61586d7f5d3SJohn Marino #define	PARTID_Am79c970A	0x2621
61686d7f5d3SJohn Marino #define	PARTID_Am79c971		0x2623
61786d7f5d3SJohn Marino #define	PARTID_Am79c972		0x2624
61886d7f5d3SJohn Marino #define	PARTID_Am79c973		0x2625
61986d7f5d3SJohn Marino #define	PARTID_Am79c978		0x2626
62086d7f5d3SJohn Marino #define	PARTID_Am79c975		0x2627
62186d7f5d3SJohn Marino #define	PARTID_Am79c976		0x2628
62286d7f5d3SJohn Marino 
62386d7f5d3SJohn Marino #endif	/* !_DEV_LE_LANCEREG_H_ */
624