xref: /openbmc/linux/drivers/net/ethernet/chelsio/cxgb/vsc7326_reg.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f7917c00SJeff Kirsher /* $Date: 2006/04/28 19:20:17 $ $RCSfile: vsc7326_reg.h,v $ $Revision: 1.5 $ */
3f7917c00SJeff Kirsher #ifndef _VSC7321_REG_H_
4f7917c00SJeff Kirsher #define _VSC7321_REG_H_
5f7917c00SJeff Kirsher 
6f7917c00SJeff Kirsher /* Register definitions for Vitesse VSC7321 (Meigs II) MAC
7f7917c00SJeff Kirsher  *
8f7917c00SJeff Kirsher  * Straight off the data sheet, VMDS-10038 Rev 2.0 and
9f7917c00SJeff Kirsher  * PD0011-01-14-Meigs-II 2002-12-12
10f7917c00SJeff Kirsher  */
11f7917c00SJeff Kirsher 
12f7917c00SJeff Kirsher /* Just 'cause it's in here doesn't mean it's used. */
13f7917c00SJeff Kirsher 
14f7917c00SJeff Kirsher #define CRA(blk,sub,adr) ((((blk) & 0x7) << 13) | (((sub) & 0xf) << 9) | (((adr) & 0xff) << 1))
15f7917c00SJeff Kirsher 
16f7917c00SJeff Kirsher /* System and CPU comm's registers */
17f7917c00SJeff Kirsher #define REG_CHIP_ID		CRA(0x7,0xf,0x00)	/* Chip ID */
18f7917c00SJeff Kirsher #define REG_BLADE_ID		CRA(0x7,0xf,0x01)	/* Blade ID */
19f7917c00SJeff Kirsher #define REG_SW_RESET		CRA(0x7,0xf,0x02)	/* Global Soft Reset */
20f7917c00SJeff Kirsher #define REG_MEM_BIST		CRA(0x7,0xf,0x04)	/* mem */
21f7917c00SJeff Kirsher #define REG_IFACE_MODE		CRA(0x7,0xf,0x07)	/* Interface mode */
22f7917c00SJeff Kirsher #define REG_MSCH		CRA(0x7,0x2,0x06)	/* CRC error count */
23f7917c00SJeff Kirsher #define REG_CRC_CNT		CRA(0x7,0x2,0x0a)	/* CRC error count */
24f7917c00SJeff Kirsher #define REG_CRC_CFG		CRA(0x7,0x2,0x0b)	/* CRC config */
25f7917c00SJeff Kirsher #define REG_SI_TRANSFER_SEL	CRA(0x7,0xf,0x18)	/* SI Transfer Select */
26f7917c00SJeff Kirsher #define REG_PLL_CLK_SPEED	CRA(0x7,0xf,0x19)	/* Clock Speed Selection */
27f7917c00SJeff Kirsher #define REG_SYS_CLK_SELECT	CRA(0x7,0xf,0x1c)	/* System Clock Select */
28f7917c00SJeff Kirsher #define REG_GPIO_CTRL		CRA(0x7,0xf,0x1d)	/* GPIO Control */
29f7917c00SJeff Kirsher #define REG_GPIO_OUT		CRA(0x7,0xf,0x1e)	/* GPIO Out */
30f7917c00SJeff Kirsher #define REG_GPIO_IN		CRA(0x7,0xf,0x1f)	/* GPIO In */
31f7917c00SJeff Kirsher #define REG_CPU_TRANSFER_SEL	CRA(0x7,0xf,0x20)	/* CPU Transfer Select */
32f7917c00SJeff Kirsher #define REG_LOCAL_DATA		CRA(0x7,0xf,0xfe)	/* Local CPU Data Register */
33f7917c00SJeff Kirsher #define REG_LOCAL_STATUS	CRA(0x7,0xf,0xff)	/* Local CPU Status Register */
34f7917c00SJeff Kirsher 
35f7917c00SJeff Kirsher /* Aggregator registers */
36f7917c00SJeff Kirsher #define REG_AGGR_SETUP		CRA(0x7,0x1,0x00)	/* Aggregator Setup */
37f7917c00SJeff Kirsher #define REG_PMAP_TABLE		CRA(0x7,0x1,0x01)	/* Port map table */
38f7917c00SJeff Kirsher #define REG_MPLS_BIT0		CRA(0x7,0x1,0x08)	/* MPLS bit0 position */
39f7917c00SJeff Kirsher #define REG_MPLS_BIT1		CRA(0x7,0x1,0x09)	/* MPLS bit1 position */
40f7917c00SJeff Kirsher #define REG_MPLS_BIT2		CRA(0x7,0x1,0x0a)	/* MPLS bit2 position */
41f7917c00SJeff Kirsher #define REG_MPLS_BIT3		CRA(0x7,0x1,0x0b)	/* MPLS bit3 position */
42f7917c00SJeff Kirsher #define REG_MPLS_BITMASK	CRA(0x7,0x1,0x0c)	/* MPLS bit mask */
43f7917c00SJeff Kirsher #define REG_PRE_BIT0POS		CRA(0x7,0x1,0x10)	/* Preamble bit0 position */
44f7917c00SJeff Kirsher #define REG_PRE_BIT1POS		CRA(0x7,0x1,0x11)	/* Preamble bit1 position */
45f7917c00SJeff Kirsher #define REG_PRE_BIT2POS		CRA(0x7,0x1,0x12)	/* Preamble bit2 position */
46f7917c00SJeff Kirsher #define REG_PRE_BIT3POS		CRA(0x7,0x1,0x13)	/* Preamble bit3 position */
47f7917c00SJeff Kirsher #define REG_PRE_ERR_CNT		CRA(0x7,0x1,0x14)	/* Preamble parity error count */
48f7917c00SJeff Kirsher 
49f7917c00SJeff Kirsher /* BIST registers */
50f7917c00SJeff Kirsher /*#define REG_RAM_BIST_CMD	CRA(0x7,0x2,0x00)*/	/* RAM BIST Command Register */
51f7917c00SJeff Kirsher /*#define REG_RAM_BIST_RESULT	CRA(0x7,0x2,0x01)*/	/* RAM BIST Read Status/Result */
52f7917c00SJeff Kirsher #define REG_RAM_BIST_CMD	CRA(0x7,0x1,0x00)	/* RAM BIST Command Register */
53f7917c00SJeff Kirsher #define REG_RAM_BIST_RESULT	CRA(0x7,0x1,0x01)	/* RAM BIST Read Status/Result */
54f7917c00SJeff Kirsher #define   BIST_PORT_SELECT	0x00			/* BIST port select */
55f7917c00SJeff Kirsher #define   BIST_COMMAND		0x01			/* BIST enable/disable */
56f7917c00SJeff Kirsher #define   BIST_STATUS		0x02			/* BIST operation status */
57f7917c00SJeff Kirsher #define   BIST_ERR_CNT_LSB	0x03			/* BIST error count lo 8b */
58f7917c00SJeff Kirsher #define   BIST_ERR_CNT_MSB	0x04			/* BIST error count hi 8b */
59f7917c00SJeff Kirsher #define   BIST_ERR_SEL_LSB	0x05			/* BIST error select lo 8b */
60f7917c00SJeff Kirsher #define   BIST_ERR_SEL_MSB	0x06			/* BIST error select hi 8b */
61f7917c00SJeff Kirsher #define   BIST_ERROR_STATE	0x07			/* BIST engine internal state */
62f7917c00SJeff Kirsher #define   BIST_ERR_ADR0		0x08			/* BIST error address lo 8b */
63f7917c00SJeff Kirsher #define   BIST_ERR_ADR1		0x09			/* BIST error address lomid 8b */
64f7917c00SJeff Kirsher #define   BIST_ERR_ADR2		0x0a			/* BIST error address himid 8b */
65f7917c00SJeff Kirsher #define   BIST_ERR_ADR3		0x0b			/* BIST error address hi 8b */
66f7917c00SJeff Kirsher 
67f7917c00SJeff Kirsher /* FIFO registers
68f7917c00SJeff Kirsher  *   ie = 0 for ingress, 1 for egress
69f7917c00SJeff Kirsher  *   fn = FIFO number, 0-9
70f7917c00SJeff Kirsher  */
71f7917c00SJeff Kirsher #define REG_TEST(ie,fn)		CRA(0x2,ie&1,0x00+fn)	/* Mode & Test Register */
72f7917c00SJeff Kirsher #define REG_TOP_BOTTOM(ie,fn)	CRA(0x2,ie&1,0x10+fn)	/* FIFO Buffer Top & Bottom */
73f7917c00SJeff Kirsher #define REG_TAIL(ie,fn)		CRA(0x2,ie&1,0x20+fn)	/* FIFO Write Pointer */
74f7917c00SJeff Kirsher #define REG_HEAD(ie,fn)		CRA(0x2,ie&1,0x30+fn)	/* FIFO Read Pointer */
75f7917c00SJeff Kirsher #define REG_HIGH_LOW_WM(ie,fn)	CRA(0x2,ie&1,0x40+fn)	/* Flow Control Water Marks */
76f7917c00SJeff Kirsher #define REG_CT_THRHLD(ie,fn)	CRA(0x2,ie&1,0x50+fn)	/* Cut Through Threshold */
77f7917c00SJeff Kirsher #define REG_FIFO_DROP_CNT(ie,fn) CRA(0x2,ie&1,0x60+fn)	/* Drop & CRC Error Counter */
78f7917c00SJeff Kirsher #define REG_DEBUG_BUF_CNT(ie,fn) CRA(0x2,ie&1,0x70+fn)	/* Input Side Debug Counter */
79f7917c00SJeff Kirsher #define REG_BUCKI(fn) CRA(0x2,2,0x20+fn)	/* Input Side Debug Counter */
80f7917c00SJeff Kirsher #define REG_BUCKE(fn) CRA(0x2,3,0x20+fn)	/* Input Side Debug Counter */
81f7917c00SJeff Kirsher 
82f7917c00SJeff Kirsher /* Traffic shaper buckets
83f7917c00SJeff Kirsher  *   ie = 0 for ingress, 1 for egress
84f7917c00SJeff Kirsher  *   bn = bucket number 0-10 (yes, 11 buckets)
85f7917c00SJeff Kirsher  */
86f7917c00SJeff Kirsher /* OK, this one's kinda ugly.  Some hardware designers are perverse. */
87f7917c00SJeff Kirsher #define REG_TRAFFIC_SHAPER_BUCKET(ie,bn) CRA(0x2,ie&1,0x0a + (bn>7) | ((bn&7)<<4))
88f7917c00SJeff Kirsher #define REG_TRAFFIC_SHAPER_CONTROL(ie)	CRA(0x2,ie&1,0x3b)
89f7917c00SJeff Kirsher 
90f7917c00SJeff Kirsher #define REG_SRAM_ADR(ie)	CRA(0x2,ie&1,0x0e)	/* FIFO SRAM address */
91f7917c00SJeff Kirsher #define REG_SRAM_WR_STRB(ie)	CRA(0x2,ie&1,0x1e)	/* FIFO SRAM write strobe */
92f7917c00SJeff Kirsher #define REG_SRAM_RD_STRB(ie)	CRA(0x2,ie&1,0x2e)	/* FIFO SRAM read strobe */
93f7917c00SJeff Kirsher #define REG_SRAM_DATA_0(ie)	CRA(0x2,ie&1,0x3e)	/* FIFO SRAM data lo 8b */
94f7917c00SJeff Kirsher #define REG_SRAM_DATA_1(ie)	CRA(0x2,ie&1,0x4e)	/* FIFO SRAM data lomid 8b */
95f7917c00SJeff Kirsher #define REG_SRAM_DATA_2(ie)	CRA(0x2,ie&1,0x5e)	/* FIFO SRAM data himid 8b */
96f7917c00SJeff Kirsher #define REG_SRAM_DATA_3(ie)	CRA(0x2,ie&1,0x6e)	/* FIFO SRAM data hi 8b */
97f7917c00SJeff Kirsher #define REG_SRAM_DATA_BLK_TYPE(ie) CRA(0x2,ie&1,0x7e)	/* FIFO SRAM tag */
98f7917c00SJeff Kirsher /* REG_ING_CONTROL equals REG_CONTROL with ie = 0, likewise REG_EGR_CONTROL is ie = 1 */
99f7917c00SJeff Kirsher #define REG_CONTROL(ie)		CRA(0x2,ie&1,0x0f)	/* FIFO control */
100f7917c00SJeff Kirsher #define REG_ING_CONTROL		CRA(0x2,0x0,0x0f)	/* Ingress control (alias) */
101f7917c00SJeff Kirsher #define REG_EGR_CONTROL		CRA(0x2,0x1,0x0f)	/* Egress control (alias) */
102f7917c00SJeff Kirsher #define REG_AGE_TIMER(ie)	CRA(0x2,ie&1,0x1f)	/* Aging timer */
103f7917c00SJeff Kirsher #define REG_AGE_INC(ie)		CRA(0x2,ie&1,0x2f)	/* Aging increment */
104f7917c00SJeff Kirsher #define DEBUG_OUT(ie)		CRA(0x2,ie&1,0x3f)	/* Output debug counter control */
105f7917c00SJeff Kirsher #define DEBUG_CNT(ie)		CRA(0x2,ie&1,0x4f)	/* Output debug counter */
106f7917c00SJeff Kirsher 
107f7917c00SJeff Kirsher /* SPI4 interface */
108f7917c00SJeff Kirsher #define REG_SPI4_MISC		CRA(0x5,0x0,0x00)	/* Misc Register */
109f7917c00SJeff Kirsher #define REG_SPI4_STATUS		CRA(0x5,0x0,0x01)	/* CML Status */
110f7917c00SJeff Kirsher #define REG_SPI4_ING_SETUP0	CRA(0x5,0x0,0x02)	/* Ingress Status Channel Setup */
111f7917c00SJeff Kirsher #define REG_SPI4_ING_SETUP1	CRA(0x5,0x0,0x03)	/* Ingress Data Training Setup */
112f7917c00SJeff Kirsher #define REG_SPI4_ING_SETUP2	CRA(0x5,0x0,0x04)	/* Ingress Data Burst Size Setup */
113f7917c00SJeff Kirsher #define REG_SPI4_EGR_SETUP0	CRA(0x5,0x0,0x05)	/* Egress Status Channel Setup */
114f7917c00SJeff Kirsher #define REG_SPI4_DBG_CNT(n)	CRA(0x5,0x0,0x10+n)	/* Debug counters 0-9 */
115f7917c00SJeff Kirsher #define REG_SPI4_DBG_SETUP	CRA(0x5,0x0,0x1A)	/* Debug counters setup */
116f7917c00SJeff Kirsher #define REG_SPI4_TEST		CRA(0x5,0x0,0x20)	/* Test Setup Register */
117f7917c00SJeff Kirsher #define REG_TPGEN_UP0		CRA(0x5,0x0,0x21)	/* Test Pattern generator user pattern 0 */
118f7917c00SJeff Kirsher #define REG_TPGEN_UP1		CRA(0x5,0x0,0x22)	/* Test Pattern generator user pattern 1 */
119f7917c00SJeff Kirsher #define REG_TPCHK_UP0		CRA(0x5,0x0,0x23)	/* Test Pattern checker user pattern 0 */
120f7917c00SJeff Kirsher #define REG_TPCHK_UP1		CRA(0x5,0x0,0x24)	/* Test Pattern checker user pattern 1 */
121f7917c00SJeff Kirsher #define REG_TPSAM_P0		CRA(0x5,0x0,0x25)	/* Sampled pattern 0 */
122f7917c00SJeff Kirsher #define REG_TPSAM_P1		CRA(0x5,0x0,0x26)	/* Sampled pattern 1 */
123f7917c00SJeff Kirsher #define REG_TPERR_CNT		CRA(0x5,0x0,0x27)	/* Pattern checker error counter */
124f7917c00SJeff Kirsher #define REG_SPI4_STICKY		CRA(0x5,0x0,0x30)	/* Sticky bits register */
125f7917c00SJeff Kirsher #define REG_SPI4_DBG_INH	CRA(0x5,0x0,0x31)	/* Core egress & ingress inhibit */
126f7917c00SJeff Kirsher #define REG_SPI4_DBG_STATUS	CRA(0x5,0x0,0x32)	/* Sampled ingress status */
127f7917c00SJeff Kirsher #define REG_SPI4_DBG_GRANT	CRA(0x5,0x0,0x33)	/* Ingress cranted credit value */
128f7917c00SJeff Kirsher 
129f7917c00SJeff Kirsher #define REG_SPI4_DESKEW 	CRA(0x5,0x0,0x43)	/* Ingress cranted credit value */
130f7917c00SJeff Kirsher 
131f7917c00SJeff Kirsher /* 10GbE MAC Block Registers */
132f7917c00SJeff Kirsher /* Note that those registers that are exactly the same for 10GbE as for
133f7917c00SJeff Kirsher  * tri-speed are only defined with the version that needs a port number.
134f7917c00SJeff Kirsher  * Pass 0xa in those cases.
135f7917c00SJeff Kirsher  *
136f7917c00SJeff Kirsher  * Also note that despite the presence of a MAC address register, this part
137f7917c00SJeff Kirsher  * does no ingress MAC address filtering.  That register is used only for
138f7917c00SJeff Kirsher  * pause frame detection and generation.
139f7917c00SJeff Kirsher  */
140f7917c00SJeff Kirsher /* 10GbE specific, and different from tri-speed */
141f7917c00SJeff Kirsher #define REG_MISC_10G		CRA(0x1,0xa,0x00)	/* Misc 10GbE setup */
142f7917c00SJeff Kirsher #define REG_PAUSE_10G		CRA(0x1,0xa,0x01)	/* Pause register */
143f7917c00SJeff Kirsher #define REG_NORMALIZER_10G	CRA(0x1,0xa,0x05)	/* 10G normalizer */
144f7917c00SJeff Kirsher #define REG_STICKY_RX		CRA(0x1,0xa,0x06)	/* RX debug register */
145f7917c00SJeff Kirsher #define REG_DENORM_10G		CRA(0x1,0xa,0x07)	/* Denormalizer  */
146f7917c00SJeff Kirsher #define REG_STICKY_TX		CRA(0x1,0xa,0x08)	/* TX sticky bits */
147f7917c00SJeff Kirsher #define REG_MAX_RXHIGH		CRA(0x1,0xa,0x0a)	/* XGMII lane 0-3 debug */
148f7917c00SJeff Kirsher #define REG_MAX_RXLOW		CRA(0x1,0xa,0x0b)	/* XGMII lane 4-7 debug */
149f7917c00SJeff Kirsher #define REG_MAC_TX_STICKY	CRA(0x1,0xa,0x0c)	/* MAC Tx state sticky debug */
150f7917c00SJeff Kirsher #define REG_MAC_TX_RUNNING	CRA(0x1,0xa,0x0d)	/* MAC Tx state running debug */
151f7917c00SJeff Kirsher #define REG_TX_ABORT_AGE	CRA(0x1,0xa,0x14)	/* Aged Tx frames discarded */
152f7917c00SJeff Kirsher #define REG_TX_ABORT_SHORT	CRA(0x1,0xa,0x15)	/* Short Tx frames discarded */
153f7917c00SJeff Kirsher #define REG_TX_ABORT_TAXI	CRA(0x1,0xa,0x16)	/* Taxi error frames discarded */
154f7917c00SJeff Kirsher #define REG_TX_ABORT_UNDERRUN	CRA(0x1,0xa,0x17)	/* Tx Underrun abort counter */
155f7917c00SJeff Kirsher #define REG_TX_DENORM_DISCARD	CRA(0x1,0xa,0x18)	/* Tx denormalizer discards */
156f7917c00SJeff Kirsher #define REG_XAUI_STAT_A		CRA(0x1,0xa,0x20)	/* XAUI status A */
157f7917c00SJeff Kirsher #define REG_XAUI_STAT_B		CRA(0x1,0xa,0x21)	/* XAUI status B */
158f7917c00SJeff Kirsher #define REG_XAUI_STAT_C		CRA(0x1,0xa,0x22)	/* XAUI status C */
159f7917c00SJeff Kirsher #define REG_XAUI_CONF_A		CRA(0x1,0xa,0x23)	/* XAUI configuration A */
160f7917c00SJeff Kirsher #define REG_XAUI_CONF_B		CRA(0x1,0xa,0x24)	/* XAUI configuration B */
161f7917c00SJeff Kirsher #define REG_XAUI_CODE_GRP_CNT	CRA(0x1,0xa,0x25)	/* XAUI code group error count */
162f7917c00SJeff Kirsher #define REG_XAUI_CONF_TEST_A	CRA(0x1,0xa,0x26)	/* XAUI test register A */
163f7917c00SJeff Kirsher #define REG_PDERRCNT		CRA(0x1,0xa,0x27)	/* XAUI test register B */
164f7917c00SJeff Kirsher 
165f7917c00SJeff Kirsher /* pn = port number 0-9 for tri-speed, 10 for 10GbE */
166f7917c00SJeff Kirsher /* Both tri-speed and 10GbE */
167f7917c00SJeff Kirsher #define REG_MAX_LEN(pn)		CRA(0x1,pn,0x02)	/* Max length */
168f7917c00SJeff Kirsher #define REG_MAC_HIGH_ADDR(pn)	CRA(0x1,pn,0x03)	/* Upper 24 bits of MAC addr */
169f7917c00SJeff Kirsher #define REG_MAC_LOW_ADDR(pn)	CRA(0x1,pn,0x04)	/* Lower 24 bits of MAC addr */
170f7917c00SJeff Kirsher 
171f7917c00SJeff Kirsher /* tri-speed only
172f7917c00SJeff Kirsher  * pn = port number, 0-9
173f7917c00SJeff Kirsher  */
174f7917c00SJeff Kirsher #define REG_MODE_CFG(pn)	CRA(0x1,pn,0x00)	/* Mode configuration */
175f7917c00SJeff Kirsher #define REG_PAUSE_CFG(pn)	CRA(0x1,pn,0x01)	/* Pause configuration */
176f7917c00SJeff Kirsher #define REG_NORMALIZER(pn)	CRA(0x1,pn,0x05)	/* Normalizer */
177f7917c00SJeff Kirsher #define REG_TBI_STATUS(pn)	CRA(0x1,pn,0x06)	/* TBI status */
178f7917c00SJeff Kirsher #define REG_PCS_STATUS_DBG(pn)	CRA(0x1,pn,0x07)	/* PCS status debug */
179f7917c00SJeff Kirsher #define REG_PCS_CTRL(pn)	CRA(0x1,pn,0x08)	/* PCS control */
180f7917c00SJeff Kirsher #define REG_TBI_CONFIG(pn)	CRA(0x1,pn,0x09)	/* TBI configuration */
181f7917c00SJeff Kirsher #define REG_STICK_BIT(pn)	CRA(0x1,pn,0x0a)	/* Sticky bits */
182f7917c00SJeff Kirsher #define REG_DEV_SETUP(pn)	CRA(0x1,pn,0x0b)	/* MAC clock/reset setup */
183f7917c00SJeff Kirsher #define REG_DROP_CNT(pn)	CRA(0x1,pn,0x0c)	/* Drop counter */
184f7917c00SJeff Kirsher #define REG_PORT_POS(pn)	CRA(0x1,pn,0x0d)	/* Preamble port position */
185f7917c00SJeff Kirsher #define REG_PORT_FAIL(pn)	CRA(0x1,pn,0x0e)	/* Preamble port position */
186f7917c00SJeff Kirsher #define REG_SERDES_CONF(pn)	CRA(0x1,pn,0x0f)	/* SerDes configuration */
187f7917c00SJeff Kirsher #define REG_SERDES_TEST(pn)	CRA(0x1,pn,0x10)	/* SerDes test */
188f7917c00SJeff Kirsher #define REG_SERDES_STAT(pn)	CRA(0x1,pn,0x11)	/* SerDes status */
189f7917c00SJeff Kirsher #define REG_SERDES_COM_CNT(pn)	CRA(0x1,pn,0x12)	/* SerDes comma counter */
190f7917c00SJeff Kirsher #define REG_DENORM(pn)		CRA(0x1,pn,0x15)	/* Frame denormalization */
191f7917c00SJeff Kirsher #define REG_DBG(pn)		CRA(0x1,pn,0x16)	/* Device 1G debug */
192f7917c00SJeff Kirsher #define REG_TX_IFG(pn)		CRA(0x1,pn,0x18)	/* Tx IFG config */
193f7917c00SJeff Kirsher #define REG_HDX(pn)		CRA(0x1,pn,0x19)	/* Half-duplex config */
194f7917c00SJeff Kirsher 
195f7917c00SJeff Kirsher /* Statistics */
196f7917c00SJeff Kirsher /* CRA(0x4,pn,reg) */
197f7917c00SJeff Kirsher /* reg below */
198f7917c00SJeff Kirsher /* pn = port number, 0-a, a = 10GbE */
199f7917c00SJeff Kirsher 
200f7917c00SJeff Kirsher enum {
201f7917c00SJeff Kirsher 	RxInBytes		= 0x00,	// # Rx in octets
202f7917c00SJeff Kirsher 	RxSymbolCarrier		= 0x01,	// Frames w/ symbol errors
203f7917c00SJeff Kirsher 	RxPause			= 0x02,	// # pause frames received
204f7917c00SJeff Kirsher 	RxUnsupOpcode		= 0x03,	// # control frames with unsupported opcode
205f7917c00SJeff Kirsher 	RxOkBytes		= 0x04,	// # octets in good frames
206f7917c00SJeff Kirsher 	RxBadBytes		= 0x05,	// # octets in bad frames
207f7917c00SJeff Kirsher 	RxUnicast		= 0x06,	// # good unicast frames
208f7917c00SJeff Kirsher 	RxMulticast		= 0x07,	// # good multicast frames
209f7917c00SJeff Kirsher 	RxBroadcast		= 0x08,	// # good broadcast frames
210f7917c00SJeff Kirsher 	Crc			= 0x09,	// # frames w/ bad CRC only
211f7917c00SJeff Kirsher 	RxAlignment		= 0x0a,	// # frames w/ alignment err
212f7917c00SJeff Kirsher 	RxUndersize		= 0x0b,	// # frames undersize
213f7917c00SJeff Kirsher 	RxFragments		= 0x0c,	// # frames undersize w/ crc err
214f7917c00SJeff Kirsher 	RxInRangeLengthError	= 0x0d,	// # frames with length error
215f7917c00SJeff Kirsher 	RxOutOfRangeError	= 0x0e,	// # frames with illegal length field
216f7917c00SJeff Kirsher 	RxOversize		= 0x0f,	// # frames oversize
217f7917c00SJeff Kirsher 	RxJabbers		= 0x10,	// # frames oversize w/ crc err
218f7917c00SJeff Kirsher 	RxSize64		= 0x11,	// # frames 64 octets long
219f7917c00SJeff Kirsher 	RxSize65To127		= 0x12,	// # frames 65-127 octets
220f7917c00SJeff Kirsher 	RxSize128To255		= 0x13,	// # frames 128-255
221f7917c00SJeff Kirsher 	RxSize256To511		= 0x14,	// # frames 256-511
222f7917c00SJeff Kirsher 	RxSize512To1023		= 0x15,	// # frames 512-1023
223f7917c00SJeff Kirsher 	RxSize1024To1518	= 0x16,	// # frames 1024-1518
224f7917c00SJeff Kirsher 	RxSize1519ToMax		= 0x17,	// # frames 1519-max
225f7917c00SJeff Kirsher 
226f7917c00SJeff Kirsher 	TxOutBytes		= 0x18,	// # octets tx
227f7917c00SJeff Kirsher 	TxPause			= 0x19,	// # pause frames sent
228f7917c00SJeff Kirsher 	TxOkBytes		= 0x1a, // # octets tx OK
229f7917c00SJeff Kirsher 	TxUnicast		= 0x1b,	// # frames unicast
230f7917c00SJeff Kirsher 	TxMulticast		= 0x1c,	// # frames multicast
231f7917c00SJeff Kirsher 	TxBroadcast		= 0x1d,	// # frames broadcast
232f7917c00SJeff Kirsher 	TxMultipleColl		= 0x1e,	// # frames tx after multiple collisions
233f7917c00SJeff Kirsher 	TxLateColl		= 0x1f,	// # late collisions detected
234f7917c00SJeff Kirsher 	TxXcoll			= 0x20,	// # frames lost, excessive collisions
235f7917c00SJeff Kirsher 	TxDefer			= 0x21,	// # frames deferred on first tx attempt
236f7917c00SJeff Kirsher 	TxXdefer		= 0x22,	// # frames excessively deferred
237f7917c00SJeff Kirsher 	TxCsense		= 0x23,	// carrier sense errors at frame end
238f7917c00SJeff Kirsher 	TxSize64		= 0x24,	// # frames 64 octets long
239f7917c00SJeff Kirsher 	TxSize65To127		= 0x25,	// # frames 65-127 octets
240f7917c00SJeff Kirsher 	TxSize128To255		= 0x26,	// # frames 128-255
241f7917c00SJeff Kirsher 	TxSize256To511		= 0x27,	// # frames 256-511
242f7917c00SJeff Kirsher 	TxSize512To1023		= 0x28,	// # frames 512-1023
243f7917c00SJeff Kirsher 	TxSize1024To1518	= 0x29,	// # frames 1024-1518
244f7917c00SJeff Kirsher 	TxSize1519ToMax		= 0x2a,	// # frames 1519-max
245f7917c00SJeff Kirsher 	TxSingleColl		= 0x2b,	// # frames tx after single collision
246f7917c00SJeff Kirsher 	TxBackoff2		= 0x2c,	// # frames tx ok after 2 backoffs/collisions
247f7917c00SJeff Kirsher 	TxBackoff3		= 0x2d,	//   after 3 backoffs/collisions
248f7917c00SJeff Kirsher 	TxBackoff4		= 0x2e,	//   after 4
249f7917c00SJeff Kirsher 	TxBackoff5		= 0x2f,	//   after 5
250f7917c00SJeff Kirsher 	TxBackoff6		= 0x30,	//   after 6
251f7917c00SJeff Kirsher 	TxBackoff7		= 0x31,	//   after 7
252f7917c00SJeff Kirsher 	TxBackoff8		= 0x32,	//   after 8
253f7917c00SJeff Kirsher 	TxBackoff9		= 0x33,	//   after 9
254f7917c00SJeff Kirsher 	TxBackoff10		= 0x34,	//   after 10
255f7917c00SJeff Kirsher 	TxBackoff11		= 0x35,	//   after 11
256f7917c00SJeff Kirsher 	TxBackoff12		= 0x36,	//   after 12
257f7917c00SJeff Kirsher 	TxBackoff13		= 0x37,	//   after 13
258f7917c00SJeff Kirsher 	TxBackoff14		= 0x38,	//   after 14
259f7917c00SJeff Kirsher 	TxBackoff15		= 0x39,	//   after 15
260f7917c00SJeff Kirsher 	TxUnderrun		= 0x3a,	// # frames dropped from underrun
261f7917c00SJeff Kirsher 	// Hole. See REG_RX_XGMII_PROT_ERR below.
262f7917c00SJeff Kirsher 	RxIpgShrink		= 0x3c,	// # of IPG shrinks detected
263f7917c00SJeff Kirsher 	// Duplicate. See REG_STAT_STICKY10G below.
264f7917c00SJeff Kirsher 	StatSticky1G		= 0x3e,	// tri-speed sticky bits
265f7917c00SJeff Kirsher 	StatInit		= 0x3f	// Clear all statistics
266f7917c00SJeff Kirsher };
267f7917c00SJeff Kirsher 
268f7917c00SJeff Kirsher #define REG_RX_XGMII_PROT_ERR	CRA(0x4,0xa,0x3b)		/* # protocol errors detected on XGMII interface */
269f7917c00SJeff Kirsher #define REG_STAT_STICKY10G	CRA(0x4,0xa,StatSticky1G)	/* 10GbE sticky bits */
270f7917c00SJeff Kirsher 
271f7917c00SJeff Kirsher #define REG_RX_OK_BYTES(pn)	CRA(0x4,pn,RxOkBytes)
272f7917c00SJeff Kirsher #define REG_RX_BAD_BYTES(pn)	CRA(0x4,pn,RxBadBytes)
273f7917c00SJeff Kirsher #define REG_TX_OK_BYTES(pn)	CRA(0x4,pn,TxOkBytes)
274f7917c00SJeff Kirsher 
275f7917c00SJeff Kirsher /* MII-Management Block registers */
276f7917c00SJeff Kirsher /* These are for MII-M interface 0, which is the bidirectional LVTTL one.  If
277f7917c00SJeff Kirsher  * we hooked up to the one with separate directions, the middle 0x0 needs to
278f7917c00SJeff Kirsher  * change to 0x1.  And the current errata states that MII-M 1 doesn't work.
279f7917c00SJeff Kirsher  */
280f7917c00SJeff Kirsher 
281f7917c00SJeff Kirsher #define REG_MIIM_STATUS		CRA(0x3,0x0,0x00)	/* MII-M Status */
282f7917c00SJeff Kirsher #define REG_MIIM_CMD		CRA(0x3,0x0,0x01)	/* MII-M Command */
283f7917c00SJeff Kirsher #define REG_MIIM_DATA		CRA(0x3,0x0,0x02)	/* MII-M Data */
284f7917c00SJeff Kirsher #define REG_MIIM_PRESCALE	CRA(0x3,0x0,0x03)	/* MII-M MDC Prescale */
285f7917c00SJeff Kirsher 
286f7917c00SJeff Kirsher #define REG_ING_FFILT_UM_EN	CRA(0x2, 0, 0xd)
287f7917c00SJeff Kirsher #define REG_ING_FFILT_BE_EN	CRA(0x2, 0, 0x1d)
288f7917c00SJeff Kirsher #define REG_ING_FFILT_VAL0	CRA(0x2, 0, 0x2d)
289f7917c00SJeff Kirsher #define REG_ING_FFILT_VAL1	CRA(0x2, 0, 0x3d)
290f7917c00SJeff Kirsher #define REG_ING_FFILT_MASK0	CRA(0x2, 0, 0x4d)
291f7917c00SJeff Kirsher #define REG_ING_FFILT_MASK1	CRA(0x2, 0, 0x5d)
292f7917c00SJeff Kirsher #define REG_ING_FFILT_MASK2	CRA(0x2, 0, 0x6d)
293f7917c00SJeff Kirsher #define REG_ING_FFILT_ETYPE	CRA(0x2, 0, 0x7d)
294f7917c00SJeff Kirsher 
295f7917c00SJeff Kirsher 
296f7917c00SJeff Kirsher /* Whew. */
297f7917c00SJeff Kirsher 
298f7917c00SJeff Kirsher #endif
299