Home | History | Annotate | Line # | Download | only in pci
if_sipreg.h revision 1.4.2.3
      1  1.4.2.3  nathanw /*	$NetBSD: if_sipreg.h,v 1.4.2.3 2002/01/08 00:31:05 nathanw Exp $	*/
      2  1.4.2.2  nathanw 
      3  1.4.2.2  nathanw /*-
      4  1.4.2.2  nathanw  * Copyright (c) 2001 The NetBSD Foundation, Inc.
      5  1.4.2.2  nathanw  * All rights reserved.
      6  1.4.2.2  nathanw  *
      7  1.4.2.2  nathanw  * This code is derived from software contributed to The NetBSD Foundation
      8  1.4.2.2  nathanw  * by Jason R. Thorpe.
      9  1.4.2.2  nathanw  *
     10  1.4.2.2  nathanw  * Redistribution and use in source and binary forms, with or without
     11  1.4.2.2  nathanw  * modification, are permitted provided that the following conditions
     12  1.4.2.2  nathanw  * are met:
     13  1.4.2.2  nathanw  * 1. Redistributions of source code must retain the above copyright
     14  1.4.2.2  nathanw  *    notice, this list of conditions and the following disclaimer.
     15  1.4.2.2  nathanw  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.4.2.2  nathanw  *    notice, this list of conditions and the following disclaimer in the
     17  1.4.2.2  nathanw  *    documentation and/or other materials provided with the distribution.
     18  1.4.2.2  nathanw  * 3. All advertising materials mentioning features or use of this software
     19  1.4.2.2  nathanw  *    must display the following acknowledgement:
     20  1.4.2.2  nathanw  *	This product includes software developed by the NetBSD
     21  1.4.2.2  nathanw  *	Foundation, Inc. and its contributors.
     22  1.4.2.2  nathanw  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.4.2.2  nathanw  *    contributors may be used to endorse or promote products derived
     24  1.4.2.2  nathanw  *    from this software without specific prior written permission.
     25  1.4.2.2  nathanw  *
     26  1.4.2.2  nathanw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.4.2.2  nathanw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.4.2.2  nathanw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.4.2.2  nathanw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.4.2.2  nathanw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.4.2.2  nathanw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.4.2.2  nathanw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.4.2.2  nathanw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.4.2.2  nathanw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.4.2.2  nathanw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.4.2.2  nathanw  * POSSIBILITY OF SUCH DAMAGE.
     37  1.4.2.2  nathanw  */
     38      1.1  thorpej 
     39      1.1  thorpej /*-
     40      1.1  thorpej  * Copyright (c) 1999 Network Computer, Inc.
     41      1.1  thorpej  * All rights reserved.
     42      1.1  thorpej  *
     43      1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     44      1.1  thorpej  * modification, are permitted provided that the following conditions
     45      1.1  thorpej  * are met:
     46      1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     47      1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     48      1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     49      1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     50      1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     51      1.1  thorpej  * 3. Neither the name of Network Computer, Inc. nor the names of its
     52      1.1  thorpej  *    contributors may be used to endorse or promote products derived
     53      1.1  thorpej  *    from this software without specific prior written permission.
     54      1.1  thorpej  *
     55      1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY NETWORK COMPUTER, INC. AND CONTRIBUTORS
     56      1.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     57      1.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     58      1.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     59      1.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     60      1.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     61      1.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     62      1.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     63      1.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     64      1.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     65      1.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     66      1.1  thorpej  */
     67      1.1  thorpej 
     68      1.1  thorpej #ifndef _DEV_PCI_IF_SIPREG_H_
     69      1.1  thorpej #define	_DEV_PCI_IF_SIPREG_H_
     70      1.1  thorpej 
     71      1.1  thorpej /*
     72      1.3  thorpej  * Register description for the Silicon Integrated Systems SiS 900,
     73  1.4.2.2  nathanw  * SiS 7016, National Semiconductor DP83815 10/100, and National
     74  1.4.2.2  nathanw  * Semiconduction DP83820 10/100/1000 PCI Ethernet controller.
     75      1.1  thorpej  *
     76      1.1  thorpej  * Written by Jason R. Thorpe for Network Computer, Inc.
     77      1.1  thorpej  */
     78      1.1  thorpej 
     79      1.1  thorpej /*
     80      1.1  thorpej  * Transmit FIFO size.  Used to compute the transmit drain threshold.
     81      1.1  thorpej  *
     82      1.1  thorpej  * The transmit FIFO is arranged as a 512 32-bit memory array.
     83      1.1  thorpej  */
     84      1.1  thorpej #define	SIP_TXFIFO_SIZE	(512 * 4)
     85      1.1  thorpej 
     86      1.1  thorpej /*
     87      1.1  thorpej  * The SiS900 uses a single descriptor format for both transmit
     88      1.1  thorpej  * and receive descriptor chains.
     89  1.4.2.2  nathanw  *
     90  1.4.2.2  nathanw  * Note the DP83820 can use 64-bit DMA addresses for link and bufptr.
     91  1.4.2.2  nathanw  * However, we do not yet support that.
     92  1.4.2.2  nathanw  *
     93  1.4.2.2  nathanw  * For transmit, buffers need not be aligned.  For receive, buffers
     94  1.4.2.2  nathanw  * must be aligned to 4-byte (8-byte on DP83820) boundaries.
     95      1.1  thorpej  */
     96      1.1  thorpej struct sip_desc {
     97  1.4.2.2  nathanw #ifdef DP83820
     98  1.4.2.2  nathanw 	u_int32_t	sipd_link;	/* link to next descriptor */
     99  1.4.2.2  nathanw 	u_int32_t	sipd_bufptr;	/* pointer to DMA segment */
    100  1.4.2.2  nathanw 	u_int32_t	sipd_cmdsts;	/* command/status word */
    101  1.4.2.2  nathanw 	u_int32_t	sipd_extsts;	/* extended status */
    102  1.4.2.2  nathanw #else
    103      1.1  thorpej 	u_int32_t	sipd_link;	/* link to next descriptor */
    104      1.1  thorpej 	u_int32_t	sipd_cmdsts;	/* command/status word */
    105      1.1  thorpej 	u_int32_t	sipd_bufptr;	/* pointer to DMA segment */
    106  1.4.2.2  nathanw #endif /* DP83820 */
    107      1.1  thorpej };
    108      1.1  thorpej 
    109      1.1  thorpej /*
    110      1.1  thorpej  * CMDSTS bits common to transmit and receive.
    111      1.1  thorpej  */
    112      1.1  thorpej #define	CMDSTS_OWN	0x80000000	/* owned by consumer */
    113      1.1  thorpej #define	CMDSTS_MORE	0x40000000	/* more descriptors */
    114      1.1  thorpej #define	CMDSTS_INTR	0x20000000	/* interrupt when ownership changes */
    115      1.1  thorpej #define	CMDSTS_SUPCRC	0x10000000	/* suppress CRC */
    116      1.1  thorpej #define	CMDSTS_OK	0x08000000	/* packet ok */
    117  1.4.2.2  nathanw #ifdef DP83820
    118  1.4.2.2  nathanw #define	CMDSTS_SIZE_MASK 0x0000ffff	/* packet size */
    119  1.4.2.2  nathanw #else
    120      1.1  thorpej #define	CMDSTS_SIZE_MASK 0x000007ff	/* packet size */
    121  1.4.2.2  nathanw #endif /* DP83820 */
    122      1.1  thorpej 
    123      1.1  thorpej #define	CMDSTS_SIZE(x)	((x) & CMDSTS_SIZE_MASK)
    124      1.1  thorpej 
    125      1.1  thorpej /*
    126      1.1  thorpej  * CMDSTS bits for transmit.
    127      1.1  thorpej  */
    128      1.1  thorpej #define	CMDSTS_Tx_TXA	0x04000000	/* transmit abort */
    129      1.1  thorpej #define	CMDSTS_Tx_TFU	0x02000000	/* transmit FIFO underrun */
    130      1.1  thorpej #define	CMDSTS_Tx_CRS	0x01000000	/* carrier sense lost */
    131      1.1  thorpej #define	CMDSTS_Tx_TD	0x00800000	/* transmit deferred */
    132      1.1  thorpej #define	CMDSTS_Tx_ED	0x00400000	/* excessive deferral */
    133      1.1  thorpej #define	CMDSTS_Tx_OWC	0x00200000	/* out of window collision */
    134      1.1  thorpej #define	CMDSTS_Tx_EC	0x00100000	/* excessive collisions */
    135      1.1  thorpej #define	CMDSTS_Tx_CCNT	0x000f0000	/* collision count */
    136      1.1  thorpej 
    137      1.1  thorpej #define	CMDSTS_COLLISIONS(x)	(((x) & CMDSTS_Tx_CCNT) >> 16)
    138      1.1  thorpej 
    139      1.1  thorpej /*
    140      1.1  thorpej  * CMDSTS bits for receive.
    141      1.1  thorpej  */
    142      1.1  thorpej #define	CMDSTS_Rx_RXA	0x04000000	/* receive abort */
    143      1.1  thorpej #define	CMDSTS_Rx_RXO	0x02000000	/* receive overrun */
    144      1.1  thorpej #define	CMDSTS_Rx_DEST	0x01800000	/* destination class */
    145      1.1  thorpej #define	CMDSTS_Rx_LONG	0x00400000	/* packet too long */
    146      1.1  thorpej #define	CMDSTS_Rx_RUNT	0x00200000	/* runt packet */
    147      1.1  thorpej #define	CMDSTS_Rx_ISE	0x00100000	/* invalid symbol error */
    148      1.1  thorpej #define	CMDSTS_Rx_CRCE	0x00080000	/* CRC error */
    149      1.1  thorpej #define	CMDSTS_Rx_FAE	0x00040000	/* frame alignment error */
    150      1.1  thorpej #define	CMDSTS_Rx_LBP	0x00020000	/* loopback packet */
    151  1.4.2.2  nathanw #ifdef DP83820
    152  1.4.2.2  nathanw #define	CMDSTS_Rx_IRL	0x00010000	/* in-range length error */
    153  1.4.2.2  nathanw #else
    154      1.1  thorpej #define	CMDSTS_Rx_COL	0x00010000	/* collision activity */
    155  1.4.2.2  nathanw #endif /* DP83820 */
    156      1.1  thorpej 
    157      1.1  thorpej #define	CMDSTS_Rx_DEST_REJ 0x00000000	/* packet rejected */
    158      1.1  thorpej #define	CMDSTS_Rx_DEST_STA 0x00800000	/* matched station address */
    159      1.1  thorpej #define	CMDSTS_Rx_DEST_MUL 0x01000000	/* multicast address */
    160      1.1  thorpej #define	CMDSTS_Rx_DEST_BRD 0x01800000	/* broadcast address */
    161      1.1  thorpej 
    162  1.4.2.2  nathanw #ifdef DP83820
    163  1.4.2.2  nathanw /*
    164  1.4.2.2  nathanw  * EXTSTS bits.
    165  1.4.2.2  nathanw  */
    166  1.4.2.2  nathanw #define	EXTSTS_Rx_UDPERR 0x00400000	/* UDP checksum error */
    167  1.4.2.2  nathanw #define	EXTSTS_UDPPKT	 0x00200000	/* perform UDP checksum */
    168  1.4.2.2  nathanw #define	EXTSTS_Rx_TCPERR 0x00100000	/* TCP checksum error */
    169  1.4.2.2  nathanw #define	EXTSTS_TCPPKT	 0x00080000	/* perform TCP checksum */
    170  1.4.2.2  nathanw #define	EXTSTS_Rx_IPERR	 0x00040000	/* IP header checksum error */
    171  1.4.2.2  nathanw #define	EXTSTS_IPPKT	 0x00020000	/* perform IP header checksum */
    172  1.4.2.2  nathanw #define	EXTSTS_VPKT	 0x00010000	/* insert VLAN tag */
    173  1.4.2.2  nathanw #define	EXTSTS_VTCI	 0x0000ffff	/* VLAN tag control information */
    174  1.4.2.2  nathanw #endif /* DP83820 */
    175  1.4.2.2  nathanw 
    176      1.1  thorpej /*
    177      1.1  thorpej  * PCI Configuration space registers.
    178      1.1  thorpej  */
    179      1.1  thorpej #define	SIP_PCI_CFGIOA	(PCI_MAPREG_START + 0x00)
    180      1.1  thorpej 
    181      1.1  thorpej #define	SIP_PCI_CFGMA	(PCI_MAPREG_START + 0x04)
    182      1.1  thorpej 
    183  1.4.2.2  nathanw #ifdef DP83820
    184  1.4.2.2  nathanw #define	SIP_PCI_CFGMA1	(PCI_MAPREG_START + 0x08)
    185  1.4.2.2  nathanw #endif /* DP83820 */
    186  1.4.2.2  nathanw 
    187      1.1  thorpej #define	SIP_PCI_CFGEROMA 0x30		/* expansion ROM address */
    188      1.1  thorpej 
    189      1.1  thorpej #define	SIP_PCI_CFGPMC	 0x40		/* power management cap. */
    190      1.1  thorpej 
    191      1.1  thorpej #define	SIP_PCI_CFGPMCSR 0x44		/* power management ctl. */
    192      1.1  thorpej 
    193      1.1  thorpej /*
    194      1.1  thorpej  * MAC Operation Registers
    195      1.1  thorpej  */
    196      1.1  thorpej #define	SIP_CR		0x00	/* command register */
    197  1.4.2.2  nathanw #ifdef DP83820
    198  1.4.2.2  nathanw #define	CR_RXPRI3	0x00010000	/* Rx priority queue select */
    199  1.4.2.2  nathanw #define	CR_RXPRI2	0x00008000	/* Rx priority queue select */
    200  1.4.2.2  nathanw #define	CR_RXPRI1	0x00004000	/* Rx priority queue select */
    201  1.4.2.2  nathanw #define	CR_RXPRI0	0x00002000	/* Rx priority queue select */
    202  1.4.2.2  nathanw #define	CR_TXPRI3	0x00001000	/* Tx priority queue select */
    203  1.4.2.2  nathanw #define	CR_TXPRI2	0x00000800	/* Tx priority queue select */
    204  1.4.2.2  nathanw #define	CR_TXPRI1	0x00000400	/* Tx priority queue select */
    205  1.4.2.2  nathanw #define	CR_TXPRI0	0x00000200	/* Tx priority queue select */
    206  1.4.2.2  nathanw #endif /* DP83820 */
    207  1.4.2.3  nathanw #define	CR_RLD		0x00000400	/* reload from NVRAM */
    208      1.1  thorpej #define	CR_RST		0x00000100	/* software reset */
    209      1.1  thorpej #define	CR_SWI		0x00000080	/* software interrupt */
    210      1.1  thorpej #define	CR_RXR		0x00000020	/* receiver reset */
    211      1.1  thorpej #define	CR_TXR		0x00000010	/* transmit reset */
    212      1.1  thorpej #define	CR_RXD		0x00000008	/* receiver disable */
    213      1.1  thorpej #define	CR_RXE		0x00000004	/* receiver enable */
    214      1.1  thorpej #define	CR_TXD		0x00000002	/* transmit disable */
    215      1.1  thorpej #define	CR_TXE		0x00000001	/* transmit enable */
    216      1.1  thorpej 
    217      1.1  thorpej #define	SIP_CFG		0x04	/* configuration register */
    218      1.3  thorpej #define	CFG_LNKSTS	0x80000000	/* link status (83815) */
    219  1.4.2.2  nathanw #ifdef DP83820
    220  1.4.2.2  nathanw #define	CFG_SPEED1000	0x40000000	/* 1000Mb/s input pin */
    221  1.4.2.2  nathanw #define	CFG_SPEED100	0x20000000	/* 100Mb/s input pin */
    222  1.4.2.2  nathanw #define	CFG_DUPSTS	0x10000000	/* full-duplex status */
    223  1.4.2.2  nathanw #define	CFG_TBI_EN	0x01000000	/* ten-bit interface enable */
    224  1.4.2.2  nathanw #define	CFG_MODE_1000	0x00400000	/* 1000Mb/s mode enable */
    225  1.4.2.2  nathanw #define	CFG_PINT_DUP	0x00100000	/* interrupt on PHY DUP change */
    226  1.4.2.2  nathanw #define	CFG_PINT_LNK	0x00080000	/* interrupt on PHY LNK change */
    227  1.4.2.2  nathanw #define	CFG_PINT_SPD	0x00040000	/* interrupt on PHY SPD change */
    228  1.4.2.2  nathanw #define	CFG_TMRTEST	0x00020000	/* timer test mode */
    229  1.4.2.2  nathanw #define	CFG_MRM_DIS	0x00010000	/* MRM disable */
    230  1.4.2.2  nathanw #define	CFG_MWI_DIS	0x00008000	/* MWI disable */
    231  1.4.2.2  nathanw #define	CFG_T64ADDR	0x00004000	/* target 64-bit addressing enable */
    232  1.4.2.2  nathanw #define	CFG_PCI64_DET	0x00002000	/* 64-bit PCI bus detected */
    233  1.4.2.2  nathanw #define	CFG_DATA64_EN	0x00001000	/* 64-bit data enable */
    234  1.4.2.2  nathanw #define	CFG_M64ADDR	0x00000800	/* master 64-bit addressing enable */
    235  1.4.2.2  nathanw #else
    236      1.3  thorpej #define	CFG_SPEED100	0x40000000	/* 100Mb/s (83815) */
    237      1.3  thorpej #define	CFG_FDUP	0x20000000	/* full duplex (83815) */
    238      1.3  thorpej #define	CFG_POL		0x10000000	/* 10Mb/s polarity (83815) */
    239      1.3  thorpej #define	CFG_ANEG_DN	0x08000000	/* autonegotiation done (83815) */
    240      1.3  thorpej #define	CFG_PHY_CFG	0x00fc0000	/* PHY configuration (83815) */
    241      1.3  thorpej #define	CFG_PINT_ACEN	0x00020000	/* PHY interrupt auto clear (83815) */
    242      1.3  thorpej #define	CFG_PAUSE_ADV	0x00010000	/* pause advertise (83815) */
    243      1.3  thorpej #define	CFG_ANEG_SEL	0x0000e000	/* autonegotiation select (83815) */
    244  1.4.2.2  nathanw #endif /* DP83820 */
    245      1.3  thorpej #define	CFG_PHY_RST	0x00000400	/* PHY reset (83815) */
    246      1.3  thorpej #define	CFG_PHY_DIS	0x00000200	/* PHY disable (83815) */
    247  1.4.2.2  nathanw #ifdef DP83820
    248  1.4.2.2  nathanw #define	CFG_EXTSTS_EN	0x00000100	/* extended status enable */
    249  1.4.2.2  nathanw #else
    250      1.3  thorpej #define	CFG_EUPHCOMP	0x00000100	/* 83810 descriptor compat (83815) */
    251  1.4.2.2  nathanw #endif /* DP83820 */
    252      1.1  thorpej #define	CFG_REQALG	0x00000080	/* PCI bus request alg. */
    253      1.1  thorpej #define	CFG_SB		0x00000040	/* single backoff */
    254      1.1  thorpej #define	CFG_POW		0x00000020	/* program out of window timer */
    255      1.1  thorpej #define	CFG_EXD		0x00000010	/* excessive defferal timer disable */
    256      1.1  thorpej #define	CFG_PESEL	0x00000008	/* parity error detection action */
    257  1.4.2.2  nathanw #ifdef DP83820
    258  1.4.2.2  nathanw #define	CFG_BROM_DIS	0x00000004	/* boot ROM disable */
    259  1.4.2.2  nathanw #define	CFG_EXT_125	0x00000002	/* external 125MHz reference select */
    260  1.4.2.2  nathanw #endif /* DP83820 */
    261      1.1  thorpej #define	CFG_BEM		0x00000001	/* big-endian mode */
    262      1.1  thorpej 
    263      1.1  thorpej #define	SIP_EROMAR	0x08	/* EEPROM access register */
    264  1.4.2.2  nathanw #ifdef DP83820
    265  1.4.2.2  nathanw #define	EROMAR_MDC	0x00000040	/* MII clock */
    266  1.4.2.2  nathanw #define	EROMAR_MDDIR	0x00000020	/* MII direction (1 == MAC->PHY) */
    267  1.4.2.2  nathanw #define	EROMAR_MDIO	0x00000010	/* MII data */
    268  1.4.2.2  nathanw #endif /* DP83820 */
    269      1.1  thorpej #define	EROMAR_EECS	0x00000008	/* chip select */
    270      1.1  thorpej #define	EROMAR_EESK	0x00000004	/* clock */
    271      1.1  thorpej #define	EROMAR_EEDO	0x00000002	/* data out */
    272      1.1  thorpej #define	EROMAR_EEDI	0x00000001	/* data in */
    273      1.1  thorpej 
    274      1.1  thorpej #define	SIP_PTSCR	0x0c	/* PCI test control register */
    275  1.4.2.2  nathanw #ifdef DP83820
    276  1.4.2.2  nathanw #define	PTSCR_RBIST_RST	    0x00002000	/* SRAM BIST reset */
    277  1.4.2.2  nathanw #define	PTSCR_RBIST_EN	    0x00000400	/* SRAM BIST enable */
    278  1.4.2.2  nathanw #define	PTSCR_RBIST_DONE    0x00000200	/* SRAM BIST done */
    279  1.4.2.2  nathanw #define	PTSCR_RBIST_RX1FAIL 0x00000100	/* Rx status FIFO BIST fail */
    280  1.4.2.2  nathanw #define	PTSCR_RBIST_RX0FAIL 0x00000080	/* Rx data FIFO BIST fail */
    281  1.4.2.2  nathanw #define	PTSCR_RBIST_TX0FAIL 0x00000020	/* Tx data FIFO BIST fail */
    282  1.4.2.2  nathanw #define	PTSCR_RBIST_HFFAIL  0x00000010	/* hash filter BIST fail */
    283  1.4.2.2  nathanw #define	PTSCR_RBIST_RXFAIL  0x00000008	/* Rx filter BIST failed */
    284  1.4.2.2  nathanw #define	PTSCR_EELOAD_EN	    0x00000004	/* EEPROM load initiate */
    285  1.4.2.2  nathanw #define	PTSCR_EEBIST_EN	    0x00000002	/* EEPROM BIST enable */
    286  1.4.2.2  nathanw #define	PTSCR_EEBIST_FAIL   0x00000001	/* EEPROM BIST failed */
    287  1.4.2.2  nathanw #else
    288      1.1  thorpej #define	PTSCR_DIS_TEST	0x40000000	/* discard timer test mode */
    289      1.1  thorpej #define	PTSCR_EROM_TACC	0x0f000000	/* boot rom access time */
    290      1.1  thorpej #define	PTSCR_TRRAMADR	0x001ff000	/* TX/RX RAM address */
    291      1.1  thorpej #define	PTSCR_BMTEN	0x00000200	/* bus master test enable */
    292      1.1  thorpej #define	PTSCR_RRTMEN	0x00000080	/* receive RAM test mode enable */
    293      1.1  thorpej #define	PTSCR_TRTMEN	0x00000040	/* transmit RAM test mode enable */
    294      1.1  thorpej #define	PTSCR_SRTMEN	0x00000020	/* status RAM test mode enable */
    295      1.1  thorpej #define	PTSCR_SRAMADR	0x0000001f	/* status RAM address */
    296  1.4.2.2  nathanw #endif /* DP83820 */
    297      1.1  thorpej 
    298      1.1  thorpej #define	SIP_ISR		0x10	/* interrupt status register */
    299  1.4.2.2  nathanw #ifdef DP83820
    300  1.4.2.2  nathanw #define	ISR_TXDESC3	0x40000000	/* Tx queue 3 */
    301  1.4.2.2  nathanw #define	ISR_TXDESC2	0x20000000	/* Tx queue 2 */
    302  1.4.2.2  nathanw #define	ISR_TXDESC1	0x10000000	/* Tx queue 1 */
    303  1.4.2.2  nathanw #define	ISR_TXDESC0	0x08000000	/* Tx queue 0 */
    304  1.4.2.2  nathanw #define	ISR_RXDESC3	0x04000000	/* Rx queue 3 */
    305  1.4.2.2  nathanw #define	ISR_RXDESC2	0x02000000	/* Rx queue 2 */
    306  1.4.2.2  nathanw #define	ISR_RXDESC1	0x01000000	/* Rx queue 1 */
    307  1.4.2.2  nathanw #define	ISR_RXDESC0	0x00800000	/* Rx queue 0 */
    308  1.4.2.2  nathanw #define	ISR_TXRCMP	0x00400000	/* transmit reset complete */
    309  1.4.2.2  nathanw #define	ISR_RXRCMP	0x00200000	/* receive reset complete */
    310  1.4.2.2  nathanw #define	ISR_DPERR	0x00100000	/* detected parity error */
    311  1.4.2.2  nathanw #define	ISR_SSERR	0x00080000	/* signalled system error */
    312  1.4.2.2  nathanw #define	ISR_RMABT	0x00040000	/* received master abort */
    313  1.4.2.2  nathanw #define	ISR_RTABT	0x00020000	/* received target abort */
    314  1.4.2.2  nathanw #else
    315      1.1  thorpej #define	ISR_WAKEEVT	0x10000000	/* wake up event */
    316      1.1  thorpej #define	ISR_PAUSE_END	0x08000000	/* end of transmission pause */
    317      1.1  thorpej #define	ISR_PAUSE_ST	0x04000000	/* start of transmission pause */
    318      1.1  thorpej #define	ISR_TXRCMP	0x02000000	/* transmit reset complete */
    319      1.1  thorpej #define	ISR_RXRCMP	0x01000000	/* receive reset complete */
    320      1.1  thorpej #define	ISR_DPERR	0x00800000	/* detected parity error */
    321      1.1  thorpej #define	ISR_SSERR	0x00400000	/* signalled system error */
    322      1.1  thorpej #define	ISR_RMABT	0x00200000	/* received master abort */
    323      1.1  thorpej #define	ISR_RTABT	0x00100000	/* received target abort */
    324  1.4.2.2  nathanw #endif /* DP83820 */
    325      1.1  thorpej #define	ISR_RXSOVR	0x00010000	/* Rx status FIFO overrun */
    326      1.1  thorpej #define	ISR_HIBERR	0x00008000	/* high bits error set */
    327  1.4.2.2  nathanw #ifdef DP83820
    328  1.4.2.2  nathanw #define	ISR_PHY		0x00004000	/* PHY interrupt */
    329  1.4.2.2  nathanw #define	ISR_PME		0x00002000	/* power management event */
    330  1.4.2.2  nathanw #endif /* DP83820 */
    331      1.1  thorpej #define	ISR_SWI		0x00001000	/* software interrupt */
    332  1.4.2.2  nathanw #ifdef DP83820
    333  1.4.2.2  nathanw #define	ISR_MIB		0x00000800	/* MIB service */
    334  1.4.2.2  nathanw #endif /* DP83820 */
    335      1.1  thorpej #define	ISR_TXURN	0x00000400	/* Tx underrun */
    336      1.1  thorpej #define	ISR_TXIDLE	0x00000200	/* Tx idle */
    337      1.1  thorpej #define	ISR_TXERR	0x00000100	/* Tx error */
    338      1.1  thorpej #define	ISR_TXDESC	0x00000080	/* Tx descriptor interrupt */
    339      1.1  thorpej #define	ISR_TXOK	0x00000040	/* Tx okay */
    340      1.1  thorpej #define	ISR_RXORN	0x00000020	/* Rx overrun */
    341      1.1  thorpej #define	ISR_RXIDLE	0x00000010	/* Rx idle */
    342      1.1  thorpej #define	ISR_RXEARLY	0x00000008	/* Rx early */
    343      1.1  thorpej #define	ISR_RXERR	0x00000004	/* Rx error */
    344      1.1  thorpej #define	ISR_RXDESC	0x00000002	/* Rx descriptor interrupt */
    345      1.1  thorpej #define	ISR_RXOK	0x00000001	/* Rx okay */
    346      1.1  thorpej 
    347      1.1  thorpej #define	SIP_IMR		0x14	/* interrupt mask register */
    348      1.1  thorpej /* See bits in SIP_ISR */
    349      1.1  thorpej 
    350      1.1  thorpej #define	SIP_IER		0x18	/* interrupt enable register */
    351      1.1  thorpej #define	IER_IE		0x00000001	/* master interrupt enable */
    352      1.1  thorpej 
    353  1.4.2.2  nathanw #ifdef DP83820
    354  1.4.2.2  nathanw #define	SIP_IHR		0x1c	/* interrupt hold-off register */
    355  1.4.2.2  nathanw #define	IHR_IHCTL	0x00000100	/* interrupt hold-off control */
    356  1.4.2.2  nathanw #define	IHR_IH		0x000000ff	/* interrupt hold-off timer (100us) */
    357  1.4.2.2  nathanw #else
    358      1.1  thorpej #define	SIP_ENPHY	0x1c	/* enhanced PHY access register */
    359      1.1  thorpej #define	ENPHY_PHYDATA	0xffff0000	/* PHY data */
    360      1.1  thorpej #define	ENPHY_DATA_SHIFT 16
    361      1.2  thorpej #define	ENPHY_PHYADDR	0x0000f800	/* PHY number (7016 only) */
    362      1.2  thorpej #define	ENPHY_PHYADDR_SHIFT 11
    363      1.1  thorpej #define	ENPHY_REGADDR	0x000007c0	/* PHY register */
    364      1.1  thorpej #define	ENPHY_REGADDR_SHIFT 6
    365      1.1  thorpej #define	ENPHY_RWCMD	0x00000020	/* 1 == read, 0 == write */
    366      1.1  thorpej #define	ENPHY_ACCESS	0x00000010	/* PHY access enable */
    367  1.4.2.2  nathanw #endif /* DP83820 */
    368      1.1  thorpej 
    369      1.1  thorpej #define	SIP_TXDP	0x20	/* transmit descriptor pointer reg */
    370      1.1  thorpej 
    371  1.4.2.2  nathanw #ifdef DP83820
    372  1.4.2.2  nathanw #define	SIP_TXDP_HI	0x24	/* transmit descriptor pointer (high) reg */
    373  1.4.2.2  nathanw #endif /* DP83820 */
    374  1.4.2.2  nathanw 
    375  1.4.2.2  nathanw #ifdef DP83820
    376  1.4.2.2  nathanw #define	SIP_TXCFG	0x28	/* transmit configuration register */
    377  1.4.2.2  nathanw #else
    378      1.1  thorpej #define	SIP_TXCFG	0x24	/* transmit configuration register */
    379  1.4.2.2  nathanw #endif /* DP83820 */
    380      1.1  thorpej #define	TXCFG_CSI	0x80000000	/* carrier sense ignore */
    381      1.1  thorpej #define	TXCFG_HBI	0x40000000	/* heartbeat ignore */
    382      1.1  thorpej #define	TXCFG_MLB	0x20000000	/* MAC loopback */
    383      1.1  thorpej #define	TXCFG_ATP	0x10000000	/* automatic transmit padding */
    384  1.4.2.2  nathanw #ifdef DP83820
    385  1.4.2.2  nathanw #define	TXCFG_ECRETRY	0x008000000	/* excessive collision retry enable */
    386  1.4.2.2  nathanw #define	TXCFG_MXDMA	 0x00700000	/* max DMA burst size */
    387  1.4.2.2  nathanw #define	TXCFG_MXDMA_1024 0x00000000	/*    1024 bytes */
    388  1.4.2.2  nathanw #define	TXCFG_MXDMA_8	 0x00100000	/*       8 bytes */
    389  1.4.2.2  nathanw #define	TXCFG_MXDMA_16	 0x00200000	/*      16 bytes */
    390  1.4.2.2  nathanw #define	TXCFG_MXDMA_32	 0x00300000	/*      32 bytes */
    391  1.4.2.2  nathanw #define	TXCFG_MXDMA_64	 0x00400000	/*      64 bytes */
    392  1.4.2.2  nathanw #define	TXCFG_MXDMA_128	 0x00500000	/*     128 bytes */
    393  1.4.2.2  nathanw #define	TXCFG_MXDMA_256	 0x00600000	/*     256 bytes */
    394  1.4.2.2  nathanw #define	TXCFG_MXDMA_512	 0x00700000	/*     512 bytes */
    395  1.4.2.2  nathanw #define	TXCFG_BRST_DIS	0x00080000	/* 1000Mb/s burst disable */
    396  1.4.2.2  nathanw #define	TXCFG_FLTH	0x0000ff00	/* Fx fill threshold */
    397  1.4.2.2  nathanw #define	TXCFG_FLTH_SHIFT 8
    398  1.4.2.2  nathanw #define	TXCFG_DRTH	0x000000ff	/* Tx drain threshold */
    399  1.4.2.2  nathanw #else
    400      1.1  thorpej #define	TXCFG_MXDMA	0x00700000	/* max DMA burst size */
    401      1.1  thorpej #define	TXCFG_MXDMA_512	0x00000000	/*     512 bytes */
    402      1.1  thorpej #define	TXCFG_MXDMA_4	0x00100000	/*       4 bytes */
    403      1.1  thorpej #define	TXCFG_MXDMA_8	0x00200000	/*       8 bytes */
    404      1.1  thorpej #define	TXCFG_MXDMA_16	0x00300000	/*      16 bytes */
    405      1.1  thorpej #define	TXCFG_MXDMA_32	0x00400000	/*      32 bytes */
    406      1.1  thorpej #define	TXCFG_MXDMA_64	0x00500000	/*      64 bytes */
    407      1.1  thorpej #define	TXCFG_MXDMA_128	0x00600000	/*     128 bytes */
    408      1.1  thorpej #define	TXCFG_MXDMA_256	0x00700000	/*     256 bytes */
    409      1.1  thorpej #define	TXCFG_FLTH	0x00003f00	/* Tx fill threshold */
    410      1.1  thorpej #define	TXCFG_FLTH_SHIFT 8
    411      1.1  thorpej #define	TXCFG_DRTH	0x0000003f	/* Tx drain threshold */
    412  1.4.2.2  nathanw #endif /* DP83820 */
    413      1.1  thorpej 
    414  1.4.2.2  nathanw #ifdef DP83820
    415  1.4.2.2  nathanw #define	SIP_GPIOR	0x2c	/* general purpose i/o register */
    416  1.4.2.2  nathanw #define	GPIOR_GP5_IN	0x00004000	/* GP 5 in */
    417  1.4.2.2  nathanw #define	GPIOR_GP4_IN	0x00002000	/* GP 4 in */
    418  1.4.2.2  nathanw #define	GPIOR_GP3_IN	0x00001000	/* GP 3 in */
    419  1.4.2.2  nathanw #define	GPIOR_GP2_IN	0x00000800	/* GP 2 in */
    420  1.4.2.2  nathanw #define	GPIOR_GP1_IN	0x00000400	/* GP 1 in */
    421  1.4.2.2  nathanw #define	GPIOR_GP5_OE	0x00000200	/* GP 5 out enable */
    422  1.4.2.2  nathanw #define	GPIOR_GP4_OE	0x00000100	/* GP 4 out enable */
    423  1.4.2.2  nathanw #define	GPIOR_GP3_OE	0x00000080	/* GP 3 out enable */
    424  1.4.2.2  nathanw #define	GPIOR_GP2_OE	0x00000040	/* GP 2 out enable */
    425  1.4.2.2  nathanw #define	GPIOR_GP1_OE	0x00000020	/* GP 1 out enable */
    426  1.4.2.2  nathanw #define	GPIOR_GP5_OUT	0x00000010	/* GP 5 out */
    427  1.4.2.2  nathanw #define	GPIOR_GP4_OUT	0x00000008	/* GP 4 out */
    428  1.4.2.2  nathanw #define	GPIOR_GP3_OUT	0x00000004	/* GP 3 out */
    429  1.4.2.2  nathanw #define	GPIOR_GP2_OUT	0x00000002	/* GP 2 out */
    430  1.4.2.2  nathanw #define	GPIOR_GP1_OUT	0x00000001	/* GP 1 out */
    431  1.4.2.2  nathanw #endif /* DP83820 */
    432  1.4.2.2  nathanw 
    433  1.4.2.2  nathanw #define	SIP_RXDP	0x30	/* receive descriptor pointer reg */
    434  1.4.2.2  nathanw 
    435  1.4.2.2  nathanw #ifdef DP83820
    436  1.4.2.2  nathanw #define	SIP_RXDP_HI	0x34	/* receive descriptor pointer (high) reg */
    437  1.4.2.2  nathanw #endif /* DP83820 */
    438  1.4.2.2  nathanw 
    439  1.4.2.2  nathanw #ifdef DP83820
    440  1.4.2.2  nathanw #define	SIP_RXCFG	0x38	/* receive configuration register */
    441  1.4.2.2  nathanw #else
    442      1.1  thorpej #define	SIP_RXCFG	0x34	/* receive configuration register */
    443  1.4.2.2  nathanw #endif
    444      1.1  thorpej #define	RXCFG_AEP	0x80000000	/* accept error packets */
    445      1.1  thorpej #define	RXCFG_ARP	0x40000000	/* accept runt packets */
    446  1.4.2.2  nathanw #ifdef DP83820
    447  1.4.2.2  nathanw #define	RXCFG_STRIPCRC	0x20000000	/* strip CRC */
    448  1.4.2.2  nathanw #endif /* DP83820 */
    449      1.1  thorpej #define	RXCFG_ATX	0x10000000	/* accept transmit packets */
    450      1.1  thorpej #define	RXCFG_AJAB	0x08000000	/* accept jabber packets */
    451  1.4.2.2  nathanw #ifdef DP83820
    452  1.4.2.2  nathanw #define	RXCFG_AIRL	0x04000000	/* accept in-range length err packets */
    453  1.4.2.2  nathanw #define	RXCFG_MXDMA	 0x00700000	/* max DMA burst size */
    454  1.4.2.2  nathanw #define	RXCFG_MXDMA_1024 0x00000000	/*    1024 bytes */
    455  1.4.2.2  nathanw #define	RXCFG_MXDMA_8	 0x00100000	/*       8 bytes */
    456  1.4.2.2  nathanw #define	RXCFG_MXDMA_16	 0x00200000	/*      16 bytes */
    457  1.4.2.2  nathanw #define	RXCFG_MXDMA_32	 0x00300000	/*      32 bytes */
    458  1.4.2.2  nathanw #define	RXCFG_MXDMA_64	 0x00400000	/*      64 bytes */
    459  1.4.2.2  nathanw #define	RXCFG_MXDMA_128	 0x00500000	/*     128 bytes */
    460  1.4.2.2  nathanw #define	RXCFG_MXDMA_256	 0x00600000	/*     256 bytes */
    461  1.4.2.2  nathanw #define	RXCFG_MXDMA_512	 0x00700000	/*     512 bytes */
    462  1.4.2.2  nathanw #else
    463      1.1  thorpej #define	RXCFG_MXDMA	0x00700000	/* max DMA burst size */
    464      1.1  thorpej #define	RXCFG_MXDMA_512	0x00000000	/*     512 bytes */
    465      1.1  thorpej #define	RXCFG_MXDMA_4	0x00100000	/*       4 bytes */
    466      1.1  thorpej #define	RXCFG_MXDMA_8	0x00200000	/*       8 bytes */
    467      1.1  thorpej #define	RXCFG_MXDMA_16	0x00300000	/*      16 bytes */
    468      1.1  thorpej #define	RXCFG_MXDMA_32	0x00400000	/*      32 bytes */
    469      1.1  thorpej #define	RXCFG_MXDMA_64	0x00500000	/*      64 bytes */
    470      1.1  thorpej #define	RXCFG_MXDMA_128	0x00600000	/*     128 bytes */
    471      1.1  thorpej #define	RXCFG_MXDMA_256	0x00700000	/*     256 bytes */
    472  1.4.2.2  nathanw #endif /* DP83820 */
    473      1.1  thorpej #define	RXCFG_DRTH	0x0000003e
    474      1.1  thorpej #define	RXCFG_DRTH_SHIFT 1
    475      1.1  thorpej 
    476  1.4.2.2  nathanw #ifdef DP83820
    477  1.4.2.2  nathanw #define	SIP_PQCR	0x3c	/* priority queueing control register */
    478  1.4.2.2  nathanw #define	PQCR_RXPQ_4	0x0000000c	/* 4 Rx queues */
    479  1.4.2.2  nathanw #define	PQCR_RXPQ_3	0x00000008	/* 3 Rx queues */
    480  1.4.2.2  nathanw #define	PQCR_RXPQ_2	0x00000004	/* 2 Rx queues */
    481  1.4.2.2  nathanw #define	PQCR_TXFAIR	0x00000002	/* Tx fairness enable */
    482  1.4.2.2  nathanw #define	PQCR_TXPQEN	0x00000001	/* Tx priority queueing enable */
    483  1.4.2.2  nathanw #else
    484      1.1  thorpej #define	SIP_FLOWCTL	0x38	/* flow control register */
    485      1.1  thorpej #define	FLOWCTL_PAUSE	0x00000002	/* PAUSE flag */
    486      1.1  thorpej #define	FLOWCTL_FLOWEN	0x00000001	/* enable flow control */
    487      1.1  thorpej 
    488      1.3  thorpej #define	SIP_NS_CCSR	0x3c	/* CLKRUN control/status register (83815) */
    489      1.3  thorpej #define	CCSR_PMESTS	0x00008000	/* PME status */
    490      1.3  thorpej #define	CCSR_PMEEN	0x00000100	/* PME enable */
    491      1.3  thorpej #define	CCSR_CLKRUN_EN	0x00000001	/* clkrun enable */
    492  1.4.2.2  nathanw #endif /* DP83820 */
    493      1.3  thorpej 
    494      1.3  thorpej #define	SIP_NS_WCSR	0x40	/* WoL control/status register (83815) */
    495      1.3  thorpej 
    496      1.3  thorpej #define	SIP_NS_PCR	0x44	/* pause control/status register (83815) */
    497      1.3  thorpej 
    498      1.1  thorpej #define	SIP_RFCR	0x48	/* receive filter control register */
    499      1.1  thorpej #define	RFCR_RFEN	0x80000000	/* Rx filter enable */
    500      1.1  thorpej #define	RFCR_AAB	0x40000000	/* accept all broadcast */
    501      1.1  thorpej #define	RFCR_AAM	0x20000000	/* accept all multicast */
    502      1.1  thorpej #define	RFCR_AAP	0x10000000	/* accept all physical */
    503      1.3  thorpej #define	RFCR_APM	0x08000000	/* accept perfect match (83815) */
    504      1.3  thorpej #define	RFCR_APAT	0x07800000	/* accept pattern match (83815) */
    505      1.3  thorpej #define	RFCR_AARP	0x00400000	/* accept ARP (83815) */
    506      1.3  thorpej #define	RFCR_MHEN	0x00200000	/* multicast hash enable (83815) */
    507      1.3  thorpej #define	RFCR_UHEN	0x00100000	/* unicast hash enable (83815) */
    508      1.3  thorpej #define	RFCR_ULM	0x00080000	/* U/L bit mask (83815) */
    509      1.3  thorpej #define	RFCR_NS_RFADDR	0x000003ff	/* Rx filter ext reg address (83815) */
    510      1.1  thorpej #define	RFCR_RFADDR	0x000f0000	/* Rx filter address */
    511      1.1  thorpej #define	RFCR_RFADDR_NODE0 0x00000000	/* node address 1, 0 */
    512      1.1  thorpej #define	RFCR_RFADDR_NODE2 0x00010000	/* node address 3, 2 */
    513      1.1  thorpej #define	RFCR_RFADDR_NODE4 0x00020000	/* node address 5, 4 */
    514      1.1  thorpej #define	RFCR_RFADDR_MC0	  0x00040000	/* multicast hash word 0 */
    515      1.1  thorpej #define	RFCR_RFADDR_MC1	  0x00050000	/* multicast hash word 1 */
    516      1.1  thorpej #define	RFCR_RFADDR_MC2	  0x00060000	/* multicast hash word 2 */
    517      1.1  thorpej #define	RFCR_RFADDR_MC3	  0x00070000	/* multicast hash word 3 */
    518      1.1  thorpej #define	RFCR_RFADDR_MC4	  0x00080000	/* multicast hash word 4 */
    519      1.1  thorpej #define	RFCR_RFADDR_MC5	  0x00090000	/* multicast hash word 5 */
    520      1.1  thorpej #define	RFCR_RFADDR_MC6	  0x000a0000	/* multicast hash word 6 */
    521      1.1  thorpej #define	RFCR_RFADDR_MC7	  0x000b0000	/* multicast hash word 7 */
    522      1.4  thorpej 
    523  1.4.2.1  nathanw #define	RFCR_NS_RFADDR_PMATCH0	0x0000	/* perfect match octets 1-0 */
    524  1.4.2.1  nathanw #define	RFCR_NS_RFADDR_PMATCH2	0x0002	/* perfect match octets 3-2 */
    525  1.4.2.1  nathanw #define	RFCR_NS_RFADDR_PMATCH4	0x0004	/* perfect match octets 5-4 */
    526      1.4  thorpej #define	RFCR_NS_RFADDR_PCOUNT	0x0006	/* pattern count */
    527  1.4.2.2  nathanw #ifdef DP83820
    528  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_PCOUNT2	0x0008	/* pattern count 2, 3 */
    529  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_SOPAS0	0x000a	/* SecureOn 0, 1 */
    530  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_SOPAS2	0x000c	/* SecureOn 2, 3 */
    531  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_SOPAS4	0x000e	/* SecureOn 4, 5 */
    532  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_FILTMEM	0x0100	/* hash memory */
    533  1.4.2.2  nathanw #define	RFCR_NS_RFADDR_PATMEM	0x0200	/* pattern memory */
    534  1.4.2.2  nathanw #else
    535      1.4  thorpej #define	RFCR_NS_RFADDR_FILTMEM	0x0200	/* filter memory (hash/pattern) */
    536  1.4.2.2  nathanw #endif /* DP83820 */
    537      1.1  thorpej 
    538      1.1  thorpej #define	SIP_RFDR	0x4c	/* receive filter data register */
    539      1.3  thorpej #define	RFDR_BMASK	0x00030000	/* byte mask (83815) */
    540      1.1  thorpej #define	RFDR_DATA	0x0000ffff	/* data bits */
    541      1.3  thorpej 
    542      1.3  thorpej #define	SIP_NS_BRAR	0x50	/* boot rom address (83815) */
    543      1.3  thorpej #define	BRAR_AUTOINC	0x80000000	/* autoincrement */
    544      1.3  thorpej #define	BRAR_ADDR	0x0000ffff	/* address */
    545      1.3  thorpej 
    546      1.3  thorpej #define	SIP_NS_BRDR	0x54	/* boot rom data (83815) */
    547      1.3  thorpej 
    548      1.3  thorpej #define	SIP_NS_SRR	0x58	/* silicon revision register (83815) */
    549  1.4.2.2  nathanw #ifdef DP83820
    550  1.4.2.2  nathanw #define	SRR_REV_B	0x00000103
    551  1.4.2.2  nathanw #else
    552      1.3  thorpej #define	SRR_REV_A	0x00000101
    553      1.3  thorpej #define	SRR_REV_B_1	0x00000200
    554      1.3  thorpej #define	SRR_REV_B_2	0x00000201
    555      1.3  thorpej #define	SRR_REV_B_3	0x00000203
    556      1.3  thorpej #define	SRR_REV_C_1	0x00000300
    557      1.3  thorpej #define	SRR_REV_C_2	0x00000302
    558  1.4.2.2  nathanw #endif /* DP83820 */
    559      1.3  thorpej 
    560      1.3  thorpej #define	SIP_NS_MIBC	0x5c	/* mib control register (83815) */
    561      1.3  thorpej #define	MIBC_MIBS	0x00000008	/* mib counter strobe */
    562      1.3  thorpej #define	MIBC_ACLR	0x00000004	/* clear all counters */
    563      1.3  thorpej #define	MIBC_FRZ	0x00000002	/* freeze all counters */
    564      1.3  thorpej #define	MIBC_WRN	0x00000001	/* warning test indicator */
    565      1.3  thorpej 
    566      1.3  thorpej #define	SIP_NS_MIB(mibreg)	/* mib data registers (83815) */	\
    567      1.3  thorpej 	(0x60 + (mibreg))
    568      1.3  thorpej #define	MIB_RXErroredPkts	0x00
    569      1.3  thorpej #define	MIB_RXFCSErrors		0x04
    570      1.3  thorpej #define	MIB_RXMsdPktErrors	0x08
    571      1.3  thorpej #define	MIB_RXFAErrors		0x0c
    572      1.3  thorpej #define	MIB_RXSymbolErrors	0x10
    573      1.3  thorpej #define	MIB_RXFrameTooLong	0x14
    574  1.4.2.2  nathanw #ifdef DP83820
    575  1.4.2.2  nathanw #define	MIB_RXIRLErrors		0x18
    576  1.4.2.2  nathanw #define	MIB_RXBadOpcodes	0x1c
    577  1.4.2.2  nathanw #define	MIB_RXPauseFrames	0x20
    578  1.4.2.2  nathanw #define	MIB_TXPauseFrames	0x24
    579  1.4.2.2  nathanw #define	MIB_TXSQEErrors		0x28
    580  1.4.2.2  nathanw #else
    581      1.3  thorpej #define	MIB_RXTXSQEErrors	0x18
    582  1.4.2.2  nathanw #endif /* DP83820 */
    583      1.3  thorpej 
    584  1.4.2.2  nathanw #ifndef DP83820
    585      1.3  thorpej #define	SIP_NS_PHY(miireg)	/* PHY registers (83815) */		\
    586      1.3  thorpej 	(0x80 + ((miireg) << 2))
    587  1.4.2.2  nathanw #endif
    588  1.4.2.2  nathanw 
    589  1.4.2.2  nathanw #ifdef DP83820
    590  1.4.2.2  nathanw #define	SIP_TXDP1	0xa0	/* transmit descriptor pointer (pri 1) */
    591  1.4.2.2  nathanw 
    592  1.4.2.2  nathanw #define	SIP_TXDP2	0xa4	/* transmit descriptor pointer (pri 2) */
    593  1.4.2.2  nathanw 
    594  1.4.2.2  nathanw #define	SIP_TXDP3	0xa8	/* transmit descriptor pointer (pri 3) */
    595      1.1  thorpej 
    596  1.4.2.2  nathanw #define	SIP_RXDP1	0xb0	/* receive descriptor pointer (pri 1) */
    597  1.4.2.2  nathanw 
    598  1.4.2.2  nathanw #define	SIP_RXDP2	0xb4	/* receive descriptor pointer (pri 2) */
    599  1.4.2.2  nathanw 
    600  1.4.2.2  nathanw #define	SIP_RXDP3	0xb8	/* receive descriptor pointer (pri 3) */
    601  1.4.2.2  nathanw 
    602  1.4.2.2  nathanw #define	SIP_VRCR	0xbc	/* VLAN/IP receive control register */
    603  1.4.2.2  nathanw #define	VRCR_RUDPE	0x00000080	/* reject UDP checksum errors */
    604  1.4.2.2  nathanw #define	VRCR_RTCPE	0x00000040	/* reject TCP checksum errors */
    605  1.4.2.2  nathanw #define	VRCR_RIPE	0x00000020	/* reject IP checksum errors */
    606  1.4.2.2  nathanw #define	VRCR_IPEN	0x00000010	/* IP checksum enable */
    607  1.4.2.2  nathanw #define	VRCR_DUTF	0x00000008	/* discard untagged frames */
    608  1.4.2.2  nathanw #define	VRCR_DVTF	0x00000004	/* discard VLAN tagged frames */
    609  1.4.2.2  nathanw #define	VRCR_VTREN	0x00000002	/* VLAN tag removal enable */
    610  1.4.2.2  nathanw #define	VRCR_VTDEN	0x00000001	/* VLAN tag detection enable */
    611  1.4.2.2  nathanw 
    612  1.4.2.2  nathanw #define	SIP_VTCR	0xc0	/* VLAN/IP transmit control register */
    613  1.4.2.2  nathanw #define	VTCR_PPCHK	0x00000008	/* per-packet checksum generation */
    614  1.4.2.2  nathanw #define	VTCR_GCHK	0x00000004	/* global checksum generation */
    615  1.4.2.2  nathanw #define	VTCR_VPPTI	0x00000002	/* VLAN per-packet tag insertion */
    616  1.4.2.2  nathanw #define	VTCR_VGTI	0x00000001	/* VLAN global tag insertion */
    617  1.4.2.2  nathanw 
    618  1.4.2.2  nathanw #define	SIP_VDR		0xc4	/* VLAN data register */
    619  1.4.2.2  nathanw #define	VDR_VTCI	0xffff0000	/* VLAN tag control information */
    620  1.4.2.2  nathanw #define	VDR_VTYPE	0x0000ffff	/* VLAN type field */
    621  1.4.2.2  nathanw 
    622  1.4.2.2  nathanw #define	SIP_NS_CCSR	0xcc	/* CLKRUN control/status register (83815) */
    623  1.4.2.2  nathanw #define	CCSR_PMESTS	0x00008000	/* PME status */
    624  1.4.2.2  nathanw #define	CCSR_PMEEN	0x00000100	/* PME enable */
    625  1.4.2.2  nathanw #define	CCSR_CLKRUN_EN	0x00000001	/* clkrun enable */
    626  1.4.2.2  nathanw 
    627  1.4.2.2  nathanw #define	SIP_TBICR	0xe0	/* TBI control register */
    628  1.4.2.2  nathanw #define	TBICR_MR_LOOPBACK   0x00004000	/* TBI PCS loopback enable */
    629  1.4.2.2  nathanw #define	TBICR_MR_AN_ENABLE  0x00001000	/* TBI autonegotiation enable */
    630  1.4.2.2  nathanw #define	TBICR_MR_RESTART_AN 0x00000200	/* restart TBI autoneogtiation */
    631  1.4.2.2  nathanw 
    632  1.4.2.2  nathanw #define	SIP_TBISR	0xe4	/* TBI status register */
    633  1.4.2.2  nathanw #define	TBISR_MR_LINK_STATUS 0x00000020	/* TBI link status */
    634  1.4.2.2  nathanw #define	TBISR_MR_AN_COMPLETE 0x00000004	/* TBI autonegotiation complete */
    635  1.4.2.2  nathanw 
    636  1.4.2.2  nathanw #define	SIP_TANAR	0xe8	/* TBI autoneg adv. register */
    637  1.4.2.2  nathanw #define	TANAR_NP	0x00008000	/* next page exchange required */
    638  1.4.2.2  nathanw #define	TANAR_RF2	0x00002000	/* remote fault 2 */
    639  1.4.2.2  nathanw #define	TANAR_RF1	0x00001000	/* remote fault 1 */
    640  1.4.2.2  nathanw #define	TANAR_PS2	0x00000100	/* pause encoding 2 */
    641  1.4.2.2  nathanw #define	TANAR_PS1	0x00000080	/* pause encoding 1 */
    642  1.4.2.2  nathanw #define	TANAR_HALF_DUP	0x00000040	/* adv. half duplex */
    643  1.4.2.2  nathanw #define	TANAR_FULL_DUP	0x00000020	/* adv. full duplex */
    644  1.4.2.2  nathanw 
    645  1.4.2.2  nathanw #define	SIP_TANLPAR	0xec	/* TBI autoneg link partner ability register */
    646  1.4.2.2  nathanw 	/* See TANAR bits */
    647  1.4.2.2  nathanw 
    648  1.4.2.2  nathanw #define	SIP_TANER	0xf0	/* TBI autoneg expansion register */
    649  1.4.2.2  nathanw #define	TANER_NPA	0x00000004	/* we support next page function */
    650  1.4.2.2  nathanw #define	TANER_PR	0x00000002	/* page received from link partner */
    651  1.4.2.2  nathanw 
    652  1.4.2.2  nathanw #define	SIP_TESR	0xf4	/* TBI extended status register */
    653  1.4.2.2  nathanw #define	TESR_1000FDX	0x00008000	/* we support 1000base FDX */
    654  1.4.2.2  nathanw #define	TESR_1000HDX	0x00004000	/* we support 1000base HDX */
    655  1.4.2.2  nathanw #else
    656      1.1  thorpej #define	SIP_PMCTL	0xb0	/* power management control register */
    657      1.1  thorpej #define	PMCTL_GATECLK	0x80000000	/* gate dual clock enable */
    658      1.1  thorpej #define	PMCTL_WAKEALL	0x40000000	/* wake on all Rx OK */
    659      1.1  thorpej #define	PMCTL_FRM3ACS	0x04000000	/* 3rd wake-up frame access */
    660      1.1  thorpej #define	PMCTL_FRM2ACS	0x02000000	/* 2nd wake-up frame access */
    661      1.1  thorpej #define	PMCTL_FRM1ACS	0x01000000	/* 1st wake-up frame access */
    662      1.1  thorpej #define	PMCTL_FRM3EN	0x00400000	/* 3rd wake-up frame match enable */
    663      1.1  thorpej #define	PMCTL_FRM2EN	0x00200000	/* 2nd wake-up frame match enable */
    664      1.1  thorpej #define	PMCTL_FRM1EN	0x00100000	/* 1st wake-up frame match enable */
    665      1.1  thorpej #define	PMCTL_ALGORITHM	0x00000800	/* Magic Packet match algorithm */
    666      1.1  thorpej #define	PMCTL_MAGICPKT	0x00000400	/* Magic Packet match enable */
    667      1.1  thorpej #define	PMCTL_LINKON	0x00000002	/* link on monitor enable */
    668      1.1  thorpej #define	PMCTL_LINKLOSS	0x00000001	/* link loss monitor enable */
    669      1.1  thorpej 
    670      1.1  thorpej #define	SIP_PMEVT	0xb4	/* power management wake-up evnt reg */
    671      1.1  thorpej #define	PMEVT_ALLFRMMAT	0x40000000	/* receive packet ok */
    672      1.1  thorpej #define	PMEVT_FRM3MAT	0x04000000	/* match 3rd wake-up frame */
    673      1.1  thorpej #define	PMEVT_FRM2MAT	0x02000000	/* match 2nd wake-up frame */
    674      1.1  thorpej #define	PMEVT_FRM1MAT	0x01000000	/* match 1st wake-up frame */
    675      1.1  thorpej #define	PMEVT_MAGICPKT	0x00000400	/* Magic Packet */
    676      1.1  thorpej #define	PMEVT_ONEVT	0x00000002	/* link on event */
    677      1.1  thorpej #define	PMEVT_LOSSEVT	0x00000001	/* link loss event */
    678      1.1  thorpej 
    679      1.1  thorpej #define	SIP_WAKECRC	0xbc	/* wake-up frame CRC register */
    680      1.1  thorpej 
    681      1.1  thorpej #define	SIP_WAKEMASK0	0xc0	/* wake-up frame mask registers */
    682      1.1  thorpej #define	SIP_WAKEMASK1	0xc4
    683      1.1  thorpej #define	SIP_WAKEMASK2	0xc8
    684      1.1  thorpej #define	SIP_WAKEMASK3	0xcc
    685      1.1  thorpej #define	SIP_WAKEMASK4	0xe0
    686  1.4.2.1  nathanw #define	SIP_WAKEMASK5	0xe4
    687      1.1  thorpej #define	SIP_WAKEMASK6	0xe8
    688      1.1  thorpej #define	SIP_WAKEMASK7	0xec
    689  1.4.2.2  nathanw #endif /* DP83820 */
    690  1.4.2.3  nathanw 
    691  1.4.2.3  nathanw /*
    692  1.4.2.3  nathanw  * Revision codes for the SiS 630 chipset built-in Ethernet.
    693  1.4.2.3  nathanw  */
    694  1.4.2.3  nathanw #define	SIS_REV_630E	0x81
    695  1.4.2.3  nathanw #define	SIS_REV_630S	0x82
    696  1.4.2.3  nathanw #define	SIS_REV_630EA1	0x83
    697      1.1  thorpej 
    698      1.1  thorpej /*
    699      1.1  thorpej  * Serial EEPROM opcodes, including the start bit.
    700      1.1  thorpej  */
    701      1.1  thorpej #define	SIP_EEPROM_OPC_ERASE	0x04
    702      1.1  thorpej #define	SIP_EEPROM_OPC_WRITE	0x05
    703      1.1  thorpej #define	SIP_EEPROM_OPC_READ	0x06
    704      1.1  thorpej 
    705      1.1  thorpej /*
    706  1.4.2.1  nathanw  * Serial EEPROM address map (byte address) for the SiS900.
    707      1.1  thorpej  */
    708      1.1  thorpej #define	SIP_EEPROM_SIGNATURE	0x00	/* SiS 900 signature */
    709      1.1  thorpej #define	SIP_EEPROM_MASK		0x02	/* `enable' mask */
    710      1.1  thorpej #define	SIP_EEPROM_VENDOR_ID	0x04	/* PCI vendor ID */
    711      1.1  thorpej #define	SIP_EEPROM_DEVICE_ID	0x06	/* PCI device ID */
    712      1.1  thorpej #define	SIP_EEPROM_SUBVENDOR_ID	0x08	/* PCI subvendor ID */
    713      1.1  thorpej #define	SIP_EEPROM_SUBSYSTEM_ID	0x0a	/* PCI subsystem ID */
    714      1.1  thorpej #define	SIP_EEPROM_PMC		0x0c	/* PCI power management capabilities */
    715      1.1  thorpej #define	SIP_EEPROM_reserved	0x0e	/* reserved */
    716      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID0	0x10	/* Ethernet address 0, 1 */
    717      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID1	0x12	/* Ethernet address 2, 3 */
    718      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID2	0x14	/* Ethernet address 4, 5 */
    719      1.1  thorpej #define	SIP_EEPROM_CHECKSUM	0x16	/* checksum */
    720  1.4.2.1  nathanw 
    721  1.4.2.1  nathanw /*
    722  1.4.2.1  nathanw  * Serial EEPROM data (byte addresses) for the DP83815.
    723  1.4.2.1  nathanw  */
    724  1.4.2.1  nathanw #define	SIP_DP83815_EEPROM_CHECKSUM	0x16	/* checksum */
    725  1.4.2.1  nathanw #define	SIP_DP83815_EEPROM_LENGTH	0x18	/* length of EEPROM data */
    726  1.4.2.2  nathanw 
    727  1.4.2.2  nathanw /*
    728  1.4.2.2  nathanw  * Serial EEPROM data (byte addresses) for the DP83820.
    729  1.4.2.2  nathanw  */
    730  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_SUBSYSTEM_ID	0x00	/* PCI subsystem ID */
    731  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_SUBVENDOR_ID	0x02	/* PCI subvendor ID */
    732  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_CFGINT	0x04	/* PCI INT [31:16] */
    733  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_SOPAS0	0x0e	/* SecureOn [47:32] */
    734  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_SOPAS1	0x10	/* SecureOn [31:16] */
    735  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_SOPAS2	0x12	/* SecureOn [15:0] */
    736  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_PMATCH0	0x14	/* MAC [47:32] */
    737  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_PMATCH1	0x16	/* MAC [31:16] */
    738  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_PMATCH2	0x18	/* MAC [15:0] */
    739  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_CHECKSUM	0x1a	/* checksum */
    740  1.4.2.2  nathanw #define	SIP_DP83820_EEPROM_LENGTH	0x1c	/* length of EEPROM data */
    741      1.1  thorpej 
    742      1.1  thorpej #endif /* _DEV_PCI_IF_SIPREG_H_ */
    743