Home | History | Annotate | Line # | Download | only in pci
if_sipreg.h revision 1.2.4.3
      1  1.2.4.3  msaitoh /*	$NetBSD: if_sipreg.h,v 1.2.4.3 2003/09/08 07:10:12 msaitoh Exp $	*/
      2      1.1  thorpej 
      3      1.1  thorpej /*-
      4      1.1  thorpej  * Copyright (c) 1999 Network Computer, Inc.
      5      1.1  thorpej  * All rights reserved.
      6      1.1  thorpej  *
      7      1.1  thorpej  * Redistribution and use in source and binary forms, with or without
      8      1.1  thorpej  * modification, are permitted provided that the following conditions
      9      1.1  thorpej  * are met:
     10      1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     11      1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     12      1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     13      1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     14      1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     15      1.1  thorpej  * 3. Neither the name of Network Computer, Inc. nor the names of its
     16      1.1  thorpej  *    contributors may be used to endorse or promote products derived
     17      1.1  thorpej  *    from this software without specific prior written permission.
     18      1.1  thorpej  *
     19      1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY NETWORK COMPUTER, INC. AND CONTRIBUTORS
     20      1.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21      1.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22      1.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23      1.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24      1.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25      1.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26      1.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27      1.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28      1.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29      1.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     30      1.1  thorpej  */
     31      1.1  thorpej 
     32      1.1  thorpej #ifndef _DEV_PCI_IF_SIPREG_H_
     33      1.1  thorpej #define	_DEV_PCI_IF_SIPREG_H_
     34      1.1  thorpej 
     35      1.1  thorpej /*
     36  1.2.4.1  thorpej  * Register description for the Silicon Integrated Systems SiS 900,
     37  1.2.4.1  thorpej  * SiS 7016, and National Semiconductor DP83815 10/100 PCI Ethernet
     38  1.2.4.1  thorpej  * controller.
     39      1.1  thorpej  *
     40      1.1  thorpej  * Written by Jason R. Thorpe for Network Computer, Inc.
     41      1.1  thorpej  */
     42      1.1  thorpej 
     43      1.1  thorpej /*
     44      1.1  thorpej  * Transmit FIFO size.  Used to compute the transmit drain threshold.
     45      1.1  thorpej  *
     46      1.1  thorpej  * The transmit FIFO is arranged as a 512 32-bit memory array.
     47      1.1  thorpej  */
     48      1.1  thorpej #define	SIP_TXFIFO_SIZE	(512 * 4)
     49      1.1  thorpej 
     50      1.1  thorpej /*
     51      1.1  thorpej  * The SiS900 uses a single descriptor format for both transmit
     52      1.1  thorpej  * and receive descriptor chains.
     53      1.1  thorpej  */
     54      1.1  thorpej struct sip_desc {
     55      1.1  thorpej 	u_int32_t	sipd_link;	/* link to next descriptor */
     56      1.1  thorpej 	u_int32_t	sipd_cmdsts;	/* command/status word */
     57      1.1  thorpej 	u_int32_t	sipd_bufptr;	/* pointer to DMA segment */
     58      1.1  thorpej };
     59      1.1  thorpej 
     60      1.1  thorpej /*
     61      1.1  thorpej  * CMDSTS bits common to transmit and receive.
     62      1.1  thorpej  */
     63      1.1  thorpej #define	CMDSTS_OWN	0x80000000	/* owned by consumer */
     64      1.1  thorpej #define	CMDSTS_MORE	0x40000000	/* more descriptors */
     65      1.1  thorpej #define	CMDSTS_INTR	0x20000000	/* interrupt when ownership changes */
     66      1.1  thorpej #define	CMDSTS_SUPCRC	0x10000000	/* suppress CRC */
     67      1.1  thorpej #define	CMDSTS_OK	0x08000000	/* packet ok */
     68      1.1  thorpej #define	CMDSTS_SIZE_MASK 0x000007ff	/* packet size */
     69      1.1  thorpej 
     70      1.1  thorpej #define	CMDSTS_SIZE(x)	((x) & CMDSTS_SIZE_MASK)
     71      1.1  thorpej 
     72      1.1  thorpej /*
     73      1.1  thorpej  * CMDSTS bits for transmit.
     74      1.1  thorpej  */
     75      1.1  thorpej #define	CMDSTS_Tx_TXA	0x04000000	/* transmit abort */
     76      1.1  thorpej #define	CMDSTS_Tx_TFU	0x02000000	/* transmit FIFO underrun */
     77      1.1  thorpej #define	CMDSTS_Tx_CRS	0x01000000	/* carrier sense lost */
     78      1.1  thorpej #define	CMDSTS_Tx_TD	0x00800000	/* transmit deferred */
     79      1.1  thorpej #define	CMDSTS_Tx_ED	0x00400000	/* excessive deferral */
     80      1.1  thorpej #define	CMDSTS_Tx_OWC	0x00200000	/* out of window collision */
     81      1.1  thorpej #define	CMDSTS_Tx_EC	0x00100000	/* excessive collisions */
     82      1.1  thorpej #define	CMDSTS_Tx_CCNT	0x000f0000	/* collision count */
     83      1.1  thorpej 
     84      1.1  thorpej #define	CMDSTS_COLLISIONS(x)	(((x) & CMDSTS_Tx_CCNT) >> 16)
     85      1.1  thorpej 
     86      1.1  thorpej /*
     87      1.1  thorpej  * CMDSTS bits for receive.
     88      1.1  thorpej  */
     89      1.1  thorpej #define	CMDSTS_Rx_RXA	0x04000000	/* receive abort */
     90      1.1  thorpej #define	CMDSTS_Rx_RXO	0x02000000	/* receive overrun */
     91      1.1  thorpej #define	CMDSTS_Rx_DEST	0x01800000	/* destination class */
     92      1.1  thorpej #define	CMDSTS_Rx_LONG	0x00400000	/* packet too long */
     93      1.1  thorpej #define	CMDSTS_Rx_RUNT	0x00200000	/* runt packet */
     94      1.1  thorpej #define	CMDSTS_Rx_ISE	0x00100000	/* invalid symbol error */
     95      1.1  thorpej #define	CMDSTS_Rx_CRCE	0x00080000	/* CRC error */
     96      1.1  thorpej #define	CMDSTS_Rx_FAE	0x00040000	/* frame alignment error */
     97      1.1  thorpej #define	CMDSTS_Rx_LBP	0x00020000	/* loopback packet */
     98      1.1  thorpej #define	CMDSTS_Rx_COL	0x00010000	/* collision activity */
     99      1.1  thorpej 
    100      1.1  thorpej #define	CMDSTS_Rx_DEST_REJ 0x00000000	/* packet rejected */
    101      1.1  thorpej #define	CMDSTS_Rx_DEST_STA 0x00800000	/* matched station address */
    102      1.1  thorpej #define	CMDSTS_Rx_DEST_MUL 0x01000000	/* multicast address */
    103      1.1  thorpej #define	CMDSTS_Rx_DEST_BRD 0x01800000	/* broadcast address */
    104      1.1  thorpej 
    105      1.1  thorpej /*
    106      1.1  thorpej  * PCI Configuration space registers.
    107      1.1  thorpej  */
    108      1.1  thorpej #define	SIP_PCI_CFGIOA	(PCI_MAPREG_START + 0x00)
    109      1.1  thorpej 
    110      1.1  thorpej #define	SIP_PCI_CFGMA	(PCI_MAPREG_START + 0x04)
    111      1.1  thorpej 
    112      1.1  thorpej #define	SIP_PCI_CFGEROMA 0x30		/* expansion ROM address */
    113      1.1  thorpej 
    114      1.1  thorpej #define	SIP_PCI_CFGPMC	 0x40		/* power management cap. */
    115      1.1  thorpej 
    116      1.1  thorpej #define	SIP_PCI_CFGPMCSR 0x44		/* power management ctl. */
    117      1.1  thorpej 
    118      1.1  thorpej /*
    119      1.1  thorpej  * MAC Operation Registers
    120      1.1  thorpej  */
    121      1.1  thorpej #define	SIP_CR		0x00	/* command register */
    122      1.1  thorpej #define	CR_RST		0x00000100	/* software reset */
    123      1.1  thorpej #define	CR_SWI		0x00000080	/* software interrupt */
    124      1.1  thorpej #define	CR_RXR		0x00000020	/* receiver reset */
    125      1.1  thorpej #define	CR_TXR		0x00000010	/* transmit reset */
    126      1.1  thorpej #define	CR_RXD		0x00000008	/* receiver disable */
    127      1.1  thorpej #define	CR_RXE		0x00000004	/* receiver enable */
    128      1.1  thorpej #define	CR_TXD		0x00000002	/* transmit disable */
    129      1.1  thorpej #define	CR_TXE		0x00000001	/* transmit enable */
    130      1.1  thorpej 
    131      1.1  thorpej #define	SIP_CFG		0x04	/* configuration register */
    132  1.2.4.1  thorpej #define	CFG_LNKSTS	0x80000000	/* link status (83815) */
    133  1.2.4.1  thorpej #define	CFG_SPEED100	0x40000000	/* 100Mb/s (83815) */
    134  1.2.4.1  thorpej #define	CFG_FDUP	0x20000000	/* full duplex (83815) */
    135  1.2.4.1  thorpej #define	CFG_POL		0x10000000	/* 10Mb/s polarity (83815) */
    136  1.2.4.1  thorpej #define	CFG_ANEG_DN	0x08000000	/* autonegotiation done (83815) */
    137  1.2.4.1  thorpej #define	CFG_PHY_CFG	0x00fc0000	/* PHY configuration (83815) */
    138  1.2.4.1  thorpej #define	CFG_PINT_ACEN	0x00020000	/* PHY interrupt auto clear (83815) */
    139  1.2.4.1  thorpej #define	CFG_PAUSE_ADV	0x00010000	/* pause advertise (83815) */
    140  1.2.4.1  thorpej #define	CFG_ANEG_SEL	0x0000e000	/* autonegotiation select (83815) */
    141  1.2.4.1  thorpej #define	CFG_PHY_RST	0x00000400	/* PHY reset (83815) */
    142  1.2.4.1  thorpej #define	CFG_PHY_DIS	0x00000200	/* PHY disable (83815) */
    143  1.2.4.1  thorpej #define	CFG_EUPHCOMP	0x00000100	/* 83810 descriptor compat (83815) */
    144      1.1  thorpej #define	CFG_REQALG	0x00000080	/* PCI bus request alg. */
    145      1.1  thorpej #define	CFG_SB		0x00000040	/* single backoff */
    146      1.1  thorpej #define	CFG_POW		0x00000020	/* program out of window timer */
    147      1.1  thorpej #define	CFG_EXD		0x00000010	/* excessive defferal timer disable */
    148      1.1  thorpej #define	CFG_PESEL	0x00000008	/* parity error detection action */
    149      1.1  thorpej #define	CFG_BEM		0x00000001	/* big-endian mode */
    150      1.1  thorpej 
    151      1.1  thorpej #define	SIP_EROMAR	0x08	/* EEPROM access register */
    152      1.1  thorpej #define	EROMAR_EECS	0x00000008	/* chip select */
    153      1.1  thorpej #define	EROMAR_EESK	0x00000004	/* clock */
    154      1.1  thorpej #define	EROMAR_EEDO	0x00000002	/* data out */
    155      1.1  thorpej #define	EROMAR_EEDI	0x00000001	/* data in */
    156      1.1  thorpej 
    157      1.1  thorpej #define	SIP_PTSCR	0x0c	/* PCI test control register */
    158      1.1  thorpej #define	PTSCR_DIS_TEST	0x40000000	/* discard timer test mode */
    159      1.1  thorpej #define	PTSCR_EROM_TACC	0x0f000000	/* boot rom access time */
    160      1.1  thorpej #define	PTSCR_TRRAMADR	0x001ff000	/* TX/RX RAM address */
    161      1.1  thorpej #define	PTSCR_BMTEN	0x00000200	/* bus master test enable */
    162      1.1  thorpej #define	PTSCR_RRTMEN	0x00000080	/* receive RAM test mode enable */
    163      1.1  thorpej #define	PTSCR_TRTMEN	0x00000040	/* transmit RAM test mode enable */
    164      1.1  thorpej #define	PTSCR_SRTMEN	0x00000020	/* status RAM test mode enable */
    165      1.1  thorpej #define	PTSCR_SRAMADR	0x0000001f	/* status RAM address */
    166      1.1  thorpej 
    167      1.1  thorpej #define	SIP_ISR		0x10	/* interrupt status register */
    168      1.1  thorpej #define	ISR_WAKEEVT	0x10000000	/* wake up event */
    169      1.1  thorpej #define	ISR_PAUSE_END	0x08000000	/* end of transmission pause */
    170      1.1  thorpej #define	ISR_PAUSE_ST	0x04000000	/* start of transmission pause */
    171      1.1  thorpej #define	ISR_TXRCMP	0x02000000	/* transmit reset complete */
    172      1.1  thorpej #define	ISR_RXRCMP	0x01000000	/* receive reset complete */
    173      1.1  thorpej #define	ISR_DPERR	0x00800000	/* detected parity error */
    174      1.1  thorpej #define	ISR_SSERR	0x00400000	/* signalled system error */
    175      1.1  thorpej #define	ISR_RMABT	0x00200000	/* received master abort */
    176      1.1  thorpej #define	ISR_RTABT	0x00100000	/* received target abort */
    177      1.1  thorpej #define	ISR_RXSOVR	0x00010000	/* Rx status FIFO overrun */
    178      1.1  thorpej #define	ISR_HIBERR	0x00008000	/* high bits error set */
    179      1.1  thorpej #define	ISR_SWI		0x00001000	/* software interrupt */
    180      1.1  thorpej #define	ISR_TXURN	0x00000400	/* Tx underrun */
    181      1.1  thorpej #define	ISR_TXIDLE	0x00000200	/* Tx idle */
    182      1.1  thorpej #define	ISR_TXERR	0x00000100	/* Tx error */
    183      1.1  thorpej #define	ISR_TXDESC	0x00000080	/* Tx descriptor interrupt */
    184      1.1  thorpej #define	ISR_TXOK	0x00000040	/* Tx okay */
    185      1.1  thorpej #define	ISR_RXORN	0x00000020	/* Rx overrun */
    186      1.1  thorpej #define	ISR_RXIDLE	0x00000010	/* Rx idle */
    187      1.1  thorpej #define	ISR_RXEARLY	0x00000008	/* Rx early */
    188      1.1  thorpej #define	ISR_RXERR	0x00000004	/* Rx error */
    189      1.1  thorpej #define	ISR_RXDESC	0x00000002	/* Rx descriptor interrupt */
    190      1.1  thorpej #define	ISR_RXOK	0x00000001	/* Rx okay */
    191      1.1  thorpej 
    192      1.1  thorpej #define	SIP_IMR		0x14	/* interrupt mask register */
    193      1.1  thorpej /* See bits in SIP_ISR */
    194      1.1  thorpej 
    195      1.1  thorpej #define	SIP_IER		0x18	/* interrupt enable register */
    196      1.1  thorpej #define	IER_IE		0x00000001	/* master interrupt enable */
    197      1.1  thorpej 
    198      1.1  thorpej #define	SIP_ENPHY	0x1c	/* enhanced PHY access register */
    199      1.1  thorpej #define	ENPHY_PHYDATA	0xffff0000	/* PHY data */
    200      1.1  thorpej #define	ENPHY_DATA_SHIFT 16
    201      1.2  thorpej #define	ENPHY_PHYADDR	0x0000f800	/* PHY number (7016 only) */
    202      1.2  thorpej #define	ENPHY_PHYADDR_SHIFT 11
    203      1.1  thorpej #define	ENPHY_REGADDR	0x000007c0	/* PHY register */
    204      1.1  thorpej #define	ENPHY_REGADDR_SHIFT 6
    205      1.1  thorpej #define	ENPHY_RWCMD	0x00000020	/* 1 == read, 0 == write */
    206      1.1  thorpej #define	ENPHY_ACCESS	0x00000010	/* PHY access enable */
    207      1.1  thorpej 
    208      1.1  thorpej #define	SIP_TXDP	0x20	/* transmit descriptor pointer reg */
    209      1.1  thorpej 
    210      1.1  thorpej #define	SIP_TXCFG	0x24	/* transmit configuration register */
    211      1.1  thorpej #define	TXCFG_CSI	0x80000000	/* carrier sense ignore */
    212      1.1  thorpej #define	TXCFG_HBI	0x40000000	/* heartbeat ignore */
    213      1.1  thorpej #define	TXCFG_MLB	0x20000000	/* MAC loopback */
    214      1.1  thorpej #define	TXCFG_ATP	0x10000000	/* automatic transmit padding */
    215      1.1  thorpej #define	TXCFG_MXDMA	0x00700000	/* max DMA burst size */
    216      1.1  thorpej #define	TXCFG_MXDMA_512	0x00000000	/*     512 bytes */
    217      1.1  thorpej #define	TXCFG_MXDMA_4	0x00100000	/*       4 bytes */
    218      1.1  thorpej #define	TXCFG_MXDMA_8	0x00200000	/*       8 bytes */
    219      1.1  thorpej #define	TXCFG_MXDMA_16	0x00300000	/*      16 bytes */
    220      1.1  thorpej #define	TXCFG_MXDMA_32	0x00400000	/*      32 bytes */
    221      1.1  thorpej #define	TXCFG_MXDMA_64	0x00500000	/*      64 bytes */
    222      1.1  thorpej #define	TXCFG_MXDMA_128	0x00600000	/*     128 bytes */
    223      1.1  thorpej #define	TXCFG_MXDMA_256	0x00700000	/*     256 bytes */
    224      1.1  thorpej #define	TXCFG_FLTH	0x00003f00	/* Tx fill threshold */
    225      1.1  thorpej #define	TXCFG_FLTH_SHIFT 8
    226      1.1  thorpej #define	TXCFG_DRTH	0x0000003f	/* Tx drain threshold */
    227      1.1  thorpej 
    228      1.1  thorpej #define	SIP_RXDP	0x30	/* receive desciptor pointer reg */
    229      1.1  thorpej 
    230      1.1  thorpej #define	SIP_RXCFG	0x34	/* receive configuration register */
    231      1.1  thorpej #define	RXCFG_AEP	0x80000000	/* accept error packets */
    232      1.1  thorpej #define	RXCFG_ARP	0x40000000	/* accept runt packets */
    233      1.1  thorpej #define	RXCFG_ATX	0x10000000	/* accept transmit packets */
    234  1.2.4.3  msaitoh #define	RXCFG_ALP	0x08000000	/* accept long packets */
    235      1.1  thorpej #define	RXCFG_MXDMA	0x00700000	/* max DMA burst size */
    236      1.1  thorpej #define	RXCFG_MXDMA_512	0x00000000	/*     512 bytes */
    237      1.1  thorpej #define	RXCFG_MXDMA_4	0x00100000	/*       4 bytes */
    238      1.1  thorpej #define	RXCFG_MXDMA_8	0x00200000	/*       8 bytes */
    239      1.1  thorpej #define	RXCFG_MXDMA_16	0x00300000	/*      16 bytes */
    240      1.1  thorpej #define	RXCFG_MXDMA_32	0x00400000	/*      32 bytes */
    241      1.1  thorpej #define	RXCFG_MXDMA_64	0x00500000	/*      64 bytes */
    242      1.1  thorpej #define	RXCFG_MXDMA_128	0x00600000	/*     128 bytes */
    243      1.1  thorpej #define	RXCFG_MXDMA_256	0x00700000	/*     256 bytes */
    244      1.1  thorpej #define	RXCFG_DRTH	0x0000003e
    245      1.1  thorpej #define	RXCFG_DRTH_SHIFT 1
    246      1.1  thorpej 
    247      1.1  thorpej #define	SIP_FLOWCTL	0x38	/* flow control register */
    248      1.1  thorpej #define	FLOWCTL_PAUSE	0x00000002	/* PAUSE flag */
    249      1.1  thorpej #define	FLOWCTL_FLOWEN	0x00000001	/* enable flow control */
    250      1.1  thorpej 
    251  1.2.4.1  thorpej #define	SIP_NS_CCSR	0x3c	/* CLKRUN control/status register (83815) */
    252  1.2.4.1  thorpej #define	CCSR_PMESTS	0x00008000	/* PME status */
    253  1.2.4.1  thorpej #define	CCSR_PMEEN	0x00000100	/* PME enable */
    254  1.2.4.1  thorpej #define	CCSR_CLKRUN_EN	0x00000001	/* clkrun enable */
    255  1.2.4.1  thorpej 
    256  1.2.4.1  thorpej #define	SIP_NS_WCSR	0x40	/* WoL control/status register (83815) */
    257  1.2.4.1  thorpej 
    258  1.2.4.1  thorpej #define	SIP_NS_PCR	0x44	/* pause control/status register (83815) */
    259  1.2.4.1  thorpej 
    260      1.1  thorpej #define	SIP_RFCR	0x48	/* receive filter control register */
    261      1.1  thorpej #define	RFCR_RFEN	0x80000000	/* Rx filter enable */
    262      1.1  thorpej #define	RFCR_AAB	0x40000000	/* accept all broadcast */
    263      1.1  thorpej #define	RFCR_AAM	0x20000000	/* accept all multicast */
    264      1.1  thorpej #define	RFCR_AAP	0x10000000	/* accept all physical */
    265  1.2.4.1  thorpej #define	RFCR_APM	0x08000000	/* accept perfect match (83815) */
    266  1.2.4.1  thorpej #define	RFCR_APAT	0x07800000	/* accept pattern match (83815) */
    267  1.2.4.1  thorpej #define	RFCR_AARP	0x00400000	/* accept ARP (83815) */
    268  1.2.4.1  thorpej #define	RFCR_MHEN	0x00200000	/* multicast hash enable (83815) */
    269  1.2.4.1  thorpej #define	RFCR_UHEN	0x00100000	/* unicast hash enable (83815) */
    270  1.2.4.1  thorpej #define	RFCR_ULM	0x00080000	/* U/L bit mask (83815) */
    271  1.2.4.1  thorpej #define	RFCR_NS_RFADDR	0x000003ff	/* Rx filter ext reg address (83815) */
    272      1.1  thorpej #define	RFCR_RFADDR	0x000f0000	/* Rx filter address */
    273      1.1  thorpej #define	RFCR_RFADDR_NODE0 0x00000000	/* node address 1, 0 */
    274      1.1  thorpej #define	RFCR_RFADDR_NODE2 0x00010000	/* node address 3, 2 */
    275      1.1  thorpej #define	RFCR_RFADDR_NODE4 0x00020000	/* node address 5, 4 */
    276      1.1  thorpej #define	RFCR_RFADDR_MC0	  0x00040000	/* multicast hash word 0 */
    277      1.1  thorpej #define	RFCR_RFADDR_MC1	  0x00050000	/* multicast hash word 1 */
    278      1.1  thorpej #define	RFCR_RFADDR_MC2	  0x00060000	/* multicast hash word 2 */
    279      1.1  thorpej #define	RFCR_RFADDR_MC3	  0x00070000	/* multicast hash word 3 */
    280      1.1  thorpej #define	RFCR_RFADDR_MC4	  0x00080000	/* multicast hash word 4 */
    281      1.1  thorpej #define	RFCR_RFADDR_MC5	  0x00090000	/* multicast hash word 5 */
    282      1.1  thorpej #define	RFCR_RFADDR_MC6	  0x000a0000	/* multicast hash word 6 */
    283      1.1  thorpej #define	RFCR_RFADDR_MC7	  0x000b0000	/* multicast hash word 7 */
    284      1.1  thorpej 
    285  1.2.4.2       he #define	RFCR_NS_RFADDR_PMATCH0	0x0000	/* perfect match octets 1-0 */
    286  1.2.4.2       he #define	RFCR_NS_RFADDR_PMATCH2	0x0002	/* perfect match octets 3-2 */
    287  1.2.4.2       he #define	RFCR_NS_RFADDR_PMATCH4	0x0004	/* perfect match octets 5-4 */
    288  1.2.4.1  thorpej #define	RFCR_NS_RFADDR_PCOUNT	0x0006	/* pattern count */
    289  1.2.4.1  thorpej #define	RFCR_NS_RFADDR_FILTMEM	0x0200	/* filter memory (hash/pattern) */
    290  1.2.4.1  thorpej 
    291      1.1  thorpej #define	SIP_RFDR	0x4c	/* receive filter data register */
    292  1.2.4.1  thorpej #define	RFDR_BMASK	0x00030000	/* byte mask (83815) */
    293      1.1  thorpej #define	RFDR_DATA	0x0000ffff	/* data bits */
    294  1.2.4.1  thorpej 
    295  1.2.4.1  thorpej #define	SIP_NS_BRAR	0x50	/* boot rom address (83815) */
    296  1.2.4.1  thorpej #define	BRAR_AUTOINC	0x80000000	/* autoincrement */
    297  1.2.4.1  thorpej #define	BRAR_ADDR	0x0000ffff	/* address */
    298  1.2.4.1  thorpej 
    299  1.2.4.1  thorpej #define	SIP_NS_BRDR	0x54	/* boot rom data (83815) */
    300  1.2.4.1  thorpej 
    301  1.2.4.1  thorpej #define	SIP_NS_SRR	0x58	/* silicon revision register (83815) */
    302  1.2.4.1  thorpej #define	SRR_REV_A	0x00000101
    303  1.2.4.1  thorpej #define	SRR_REV_B_1	0x00000200
    304  1.2.4.1  thorpej #define	SRR_REV_B_2	0x00000201
    305  1.2.4.1  thorpej #define	SRR_REV_B_3	0x00000203
    306  1.2.4.1  thorpej #define	SRR_REV_C_1	0x00000300
    307  1.2.4.1  thorpej #define	SRR_REV_C_2	0x00000302
    308  1.2.4.1  thorpej 
    309  1.2.4.1  thorpej #define	SIP_NS_MIBC	0x5c	/* mib control register (83815) */
    310  1.2.4.1  thorpej #define	MIBC_MIBS	0x00000008	/* mib counter strobe */
    311  1.2.4.1  thorpej #define	MIBC_ACLR	0x00000004	/* clear all counters */
    312  1.2.4.1  thorpej #define	MIBC_FRZ	0x00000002	/* freeze all counters */
    313  1.2.4.1  thorpej #define	MIBC_WRN	0x00000001	/* warning test indicator */
    314  1.2.4.1  thorpej 
    315  1.2.4.1  thorpej #define	SIP_NS_MIB(mibreg)	/* mib data registers (83815) */	\
    316  1.2.4.1  thorpej 	(0x60 + (mibreg))
    317  1.2.4.1  thorpej #define	MIB_RXErroredPkts	0x00
    318  1.2.4.1  thorpej #define	MIB_RXFCSErrors		0x04
    319  1.2.4.1  thorpej #define	MIB_RXMsdPktErrors	0x08
    320  1.2.4.1  thorpej #define	MIB_RXFAErrors		0x0c
    321  1.2.4.1  thorpej #define	MIB_RXSymbolErrors	0x10
    322  1.2.4.1  thorpej #define	MIB_RXFrameTooLong	0x14
    323  1.2.4.1  thorpej #define	MIB_RXTXSQEErrors	0x18
    324  1.2.4.1  thorpej 
    325  1.2.4.1  thorpej #define	SIP_NS_PHY(miireg)	/* PHY registers (83815) */		\
    326  1.2.4.1  thorpej 	(0x80 + ((miireg) << 2))
    327      1.1  thorpej 
    328      1.1  thorpej #define	SIP_PMCTL	0xb0	/* power management control register */
    329      1.1  thorpej #define	PMCTL_GATECLK	0x80000000	/* gate dual clock enable */
    330      1.1  thorpej #define	PMCTL_WAKEALL	0x40000000	/* wake on all Rx OK */
    331      1.1  thorpej #define	PMCTL_FRM3ACS	0x04000000	/* 3rd wake-up frame access */
    332      1.1  thorpej #define	PMCTL_FRM2ACS	0x02000000	/* 2nd wake-up frame access */
    333      1.1  thorpej #define	PMCTL_FRM1ACS	0x01000000	/* 1st wake-up frame access */
    334      1.1  thorpej #define	PMCTL_FRM3EN	0x00400000	/* 3rd wake-up frame match enable */
    335      1.1  thorpej #define	PMCTL_FRM2EN	0x00200000	/* 2nd wake-up frame match enable */
    336      1.1  thorpej #define	PMCTL_FRM1EN	0x00100000	/* 1st wake-up frame match enable */
    337      1.1  thorpej #define	PMCTL_ALGORITHM	0x00000800	/* Magic Packet match algorithm */
    338      1.1  thorpej #define	PMCTL_MAGICPKT	0x00000400	/* Magic Packet match enable */
    339      1.1  thorpej #define	PMCTL_LINKON	0x00000002	/* link on monitor enable */
    340      1.1  thorpej #define	PMCTL_LINKLOSS	0x00000001	/* link loss monitor enable */
    341      1.1  thorpej 
    342      1.1  thorpej #define	SIP_PMEVT	0xb4	/* power management wake-up evnt reg */
    343      1.1  thorpej #define	PMEVT_ALLFRMMAT	0x40000000	/* receive packet ok */
    344      1.1  thorpej #define	PMEVT_FRM3MAT	0x04000000	/* match 3rd wake-up frame */
    345      1.1  thorpej #define	PMEVT_FRM2MAT	0x02000000	/* match 2nd wake-up frame */
    346      1.1  thorpej #define	PMEVT_FRM1MAT	0x01000000	/* match 1st wake-up frame */
    347      1.1  thorpej #define	PMEVT_MAGICPKT	0x00000400	/* Magic Packet */
    348      1.1  thorpej #define	PMEVT_ONEVT	0x00000002	/* link on event */
    349      1.1  thorpej #define	PMEVT_LOSSEVT	0x00000001	/* link loss event */
    350      1.1  thorpej 
    351      1.1  thorpej #define	SIP_WAKECRC	0xbc	/* wake-up frame CRC register */
    352      1.1  thorpej 
    353      1.1  thorpej #define	SIP_WAKEMASK0	0xc0	/* wake-up frame mask registers */
    354      1.1  thorpej #define	SIP_WAKEMASK1	0xc4
    355      1.1  thorpej #define	SIP_WAKEMASK2	0xc8
    356      1.1  thorpej #define	SIP_WAKEMASK3	0xcc
    357      1.1  thorpej #define	SIP_WAKEMASK4	0xe0
    358  1.2.4.2       he #define	SIP_WAKEMASK5	0xe4
    359      1.1  thorpej #define	SIP_WAKEMASK6	0xe8
    360      1.1  thorpej #define	SIP_WAKEMASK7	0xec
    361      1.1  thorpej 
    362      1.1  thorpej /*
    363      1.1  thorpej  * Serial EEPROM opcodes, including the start bit.
    364      1.1  thorpej  */
    365      1.1  thorpej #define	SIP_EEPROM_OPC_ERASE	0x04
    366      1.1  thorpej #define	SIP_EEPROM_OPC_WRITE	0x05
    367      1.1  thorpej #define	SIP_EEPROM_OPC_READ	0x06
    368      1.1  thorpej 
    369      1.1  thorpej /*
    370  1.2.4.2       he  * Serial EEPROM address map (byte address) for the SiS900.
    371      1.1  thorpej  */
    372      1.1  thorpej #define	SIP_EEPROM_SIGNATURE	0x00	/* SiS 900 signature */
    373      1.1  thorpej #define	SIP_EEPROM_MASK		0x02	/* `enable' mask */
    374      1.1  thorpej #define	SIP_EEPROM_VENDOR_ID	0x04	/* PCI vendor ID */
    375      1.1  thorpej #define	SIP_EEPROM_DEVICE_ID	0x06	/* PCI device ID */
    376      1.1  thorpej #define	SIP_EEPROM_SUBVENDOR_ID	0x08	/* PCI subvendor ID */
    377      1.1  thorpej #define	SIP_EEPROM_SUBSYSTEM_ID	0x0a	/* PCI subsystem ID */
    378      1.1  thorpej #define	SIP_EEPROM_PMC		0x0c	/* PCI power management capabilities */
    379      1.1  thorpej #define	SIP_EEPROM_reserved	0x0e	/* reserved */
    380      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID0	0x10	/* Ethernet address 0, 1 */
    381      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID1	0x12	/* Ethernet address 2, 3 */
    382      1.1  thorpej #define	SIP_EEPROM_ETHERNET_ID2	0x14	/* Ethernet address 4, 5 */
    383      1.1  thorpej #define	SIP_EEPROM_CHECKSUM	0x16	/* checksum */
    384  1.2.4.2       he 
    385  1.2.4.2       he /*
    386  1.2.4.2       he  * Serial EEPROM data (byte addresses) for the DP83815.
    387  1.2.4.2       he  */
    388  1.2.4.2       he #define	SIP_DP83815_EEPROM_CHECKSUM	0x16	/* checksum */
    389  1.2.4.2       he #define	SIP_DP83815_EEPROM_LENGTH	0x18	/* length of EEPROM data */
    390      1.1  thorpej 
    391      1.1  thorpej #endif /* _DEV_PCI_IF_SIPREG_H_ */
    392