Home | History | Annotate | Line # | Download | only in ic
smc83c170reg.h revision 1.1
      1  1.1  thorpej /*	$NetBSD: smc83c170reg.h,v 1.1 1998/06/02 01:29:42 thorpej Exp $	*/
      2  1.1  thorpej 
      3  1.1  thorpej /*-
      4  1.1  thorpej  * Copyright (c) 1998 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_SMC83C170REG_H_
     41  1.1  thorpej #define	_DEV_IC_SMC83C170REG_H_
     42  1.1  thorpej 
     43  1.1  thorpej /*
     44  1.1  thorpej  * Register description for the Standard Microsystems Corp. 83C170
     45  1.1  thorpej  * Ethernet PCI Integrated Controller (EPIC/100).
     46  1.1  thorpej  */
     47  1.1  thorpej 
     48  1.1  thorpej /*
     49  1.1  thorpej  * EPIC transmit descriptor.  Must be 4-byte aligned.
     50  1.1  thorpej  */
     51  1.1  thorpej struct epic_txdesc {
     52  1.1  thorpej #if BYTE_ORDER == BIG_ENDIAN
     53  1.1  thorpej 	u_int16_t	et_txlength;	/* transmit length */
     54  1.1  thorpej 	u_int16_t	et_txstatus;	/* transmit status; see below */
     55  1.1  thorpej #else
     56  1.1  thorpej 	u_int16_t	et_txstatus;	/* transmit status; see below */
     57  1.1  thorpej 	u_int16_t	et_txlength;	/* transmit length */
     58  1.1  thorpej #endif
     59  1.1  thorpej 	u_int32_t	et_bufaddr;	/* buffer address */
     60  1.1  thorpej #if BYTE_ORDER == BIG_ENDIAN
     61  1.1  thorpej 	u_int16_t	et_control;	/* control word; see below */
     62  1.1  thorpej 	u_int16_t	et_buflength;	/* buffer length */
     63  1.1  thorpej #else
     64  1.1  thorpej 	u_int16_t	et_buflength;	/* buffer length */
     65  1.1  thorpej 	u_int16_t	et_control;	/* control word; see below */
     66  1.1  thorpej #endif
     67  1.1  thorpej 	u_int32_t	et_nextdesc;	/* next descriptor pointer */
     68  1.1  thorpej };
     69  1.1  thorpej 
     70  1.1  thorpej /* et_txstatus */
     71  1.1  thorpej #define	ET_TXSTAT_OWNER		0x8000	/* NIC owns descriptor */
     72  1.1  thorpej #define	ET_TXSTAT_COLLMASK	0x1f00	/* collisions */
     73  1.1  thorpej #define	ET_TXSTAT_DEFERRING	0x0080	/* deferring due to jabber */
     74  1.1  thorpej #define	ET_TXSTAT_OOWCOLL	0x0040	/* out of window collision */
     75  1.1  thorpej #define	ET_TXSTAT_CDHB		0x0020	/* collision detect heartbeat */
     76  1.1  thorpej #define	ET_TXSTAT_UNDERRUN	0x0010	/* DMA underrun */
     77  1.1  thorpej #define	ET_TXSTAT_CARSENSELOST	0x0008	/* carrier lost */
     78  1.1  thorpej #define	ET_TXSTAT_TXWITHCOLL	0x0004	/* encountered collisions during tx */
     79  1.1  thorpej #define	ET_TXSTAT_NONDEFERRED	0x0002	/* transmitted without deferring */
     80  1.1  thorpej #define	ET_TXSTAT_PACKETTX	0x0001	/* packet transmitted successfully */
     81  1.1  thorpej 
     82  1.1  thorpej #define	TXSTAT_COLLISIONS(x)	(((x) & ET_TXSTAT_COLLMASK) >> 8)
     83  1.1  thorpej 
     84  1.1  thorpej /* et_control */
     85  1.1  thorpej #define	ET_TXCTL_LASTDESC	0x0010	/* last descriptor in frame */
     86  1.1  thorpej #define	ET_TXCTL_NOCRC		0x0008	/* disable CRC generation */
     87  1.1  thorpej #define	ET_TXCTL_IAF		0x0004	/* interrupt after frame */
     88  1.1  thorpej #define	ET_TXCTL_LFFORM		0x0002	/* alternate fraglist format */
     89  1.1  thorpej #define	ET_TXCTL_FRAGLIST	0x0001	/* descriptor points to fraglist */
     90  1.1  thorpej 
     91  1.1  thorpej /*
     92  1.1  thorpej  * EPIC receive descriptor.  Must be 4-byte aligned.
     93  1.1  thorpej  */
     94  1.1  thorpej struct epic_rxdesc {
     95  1.1  thorpej #if BYTE_ORDER == BIG_ENDIAN
     96  1.1  thorpej 	u_int16_t	er_rxlength;	/* receive frame length */
     97  1.1  thorpej 	u_int16_t	er_rxstatus;	/* receive status; see below */
     98  1.1  thorpej #else
     99  1.1  thorpej 	u_int16_t	er_rxstatus;	/* receive status; see below */
    100  1.1  thorpej 	u_int16_t	er_rxlength;	/* receive frame length */
    101  1.1  thorpej #endif
    102  1.1  thorpej 	u_int32_t	er_bufaddr;	/* buffer address */
    103  1.1  thorpej #if BYTE_ORDER == BIG_ENDIAN
    104  1.1  thorpej 	u_int16_t	er_control;	/* control word; see below */
    105  1.1  thorpej 	u_int16_t	er_buflength;	/* buffer length */
    106  1.1  thorpej #else
    107  1.1  thorpej 	u_int16_t	er_buflength;	/* buffer length */
    108  1.1  thorpej 	u_int16_t	er_control;	/* control word; see below */
    109  1.1  thorpej #endif
    110  1.1  thorpej 	u_int32_t	er_nextdesc;	/* next descriptor pointer */
    111  1.1  thorpej };
    112  1.1  thorpej 
    113  1.1  thorpej /* er_rxstatus */
    114  1.1  thorpej #define	ER_RXSTAT_OWNER		0x8000	/* NIC owns descriptor */
    115  1.1  thorpej #define	ER_RXSTAT_HDRCOPIED	0x4000	/* rx status posted after hdr copy */
    116  1.1  thorpej #define	ER_RXSTAT_FRAGLISTERR	0x2000	/* ran out of frags to copy frame */
    117  1.1  thorpej #define	ER_RXSTAT_NETSTATVALID	0x1000	/* length and status are valid */
    118  1.1  thorpej #define	ER_RXSTAT_RCVRDIS	0x0040	/* receiver disabled */
    119  1.1  thorpej #define	ER_RXSTAT_BCAST		0x0020	/* broadcast address recognized */
    120  1.1  thorpej #define	ER_RXSTAT_MCAST		0x0010	/* multicast address recognized */
    121  1.1  thorpej #define	ER_RXSTAT_MISSEDPKT	0x0008	/* missed packet */
    122  1.1  thorpej #define	ER_RXSTAT_CRCERROR	0x0004	/* EPIC or MII asserted CRC error */
    123  1.1  thorpej #define	ER_RXSTAT_ALIGNERROR	0x0002	/* frame not byte-aligned */
    124  1.1  thorpej #define	ER_RXSTAT_PKTINTACT	0x0001	/* packet received without error */
    125  1.1  thorpej 
    126  1.1  thorpej /* er_control */
    127  1.1  thorpej #define	ER_RXCTL_HEADER		0x0004	/* descriptor is for hdr copy */
    128  1.1  thorpej #define	ER_RXCTL_LFFORM		0x0002	/* alternate fraglist format */
    129  1.1  thorpej #define	ER_RXCTL_FRAGLIST	0x0001	/* descriptor points to fraglist */
    130  1.1  thorpej 
    131  1.1  thorpej #define	EPIC_NFRAGS		63	/* maximum number of frags in list */
    132  1.1  thorpej 
    133  1.1  thorpej /*
    134  1.1  thorpej  * EPIC fraglist descriptor.
    135  1.1  thorpej  */
    136  1.1  thorpej struct epic_fraglist {
    137  1.1  thorpej 	u_int32_t	ef_nfrags;	/* number of frags in list */
    138  1.1  thorpej 	struct {
    139  1.1  thorpej 		u_int32_t ef_addr;	/* address of frag */
    140  1.1  thorpej 		u_int32_t ef_length;	/* length of frag */
    141  1.1  thorpej 	} ef_frags[EPIC_NFRAGS];
    142  1.1  thorpej };
    143  1.1  thorpej 
    144  1.1  thorpej /*
    145  1.1  thorpej  * EPIC control registers.
    146  1.1  thorpej  */
    147  1.1  thorpej 
    148  1.1  thorpej #define	EPIC_COMMAND		0x00 /* COMMAND */
    149  1.1  thorpej #define	COMMAND_TXUGO		0x00000080	/* start tx after underrun */
    150  1.1  thorpej #define	COMMAND_STOP_RDMA	0x00000040	/* stop rx dma */
    151  1.1  thorpej #define	COMMAND_STOP_TDMA	0x00000020	/* stop tx dma */
    152  1.1  thorpej #define	COMMAND_NEXTFRAME	0x00000010	/* move onto next rx frame */
    153  1.1  thorpej #define	COMMAND_RXQUEUED	0x00000008	/* queue a rx descriptor */
    154  1.1  thorpej #define	COMMAND_TXQUEUED	0x00000004	/* queue a tx descriptor */
    155  1.1  thorpej #define	COMMAND_START_RX	0x00000002	/* start receiver */
    156  1.1  thorpej #define	COMMAND_STOP_RX		0x00000001	/* stop receiver */
    157  1.1  thorpej 
    158  1.1  thorpej #define	EPIC_INTSTAT		0x04 /* INTERRUPT STATUS */
    159  1.1  thorpej #define	INTSTAT_PTA		0x08000000	/* PCI target abort */
    160  1.1  thorpej #define	INTSTAT_PMA		0x04000000	/* PCI master abort */
    161  1.1  thorpej #define	INTSTAT_APE		0x02000000	/* PCI address parity error */
    162  1.1  thorpej #define	INTSTAT_DPE		0x01000000	/* PCI data parity error */
    163  1.1  thorpej #define	INTSTAT_RSV		0x00800000	/* rx status valid */
    164  1.1  thorpej #define	INTSTAT_RCTS		0x00400000	/* rx copy threshold status */
    165  1.1  thorpej #define	INTSTAT_RBE		0x00200000	/* rx buffers empty */
    166  1.1  thorpej #define	INTSTAT_TCIP		0x00100000	/* tx copy in progress */
    167  1.1  thorpej #define	INTSTAT_RCIP		0x00080000	/* rx copy in progress */
    168  1.1  thorpej #define	INTSTAT_TXIDLE		0x00040000	/* transmit idle */
    169  1.1  thorpej #define	INTSTAT_RXIDLE		0x00020000	/* receive idle */
    170  1.1  thorpej #define	INTSTAT_INT_ACTV	0x00010000	/* interrupt active */
    171  1.1  thorpej #define	INTSTAT_GP2_INT		0x00008000	/* gpio2 low (PHY event) */
    172  1.1  thorpej #define	INTSTAT_FATAL_INT	0x00001000	/* fatal error occured */
    173  1.1  thorpej #define	INTSTAT_RCT		0x00000800	/* rx copy threshold crossed */
    174  1.1  thorpej #define	INTSTAT_PREI		0x00000400	/* preemptive interrupt */
    175  1.1  thorpej #define	INTSTAT_CNT		0x00000200	/* counter overflow */
    176  1.1  thorpej #define	INTSTAT_TXU		0x00000100	/* transmit underrun */
    177  1.1  thorpej #define	INTSTAT_TQE		0x00000080	/* transmit queue empty */
    178  1.1  thorpej #define	INTSTAT_TCC		0x00000040	/* transmit chain complete */
    179  1.1  thorpej #define	INTSTAT_TXC		0x00000020	/* transmit complete */
    180  1.1  thorpej #define	INTSTAT_RXE		0x00000010	/* receive error */
    181  1.1  thorpej #define	INTSTAT_OVW		0x00000008	/* rx buffer overflow */
    182  1.1  thorpej #define	INTSTAT_RQE		0x00000004	/* receive queue empty */
    183  1.1  thorpej #define	INTSTAT_HCC		0x00000002	/* header copy complete */
    184  1.1  thorpej #define	INTSTAT_RCC		0x00000001	/* receive copy complete */
    185  1.1  thorpej 
    186  1.1  thorpej #define	EPIC_INTMASK		0x08 /* INTERRUPT MASK */
    187  1.1  thorpej 	/* Bits 0-15 enable the corresponding interrupt in INTSTAT. */
    188  1.1  thorpej 
    189  1.1  thorpej #define	EPIC_GENCTL		0x0c /* GENERAL CONTROL */
    190  1.1  thorpej #define	GENCTL_RESET_PHY	0x00004000	/* reset PHY */
    191  1.1  thorpej #define	GENCTL_SOFT1		0x00002000	/* software use */
    192  1.1  thorpej #define	GENCTL_SOFT0		0x00001000	/* software use */
    193  1.1  thorpej #define	GENCTL_MEM_READ_CTL1	0x00000800	/* PCI memory control */
    194  1.1  thorpej #define	GENCTL_MEM_READ_CTL0	0x00000400	/* (see below) */
    195  1.1  thorpej #define	GENCTL_RX_FIFO_THRESH1	0x00000200	/* rx fifo thresh */
    196  1.1  thorpej #define	GENCTL_RX_FIFO_THRESH0	0x00000100	/* (see below) */
    197  1.1  thorpej #define	GENCTL_BIG_ENDIAN	0x00000020	/* big endian mode */
    198  1.1  thorpej #define	GENCTL_ONECOPY		0x00000010	/* auto-NEXTFRAME */
    199  1.1  thorpej #define	GENCTL_POWERDOWN	0x00000008	/* powersave sleep mode */
    200  1.1  thorpej #define	GENCTL_SOFTINT		0x00000004	/* software-generated intr */
    201  1.1  thorpej #define	GENCTL_INTENA		0x00000002	/* interrupt enable */
    202  1.1  thorpej #define	GENCTL_SOFTRESET	0x00000001	/* initialize EPIC */
    203  1.1  thorpej 
    204  1.1  thorpej /*
    205  1.1  thorpej  * Explanation of MEMORY READ CONTROL:
    206  1.1  thorpej  *
    207  1.1  thorpej  * These bits control which PCI command the transmit DMA will use when
    208  1.1  thorpej  * bursting data over the PCI bus.  When CTL1 is set, the transmit DMA
    209  1.1  thorpej  * will use the PCI "memory read line" command.  When CTL0 is set, the
    210  1.1  thorpej  * transmit DMA will use the PCI "memory read multiple" command.  When
    211  1.1  thorpej  * neither bit is set, the transmit DMA will use the "memory read" command.
    212  1.1  thorpej  * Use of "memory read line" or "memory read multiple" may enhance
    213  1.1  thorpej  * performance on some systems.
    214  1.1  thorpej  */
    215  1.1  thorpej 
    216  1.1  thorpej /*
    217  1.1  thorpej  * Explanation of RECEIVE FIFO THRESHOLD:
    218  1.1  thorpej  *
    219  1.1  thorpej  * Controls the level at which the PCI burst state machine begins to
    220  1.1  thorpej  * empty the receive FIFO.  Default is "1/2 full" (0,1).
    221  1.1  thorpej  *
    222  1.1  thorpej  *	0,0	1/4 full	32 bytes
    223  1.1  thorpej  *	0,1	1/2 full	64 bytes
    224  1.1  thorpej  *	1,0	3/4 full	96 bytes
    225  1.1  thorpej  *	1,1	full		128 bytes
    226  1.1  thorpej  */
    227  1.1  thorpej 
    228  1.1  thorpej #define	EPIC_NVCTL		0x10 /* NON-VOLATILE CONTROL */
    229  1.1  thorpej #define	NVCTL_IPG_DLY_MASK	0x00000780	/* interpacket delay gap */
    230  1.1  thorpej #define	NVCTL_CB_MODE		0x00000040	/* CardBus mode */
    231  1.1  thorpej #define	NVCTL_GPIO2		0x00000020	/* general purpose i/o */
    232  1.1  thorpej #define	NVCTL_GPIO1		0x00000010	/* ... */
    233  1.1  thorpej #define	NVCTL_GPOE2		0x00000008	/* general purpose output ena */
    234  1.1  thorpej #define	NVCTL_GPOE1		0x00000004	/* ... */
    235  1.1  thorpej #define	NVCTL_CLKRUNSUPP	0x00000002	/* clock run supported */
    236  1.1  thorpej #define	NVCTL_ENAMEMMAP		0x00000001	/* enable memory map */
    237  1.1  thorpej 
    238  1.1  thorpej #define	NVCTL_IPG_DLY(x)	(((x) & NVCTL_IPG_DLY_MASK) >> 7)
    239  1.1  thorpej 
    240  1.1  thorpej #define	EPIC_EECTL		0x14 /* EEPROM CONTROL */
    241  1.1  thorpej #define	EECTL_EEPROMSIZE	0x00000040	/* eeprom size; see below */
    242  1.1  thorpej #define	EECTL_EERDY		0x00000020	/* eeprom ready */
    243  1.1  thorpej #define	EECTL_EEDO		0x00000010	/* eeprom data out (from) */
    244  1.1  thorpej #define	EECTL_EEDI		0x00000008	/* eeprom data in (to) */
    245  1.1  thorpej #define	EECTL_EESK		0x00000004	/* eeprom clock */
    246  1.1  thorpej #define	EECTL_EECS		0x00000002	/* eeprom chip select */
    247  1.1  thorpej #define	EECTL_ENABLE		0x00000001	/* eeprom enable */
    248  1.1  thorpej 
    249  1.1  thorpej /*
    250  1.1  thorpej  * Explanation of EEPROM SIZE:
    251  1.1  thorpej  *
    252  1.1  thorpej  * Indicates the size of the serial EEPROM:
    253  1.1  thorpej  *
    254  1.1  thorpej  *	1	16x16 or 64x16
    255  1.1  thorpej  *	0	128x16 or 256x16
    256  1.1  thorpej  */
    257  1.1  thorpej 
    258  1.1  thorpej /*
    259  1.1  thorpej  * Serial EEPROM opcodes, including start bit:
    260  1.1  thorpej  */
    261  1.1  thorpej #define	EPIC_EEPROM_OPC_WRITE	0x05
    262  1.1  thorpej #define	EPIC_EEPROM_OPC_READ	0x06
    263  1.1  thorpej 
    264  1.1  thorpej #define	EPIC_PBLCNT		0x18 /* PBLCNT */
    265  1.1  thorpej #define	PBLCNT_MASK		0x0000003f	/* programmable burst length */
    266  1.1  thorpej 
    267  1.1  thorpej #define	EPIC_TEST		0x1c /* TEST */
    268  1.1  thorpej #define	TEST_INIT		0x00000008
    269  1.1  thorpej 
    270  1.1  thorpej #define	EPIC_CRCCNT		0x20 /* CRC ERROR COUNTER */
    271  1.1  thorpej #define	CRCCNT_MASK		0x0000000f	/* crc errs since last read */
    272  1.1  thorpej 
    273  1.1  thorpej #define	EPIC_ALICNT		0x24 /* FRAME ALIGNMENT ERROR COUNTER */
    274  1.1  thorpej #define	ALICNT_MASK		0x0000000f	/* align errs since last read */
    275  1.1  thorpej 
    276  1.1  thorpej #define	EPIC_MPCNT		0x28 /* MISSED PACKET COUNTER */
    277  1.1  thorpej #define	MPCNT_MASK		0x0000000f	/* miss. pkts since last read */
    278  1.1  thorpej 
    279  1.1  thorpej #define	EPIC_RXFIFO		0x2c
    280  1.1  thorpej 
    281  1.1  thorpej #define	EPIC_MMCTL		0x30 /* MII MANAGEMENT INTERFACE CONTROL */
    282  1.1  thorpej #define	MMCTL_PHY_ADDR_MASK	0x00003e00	/* phy address field */
    283  1.1  thorpej #define	MMCTL_PHY_REG_ADDR_MASK	0x000001f0	/* phy register address field */
    284  1.1  thorpej #define	MMCTL_RESPONDER		0x00000008	/* phy responder */
    285  1.1  thorpej #define	MMCTL_WRITE		0x00000002	/* write to phy */
    286  1.1  thorpej #define	MMCTL_READ		0x00000001	/* read from phy */
    287  1.1  thorpej 
    288  1.1  thorpej #define	EPIC_MMDATA		0x34 /* MII MANAGEMENT INTERFACE DATA */
    289  1.1  thorpej #define	MMDATA_MASK		0x0000ffff	/* MII frame data */
    290  1.1  thorpej 
    291  1.1  thorpej #define	EPIC_MIICFG		0x38 /* MII CONFIGURATION */
    292  1.1  thorpej #define	MIICFG_ALTDIR		0x00000080	/* alternate direction */
    293  1.1  thorpej #define	MIICFG_ALTDATA		0x00000040	/* alternate data */
    294  1.1  thorpej #define	MIICFG_ALTCLOCK		0x00000020	/* alternate clock source */
    295  1.1  thorpej #define	MIICFG_ENASER		0x00000010	/* enable serial manag intf */
    296  1.1  thorpej #define	MIICFG_PHYPRESENT	0x00000008	/* phy present on MII */
    297  1.1  thorpej #define	MIICFG_LINKSTATUS	0x00000004	/* 694 link status */
    298  1.1  thorpej #define	MIICFG_ENABLE		0x00000002	/* enable 694 */
    299  1.1  thorpej #define	MIICFG_SERMODEENA	0x00000001	/* serial mode enable */
    300  1.1  thorpej 
    301  1.1  thorpej #define	EPIC_IPG		0x3c /* INTERPACKET GAP */
    302  1.1  thorpej #define	IPG_INTERFRAME_MASK	0x00007f00	/* interframe gap time */
    303  1.1  thorpej #define	IPG_INTERPKT_MASK	0x000000ff	/* interpacket gap time */
    304  1.1  thorpej 
    305  1.1  thorpej #define	EPIC_LAN0		0x40 /* LAN ADDRESS */
    306  1.1  thorpej 
    307  1.1  thorpej #define	EPIC_LAN1		0x44
    308  1.1  thorpej 
    309  1.1  thorpej #define	EPIC_LAN2		0x48
    310  1.1  thorpej 
    311  1.1  thorpej #define	LANn_MASK		0x0000ffff
    312  1.1  thorpej 
    313  1.1  thorpej /*
    314  1.1  thorpej  * Explanation of LAN ADDRESS registers:
    315  1.1  thorpej  *
    316  1.1  thorpej  * LAN address is described as:
    317  1.1  thorpej  *
    318  1.1  thorpej  *	0000 [n1][n0][n3][n2] | 0000 [n5][n4][n7][n6] | 0000 [n9][n8][n11][n10]
    319  1.1  thorpej  *
    320  1.1  thorpej  * n == one nibble, mapped as follows:
    321  1.1  thorpej  *
    322  1.1  thorpej  *	LAN0	[15-12]		n3
    323  1.1  thorpej  *	LAN0	[11-8]		n2
    324  1.1  thorpej  *	LAN0	[7-4]		n1
    325  1.1  thorpej  *	LAN0	[3-0]		n0
    326  1.1  thorpej  *	LAN1	[15-12]		n7
    327  1.1  thorpej  *	LAN1	[11-8]		n6
    328  1.1  thorpej  *	LAN1	[7-4]		n5
    329  1.1  thorpej  *	LAN1	[3-0]		n4
    330  1.1  thorpej  *	LAN2	[15-12]		n11
    331  1.1  thorpej  *	LAN2	[11-8]		n10
    332  1.1  thorpej  *	LAN2	[7-4]		n9
    333  1.1  thorpej  *	LAN2	[3-0]		n8
    334  1.1  thorpej  *
    335  1.1  thorpej  * The LAN address is automatically recalled from the EEPROM after a
    336  1.1  thorpej  * hard reseet.
    337  1.1  thorpej  */
    338  1.1  thorpej 
    339  1.1  thorpej #define	EPIC_IDCHK		0x4c /* BOARD ID/CHECKSUM */
    340  1.1  thorpej #define	IDCHK_ID_MASK		0x0000ff00	/* board ID */
    341  1.1  thorpej #define	IDCHK_CKSUM_MASK	0x000000ff	/* checksum (should be 0xff) */
    342  1.1  thorpej 
    343  1.1  thorpej #define	EPIC_MC0		0x50 /* MULTICAST ADDDRESS HASH TABLE */
    344  1.1  thorpej 
    345  1.1  thorpej #define	EPIC_MC1		0x54
    346  1.1  thorpej 
    347  1.1  thorpej #define	EPIC_MC2		0x58
    348  1.1  thorpej 
    349  1.1  thorpej #define	EPIC_MC3		0x5c
    350  1.1  thorpej 
    351  1.1  thorpej /*
    352  1.1  thorpej  * Explanation of MULTICAST ADDRESS HASH TABLE registers:
    353  1.1  thorpej  *
    354  1.1  thorpej  * Bits in the hash table are encoded as follows:
    355  1.1  thorpej  *
    356  1.1  thorpej  *	MC0	[15-0]
    357  1.1  thorpej  *	MC1	[31-16]
    358  1.1  thorpej  *	MC2	[47-32]
    359  1.1  thorpej  *	MC3	[53-48]
    360  1.1  thorpej  */
    361  1.1  thorpej 
    362  1.1  thorpej #define	EPIC_RXCON		0x60 /* RECEIVE CONTROL */
    363  1.1  thorpej #define	RXCON_EXTBUFSIZESEL1	0x00000200	/* ext buf size; see below */
    364  1.1  thorpej #define	RXCON_EXTBUFSIZESEL0	0x00000100	/* ... */
    365  1.1  thorpej #define	RXCON_EARLYRXENABLE	0x00000080	/* early receive enable */
    366  1.1  thorpej #define	RXCON_MONITORMODE	0x00000040	/* monitor mode */
    367  1.1  thorpej #define	RXCON_PROMISCMODE	0x00000020	/* promiscuous mode */
    368  1.1  thorpej #define	RXCON_RXINVADDR		0x00000010	/* rx inv individual addr */
    369  1.1  thorpej #define	RXCON_RXMULTICAST	0x00000008	/* receive multicast */
    370  1.1  thorpej #define	RXCON_RXBROADCAST	0x00000004	/* receive broadcast */
    371  1.1  thorpej #define	RXCON_RXRUNT		0x00000002	/* receive runt frames */
    372  1.1  thorpej #define	RXCON_SAVEERRPKTS	0x00000001	/* save errored packets */
    373  1.1  thorpej 
    374  1.1  thorpej /*
    375  1.1  thorpej  * Explanation of EXTERNAL BUFFER SIZE SELECT:
    376  1.1  thorpej  *
    377  1.1  thorpej  * 	0,0	external buffer access is disabled
    378  1.1  thorpej  *	0,1	16k
    379  1.1  thorpej  *	1,0	32k
    380  1.1  thorpej  *	1,1	128k
    381  1.1  thorpej  */
    382  1.1  thorpej 
    383  1.1  thorpej #define	EPIC_RXSTAT		0x64 /* RECEIVE STATUS */
    384  1.1  thorpej 
    385  1.1  thorpej #define	EPIC_RXCNT		0x68
    386  1.1  thorpej 
    387  1.1  thorpej #define	EPIC_RXTEST		0x6c
    388  1.1  thorpej 
    389  1.1  thorpej #define	EPIC_TXCON		0x70 /* TRANSMIT CONTROL */
    390  1.1  thorpej #define	TXCON_SLOTTIME_MASK	0x000000f8	/* slot time */
    391  1.1  thorpej #define	TXCON_LOOPBACK_D2	0x00000004	/* loopback mode bit 2 */
    392  1.1  thorpej #define	TXCON_LOOPBACK_D1	0x00000002	/* loopback mode bit 1 */
    393  1.1  thorpej #define	TXCON_EARLYTX_ENABLE	0x00000001	/* early transmit enable */
    394  1.1  thorpej 
    395  1.1  thorpej /*
    396  1.1  thorpej  * Explanation of LOOPBACK MODE BIT:
    397  1.1  thorpej  *
    398  1.1  thorpej  *	0,0	normal operation
    399  1.1  thorpej  *	0,1	internal loopback (before PHY)
    400  1.1  thorpej  *	1,0	external loopback (after PHY)
    401  1.1  thorpej  *	1,1	full duplex - decouples transmit and receive blocks
    402  1.1  thorpej  */
    403  1.1  thorpej 
    404  1.1  thorpej #define	EPIC_TXSTAT		0x74 /* TRANSMIT STATUS */
    405  1.1  thorpej 
    406  1.1  thorpej #define	EPIC_TDPAR		0x78
    407  1.1  thorpej 
    408  1.1  thorpej #define	EPIC_TXTEST		0x7c
    409  1.1  thorpej 
    410  1.1  thorpej #define	EPIC_PRFDAR		0x80
    411  1.1  thorpej 
    412  1.1  thorpej #define	EPIC_PRCDAR		0x84 /* PCI RECEIVE CURRENT DESCRIPTOR ADDR */
    413  1.1  thorpej 
    414  1.1  thorpej #define	EPIC_PRHDAR		0x88
    415  1.1  thorpej 
    416  1.1  thorpej #define	EPIC_PRFLAR		0x8c
    417  1.1  thorpej 
    418  1.1  thorpej #define	EPIC_PRDLGTH		0x90
    419  1.1  thorpej 
    420  1.1  thorpej #define	EPIC_PRFCNT		0x94
    421  1.1  thorpej 
    422  1.1  thorpej #define	EPIC_PRLCAR		0x98
    423  1.1  thorpej 
    424  1.1  thorpej #define	EPIC_PRLPAR		0x9c
    425  1.1  thorpej 
    426  1.1  thorpej #define	EPIC_PREFAR		0xa0
    427  1.1  thorpej 
    428  1.1  thorpej #define	EPIC_PRSTAT		0xa4 /* PCI RECEIVE DMA STATUS */
    429  1.1  thorpej 
    430  1.1  thorpej #define	EPIC_PRBUF		0xa8
    431  1.1  thorpej 
    432  1.1  thorpej #define	EPIC_RDNCAR		0xac
    433  1.1  thorpej 
    434  1.1  thorpej #define	EPIC_PRCPTHR		0xb0 /* PCI RECEIVE COPY THRESHOLD */
    435  1.1  thorpej 
    436  1.1  thorpej #define	EPIC_ROMDATA		0xb4
    437  1.1  thorpej 
    438  1.1  thorpej #define	EPIC_PREEMPR		0xbc
    439  1.1  thorpej 
    440  1.1  thorpej #define	EPIC_PTFDAR		0xc0
    441  1.1  thorpej 
    442  1.1  thorpej #define	EPIC_PTCDAR		0xc4 /* PCI TRANSMIT CURRENT DESCRIPTOR ADDR */
    443  1.1  thorpej 
    444  1.1  thorpej #define	EPIC_PTHDAR		0xc8
    445  1.1  thorpej 
    446  1.1  thorpej #define	EPIC_PTFLAR		0xcc
    447  1.1  thorpej 
    448  1.1  thorpej #define	EPIC_PTDLGTH		0xd0
    449  1.1  thorpej 
    450  1.1  thorpej #define	EPIC_PTFCNT		0xd4
    451  1.1  thorpej 
    452  1.1  thorpej #define	EPIC_PTLCAR		0xd8
    453  1.1  thorpej 
    454  1.1  thorpej #define	EPIC_ETXTHR		0xdc /* EARLY TRANSMIT THRESHOLD */
    455  1.1  thorpej 
    456  1.1  thorpej #define	EPIC_PTETXC		0xe0
    457  1.1  thorpej 
    458  1.1  thorpej #define	EPIC_PTSTAT		0xe4
    459  1.1  thorpej 
    460  1.1  thorpej #define	EPIC_PTBUF		0xe8
    461  1.1  thorpej 
    462  1.1  thorpej #define	EPIC_PTFDAR2		0xec
    463  1.1  thorpej 
    464  1.1  thorpej #define	EPIC_FEVTR		0xf0 /* FEVTR (CardBus) */
    465  1.1  thorpej 
    466  1.1  thorpej #define	EPIC_FEVTRMSKR		0xf4 /* FEVTRMSKR (CardBus) */
    467  1.1  thorpej 
    468  1.1  thorpej #define	EPIC_FPRSTSTR		0xf8 /* FPRSTR (CardBus) */
    469  1.1  thorpej 
    470  1.1  thorpej #define	EPIC_FFRCEVTR		0xfc /* PPRCEVTR (CardBus) */
    471  1.1  thorpej 
    472  1.1  thorpej /*
    473  1.1  thorpej  * EEPROM format:
    474  1.1  thorpej  *
    475  1.1  thorpej  *	Word	Bits	Description
    476  1.1  thorpej  *	----	----	-----------
    477  1.1  thorpej  *	0	7-0	LAN Address Byte 0
    478  1.1  thorpej  *	0	15-8	LAN Address Byte 1
    479  1.1  thorpej  *	1	7-0	LAN Address Byte 2
    480  1.1  thorpej  *	1	15-8	LAN Address Byte 3
    481  1.1  thorpej  *	2	7-0	LAN Address Byte 4
    482  1.1  thorpej  *	2	15-8	LAN Address Byte 5
    483  1.1  thorpej  *	3	7-0	Board ID
    484  1.1  thorpej  *	3	15-8	Checksum
    485  1.1  thorpej  *	4	5-0	Non-Volatile Control Register Contents
    486  1.1  thorpej  *	5	7-0	PCI Minimum Grant Desired Setting
    487  1.1  thorpej  *	5	15-8	PCI Maximum Latency Desired Setting
    488  1.1  thorpej  *	6	15-0	Subsystem Vendor ID
    489  1.1  thorpej  *	7	14-0	Subsystem ID
    490  1.1  thorpej  */
    491  1.1  thorpej 
    492  1.1  thorpej #endif /* _DEV_IC_SMC83C170REG_H_ */
    493