Home | History | Annotate | Line # | Download | only in ic
tulipreg.h revision 1.2
      1  1.2  thorpej /*	$NetBSD: tulipreg.h,v 1.2 1999/09/02 23:25:29 thorpej Exp $	*/
      2  1.1  thorpej 
      3  1.1  thorpej /*-
      4  1.1  thorpej  * Copyright (c) 1999 The NetBSD Foundation, Inc.
      5  1.1  thorpej  * All rights reserved.
      6  1.1  thorpej  *
      7  1.1  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  thorpej  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
      9  1.1  thorpej  * NASA Ames Research Center.
     10  1.1  thorpej  *
     11  1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     12  1.1  thorpej  * modification, are permitted provided that the following conditions
     13  1.1  thorpej  * are met:
     14  1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     15  1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     16  1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     17  1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     18  1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     19  1.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     20  1.1  thorpej  *    must display the following acknowledgement:
     21  1.1  thorpej  *	This product includes software developed by the NetBSD
     22  1.1  thorpej  *	Foundation, Inc. and its contributors.
     23  1.1  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     24  1.1  thorpej  *    contributors may be used to endorse or promote products derived
     25  1.1  thorpej  *    from this software without specific prior written permission.
     26  1.1  thorpej  *
     27  1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     28  1.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     29  1.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     30  1.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     31  1.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32  1.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33  1.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34  1.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35  1.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36  1.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37  1.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     38  1.1  thorpej  */
     39  1.1  thorpej 
     40  1.1  thorpej #ifndef _DEV_IC_TULIPREG_H_
     41  1.1  thorpej #define	_DEV_IC_TULIPREG_H_
     42  1.1  thorpej 
     43  1.1  thorpej /*
     44  1.1  thorpej  * Register description for the Digital Semiconductor ``Tulip'' (21x4x)
     45  1.1  thorpej  * Ethernet controller family, and a variety of clone chips, including:
     46  1.1  thorpej  *
     47  1.1  thorpej  *	- Macronix 98713, 98713A, 98715, 98715A, 98725 (PMAC):
     48  1.1  thorpej  *
     49  1.1  thorpej  *	  These chips are fairly straight-forward Tulip clones.
     50  1.1  thorpej  *	  The 98713 and 98713A have an MII.  All have an internal
     51  1.1  thorpej  *	  transciever capable of NWAY.  The 98713A, 98715A, and
     52  1.1  thorpej  *	  98725 support power management.
     53  1.1  thorpej  *
     54  1.1  thorpej  *	- Lite-On 82C168, 82C169 (PNIC):
     55  1.1  thorpej  *
     56  1.1  thorpej  *	  These are Tulip clones with a few small differences; the
     57  1.1  thorpej  *	  EEPROM is accessed totally differently, as is the MII.
     58  1.1  thorpej  *	  The PNIC also has a built-in NWAY transciever.
     59  1.1  thorpej  *
     60  1.1  thorpej  *	- Winbond 89C840F
     61  1.1  thorpej  *
     62  1.1  thorpej  *	  Fairly straight-forward Tulip clone, with the exception
     63  1.1  thorpej  *	  that registers don't have a pad longword between them,
     64  1.1  thorpej  *	  and the receive filter is set up differently: instead of
     65  1.1  thorpej  *	  a setup packet, we have 2 32-bit multicast hash table
     66  1.1  thorpej  *	  registers, and 2 station address registers.
     67  1.1  thorpej  *
     68  1.1  thorpej  * Some of the clone chips have different registers, and some have
     69  1.1  thorpej  * different bits in the same registers.  These will be denoted by
     70  1.1  thorpej  * PMAC, PNIC, and WINB in the register/bit names.
     71  1.1  thorpej  */
     72  1.1  thorpej 
     73  1.1  thorpej /*
     74  1.1  thorpej  * Tulip buffer descriptor.  Must be 4-byte aligned.
     75  1.1  thorpej  *
     76  1.1  thorpej  * Note for receive descriptors, the byte count fields must
     77  1.1  thorpej  * be a multiple of 4.
     78  1.1  thorpej  */
     79  1.1  thorpej struct tulip_desc {
     80  1.1  thorpej 	__volatile u_int32_t td_status;	  /* Status */
     81  1.1  thorpej 	__volatile u_int32_t td_ctl;	  /* Control and Byte Counts */
     82  1.1  thorpej 	__volatile u_int32_t td_bufaddr1; /* Buffer Address 1 */
     83  1.1  thorpej 	__volatile u_int32_t td_bufaddr2; /* Buffer Address 2 */
     84  1.1  thorpej };
     85  1.1  thorpej 
     86  1.1  thorpej /*
     87  1.1  thorpej  * Descriptor Status bits common to transmit and receive.
     88  1.1  thorpej  */
     89  1.1  thorpej #define	TDSTAT_OWN	0x80000000	/* Tulip owns descriptor */
     90  1.1  thorpej #define	TDSTAT_ES	0x00008000	/* Error Summary */
     91  1.1  thorpej 
     92  1.1  thorpej /*
     93  1.1  thorpej  * Descriptor Status bits for Receive Descriptor.
     94  1.1  thorpej  */
     95  1.1  thorpej #define	TDSTAT_Rx_FF	0x40000000	/* Filtering Fail */
     96  1.2  thorpej #define	TDSTAT_WINB_Rx_RCMP 0x40000000	/* Receive Complete */
     97  1.1  thorpej #define	TDSTAT_Rx_FL	0x3fff0000	/* Frame Length including CRC */
     98  1.1  thorpej #define	TDSTAT_Rx_DE	0x00004000	/* Descriptor Error */
     99  1.1  thorpej #define	TDSTAT_Rx_DT	0x00003000	/* Data Type */
    100  1.1  thorpej #define	TDSTAT_Rx_RF	0x00000800	/* Runt Frame */
    101  1.1  thorpej #define	TDSTAT_Rx_MF	0x00000400	/* Multicast Frame */
    102  1.1  thorpej #define	TDSTAT_Rx_FS	0x00000200	/* First Descriptor */
    103  1.1  thorpej #define	TDSTAT_Rx_LS	0x00000100	/* Last Descriptor */
    104  1.1  thorpej #define	TDSTAT_Rx_TL	0x00000080	/* Frame Too Long */
    105  1.1  thorpej #define	TDSTAT_Rx_CS	0x00000040	/* Collision Seen */
    106  1.1  thorpej #define	TDSTAT_Rx_RT	0x00000020	/* Frame Type */
    107  1.1  thorpej #define	TDSTAT_Rx_RW	0x00000010	/* Receive Watchdog */
    108  1.1  thorpej #define	TDSTAT_Rx_RE	0x00000008	/* Report on MII Error */
    109  1.1  thorpej #define	TDSTAT_Rx_DB	0x00000004	/* Dribbling Bit */
    110  1.1  thorpej #define	TDSTAT_Rx_CE	0x00000002	/* CRC Error */
    111  1.1  thorpej #define	TDSTAT_Rx_ZER	0x00000001	/* Zero (always 0) */
    112  1.1  thorpej 
    113  1.1  thorpej #define	TDSTAT_Rx_LENGTH(x)	(((x) & TDSTAT_Rx_FL) >> 16)
    114  1.1  thorpej 
    115  1.1  thorpej #define	TDSTAT_Rx_DT_SR	0x00000000	/* Serial Received Frame */
    116  1.1  thorpej #define	TDSTAT_Rx_DT_IL	0x00001000	/* Internal Loopback Frame */
    117  1.1  thorpej #define	TDSTAT_Rx_DT_EL	0x00002000	/* External Loopback Frame */
    118  1.1  thorpej #define	TDSTAT_Rx_DT_r	0x00003000	/* Reserved */
    119  1.1  thorpej 
    120  1.1  thorpej /*
    121  1.1  thorpej  * Descriptor Status bits for Transmit Descriptor.
    122  1.1  thorpej  */
    123  1.2  thorpej #define	TDSTAT_WINB_Tx_TE 0x00008000	/* Transmit Error */
    124  1.1  thorpej #define	TDSTAT_Tx_TO	0x00004000	/* Transmit Jabber Timeout */
    125  1.1  thorpej #define	TDSTAT_Tx_LO	0x00000800	/* Loss of Carrier */
    126  1.1  thorpej #define	TDSTAT_Tx_NC	0x00000400	/* No Carrier */
    127  1.1  thorpej #define	TDSTAT_Tx_LC	0x00000200	/* Late Collision */
    128  1.1  thorpej #define	TDSTAT_Tx_EC	0x00000100	/* Excessive Collisions */
    129  1.1  thorpej #define	TDSTAT_Tx_HF	0x00000080	/* Heartbeat Fail */
    130  1.1  thorpej #define	TDSTAT_Tx_CC	0x00000078	/* Collision Count */
    131  1.1  thorpej #define	TDSTAT_Tx_LF	0x00000004	/* Link Fail */
    132  1.1  thorpej #define	TDSTAT_Tx_UF	0x00000002	/* Underflow Error */
    133  1.1  thorpej #define	TDSTAT_Tx_DE	0x00000001	/* Deferred */
    134  1.1  thorpej 
    135  1.1  thorpej #define	TDSTAT_Tx_COLLISIONS(x)	(((x) & TDSTAT_Tx_CC) >> 3)
    136  1.1  thorpej 
    137  1.1  thorpej /*
    138  1.1  thorpej  * Descriptor Control bits common to transmit and receive.
    139  1.1  thorpej  */
    140  1.1  thorpej #define	TDCTL_SIZE1	0x000007ff	/* Size of buffer 1 */
    141  1.1  thorpej #define	TDCTL_SIZE1_SHIFT 0
    142  1.1  thorpej 
    143  1.1  thorpej #define	TDCTL_SIZE2	0x003ff800	/* Size of buffer 2 */
    144  1.1  thorpej #define	TDCTL_SIZE2_SHIFT 11
    145  1.1  thorpej 
    146  1.1  thorpej #define	TDCTL_ER	0x02000000	/* End of Ring */
    147  1.1  thorpej #define	TDCTL_CH	0x01000000	/* Second Address Chained */
    148  1.1  thorpej 
    149  1.1  thorpej /*
    150  1.1  thorpej  * Descriptor Control bits for Transmit Descriptor.
    151  1.1  thorpej  */
    152  1.1  thorpej #define	TDCTL_Tx_IC	0x80000000	/* Interrupt on Completion */
    153  1.1  thorpej #define	TDCTL_Tx_LS	0x40000000	/* Last Segment */
    154  1.1  thorpej #define	TDCTL_Tx_FS	0x20000000	/* First Segment */
    155  1.1  thorpej #define	TDCTL_Tx_FT1	0x10000000	/* Filtering Type 1 */
    156  1.1  thorpej #define	TDCTL_Tx_SET	0x08000000	/* Setup Packet */
    157  1.1  thorpej #define	TDCTL_Tx_AC	0x04000000	/* Add CRC Disable */
    158  1.1  thorpej #define	TDCTL_Tx_DPD	0x00800000	/* Disabled Padding */
    159  1.1  thorpej #define	TDCTL_Tx_FT0	0x00400000	/* Filtering Type 0 */
    160  1.1  thorpej 
    161  1.1  thorpej /*
    162  1.1  thorpej  * The Tulip filter is programmed by "transmitting" a Setup Packet
    163  1.1  thorpej  * (indicated by TDCTL_Tx_SET).  The filtering type is indicated
    164  1.1  thorpej  * as follows:
    165  1.1  thorpej  *
    166  1.1  thorpej  *	FT1	FT0	Description
    167  1.1  thorpej  *	---	---	-----------
    168  1.1  thorpej  *	0	0	Perfect Filtering: The Tulip interprets the
    169  1.1  thorpej  *			descriptor buffer as a table of 16 MAC addresses
    170  1.1  thorpej  *			that the Tulip should receive.
    171  1.1  thorpej  *
    172  1.1  thorpej  *	0	1	Hash Filtering: The Tulip interprets the
    173  1.1  thorpej  *			descriptor buffer as a 512-bit hash table
    174  1.1  thorpej  *			plus one perfect address.  If the incoming
    175  1.1  thorpej  *			address is Multicast, the hash table filters
    176  1.1  thorpej  *			the address, else the address is filtered by
    177  1.1  thorpej  *			the perfect address.
    178  1.1  thorpej  *
    179  1.1  thorpej  *	1	0	Inverse Filtering: Like Perfect Filtering, except
    180  1.1  thorpej  *			the table is addresses that the Tulip does NOT
    181  1.1  thorpej  *			receive.
    182  1.1  thorpej  *
    183  1.1  thorpej  *	1	1	Hash-only Filtering: Like Hash Filtering, but
    184  1.1  thorpej  *			physical addresses are matched by the hash table
    185  1.1  thorpej  *			as well, and not by matching a single perfect
    186  1.1  thorpej  *			address.
    187  1.1  thorpej  *
    188  1.1  thorpej  * A Setup Packet must always be 192 bytes long.  The Tulip can store
    189  1.1  thorpej  * 16 MAC addresses.  If not all 16 are specified in Perfect Filtering
    190  1.1  thorpej  * or Inverse Filtering mode, then unused entries should duplicate
    191  1.1  thorpej  * one of the valid entries.
    192  1.1  thorpej  */
    193  1.1  thorpej #define	TDCTL_Tx_FT_PERFECT	0
    194  1.1  thorpej #define	TDCTL_Tx_FT_HASH	TDCTL_Tx_FT0
    195  1.1  thorpej #define	TDCTL_Tx_FT_INVERSE	TDCTL_Tx_FT1
    196  1.1  thorpej #define	TDCTL_Tx_FT_HASHONLY	(TDCTL_Tx_FT1|TDCTL_Tx_FT0)
    197  1.1  thorpej 
    198  1.1  thorpej #define	TULIP_SETUP_PACKET_LEN	192
    199  1.1  thorpej #define	TULIP_MAXADDRS		16
    200  1.1  thorpej #define	TULIP_MCHASHSIZE	512
    201  1.1  thorpej 
    202  1.1  thorpej /*
    203  1.1  thorpej  * Maximum size of a Tulip Ethernet Address ROM or SROM.
    204  1.1  thorpej  */
    205  1.1  thorpej #define	TULIP_MAX_ROM_SIZE	128
    206  1.1  thorpej 
    207  1.1  thorpej /*
    208  1.1  thorpej  * Tulip control registers.
    209  1.1  thorpej  */
    210  1.1  thorpej 
    211  1.1  thorpej #define	TULIP_CSR0	0x00
    212  1.1  thorpej #define	TULIP_CSR1	0x08
    213  1.1  thorpej #define	TULIP_CSR2	0x10
    214  1.1  thorpej #define	TULIP_CSR3	0x18
    215  1.1  thorpej #define	TULIP_CSR4	0x20
    216  1.1  thorpej #define	TULIP_CSR5	0x28
    217  1.1  thorpej #define	TULIP_CSR6	0x30
    218  1.1  thorpej #define	TULIP_CSR7	0x38
    219  1.1  thorpej #define	TULIP_CSR8	0x40
    220  1.1  thorpej #define	TULIP_CSR9	0x48
    221  1.1  thorpej #define	TULIP_CSR10	0x50
    222  1.1  thorpej #define	TULIP_CSR11	0x58
    223  1.1  thorpej #define	TULIP_CSR12	0x60
    224  1.1  thorpej #define	TULIP_CSR13	0x68
    225  1.1  thorpej #define	TULIP_CSR14	0x70
    226  1.1  thorpej #define	TULIP_CSR15	0x78
    227  1.1  thorpej #define	TULIP_CSR16	0x80
    228  1.1  thorpej #define	TULIP_CSR17	0x88
    229  1.1  thorpej #define	TULIP_CSR18	0x90
    230  1.1  thorpej #define	TULIP_CSR19	0x98
    231  1.1  thorpej #define	TULIP_CSR20	0xa0
    232  1.1  thorpej 
    233  1.1  thorpej /* CSR0 - Bus Mode */
    234  1.1  thorpej #define	CSR_BUSMODE		TULIP_CSR0
    235  1.1  thorpej #define	BUSMODE_SWR		0x00000001	/* software reset */
    236  1.1  thorpej #define	BUSMODE_BAR		0x00000002	/* bus arbitration */
    237  1.1  thorpej #define	BUSMODE_DSL		0x0000007c	/* descriptor skip length */
    238  1.1  thorpej #define	BUSMODE_BLE		0x00000080	/* big endian */
    239  1.1  thorpej 						/* programmable burst length */
    240  1.1  thorpej #define	BUSMODE_PBL_DEFAULT	0x00000000	/*     default value */
    241  1.1  thorpej #define	BUSMODE_PBL_1LW		0x00000100	/*     1 longword */
    242  1.1  thorpej #define	BUSMODE_PBL_2LW		0x00000200	/*     2 longwords */
    243  1.1  thorpej #define	BUSMODE_PBL_4LW		0x00000400	/*     4 longwords */
    244  1.1  thorpej #define	BUSMODE_PBL_8LW		0x00000800	/*     8 longwords */
    245  1.1  thorpej #define	BUSMODE_PBL_16LW	0x00001000	/*    16 longwords */
    246  1.1  thorpej #define	BUSMODE_PBL_32LW	0x00002000	/*    32 longwords */
    247  1.1  thorpej 						/* cache alignment */
    248  1.1  thorpej #define	BUSMODE_CAL_NONE	0x00000000	/*     no alignment */
    249  1.1  thorpej #define	BUSMODE_CAL_8LW		0x00004000	/*     8 longwords */
    250  1.1  thorpej #define	BUSMODE_CAL_16LW	0x00008000	/*    16 longwords */
    251  1.1  thorpej #define	BUSMODE_CAL_32LW	0x0000c000	/*    32 longwords */
    252  1.1  thorpej #define	BUSMODE_DAS		0x00010000	/* diagnostic address space */
    253  1.1  thorpej 						/*   must be zero on most */
    254  1.1  thorpej 						/* transmit auto-poll */
    255  1.2  thorpej 		/*
    256  1.2  thorpej 		 * Transmit auto-polling not supported on:
    257  1.2  thorpej 		 *	Winbond 89C040F
    258  1.2  thorpej 		 */
    259  1.1  thorpej #define	BUSMODE_TAP_NONE	0x00000000	/*     no auto-polling */
    260  1.1  thorpej #define	BUSMODE_TAP_200us	0x00020000	/*   200 uS */
    261  1.1  thorpej #define	BUSMODE_TAP_800us	0x00040000	/*   400 uS */
    262  1.1  thorpej #define	BUSMODE_TAP_1_6ms	0x00060000	/*   1.6 mS */
    263  1.1  thorpej #define	BUSMODE_TAP_12_8us	0x00080000	/*  12.8 uS (21041+) */
    264  1.1  thorpej #define	BUSMODE_TAP_25_6us	0x000a0000	/*  25.6 uS (21041+) */
    265  1.1  thorpej #define	BUSMODE_TAP_51_2us	0x000c0000	/*  51.2 uS (21041+) */
    266  1.1  thorpej #define	BUSMODE_TAP_102_4us	0x000e0000	/* 102.4 uS (21041+) */
    267  1.1  thorpej #define	BUSMODE_DBO		0x00100000	/* desc-only b/e (21041+) */
    268  1.1  thorpej #define	BUSMODE_RME		0x00200000	/* rd/mult enab (21140+) */
    269  1.2  thorpej #define	BUSMODE_WINB_WAIT	0x00200000	/* wait state insertion */
    270  1.1  thorpej #define	BUSMODE_RLE		0x00800000	/* rd/line enab (21140+) */
    271  1.1  thorpej #define	BUSMODE_WLE		0x01000000	/* wt/line enab (21140+) */
    272  1.1  thorpej #define	BUSMODE_PNIC_MBO	0x04000000	/* magic `must be one' bit */
    273  1.1  thorpej 						/*    on Lite-On PNIC */
    274  1.1  thorpej 
    275  1.1  thorpej 
    276  1.1  thorpej /* CSR1 - Transmit Poll Demand */
    277  1.1  thorpej #define	CSR_TXPOLL		TULIP_CSR1
    278  1.1  thorpej #define	TXPOLL_TPD		0x00000001	/* transmit poll demand */
    279  1.1  thorpej 
    280  1.1  thorpej 
    281  1.1  thorpej /* CSR2 - Receive Poll Demand */
    282  1.1  thorpej #define	CSR_RXPOLL		TULIP_CSR2
    283  1.1  thorpej #define	RXPOLL_RPD		0x00000001	/* receive poll demand */
    284  1.1  thorpej 
    285  1.1  thorpej 
    286  1.1  thorpej /* CSR3 - Receive List Base Address */
    287  1.1  thorpej #define	CSR_RXLIST		TULIP_CSR3
    288  1.1  thorpej 
    289  1.1  thorpej /* CSR4 - Transmit List Base Address */
    290  1.1  thorpej #define	CSR_TXLIST		TULIP_CSR4
    291  1.1  thorpej 
    292  1.1  thorpej /* CSR5 - Status */
    293  1.1  thorpej #define	CSR_STATUS		TULIP_CSR5
    294  1.1  thorpej #define	STATUS_TI		0x00000001	/* transmit interrupt */
    295  1.1  thorpej #define	STATUS_TPS		0x00000002	/* transmit process stopped */
    296  1.1  thorpej #define	STATUS_TU		0x00000004	/* transmit buffer unavail */
    297  1.1  thorpej #define	STATUS_TJT		0x00000008	/* transmit jabber timeout */
    298  1.2  thorpej #define	STATUS_WINB_REI		0x00000008	/* receive early interrupt */
    299  1.1  thorpej #define	STATUS_LNPANC		0x00000010	/* link pass (21041) */
    300  1.2  thorpej #define	STATUS_WINB_RERR	0x00000010	/* receive error */
    301  1.1  thorpej #define	STATUS_UNF		0x00000020	/* transmit underflow */
    302  1.1  thorpej #define	STATUS_RI		0x00000040	/* receive interrupt */
    303  1.1  thorpej #define	STATUS_RU		0x00000080	/* receive buffer unavail */
    304  1.1  thorpej #define	STATUS_RPS		0x00000100	/* receive process stopped */
    305  1.1  thorpej #define	STATUS_RWT		0x00000200	/* receive watchdog timeout */
    306  1.1  thorpej #define	STATUS_AT		0x00000400	/* SIA AUI/TP pin changed
    307  1.1  thorpej 						   (21040) */
    308  1.2  thorpej #define	STATUS_WINB_TEI		0x00000400	/* transmit early interrupt */
    309  1.1  thorpej #define	STATUS_FD		0x00000800	/* full duplex short frame
    310  1.1  thorpej 						   received (21040) */
    311  1.1  thorpej #define	STATUS_TM		0x00000800	/* timer expired (21041) */
    312  1.1  thorpej #define	STATUS_LNF		0x00001000	/* link fail (21040) */
    313  1.1  thorpej #define	STATUS_SE		0x00002000	/* system error */
    314  1.1  thorpej #define	STATUS_ER		0x00004000	/* early receive (21041) */
    315  1.1  thorpej #define	STATUS_AIS		0x00008000	/* abnormal interrupt summary */
    316  1.1  thorpej #define	STATUS_NIS		0x00010000	/* normal interrupt summary */
    317  1.1  thorpej #define	STATUS_RS		0x000e0000	/* receive process state */
    318  1.1  thorpej #define	STATUS_RS_STOPPED	0x00000000	/* Stopped */
    319  1.1  thorpej #define	STATUS_RS_FETCH		0x00020000	/* Running - fetch receive
    320  1.1  thorpej 						   descriptor */
    321  1.1  thorpej #define	STATUS_RS_CHECK		0x00040000	/* Running - check for end
    322  1.1  thorpej 						   of receive */
    323  1.1  thorpej #define	STATUS_RS_WAIT		0x00060000	/* Running - wait for packet */
    324  1.1  thorpej #define	STATUS_RS_SUSPENDED	0x00080000	/* Suspended */
    325  1.1  thorpej #define	STATUS_RS_CLOSE		0x000a0000	/* Running - close receive
    326  1.1  thorpej 						   descriptor */
    327  1.1  thorpej #define	STATUS_RS_FLUSH		0x000c0000	/* Running - flush current
    328  1.1  thorpej 						   frame from FIFO */
    329  1.1  thorpej #define	STATUS_RS_QUEUE		0x000e0000	/* Running - queue current
    330  1.1  thorpej 						   frame from FIFO into
    331  1.1  thorpej 						   buffer */
    332  1.1  thorpej #define	STATUS_TS		0x00700000	/* transmit process state */
    333  1.1  thorpej #define	STATUS_TS_STOPPED	0x00000000	/* Stopped */
    334  1.1  thorpej #define	STATUS_TS_FETCH		0x00100000	/* Running - fetch transmit
    335  1.1  thorpej 						   descriptor */
    336  1.1  thorpej #define	STATUS_TS_WAIT		0x00200000	/* Running - wait for end
    337  1.1  thorpej 						   of transmission */
    338  1.1  thorpej #define	STATUS_TS_READING	0x00300000	/* Running - read buffer from
    339  1.1  thorpej 						   memory and queue into
    340  1.1  thorpej 						   FIFO */
    341  1.1  thorpej #define	STATUS_TS_RESERVED	0x00400000	/* RESERVED */
    342  1.1  thorpej #define	STATUS_TS_SETUP		0x00500000	/* Running - Setup packet */
    343  1.1  thorpej #define	STATUS_TS_SUSPENDED	0x00600000	/* Suspended */
    344  1.1  thorpej #define	STATUS_TS_CLOSE		0x00700000	/* Running - close transmit
    345  1.1  thorpej 						   descriptor */
    346  1.1  thorpej #define	STATUS_EB		0x03800000	/* error bits */
    347  1.1  thorpej #define	STATUS_EB_PARITY	0x00000000	/* parity errror */
    348  1.1  thorpej #define	STATUS_EB_MABT		0x00800000	/* master abort */
    349  1.1  thorpej #define	STATUS_EB_TABT		0x01000000	/* target abort */
    350  1.1  thorpej 
    351  1.1  thorpej 
    352  1.1  thorpej /* CSR6 - Operation Mode */
    353  1.1  thorpej #define	CSR_OPMODE		TULIP_CSR6
    354  1.1  thorpej #define	OPMODE_HP		0x00000001	/* hash/perfect mode (ro) */
    355  1.1  thorpej #define	OPMODE_SR		0x00000002	/* start receive */
    356  1.1  thorpej #define	OPMODE_HO		0x00000004	/* hash only mode (ro) */
    357  1.1  thorpej #define	OPMODE_PB		0x00000008	/* pass bad frames */
    358  1.2  thorpej #define	OPMODE_WINB_APP		0x00000008	/* accept all physcal packet */
    359  1.1  thorpej #define	OPMODE_IF		0x00000010	/* inverse filter mode (ro) */
    360  1.2  thorpej #define	OPMODE_WINB_AMP		0x00000010	/* accept multicast packet */
    361  1.1  thorpej #define	OPMODE_SB		0x00000020	/* start backoff counter */
    362  1.2  thorpej #define	OPMODE_WINB_ABP		0x00000020	/* accept broadcast packet */
    363  1.1  thorpej #define	OPMODE_PR		0x00000040	/* promiscuous mode */
    364  1.2  thorpej #define	OPMODE_WINB_ARP		0x00000040	/* accept runt packet */
    365  1.1  thorpej #define	OPMODE_PM		0x00000080	/* pass all multicast */
    366  1.2  thorpej #define	OPMODE_WINB_AEP		0x00000080	/* accept error packet */
    367  1.1  thorpej #define	OPMODE_FKD		0x00000100	/* flaky oscillator disable */
    368  1.1  thorpej #define	OPMODE_FD		0x00000200	/* full-duplex mode */
    369  1.1  thorpej #define	OPMODE_OM		0x00000c00	/* operating mode */
    370  1.1  thorpej #define	OPMODE_OM_NORMAL	0x00000000	/*     normal mode */
    371  1.1  thorpej #define	OPMODE_OM_INTLOOP	0x00000400	/*     internal loopback */
    372  1.1  thorpej #define	OPMODE_OM_EXTLOOP	0x00000800	/*     external loopback */
    373  1.1  thorpej #define	OPMODE_FC		0x00001000	/* force collision */
    374  1.1  thorpej #define	OPMODE_ST		0x00002000	/* start transmitter */
    375  1.1  thorpej #define	OPMODE_TR		0x0000c000	/* threshold control */
    376  1.1  thorpej #define	OPMODE_TR_72		0x00000000	/*     72 bytes */
    377  1.1  thorpej #define	OPMODE_TR_96		0x00004000	/*     96 bytes */
    378  1.1  thorpej #define	OPMODE_TR_128		0x00008000	/*    128 bytes */
    379  1.1  thorpej #define	OPMODE_TR_160		0x0000c000	/*    160 bytes */
    380  1.2  thorpej #define	OPMODE_WINB_TTH		0x001fc000	/* transmit threshold */
    381  1.2  thorpej #define	OPMODE_WINB_TTH_SHIFT	14
    382  1.1  thorpej #define	OPMODE_BP		0x00010000	/* backpressure enable */
    383  1.1  thorpej #define	OPMODE_CA		0x00020000	/* capture effect enable */
    384  1.1  thorpej #define	OPMODE_PMAC_COE		0x00020000	/* collision offset enable */
    385  1.1  thorpej #define	OPMODE_PS		0x00040000	/* port select:
    386  1.1  thorpej 						   1 = MII/SYM, 0 = SRL
    387  1.1  thorpej 						   (21140) */
    388  1.1  thorpej #define	OPMODE_HBD		0x00080000	/* heartbeat disable:
    389  1.1  thorpej 						   set in MII/SYM 100mbps,
    390  1.1  thorpej 						   set according to PHY
    391  1.1  thorpej 						   in MII 10mbps mode
    392  1.1  thorpej 						   (21140) */
    393  1.1  thorpej #define	OPMODE_SF		0x00200000	/* store and forward mode
    394  1.1  thorpej 						   (21140) */
    395  1.2  thorpej #define	OPMODE_WINB_REIT	0x1fe00000	/* receive eartly intr thresh */
    396  1.2  thorpej #define	OPMODE_WINB_REIT_SHIFT	21
    397  1.1  thorpej #define	OPMODE_TTM		0x00400000	/* Transmit Threshold Mode:
    398  1.1  thorpej 						   1 = 10mbps, 0 = 100mbps
    399  1.1  thorpej 						   (21140) */
    400  1.1  thorpej #define	OPMODE_PCS		0x00800000	/* PCS function (21140) */
    401  1.1  thorpej #define	OPMODE_SCR		0x01000000	/* scrambler mode (21140) */
    402  1.1  thorpej #define	OPMODE_MBO		0x02000000	/* must be one (21140) */
    403  1.1  thorpej #define	OPMODE_PNIC_RXCRCDIS	0x20000000	/* don't include CRC in Rx
    404  1.1  thorpej 						   frames (PNIC) */
    405  1.2  thorpej #define	OPMODE_WINB_FES		0x20000000	/* fast ethernet select */
    406  1.1  thorpej #define	OPMODE_RA		0x40000000	/* receive all (21140) */
    407  1.1  thorpej #define	OPMODE_PNIC_EXT_ENDEC	0x40000000	/* 1 == ext, 0 == int PHY
    408  1.1  thorpej 						   (PNIC) */
    409  1.2  thorpej #define	OPMODE_WINB_TEIO	0x40000000	/* transmit early intr on */
    410  1.1  thorpej #define	OPMODE_SC		0x80000000	/* special capture effect
    411  1.1  thorpej 						   enable (21041+) */
    412  1.2  thorpej #define	OPMODE_WINB_REIO	0x80000000	/* receive early intr on */
    413  1.1  thorpej 
    414  1.1  thorpej /* CSR7 - Interrupt Enable */
    415  1.1  thorpej #define	CSR_INTEN		TULIP_CSR7
    416  1.1  thorpej 	/* See bits for CSR5 -- Status */
    417  1.1  thorpej 
    418  1.1  thorpej 
    419  1.1  thorpej /* CSR8 - Missed Frames */
    420  1.1  thorpej #define	CSR_MISSED		TULIP_CSR8
    421  1.1  thorpej #define	MISSED_MFC		0x0000ffff	/* missed packet count */
    422  1.1  thorpej #define	MISSED_MFO		0x00010000	/* missed packet count
    423  1.1  thorpej 						   overflowed */
    424  1.1  thorpej #define	MISSED_FOC		0x0ffe0000	/* fifo overflow counter
    425  1.1  thorpej 						   (21140) */
    426  1.1  thorpej #define	MISSED_OCO		0x10000000	/* overflow counter overflowed
    427  1.1  thorpej 						   (21140) */
    428  1.1  thorpej 
    429  1.1  thorpej #define	MISSED_GETMFC(x)	((x) & MISSED_MFC)
    430  1.1  thorpej #define	MISSED_GETFOC(x)	(((x) & MISSED_FOC) >> 17)
    431  1.1  thorpej 
    432  1.1  thorpej 
    433  1.1  thorpej /* CSR9 - MII, SROM, Boot ROM, Ethernet Address ROM register. */
    434  1.1  thorpej #define	CSR_MIIROM		TULIP_CSR9
    435  1.1  thorpej #define	MIIROM_DATA		0x000000ff	/* byte of data from
    436  1.1  thorpej 						   Ethernet Address ROM
    437  1.1  thorpej 						   (21040), byte of data
    438  1.1  thorpej 						   to/from Boot ROM (21041+) */
    439  1.1  thorpej #define	MIIROM_SROMCS		0x00000001	/* SROM chip select */
    440  1.1  thorpej #define	MIIROM_SROMSK		0x00000002	/* SROM clock */
    441  1.1  thorpej #define	MIIROM_SROMDI		0x00000004	/* SROM data in (to) */
    442  1.1  thorpej #define	MIIROM_SROMDO		0x00000008	/* SROM data out (from) */
    443  1.1  thorpej #define	MIIROM_REG		0x00000400	/* external register select */
    444  1.1  thorpej #define	MIIROM_SR		0x00000800	/* SROM select */
    445  1.1  thorpej #define	MIIROM_BR		0x00001000	/* boot ROM select */
    446  1.1  thorpej #define	MIIROM_WR		0x00002000	/* write to boot ROM */
    447  1.1  thorpej #define	MIIROM_RD		0x00004000	/* read from boot ROM */
    448  1.1  thorpej #define	MIIROM_MOD		0x00008000	/* mode select (ro) (21041) */
    449  1.1  thorpej #define	MIIROM_MDC		0x00010000	/* MII clock */
    450  1.1  thorpej #define	MIIROM_MDO		0x00020000	/* MII data out */
    451  1.1  thorpej #define	MIIROM_MIIDIR		0x00040000	/* MII direction mode
    452  1.1  thorpej 						   1 = PHY in read,
    453  1.1  thorpej 						   0 = PHY in write */
    454  1.1  thorpej #define	MIIROM_MDI		0x00080000	/* MII data in */
    455  1.1  thorpej #define	MIIROM_DN		0x80000000	/* data not valid (21040) */
    456  1.1  thorpej 
    457  1.1  thorpej 	/* SROM opcodes */
    458  1.1  thorpej #define	TULIP_SROM_OPC_ERASE	0x04
    459  1.1  thorpej #define	TULIP_SROM_OPC_WRITE	0x05
    460  1.1  thorpej #define	TULIP_SROM_OPC_READ	0x06
    461  1.1  thorpej 
    462  1.1  thorpej 	/* The Lite-On PNIC does this completely differently */
    463  1.1  thorpej #define	PNIC_MIIROM_DATA	0x0000ffff	/* mask of data bits ??? */
    464  1.1  thorpej #define	PNIC_MIIROM_BUSY	0x80000000	/* EEPROM is busy */
    465  1.1  thorpej 
    466  1.1  thorpej 
    467  1.1  thorpej /* CSR10 - Boot ROM address register (21041+). */
    468  1.1  thorpej #define	CSR_ROMADDR		TULIP_CSR10
    469  1.1  thorpej #define	ROMADDR_MASK		0x000003ff	/* boot rom address */
    470  1.1  thorpej 
    471  1.1  thorpej 
    472  1.1  thorpej /* CSR11 - General Purpose Timer (21041+). */
    473  1.1  thorpej #define	CSR_GPT			TULIP_CSR11
    474  1.1  thorpej #define	GPT_VALUE		0x0000ffff	/* timer value */
    475  1.1  thorpej #define	GPT_CON			0x00010000	/* continuous mode */
    476  1.1  thorpej 
    477  1.1  thorpej 
    478  1.1  thorpej /* CSR12 - SIA Status Register (21040, 21041). */
    479  1.1  thorpej #define	CSR_SIASTAT		TULIP_CSR12
    480  1.1  thorpej #define	SIASTAT_PAUI		0x00000001	/* pin AUI/TP indication
    481  1.1  thorpej 						   (21040) */
    482  1.1  thorpej #define	SIASTAT_NCR		0x00000002	/* network connection error */
    483  1.1  thorpej #define	SIASTAT_LKF		0x00000004	/* link fail status */
    484  1.1  thorpej #define	SIASTAT_APS		0x00000008	/* auto polarity status */
    485  1.1  thorpej #define	SIASTAT_DSD		0x00000010	/* PLL self test done */
    486  1.1  thorpej #define	SIASTAT_DSP		0x00000020	/* PLL self test pass */
    487  1.1  thorpej #define	SIASTAT_DAZ		0x00000040	/* PLL all zero */
    488  1.1  thorpej #define	SIASTAT_DAO		0x00000080	/* PLL all one */
    489  1.1  thorpej #define	SIASTAT_SRA		0x00000100	/* selected port receive
    490  1.1  thorpej 						   activity (21041) */
    491  1.1  thorpej #define	SIASTAT_NRA		0x00000200	/* non-selected port
    492  1.1  thorpej 						   receive activity (21041) */
    493  1.1  thorpej #define	SIASTAT_NSN		0x00000400	/* non-stable NLPs detected
    494  1.1  thorpej 						   (21041) */
    495  1.1  thorpej #define	SIASTAT_TRF		0x00000800	/* transmit remote fault
    496  1.1  thorpej 						   (21041) */
    497  1.1  thorpej #define	SIASTAT_ANS		0x00007000	/* autonegotiation state
    498  1.1  thorpej 						   (21041) */
    499  1.1  thorpej #define	SIASTAT_ANS_DIS		0x00000000	/*     disabled */
    500  1.1  thorpej #define	SIASTAT_ANS_TXDIS	0x00001000	/*     transmit disabled */
    501  1.1  thorpej #define	SIASTAT_ANS_ABD		0x00002000	/*     ability detect */
    502  1.1  thorpej #define	SIASTAT_ANS_ACKD	0x00003000	/*     acknowledge detect */
    503  1.1  thorpej #define	SIASTAT_ANS_ACKC	0x00004000	/*     complete acknowledge */
    504  1.1  thorpej #define	SIASTAT_ANS_FPLGOOD	0x00005000	/*     FLP link good */
    505  1.1  thorpej #define	SIASTAT_ANS_LINKCHECK	0x00006000	/*     link check */
    506  1.1  thorpej #define	SIASTAT_LPN		0x00008000	/* link partner negotiable
    507  1.1  thorpej 						   (21041) */
    508  1.1  thorpej #define	SIASTAT_LPC		0xffff0000	/* link partner code word */
    509  1.1  thorpej 
    510  1.1  thorpej #define	SIASTAT_GETLPC(x)	(((x) & SIASTAT_LPC) >> 16)
    511  1.1  thorpej 
    512  1.1  thorpej 
    513  1.1  thorpej /* CSR13 - SIA Connectivity Register (21040, 21041). */
    514  1.1  thorpej #define	CSR_SIACONN		TULIP_CSR13
    515  1.1  thorpej #define	SIACONN_SRL		0x00000001	/* SIA reset */
    516  1.1  thorpej #define	SIACONN_PS		0x00000002	/* pin AUI/TP selection
    517  1.1  thorpej 						   (21040) */
    518  1.1  thorpej #define	SIACONN_CAC		0x00000004	/* CSR autoconfiguration */
    519  1.1  thorpej #define	SIACONN_AUI		0x00000008	/* select AUI (0 = TP) */
    520  1.1  thorpej #define	SIACONN_EDP		0x00000010	/* SIA PLL external input
    521  1.1  thorpej 						   enable (21040) */
    522  1.1  thorpej #define	SIACONN_ENI		0x00000020	/* encoder input multiplexer
    523  1.1  thorpej 						   (21040) */
    524  1.1  thorpej #define	SIACONN_SIM		0x00000040	/* serial interface input
    525  1.1  thorpej 						   multiplexer (21040) */
    526  1.1  thorpej #define	SIACONN_ASE		0x00000080	/* APLL start enable
    527  1.1  thorpej 						   (21040) */
    528  1.1  thorpej #define	SIACONN_SEL		0x00000f00	/* external port output
    529  1.1  thorpej 						   multiplexer select
    530  1.1  thorpej 						   (21040) */
    531  1.1  thorpej #define	SIACONN_IE		0x00001000	/* input enable (21040) */
    532  1.1  thorpej #define	SIACONN_OE1_3		0x00002000	/* output enable 1, 3
    533  1.1  thorpej 						   (21040) */
    534  1.1  thorpej #define	SIACONN_OE2_4		0x00004000	/* output enable 2, 4
    535  1.1  thorpej 						   (21040) */
    536  1.1  thorpej #define	SIACONN_OE5_6_7		0x00008000	/* output enable 5, 6, 7
    537  1.1  thorpej 						   (21040) */
    538  1.1  thorpej #define	SIACONN_SDM		0x0000ef00	/* SIA diagnostic mode;
    539  1.1  thorpej 						   always set to this value
    540  1.1  thorpej 						   for normal operation
    541  1.1  thorpej 						   (21041) */
    542  1.1  thorpej 
    543  1.1  thorpej 
    544  1.1  thorpej /* CSR14 - SIA Transmit Receive Register (21040, 21041). */
    545  1.1  thorpej #define	CSR_SIATXRX		TULIP_CSR14
    546  1.1  thorpej #define	SIATXRX_ECEN		0x00000001	/* encoder enable */
    547  1.1  thorpej #define	SIATXRX_LBK		0x00000002	/* loopback enable */
    548  1.1  thorpej #define	SIATXRX_DREN		0x00000004	/* driver enable */
    549  1.1  thorpej #define	SIATXRX_LSE		0x00000008	/* link pulse send enable */
    550  1.1  thorpej #define	SIATXRX_CPEN		0x00000030	/* compensation enable */
    551  1.1  thorpej #define	SIATXRX_CPEN_DIS0	0x00000000	/*     disabled */
    552  1.1  thorpej #define	SIATXRX_CPEN_DIS1	0x00000010	/*     disabled */
    553  1.1  thorpej #define	SIATXRX_CPEN_HIGHPWR	0x00000020	/*     high power */
    554  1.1  thorpej #define	SIATXRX_CPEN_NORMAL	0x00000030	/*     normal */
    555  1.1  thorpej #define	SIATXRX_MBO		0x00000040	/* must be one (21041 pass 2) */
    556  1.1  thorpej #define	SIATXRX_ANE		0x00000080	/* autonegotiation enable
    557  1.1  thorpej 						   (21041) */
    558  1.1  thorpej #define	SIATXRX_RSQ		0x00000100	/* receive squelch enable */
    559  1.1  thorpej #define	SIATXRX_CSQ		0x00000200	/* collision squelch enable */
    560  1.1  thorpej #define	SIATXRX_CLD		0x00000400	/* collision detect enable */
    561  1.1  thorpej #define	SIATXRX_SQE		0x00000800	/* signal quality generation
    562  1.1  thorpej 						   enable */
    563  1.1  thorpej #define	SIATXRX_LTE		0x00001000	/* link test enable */
    564  1.1  thorpej #define	SIATXRX_APE		0x00002000	/* auto-polarity enable */
    565  1.1  thorpej #define	SIATXRX_SPP		0x00004000	/* set plarity plus */
    566  1.1  thorpej #define	SIATXRX_TAS		0x00008000	/* 10base-T/AUI autosensing
    567  1.1  thorpej 						   enable (21041) */
    568  1.1  thorpej 
    569  1.1  thorpej 
    570  1.1  thorpej /* CSR15 - SIA General Register (21040, 21041). */
    571  1.1  thorpej #define	CSR_SIAGEN		TULIP_CSR15
    572  1.1  thorpej #define	SIAGEN_JBD		0x00000001	/* jabber disable */
    573  1.1  thorpej #define	SIAGEN_HUJ		0x00000002	/* host unjab */
    574  1.1  thorpej #define	SIAGEN_JCK		0x00000004	/* jabber clock */
    575  1.1  thorpej #define	SIAGEN_ABM		0x00000008	/* BNC select (21041) */
    576  1.1  thorpej #define	SIAGEN_RWD		0x00000010	/* receive watchdog disable */
    577  1.1  thorpej #define	SIAGEN_RWR		0x00000020	/* receive watchdog release */
    578  1.1  thorpej #define	SIAGEN_LE1		0x00000040	/* LED 1 enable (21041) */
    579  1.1  thorpej #define	SIAGEN_LV1		0x00000080	/* LED 1 value (21041) */
    580  1.1  thorpej #define	SIAGEN_TSCK		0x00000100	/* test clock */
    581  1.1  thorpej #define	SIAGEN_FUSQ		0x00000200	/* force unsquelch */
    582  1.1  thorpej #define	SIAGEN_FLF		0x00000400	/* force link fail */
    583  1.1  thorpej #define	SIAGEN_LSD		0x00000800	/* LED stretch disable
    584  1.1  thorpej 						   (21041) */
    585  1.1  thorpej #define	SIAGEN_DPST		0x00001000	/* PLL self-test start */
    586  1.1  thorpej #define	SIAGEN_FRL		0x00002000	/* force receiver low */
    587  1.1  thorpej #define	SIAGEN_LE2		0x00004000	/* LED 2 enable (21041) */
    588  1.1  thorpej #define	SIAGEN_LV2		0x00008000	/* LED 2 value (21041) */
    589  1.1  thorpej 
    590  1.1  thorpej 
    591  1.1  thorpej /* CSR12 - General Purpose Port (21140+). */
    592  1.1  thorpej #define	CSR_GPP			TULIP_CSR12
    593  1.1  thorpej #define	GPP_MD			0x000000ff	/* general purpose mode/data */
    594  1.1  thorpej #define	GPP_GPC			0x00000100	/* general purpose control */
    595  1.1  thorpej #define	GPP_PNIC_SPEEDSEL	0x00000001	/* 1 == 100mbps, 0 == 10mbps
    596  1.1  thorpej 						   (PNIC) */
    597  1.1  thorpej #define	GPP_PNIC_100TX_LOOP	0x00000002	/* 1 == normal, 0 == loop
    598  1.1  thorpej 						   (PNIC) */
    599  1.1  thorpej #define	GPP_PNIC_BNC_ENB	0x00000004	/* BNC enable (PNIC) */
    600  1.1  thorpej #define	GPP_PNIC_100TX_LINK	0x00000008	/* 100base-TX link (PNIC) */
    601  1.1  thorpej #define	GPP_PNIC_MBO		0x00000030	/* must be one (PNIC) */
    602  1.1  thorpej 
    603  1.1  thorpej 
    604  1.1  thorpej /* CSR15 - Watchdog timer (21140+). */
    605  1.1  thorpej #define	CSR_WATCHDOG		TULIP_CSR15
    606  1.1  thorpej #define	WATCHDOG_JBD		0x00000001	/* jabber disable */
    607  1.1  thorpej #define	WATCHDOG_HUJ		0x00000002	/* host unjab */
    608  1.1  thorpej #define	WATCHDOG_JCK		0x00000004	/* jabber clock */
    609  1.1  thorpej #define	WATCHDOG_RWD		0x00000010	/* receive watchdog disable */
    610  1.1  thorpej #define	WATCHDOG_RWR		0x00000020	/* receive watchdog release */
    611  1.1  thorpej 
    612  1.1  thorpej 
    613  1.1  thorpej /*
    614  1.1  thorpej  * Digital Semiconductor 21040 registers.
    615  1.1  thorpej  */
    616  1.1  thorpej 
    617  1.1  thorpej /* CSR11 - Full Duplex Register */
    618  1.1  thorpej #define	CSR_21040_FDX		TULIP_CSR11
    619  1.1  thorpej #define	FDX21040_FDXACV		0x0000ffff	/* full duplex
    620  1.1  thorpej 						   autoconfiguration value */
    621  1.1  thorpej 
    622  1.1  thorpej 
    623  1.1  thorpej /* SIA configuration for 10base-T (from the 21040 manual) */
    624  1.1  thorpej #define	SIACONN_21040_10BASET	0x0000ef01
    625  1.1  thorpej #define	SIATXRX_21040_10BASET	0x0000ffff
    626  1.1  thorpej #define	SIAGEN_21040_10BASET	0x00000000
    627  1.1  thorpej 
    628  1.1  thorpej 
    629  1.1  thorpej /* SIA configuration for 10base-T full-duplex (from the 21040 manual) */
    630  1.1  thorpej #define SIACONN_21040_10BASET_FDX 0x0000ef01
    631  1.1  thorpej #define	SIATXRX_21040_10BASET_FDX 0x0000fffd
    632  1.1  thorpej #define	SIAGEN_21040_10BASET_FDX  0x00000000
    633  1.1  thorpej 
    634  1.1  thorpej 
    635  1.1  thorpej /* SIA configuration for 10base-5 (from the 21040 manual) */
    636  1.1  thorpej #define	SIACONN_21040_AUI	0x0000ef09
    637  1.1  thorpej #define	SIATXRX_21040_AUI	0x00000705
    638  1.1  thorpej #define	SIAGEN_21040_AUI	0x00000006
    639  1.1  thorpej 
    640  1.1  thorpej 
    641  1.1  thorpej /* SIA configuration for External SIA (from the 21040 manual) */
    642  1.1  thorpej #define	SIACONN_21040_EXTSIA	0x00003041
    643  1.1  thorpej #define	SIATXRX_21040_EXTSIA	0x00000000
    644  1.1  thorpej #define	SIAGEN_21040_EXTSIA	0x00000006
    645  1.1  thorpej 
    646  1.1  thorpej 
    647  1.1  thorpej /*
    648  1.1  thorpej  * Digital Semiconductor 21041 registers.
    649  1.1  thorpej  */
    650  1.1  thorpej 
    651  1.1  thorpej /* SIA configuration for 10base-T (from the 21041 manual) */
    652  1.1  thorpej #define	SIACONN_21041_10BASET	0x0000ef01
    653  1.1  thorpej #define	SIATXRX_21041_10BASET	0x0000ff3f
    654  1.1  thorpej #define	SIAGEN_21041_10BASET	0x00000000
    655  1.1  thorpej 
    656  1.1  thorpej #define	SIACONN_21041P2_10BASET	SIACONN_21041_10BASET
    657  1.1  thorpej #define	SIATXRX_21041P2_10BASET	0x0000ffff
    658  1.1  thorpej #define	SIAGEN_21041P2_10BASET	SIAGEN_21041_10BASET
    659  1.1  thorpej 
    660  1.1  thorpej 
    661  1.1  thorpej /* SIA configuration for 10base-T full-duplex (from the 21041 manual) */
    662  1.1  thorpej #define	SIACONN_21041_10BASET_FDX   0x0000ef01
    663  1.1  thorpej #define	SIATXRX_21041_10BASET_FDX   0x0000ff3d
    664  1.1  thorpej #define	SIAGEN_21041_10BASET_FDX    0x00000000
    665  1.1  thorpej 
    666  1.1  thorpej #define	SIACONN_21041P2_10BASET_FDX SIACONN_21041_10BASET_FDX
    667  1.1  thorpej #define	SIATXRX_21041P2_10BASET_FDX 0x0000ffff
    668  1.1  thorpej #define	SIAGEN_21041P2_10BASET_FDX  SIAGEN_21041_10BASET_FDX
    669  1.1  thorpej 
    670  1.1  thorpej 
    671  1.1  thorpej /* SIA configuration for 10base-5 (from the 21041 manual) */
    672  1.1  thorpej #define	SIACONN_21041_AUI	0x0000ef09
    673  1.1  thorpej #define	SIATXRX_21041_AUI	0x0000f73d
    674  1.1  thorpej #define	SIAGEN_21041_AUI	0x0000000e
    675  1.1  thorpej 
    676  1.1  thorpej #define	SIACONN_21041P2_AUI	SIACONN_21041_AUI
    677  1.1  thorpej #define	SIATXRX_21041P2_AUI	0x0000f7fd
    678  1.1  thorpej #define	SIAGEN_21041P2_AUI	SIAGEN_21041_AUI
    679  1.1  thorpej 
    680  1.1  thorpej 
    681  1.1  thorpej /* SIA configuration for 10base-2 (from the 21041 manual) */
    682  1.1  thorpej #define	SIACONN_21041_BNC	0x0000ef09
    683  1.1  thorpej #define	SIATXRX_21041_BNC	0x0000f73d
    684  1.1  thorpej #define	SIAGEN_21041_BNC	0x00000006
    685  1.1  thorpej 
    686  1.1  thorpej #define	SIACONN_21041P2_BNC	SIACONN_21041_BNC
    687  1.1  thorpej #define	SIATXRX_21041P2_BNC	0x0000f7fd
    688  1.1  thorpej #define	SIAGEN_21041P2_BNC	SIAGEN_21041_BNC
    689  1.1  thorpej 
    690  1.1  thorpej 
    691  1.1  thorpej /*
    692  1.1  thorpej  * Digital Semiconductor 21142/21143 registers.
    693  1.1  thorpej  */
    694  1.1  thorpej 
    695  1.1  thorpej /* XXX */
    696  1.1  thorpej 
    697  1.1  thorpej /*
    698  1.1  thorpej  * Lite-On 82C168/82C169 registers.
    699  1.1  thorpej  */
    700  1.1  thorpej 
    701  1.1  thorpej /* ENDEC General Register */
    702  1.1  thorpej #define	CSR_PNIC_ENDEC		0x78
    703  1.1  thorpej #define	PNIC_ENDEC_JABBERDIS	0x00000001	/* jabber disable */
    704  1.1  thorpej 
    705  1.1  thorpej /* SROM Power Register */
    706  1.1  thorpej #define	CSR_PNIC_SROMPWR	0x90
    707  1.1  thorpej 
    708  1.1  thorpej /* SROM Control Register */
    709  1.1  thorpej #define	CSR_PNIC_SROMCTL	0x98
    710  1.1  thorpej #define	PNIC_SROMCTL_addr	0x000000ff	/* mask of address bits */
    711  1.1  thorpej #define	PNIC_SROMCTL_READ	0x00000600	/* read command */
    712  1.1  thorpej 
    713  1.1  thorpej /* MII Access Register */
    714  1.1  thorpej #define	CSR_PNIC_MII		0xa0
    715  1.1  thorpej #define	PNIC_MII_DATA		0x0000ffff	/* mask of data bits */
    716  1.1  thorpej #define	PNIC_MII_REG		0x007c0000	/* register mask */
    717  1.1  thorpej #define	PNIC_MII_REGSHIFT	18
    718  1.1  thorpej #define	PNIC_MII_PHY		0x0f800000	/* phy mask */
    719  1.1  thorpej #define	PNIC_MII_PHYSHIFT	23
    720  1.1  thorpej #define	PNIC_MII_OPCODE		0x30000000	/* opcode mask */
    721  1.1  thorpej #define	PNIC_MII_RESERVED	0x00020000
    722  1.1  thorpej #define	PNIC_MII_BUSY		0x80000000	/* MII is busy */
    723  1.1  thorpej 
    724  1.1  thorpej 	/* !@##!@^ PNIC doesn't behave as it should */
    725  1.1  thorpej #define	PNIC_MII_READ		0x60020000	/* read PHY command */
    726  1.1  thorpej #define	PNIC_MII_WRITE		0x50020000	/* write PHY command */
    727  1.1  thorpej 
    728  1.1  thorpej /* NWAY Register */
    729  1.1  thorpej #define	CSR_PNIC_NWAY		0xb8
    730  1.1  thorpej #define	PNIC_NWAY_RESET		0x00000001	/* reset NWay logic */
    731  1.1  thorpej #define	PNIC_NWAY_PDOWN		0x00000002	/* power down */
    732  1.1  thorpej #define	PNIC_NWAY_BYPASS	0x00000004	/* bypass */
    733  1.1  thorpej #define	PNIC_NWAY_AUILOWCUR	0x00000008	/* AUI low current */
    734  1.1  thorpej #define	PNIC_NWAY_TPEXTEND	0x00000010	/* low squelch voltage */
    735  1.1  thorpej #define	PNIC_NWAY_POLARITY	0x00000020	/* 0 == normal, 1 == reverse */
    736  1.1  thorpej #define	PNIC_NWAY_TP		0x00000040	/* 1 == TP, 0 == AUI */
    737  1.1  thorpej #define	PNIC_NWAY_AUIVOLT	0x00000080	/* 1 == full, 0 == half */
    738  1.1  thorpej #define	PNIC_NWAY_DUPLEX	0x00000100	/* 1 == full, 0 == half */
    739  1.1  thorpej #define	PNIC_NWAY_LINKTEST	0x00000200	/* 1 == on, 0 == off */
    740  1.1  thorpej #define	PNIC_NWAY_AUTODETECT	0x00000400	/* 1 == on, 0 == off */
    741  1.1  thorpej #define	PNIC_NWAY_SPEEDSEL	0x00000800	/* 0 == 10mbps, 1 == 100mbps */
    742  1.1  thorpej #define	PNIC_NWAY_ENB		0x00001000	/* 1 == on, 0 == off */
    743  1.1  thorpej #define	PNIC_NWAY_CAP10T	0x00002000	/* adv. 10baseT */
    744  1.1  thorpej #define	PNIC_NWAY_CAP10TFDX	0x00004000	/* adv. 10baseT-FDX */
    745  1.1  thorpej #define	PNIC_NWAY_CAP100TXFDX	0x00008000	/* adv. 100baseTX-FDX */
    746  1.1  thorpej #define	PNIC_NWAY_CAP100TX	0x00010000	/* adv. 100baseTX */
    747  1.1  thorpej #define	PNIC_NWAY_CAP100T4	0x00020000	/* adv. 100base-T4 */
    748  1.1  thorpej #define	PNIC_NWAY_AUTONEGRSTR	0x02000000
    749  1.1  thorpej #define	PNIC_NWAY_REMFAULT	0x04000000	/* remote fault detected */
    750  1.1  thorpej #define	PNIC_NWAY_LPAR10T	0x08000000	/* link part. 10baseT */
    751  1.1  thorpej #define	PNIC_NWAY_LPAR10TFDX	0x10000000	/* link part. 10baseT-FDX */
    752  1.1  thorpej #define	PNIC_NWAY_LPAR100TXFDX	0x20000000	/* link part. 100baseTX-FDX */
    753  1.1  thorpej #define	PNIC_NWAY_LPAR100TX	0x40000000	/* link part. 100baseTX */
    754  1.1  thorpej #define	PNIC_NWAY_LPAR100T4	0x80000000	/* link part. 100base-T4 */
    755  1.1  thorpej 
    756  1.1  thorpej 
    757  1.1  thorpej /*
    758  1.1  thorpej  * Macronix 98713, 98713A, 98715, 98715A, 98725 registers.
    759  1.1  thorpej  */
    760  1.1  thorpej 
    761  1.1  thorpej /* CSR12 - 10base-T Status Port (similar to SIASTAT) */
    762  1.1  thorpej #define	CSR_PMAC_10TSTAT	   TULIP_CSR12
    763  1.1  thorpej #define	PMAC_10TSTAT_LS100	   0x00000002	/* link status 100TX
    764  1.1  thorpej 						   0 = link up */
    765  1.1  thorpej #define	PMAC_10TSTAT_LS10	   0x00000004	/* link status 10T
    766  1.1  thorpej 						   0 = link up */
    767  1.1  thorpej #define	PMAC_10TSTAT_APS	   0x00000008	/* auto polarity status */
    768  1.1  thorpej #define	PMAC_10TSTAT_TRF	   0x00000800	/* transmit remote fault
    769  1.1  thorpej 						   (21041) */
    770  1.1  thorpej #define	PMAC_10TSTAT_ANS	   0x00007000	/* autonegotiation state
    771  1.1  thorpej 						   (21041) */
    772  1.1  thorpej #define	PMAC_10TSTAT_ANS_DIS	   0x00000000	/*     disabled */
    773  1.1  thorpej #define	PMAC_10TSTAT_ANS_TXDIS	   0x00001000	/*     transmit disabled */
    774  1.1  thorpej #define	PMAC_10TSTAT_ANS_ABD	   0x00002000	/*     ability detect */
    775  1.1  thorpej #define	PMAC_10TSTAT_ANS_ACKD	   0x00003000	/*     acknowledge detect */
    776  1.1  thorpej #define	PMAC_10TSTAT_ANS_ACKC	   0x00004000	/*     complete acknowledge */
    777  1.1  thorpej #define	PMAC_10TSTAT_ANS_FPLGOOD   0x00005000	/*     FLP link good */
    778  1.1  thorpej #define	PMAC_10TSTAT_ANS_LINKCHECK 0x00006000	/*     link check */
    779  1.1  thorpej #define	PMAC_10TSTAT_LPN	   0x00008000	/* link partner negotiable
    780  1.1  thorpej 						   (21041) */
    781  1.1  thorpej #define	PMAC_10TSTAT_LPC	   0xffff0000	/* link partner code word */
    782  1.1  thorpej 
    783  1.1  thorpej #define	PMAC_10TSTAT_GETLPC(x)	   (((x) & SIASTAT_LPC) >> 16)
    784  1.1  thorpej 
    785  1.1  thorpej 
    786  1.1  thorpej /* CSR13 - NWAY Reset Register */
    787  1.1  thorpej #define	CSR_PMAC_NWAYRESET	TULIP_CSR13
    788  1.1  thorpej #define	PMAC_NWAYRESET_RESET	0x00000000	/* NWAY reset */
    789  1.1  thorpej 
    790  1.1  thorpej 
    791  1.1  thorpej /* CSR14 - 10base-T Control Port */
    792  1.1  thorpej #define	CSR_PMAC_10TCTL		TULIP_CSR14
    793  1.1  thorpej #define	PMAC_10TCTL_LBK		0x00000002	/* loopback */
    794  1.1  thorpej #define	PMAC_10TCTL_PWD10	0x00000004	/* power down 10base-T */
    795  1.1  thorpej #define	PMAC_10TCTL_HDE		0x00000040	/* half-duplex enable */
    796  1.1  thorpej #define	PMAC_10TCTL_ANE		0x00000080	/* autonegotiation enable */
    797  1.1  thorpej #define	PMAC_10TCTL_RSQ		0x00000100	/* receive squelch enable */
    798  1.1  thorpej #define	PMAC_10TCTL_LTE		0x00001000	/* link test enable */
    799  1.1  thorpej #define	PMAC_10TCTL_TXH		0x00010000	/* adv. 100tx */
    800  1.1  thorpej #define	PMAC_10TCTL_TXF		0x00020000	/* adv. 100tx-fdx */
    801  1.1  thorpej #define	PMAC_10TCTL_T4		0x00040000	/* adv. 100t4 */
    802  1.1  thorpej 
    803  1.1  thorpej 
    804  1.1  thorpej /* CSR16 - Test Operation Register (a.k.a. Magic Packet Register) */
    805  1.1  thorpej #define	CSR_PMAC_TOR		TULIP_CSR16
    806  1.1  thorpej #define	PMAC_TOR_98713		0x0F370000
    807  1.1  thorpej #define	PMAC_TOR_98715		0x0B3C0000
    808  1.1  thorpej 
    809  1.1  thorpej 
    810  1.1  thorpej /* CSR20 - NWAY Status */
    811  1.1  thorpej #define	CSR_PMAC_NWAYSTAT	TULIP_CSR20
    812  1.1  thorpej #define	PMAC_NWAYSTAT_10TXH	0x08000000	/* 10t accepted */
    813  1.1  thorpej #define	PMAC_NWAYSTAT_10TXF	0x10000000	/* 10t-fdx accepted */
    814  1.1  thorpej #define	PMAC_NWAYSTAT_100TXH	0x20000000	/* 100tx accepted */
    815  1.1  thorpej #define	PMAC_NWAYSTAT_100TXF	0x40000000	/* 100tx-fdx accepted */
    816  1.1  thorpej #define	PMAC_NWAYSTAT_T4	0x80000000	/* 100t4 accepted */
    817  1.1  thorpej 
    818  1.1  thorpej 
    819  1.1  thorpej /*
    820  1.1  thorpej  * Winbond 89C840F registers.
    821  1.1  thorpej  */
    822  1.1  thorpej 
    823  1.1  thorpej /* CSR12 - Current Receive Descriptor Register */
    824  1.2  thorpej #define	CSR_WINB_CRDAR		TULIP_CSR12
    825  1.1  thorpej 
    826  1.1  thorpej 
    827  1.1  thorpej /* CSR13 - Current Receive Buffer Register */
    828  1.2  thorpej #define	CSR_WINB_CCRBAR		TULIP_CSR13
    829  1.1  thorpej 
    830  1.1  thorpej 
    831  1.1  thorpej /* CSR14 - Multicast Address Register 0 */
    832  1.2  thorpej #define	CSR_WINB_CMA0		TULIP_CSR14
    833  1.1  thorpej 
    834  1.1  thorpej 
    835  1.1  thorpej /* CSR15 - Multicast Address Register 1 */
    836  1.2  thorpej #define	CSR_WINB_CMA1		TULIP_CSR15
    837  1.1  thorpej 
    838  1.1  thorpej 
    839  1.2  thorpej /* CSR16 - Physical Address Register 0 */
    840  1.2  thorpej #define	CSR_WINB_CPA0		TULIP_CSR16
    841  1.1  thorpej 
    842  1.1  thorpej 
    843  1.2  thorpej /* CSR17 - Physical Address Register 1 */
    844  1.2  thorpej #define	CSR_WINB_CPA1		TULIP_CSR17
    845  1.1  thorpej 
    846  1.1  thorpej 
    847  1.1  thorpej /* CSR18 - Boot ROM Size Register */
    848  1.2  thorpej #define	CSR_WINB_CBRCR		TULIP_CSR18
    849  1.2  thorpej #define	WINB_CBRCR_NONE		0x00000000	/* no boot rom */
    850  1.2  thorpej 			/*	0x00000001	   also no boot rom */
    851  1.2  thorpej #define	WINB_CBRCR_8K		0x00000002	/* 8k */
    852  1.2  thorpej #define	WINB_CBRCR_16K		0x00000003	/* 16k */
    853  1.2  thorpej #define	WINB_CBRCR_32K		0x00000004	/* 32k */
    854  1.2  thorpej #define	WINB_CBRCR_64K		0x00000005	/* 64k */
    855  1.2  thorpej #define	WINB_CBRCR_128K		0x00000006	/* 128k */
    856  1.2  thorpej #define	WINB_CBRCR_256K		0x00000007
    857  1.1  thorpej 
    858  1.1  thorpej 
    859  1.1  thorpej /* CSR19 - Current Transmit Descriptor Register */
    860  1.2  thorpej #define	CSR_WINB_CTDAR		TULIP_CSR19
    861  1.1  thorpej 
    862  1.1  thorpej 
    863  1.1  thorpej /* CSR20 - Current Transmit Buffer Register */
    864  1.2  thorpej #define	CSR_WINB_CTBAR		TULIP_CSR20
    865  1.1  thorpej 
    866  1.1  thorpej #endif /* _DEV_IC_TULIPREG_H_ */
    867