xref: /freebsd/sys/dev/sk/xmaciireg.h (revision a53204c22790a94a15f0e3c153f7fa12f9d57d27)
160727d8bSWarner Losh /*-
2df57947fSPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3df57947fSPedro F. Giffuni  *
4bd80fa2cSBill Paul  * Copyright (c) 1997, 1998, 1999, 2000
53ebb0905SBill Paul  *	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
63ebb0905SBill Paul  *
73ebb0905SBill Paul  * Redistribution and use in source and binary forms, with or without
83ebb0905SBill Paul  * modification, are permitted provided that the following conditions
93ebb0905SBill Paul  * are met:
103ebb0905SBill Paul  * 1. Redistributions of source code must retain the above copyright
113ebb0905SBill Paul  *    notice, this list of conditions and the following disclaimer.
123ebb0905SBill Paul  * 2. Redistributions in binary form must reproduce the above copyright
133ebb0905SBill Paul  *    notice, this list of conditions and the following disclaimer in the
143ebb0905SBill Paul  *    documentation and/or other materials provided with the distribution.
153ebb0905SBill Paul  * 3. All advertising materials mentioning features or use of this software
163ebb0905SBill Paul  *    must display the following acknowledgement:
173ebb0905SBill Paul  *	This product includes software developed by Bill Paul.
183ebb0905SBill Paul  * 4. Neither the name of the author nor the names of any co-contributors
193ebb0905SBill Paul  *    may be used to endorse or promote products derived from this software
203ebb0905SBill Paul  *    without specific prior written permission.
213ebb0905SBill Paul  *
223ebb0905SBill Paul  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
233ebb0905SBill Paul  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
243ebb0905SBill Paul  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
253ebb0905SBill Paul  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
263ebb0905SBill Paul  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
273ebb0905SBill Paul  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
283ebb0905SBill Paul  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
293ebb0905SBill Paul  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
303ebb0905SBill Paul  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
313ebb0905SBill Paul  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
323ebb0905SBill Paul  * THE POSSIBILITY OF SUCH DAMAGE.
333ebb0905SBill Paul  */
343ebb0905SBill Paul 
353ebb0905SBill Paul /*
363ebb0905SBill Paul  * Registers and data structures for the XaQti Corporation XMAC II
373ebb0905SBill Paul  * Gigabit Ethernet MAC. Datasheet is available from http://www.xaqti.com.
383ebb0905SBill Paul  * The XMAC can be programmed for 16-bit or 32-bit register access modes.
393ebb0905SBill Paul  * The SysKonnect gigabit ethernet adapters use 16-bit mode, so that's
403ebb0905SBill Paul  * how the registers are laid out here.
413ebb0905SBill Paul  */
423ebb0905SBill Paul 
433ebb0905SBill Paul #define XM_DEVICEID		0x00E0AE20
443ebb0905SBill Paul #define XM_XAQTI_OUI		0x00E0AE
453ebb0905SBill Paul 
463ebb0905SBill Paul #define XM_XMAC_REV(x)		(((x) & 0x000000E0) >> 5)
473ebb0905SBill Paul 
483ebb0905SBill Paul #define XM_XMAC_REV_B2		0x0
493ebb0905SBill Paul #define XM_XMAC_REV_C1		0x1
503ebb0905SBill Paul 
513ebb0905SBill Paul #define XM_MMUCMD		0x0000
523ebb0905SBill Paul #define XM_POFF			0x0008
533ebb0905SBill Paul #define XM_BURST		0x000C
543ebb0905SBill Paul #define XM_VLAN_TAGLEV1		0x0010
553ebb0905SBill Paul #define XM_VLAN_TAGLEV2		0x0014
563ebb0905SBill Paul #define XM_TXCMD		0x0020
573ebb0905SBill Paul #define XM_TX_RETRYLIMIT	0x0024
583ebb0905SBill Paul #define XM_TX_SLOTTIME		0x0028
593ebb0905SBill Paul #define XM_TX_IPG		0x003C
603ebb0905SBill Paul #define XM_RXCMD		0x0030
613ebb0905SBill Paul #define XM_PHY_ADDR		0x0034
623ebb0905SBill Paul #define XM_PHY_DATA		0x0038
633ebb0905SBill Paul #define XM_GPIO			0x0040
643ebb0905SBill Paul #define XM_IMR			0x0044
653ebb0905SBill Paul #define XM_ISR			0x0048
663ebb0905SBill Paul #define XM_HWCFG		0x004C
673ebb0905SBill Paul #define XM_TX_LOWAT		0x0060
683ebb0905SBill Paul #define XM_TX_HIWAT		0x0062
693ebb0905SBill Paul #define XM_TX_REQTHRESH_LO	0x0064
703ebb0905SBill Paul #define XM_TX_REQTHRESH_HI	0x0066
713ebb0905SBill Paul #define XM_TX_REQTHRESH		XM_TX_REQTHRESH_LO
723ebb0905SBill Paul #define XM_PAUSEDST0		0x0068
733ebb0905SBill Paul #define XM_PAUSEDST1		0x006A
743ebb0905SBill Paul #define XM_PAUSEDST2		0x006C
753ebb0905SBill Paul #define XM_CTLPARM_LO		0x0070
763ebb0905SBill Paul #define XM_CTLPARM_HI		0x0072
773ebb0905SBill Paul #define XM_CTLPARM		XM_CTLPARM_LO
783ebb0905SBill Paul #define XM_OPCODE_PAUSE_TIMER	0x0074
793ebb0905SBill Paul #define XM_TXSTAT_LIFO		0x0078
803ebb0905SBill Paul 
813ebb0905SBill Paul /*
823ebb0905SBill Paul  * Perfect filter registers. The XMAC has a table of 16 perfect
833ebb0905SBill Paul  * filter entries, spaced 8 bytes apart. This is in addition to
843ebb0905SBill Paul  * the station address registers, which appear below.
853ebb0905SBill Paul  */
863ebb0905SBill Paul #define XM_RXFILT_BASE		0x0080
873ebb0905SBill Paul #define XM_RXFILT_END		0x0107
883ebb0905SBill Paul #define XM_RXFILT_MAX		16
893ebb0905SBill Paul #define XM_RXFILT_ENTRY(ent)		(XM_RXFILT_BASE + ((ent * 8)))
903ebb0905SBill Paul 
913ebb0905SBill Paul /* Primary station address. */
923ebb0905SBill Paul #define XM_PAR0			0x0108
933ebb0905SBill Paul #define XM_PAR1			0x010A
943ebb0905SBill Paul #define XM_PAR2			0x010C
953ebb0905SBill Paul 
963ebb0905SBill Paul /* 64-bit multicast hash table registers */
973ebb0905SBill Paul #define XM_MAR0			0x0110
983ebb0905SBill Paul #define XM_MAR1			0x0112
993ebb0905SBill Paul #define XM_MAR2			0x0114
1003ebb0905SBill Paul #define XM_MAR3			0x0116
1013ebb0905SBill Paul #define XM_RX_LOWAT		0x0118
1023ebb0905SBill Paul #define XM_RX_HIWAT		0x011A
1033ebb0905SBill Paul #define XM_RX_REQTHRESH_LO	0x011C
1043ebb0905SBill Paul #define XM_RX_REQTHRESH_HI	0x011E
1053ebb0905SBill Paul #define XM_RX_REQTHRESH		XM_RX_REQTHRESH_LO
1063ebb0905SBill Paul #define XM_DEVID_LO		0x0120
1073ebb0905SBill Paul #define XM_DEVID_HI		0x0122
1083ebb0905SBill Paul #define XM_DEVID		XM_DEVID_LO
1093ebb0905SBill Paul #define XM_MODE_LO		0x0124
1103ebb0905SBill Paul #define XM_MODE_HI		0x0126
1113ebb0905SBill Paul #define XM_MODE			XM_MODE_LO
1123ebb0905SBill Paul #define XM_LASTSRC0		0x0128
1133ebb0905SBill Paul #define XM_LASTSRC1		0x012A
1143ebb0905SBill Paul #define XM_LASTSRC2		0x012C
1153ebb0905SBill Paul #define XM_TSTAMP_READ		0x0130
1163ebb0905SBill Paul #define XM_TSTAMP_LOAD		0x0134
1173ebb0905SBill Paul #define XM_STATS_CMD		0x0200
1183ebb0905SBill Paul #define XM_RXCNT_EVENT_LO	0x0204
1193ebb0905SBill Paul #define XM_RXCNT_EVENT_HI	0x0206
1203ebb0905SBill Paul #define XM_RXCNT_EVENT		XM_RXCNT_EVENT_LO
1213ebb0905SBill Paul #define XM_TXCNT_EVENT_LO	0x0208
1223ebb0905SBill Paul #define XM_TXCNT_EVENT_HI	0x020A
1233ebb0905SBill Paul #define XM_TXCNT_EVENT		XM_TXCNT_EVENT_LO
1243ebb0905SBill Paul #define XM_RXCNT_EVMASK_LO	0x020C
1253ebb0905SBill Paul #define XM_RXCNT_EVMASK_HI	0x020E
1263ebb0905SBill Paul #define XM_RXCNT_EVMASK		XM_RXCNT_EVMASK_LO
1273ebb0905SBill Paul #define XM_TXCNT_EVMASK_LO	0x0210
1283ebb0905SBill Paul #define XM_TXCNT_EVMASK_HI	0x0212
1293ebb0905SBill Paul #define XM_TXCNT_EVMASK		XM_TXCNT_EVMASK_LO
1303ebb0905SBill Paul 
1313ebb0905SBill Paul /* Statistics command register */
1323ebb0905SBill Paul #define XM_STATCMD_CLR_TX	0x0001
1333ebb0905SBill Paul #define XM_STATCMD_CLR_RX	0x0002
1343ebb0905SBill Paul #define XM_STATCMD_COPY_TX	0x0004
1353ebb0905SBill Paul #define XM_STATCMD_COPY_RX	0x0008
1363ebb0905SBill Paul #define XM_STATCMD_SNAP_TX	0x0010
1373ebb0905SBill Paul #define XM_STATCMD_SNAP_RX	0x0020
1383ebb0905SBill Paul 
1393ebb0905SBill Paul /* TX statistics registers */
1403ebb0905SBill Paul #define XM_TXSTATS_PKTSOK	0x280
1413ebb0905SBill Paul #define XM_TXSTATS_BYTESOK_HI	0x284
1423ebb0905SBill Paul #define XM_TXSTATS_BYTESOK_LO	0x288
1433ebb0905SBill Paul #define XM_TXSTATS_BCASTSOK	0x28C
1443ebb0905SBill Paul #define XM_TXSTATS_MCASTSOK	0x290
1453ebb0905SBill Paul #define XM_TXSTATS_UCASTSOK	0x294
1463ebb0905SBill Paul #define XM_TXSTATS_GIANTS	0x298
1473ebb0905SBill Paul #define XM_TXSTATS_BURSTCNT	0x29C
1483ebb0905SBill Paul #define XM_TXSTATS_PAUSEPKTS	0x2A0
1493ebb0905SBill Paul #define XM_TXSTATS_MACCTLPKTS	0x2A4
1503ebb0905SBill Paul #define XM_TXSTATS_SINGLECOLS	0x2A8
1513ebb0905SBill Paul #define XM_TXSTATS_MULTICOLS	0x2AC
1523ebb0905SBill Paul #define XM_TXSTATS_EXCESSCOLS	0x2B0
1533ebb0905SBill Paul #define XM_TXSTATS_LATECOLS	0x2B4
1543ebb0905SBill Paul #define XM_TXSTATS_DEFER	0x2B8
1553ebb0905SBill Paul #define XM_TXSTATS_EXCESSDEFER	0x2BC
1563ebb0905SBill Paul #define XM_TXSTATS_UNDERRUN	0x2C0
1573ebb0905SBill Paul #define XM_TXSTATS_CARRIERSENSE	0x2C4
1583ebb0905SBill Paul #define XM_TXSTATS_UTILIZATION	0x2C8
1593ebb0905SBill Paul #define XM_TXSTATS_64		0x2D0
1603ebb0905SBill Paul #define XM_TXSTATS_65_127	0x2D4
1613ebb0905SBill Paul #define XM_TXSTATS_128_255	0x2D8
1623ebb0905SBill Paul #define XM_TXSTATS_256_511	0x2DC
1633ebb0905SBill Paul #define XM_TXSTATS_512_1023	0x2E0
1643ebb0905SBill Paul #define XM_TXSTATS_1024_MAX	0x2E4
1653ebb0905SBill Paul 
1663ebb0905SBill Paul /* RX statistics registers */
1673ebb0905SBill Paul #define XM_RXSTATS_PKTSOK	0x300
1683ebb0905SBill Paul #define XM_RXSTATS_BYTESOK_HI	0x304
1693ebb0905SBill Paul #define XM_RXSTATS_BYTESOK_LO	0x308
1703ebb0905SBill Paul #define XM_RXSTATS_BCASTSOK	0x30C
1713ebb0905SBill Paul #define XM_RXSTATS_MCASTSOK	0x310
1723ebb0905SBill Paul #define XM_RXSTATS_UCASTSOK	0x314
1733ebb0905SBill Paul #define XM_RXSTATS_PAUSEPKTS	0x318
1743ebb0905SBill Paul #define XM_RXSTATS_MACCTLPKTS	0x31C
1753ebb0905SBill Paul #define XM_RXSTATS_BADPAUSEPKTS	0x320
1763ebb0905SBill Paul #define XM_RXSTATS_BADMACCTLPKTS	0x324
1773ebb0905SBill Paul #define XM_RXSTATS_BURSTCNT	0x328
1783ebb0905SBill Paul #define XM_RXSTATS_MISSEDPKTS	0x32C
1793ebb0905SBill Paul #define XM_RXSTATS_FRAMEERRS	0x330
1803ebb0905SBill Paul #define XM_RXSTATS_OVERRUN	0x334
1813ebb0905SBill Paul #define XM_RXSTATS_JABBER	0x338
1823ebb0905SBill Paul #define XM_RXSTATS_CARRLOSS	0x33C
1833ebb0905SBill Paul #define XM_RXSTATS_INRNGLENERR	0x340
1843ebb0905SBill Paul #define XM_RXSTATS_SYMERR	0x344
1853ebb0905SBill Paul #define XM_RXSTATS_SHORTEVENT	0x348
1863ebb0905SBill Paul #define XM_RXSTATS_RUNTS	0x34C
1873ebb0905SBill Paul #define XM_RXSTATS_GIANTS	0x350
1883ebb0905SBill Paul #define XM_RXSTATS_CRCERRS	0x354
1893ebb0905SBill Paul #define XM_RXSTATS_CEXTERRS	0x35C
1903ebb0905SBill Paul #define XM_RXSTATS_UTILIZATION	0x360
1913ebb0905SBill Paul #define XM_RXSTATS_64		0x368
1923ebb0905SBill Paul #define XM_RXSTATS_65_127	0x36C
1933ebb0905SBill Paul #define XM_RXSTATS_128_255	0x370
1943ebb0905SBill Paul #define XM_RXSTATS_256_511	0x374
1953ebb0905SBill Paul #define XM_RXSTATS_512_1023	0x378
1963ebb0905SBill Paul #define XM_RXSTATS_1024_MAX	0x37C
1973ebb0905SBill Paul 
1983ebb0905SBill Paul #define XM_MMUCMD_TX_ENB	0x0001
1993ebb0905SBill Paul #define XM_MMUCMD_RX_ENB	0x0002
2003ebb0905SBill Paul #define XM_MMUCMD_GMIILOOP	0x0004
2013ebb0905SBill Paul #define XM_MMUCMD_RATECTL	0x0008
2023ebb0905SBill Paul #define XM_MMUCMD_GMIIFDX	0x0010
2033ebb0905SBill Paul #define XM_MMUCMD_NO_MGMT_PRMB	0x0020
2043ebb0905SBill Paul #define XM_MMUCMD_SIMCOL	0x0040
2053ebb0905SBill Paul #define XM_MMUCMD_FORCETX	0x0080
2063ebb0905SBill Paul #define XM_MMUCMD_LOOPENB	0x0200
2073ebb0905SBill Paul #define XM_MMUCMD_IGNPAUSE	0x0400
2083ebb0905SBill Paul #define XM_MMUCMD_PHYBUSY	0x0800
2093ebb0905SBill Paul #define XM_MMUCMD_PHYDATARDY	0x1000
2103ebb0905SBill Paul 
2113ebb0905SBill Paul #define XM_TXCMD_AUTOPAD	0x0001
2123ebb0905SBill Paul #define XM_TXCMD_NOCRC		0x0002
2133ebb0905SBill Paul #define XM_TXCMD_NOPREAMBLE	0x0004
2143ebb0905SBill Paul #define XM_TXCMD_NOGIGAMODE	0x0008
2153ebb0905SBill Paul #define XM_TXCMD_SAMPLELINE	0x0010
2163ebb0905SBill Paul #define XM_TXCMD_ENCBYPASS	0x0020
2173ebb0905SBill Paul #define XM_TXCMD_XMITBK2BK	0x0040
2183ebb0905SBill Paul #define XM_TXCMD_FAIRSHARE	0x0080
2193ebb0905SBill Paul 
2203ebb0905SBill Paul #define XM_RXCMD_DISABLE_CEXT	0x0001
2213ebb0905SBill Paul #define XM_RXCMD_STRIPPAD	0x0002
2223ebb0905SBill Paul #define XM_RXCMD_SAMPLELINE	0x0004
2233ebb0905SBill Paul #define XM_RXCMD_SELFRX		0x0008
2243ebb0905SBill Paul #define XM_RXCMD_STRIPFCS	0x0010
2253ebb0905SBill Paul #define XM_RXCMD_TRANSPARENT	0x0020
2263ebb0905SBill Paul #define XM_RXCMD_IPGCAPTURE	0x0040
2273ebb0905SBill Paul #define XM_RXCMD_BIGPKTOK	0x0080
2283ebb0905SBill Paul #define XM_RXCMD_LENERROK	0x0100
2293ebb0905SBill Paul 
230bd80fa2cSBill Paul #define XM_GPIO_GP0_SET		0x0001
231bd80fa2cSBill Paul #define XM_GPIO_RESETSTATS	0x0004
232bd80fa2cSBill Paul #define XM_GPIO_RESETMAC	0x0008
233bd80fa2cSBill Paul #define XM_GPIO_FORCEINT	0x0020
234bd80fa2cSBill Paul #define XM_GPIO_ANEGINPROG	0x0040
235bd80fa2cSBill Paul 
2363ebb0905SBill Paul #define XM_IMR_RX_EOF		0x0001
2373ebb0905SBill Paul #define XM_IMR_TX_EOF		0x0002
2383ebb0905SBill Paul #define XM_IMR_TX_UNDERRUN	0x0004
2393ebb0905SBill Paul #define XM_IMR_RX_OVERRUN	0x0008
2403ebb0905SBill Paul #define XM_IMR_TX_STATS_OFLOW	0x0010
2413ebb0905SBill Paul #define XM_IMR_RX_STATS_OFLOW	0x0020
2423ebb0905SBill Paul #define XM_IMR_TSTAMP_OFLOW	0x0040
2433ebb0905SBill Paul #define XM_IMR_AUTONEG_DONE	0x0080
2443ebb0905SBill Paul #define XM_IMR_NEXTPAGE_RDY	0x0100
2453ebb0905SBill Paul #define XM_IMR_PAGE_RECEIVED	0x0200
2463ebb0905SBill Paul #define XM_IMR_LP_REQCFG	0x0400
2473ebb0905SBill Paul #define XM_IMR_GP0_SET		0x0800
2483ebb0905SBill Paul #define XM_IMR_FORCEINTR	0x1000
2493ebb0905SBill Paul #define XM_IMR_TX_ABORT		0x2000
2503ebb0905SBill Paul #define XM_IMR_LINKEVENT	0x4000
2513ebb0905SBill Paul 
2523ebb0905SBill Paul #define XM_INTRS	\
253bd80fa2cSBill Paul 	(~(XM_IMR_GP0_SET|XM_IMR_AUTONEG_DONE|XM_IMR_TX_UNDERRUN))
2543ebb0905SBill Paul 
2553ebb0905SBill Paul #define XM_ISR_RX_EOF		0x0001
2563ebb0905SBill Paul #define XM_ISR_TX_EOF		0x0002
2573ebb0905SBill Paul #define XM_ISR_TX_UNDERRUN	0x0004
2583ebb0905SBill Paul #define XM_ISR_RX_OVERRUN	0x0008
2593ebb0905SBill Paul #define XM_ISR_TX_STATS_OFLOW	0x0010
2603ebb0905SBill Paul #define XM_ISR_RX_STATS_OFLOW	0x0020
2613ebb0905SBill Paul #define XM_ISR_TSTAMP_OFLOW	0x0040
2623ebb0905SBill Paul #define XM_ISR_AUTONEG_DONE	0x0080
2633ebb0905SBill Paul #define XM_ISR_NEXTPAGE_RDY	0x0100
2643ebb0905SBill Paul #define XM_ISR_PAGE_RECEIVED	0x0200
2653ebb0905SBill Paul #define XM_ISR_LP_REQCFG	0x0400
2663ebb0905SBill Paul #define XM_ISR_GP0_SET		0x0800
2673ebb0905SBill Paul #define XM_ISR_FORCEINTR	0x1000
2683ebb0905SBill Paul #define XM_ISR_TX_ABORT		0x2000
2693ebb0905SBill Paul #define XM_ISR_LINKEVENT	0x4000
2703ebb0905SBill Paul 
271bd80fa2cSBill Paul #define XM_HWCFG_GENEOP		0x0008
272bd80fa2cSBill Paul #define XM_HWCFG_SIGSTATCKH	0x0004
273bd80fa2cSBill Paul #define XM_HWCFG_GMIIMODE	0x0001
274bd80fa2cSBill Paul 
2753ebb0905SBill Paul #define XM_MODE_FLUSH_RXFIFO	0x00000001
2763ebb0905SBill Paul #define XM_MODE_FLUSH_TXFIFO	0x00000002
2773ebb0905SBill Paul #define XM_MODE_BIGENDIAN	0x00000004
2783ebb0905SBill Paul #define XM_MODE_RX_PROMISC	0x00000008
2793ebb0905SBill Paul #define XM_MODE_RX_NOBROAD	0x00000010
2803ebb0905SBill Paul #define XM_MODE_RX_NOMULTI	0x00000020
2813ebb0905SBill Paul #define XM_MODE_RX_NOUNI	0x00000040
2823ebb0905SBill Paul #define XM_MODE_RX_BADFRAMES	0x00000080
2833ebb0905SBill Paul #define XM_MODE_RX_CRCERRS	0x00000100
2843ebb0905SBill Paul #define XM_MODE_RX_GIANTS	0x00000200
2853ebb0905SBill Paul #define XM_MODE_RX_INRANGELEN	0x00000400
2863ebb0905SBill Paul #define XM_MODE_RX_RUNTS	0x00000800
2873ebb0905SBill Paul #define XM_MODE_RX_MACCTL	0x00001000
2883ebb0905SBill Paul #define XM_MODE_RX_USE_PERFECT	0x00002000
2893ebb0905SBill Paul #define XM_MODE_RX_USE_STATION	0x00004000
2903ebb0905SBill Paul #define XM_MODE_RX_USE_HASH	0x00008000
2913ebb0905SBill Paul #define XM_MODE_RX_ADDRPAIR	0x00010000
2923ebb0905SBill Paul #define XM_MODE_PAUSEONHI	0x00020000
2933ebb0905SBill Paul #define XM_MODE_PAUSEONLO	0x00040000
2943ebb0905SBill Paul #define XM_MODE_TIMESTAMP	0x00080000
2953ebb0905SBill Paul #define XM_MODE_SENDPAUSE	0x00100000
2963ebb0905SBill Paul #define XM_MODE_SENDCONTINUOUS	0x00200000
2973ebb0905SBill Paul #define XM_MODE_LE_STATUSWORD	0x00400000
2983ebb0905SBill Paul #define XM_MODE_AUTOFIFOPAUSE	0x00800000
2993ebb0905SBill Paul #define XM_MODE_EXPAUSEGEN	0x02000000
3003ebb0905SBill Paul #define XM_MODE_RX_INVERSE	0x04000000
3013ebb0905SBill Paul 
3023ebb0905SBill Paul #define XM_RXSTAT_MACCTL	0x00000001
3033ebb0905SBill Paul #define XM_RXSTAT_ERRFRAME	0x00000002
3043ebb0905SBill Paul #define XM_RXSTAT_CRCERR	0x00000004
3053ebb0905SBill Paul #define XM_RXSTAT_GIANT		0x00000008
3063ebb0905SBill Paul #define XM_RXSTAT_RUNT		0x00000010
3073ebb0905SBill Paul #define XM_RXSTAT_FRAMEERR	0x00000020
3083ebb0905SBill Paul #define XM_RXSTAT_INRANGEERR	0x00000040
3093ebb0905SBill Paul #define XM_RXSTAT_CARRIERERR	0x00000080
3103ebb0905SBill Paul #define XM_RXSTAT_COLLERR	0x00000100
3113ebb0905SBill Paul #define XM_RXSTAT_802_3		0x00000200
3123ebb0905SBill Paul #define XM_RXSTAT_CARREXTERR	0x00000400
3133ebb0905SBill Paul #define XM_RXSTAT_BURSTMODE	0x00000800
3143ebb0905SBill Paul #define XM_RXSTAT_UNICAST	0x00002000
3153ebb0905SBill Paul #define XM_RXSTAT_MULTICAST	0x00004000
3163ebb0905SBill Paul #define XM_RXSTAT_BROADCAST	0x00008000
3173ebb0905SBill Paul #define XM_RXSTAT_VLAN_LEV1	0x00010000
3183ebb0905SBill Paul #define XM_RXSTAT_VLAN_LEV2	0x00020000
3193ebb0905SBill Paul #define XM_RXSTAT_LEN		0xFFFC0000
320919133a8SPyun YongHyeon #define	XM_RXSTAT_LENSHIFT	18
321919133a8SPyun YongHyeon 
322919133a8SPyun YongHyeon #define	XM_RXSTAT_BYTES(x)	((x) >> XM_RXSTAT_LENSHIFT)
3233ebb0905SBill Paul 
3243ebb0905SBill Paul /*
3253ebb0905SBill Paul  * XMAC PHY registers, indirectly accessed through
3263ebb0905SBill Paul  * XM_PHY_ADDR and XM_PHY_REG.
3273ebb0905SBill Paul  */
3283ebb0905SBill Paul 
3293ebb0905SBill Paul #define XM_PHY_BMCR		0x0000	/* control */
3303ebb0905SBill Paul #define XM_PHY_BMSR		0x0001	/* status */
3313ebb0905SBill Paul #define XM_PHY_VENID		0x0002	/* vendor id */
3323ebb0905SBill Paul #define XM_PHY_DEVID		0x0003	/* device id */
3333ebb0905SBill Paul #define XM_PHY_ANAR		0x0004	/* autoneg advertisenemt */
3343ebb0905SBill Paul #define XM_PHY_LPAR		0x0005	/* link partner ability */
3353ebb0905SBill Paul #define XM_PHY_ANEXP		0x0006	/* autoneg expansion */
3363ebb0905SBill Paul #define XM_PHY_NEXTP		0x0007	/* nextpage */
3373ebb0905SBill Paul #define XM_PHY_LPNEXTP		0x0008	/* link partner's nextpage */
338*a53204c2SGordon Bergling #define XM_PHY_EXTSTS		0x000F	/* extended status */
3393ebb0905SBill Paul #define XM_PHY_RESAB		0x0010	/* resolved ability */
3403ebb0905SBill Paul 
3413ebb0905SBill Paul #define XM_BMCR_DUPLEX		0x0100
3423ebb0905SBill Paul #define XM_BMCR_RENEGOTIATE	0x0200
3433ebb0905SBill Paul #define XM_BMCR_AUTONEGENBL	0x1000
3443ebb0905SBill Paul #define XM_BMCR_LOOPBACK	0x4000
3453ebb0905SBill Paul #define XM_BMCR_RESET		0x8000
3463ebb0905SBill Paul 
3473ebb0905SBill Paul #define XM_BMSR_EXTCAP		0x0001
3483ebb0905SBill Paul #define XM_BMSR_LINKSTAT	0x0004
3493ebb0905SBill Paul #define XM_BMSR_AUTONEGABLE	0x0008
3503ebb0905SBill Paul #define XM_BMSR_REMFAULT	0x0010
3513ebb0905SBill Paul #define XM_BMSR_AUTONEGDONE	0x0020
3523ebb0905SBill Paul #define XM_BMSR_EXTSTAT		0x0100
3533ebb0905SBill Paul 
3543ebb0905SBill Paul #define XM_VENID_XAQTI		0xD14C
3553ebb0905SBill Paul #define XM_DEVID_XMAC		0x0002
3563ebb0905SBill Paul 
3573ebb0905SBill Paul #define XM_ANAR_FULLDUPLEX	0x0020
3583ebb0905SBill Paul #define XM_ANAR_HALFDUPLEX	0x0040
3593ebb0905SBill Paul #define XM_ANAR_PAUSEBITS	0x0180
3603ebb0905SBill Paul #define XM_ANAR_REMFAULTBITS	0x1800
3613ebb0905SBill Paul #define XM_ANAR_ACK		0x4000
3623ebb0905SBill Paul #define XM_ANAR_NEXTPAGE	0x8000
3633ebb0905SBill Paul 
3643ebb0905SBill Paul #define XM_LPAR_FULLDUPLEX	0x0020
3653ebb0905SBill Paul #define XM_LPAR_HALFDUPLEX	0x0040
3663ebb0905SBill Paul #define XM_LPAR_PAUSEBITS	0x0180
3673ebb0905SBill Paul #define XM_LPAR_REMFAULTBITS	0x1800
3683ebb0905SBill Paul #define XM_LPAR_ACK		0x4000
3693ebb0905SBill Paul #define XM_LPAR_NEXTPAGE	0x8000
3703ebb0905SBill Paul 
3713ebb0905SBill Paul #define XM_PAUSE_NOPAUSE	0x0000
3723ebb0905SBill Paul #define XM_PAUSE_SYMPAUSE	0x0080
3733ebb0905SBill Paul #define XM_PAUSE_ASYMPAUSE	0x0100
3743ebb0905SBill Paul #define XM_PAUSE_BOTH		0x0180
3753ebb0905SBill Paul 
3763ebb0905SBill Paul #define XM_REMFAULT_LINKOK	0x0000
3773ebb0905SBill Paul #define XM_REMFAULT_LINKFAIL	0x0800
3783ebb0905SBill Paul #define XM_REMFAULT_OFFLINE	0x1000
3793ebb0905SBill Paul #define XM_REMFAULT_ANEGERR	0x1800
3803ebb0905SBill Paul 
3813ebb0905SBill Paul #define XM_ANEXP_GOTPAGE	0x0002
3823ebb0905SBill Paul #define XM_ANEXP_NEXTPAGE_SELF	0x0004
3833ebb0905SBill Paul #define XM_ANEXP_NEXTPAGE_LP	0x0008
3843ebb0905SBill Paul 
3853ebb0905SBill Paul #define XM_NEXTP_MESSAGE	0x07FF
3863ebb0905SBill Paul #define XM_NEXTP_TOGGLE		0x0800
3873ebb0905SBill Paul #define XM_NEXTP_ACK2		0x1000
3883ebb0905SBill Paul #define XM_NEXTP_MPAGE		0x2000
3893ebb0905SBill Paul #define XM_NEXTP_ACK1		0x4000
3903ebb0905SBill Paul #define XM_NEXTP_NPAGE		0x8000
3913ebb0905SBill Paul 
3923ebb0905SBill Paul #define XM_LPNEXTP_MESSAGE	0x07FF
3933ebb0905SBill Paul #define XM_LPNEXTP_TOGGLE	0x0800
3943ebb0905SBill Paul #define XM_LPNEXTP_ACK2		0x1000
3953ebb0905SBill Paul #define XM_LPNEXTP_MPAGE	0x2000
3963ebb0905SBill Paul #define XM_LPNEXTP_ACK1		0x4000
3973ebb0905SBill Paul #define XM_LPNEXTP_NPAGE	0x8000
3983ebb0905SBill Paul 
3993ebb0905SBill Paul #define XM_EXTSTS_HALFDUPLEX	0x4000
4003ebb0905SBill Paul #define XM_EXTSTS_FULLDUPLEX	0x8000
4013ebb0905SBill Paul 
4023ebb0905SBill Paul #define XM_RESAB_PAUSEMISMATCH	0x0008
4033ebb0905SBill Paul #define XM_RESAB_ABLMISMATCH	0x0010
4043ebb0905SBill Paul #define XM_RESAB_FDMODESEL	0x0020
4053ebb0905SBill Paul #define XM_RESAB_HDMODESEL	0x0040
4063ebb0905SBill Paul #define XM_RESAB_PAUSEBITS	0x0180
407