162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* $Date: 2006/04/28 19:20:17 $ $RCSfile: vsc7326_reg.h,v $ $Revision: 1.5 $ */ 362306a36Sopenharmony_ci#ifndef _VSC7321_REG_H_ 462306a36Sopenharmony_ci#define _VSC7321_REG_H_ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci/* Register definitions for Vitesse VSC7321 (Meigs II) MAC 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * Straight off the data sheet, VMDS-10038 Rev 2.0 and 962306a36Sopenharmony_ci * PD0011-01-14-Meigs-II 2002-12-12 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* Just 'cause it's in here doesn't mean it's used. */ 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#define CRA(blk,sub,adr) ((((blk) & 0x7) << 13) | (((sub) & 0xf) << 9) | (((adr) & 0xff) << 1)) 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* System and CPU comm's registers */ 1762306a36Sopenharmony_ci#define REG_CHIP_ID CRA(0x7,0xf,0x00) /* Chip ID */ 1862306a36Sopenharmony_ci#define REG_BLADE_ID CRA(0x7,0xf,0x01) /* Blade ID */ 1962306a36Sopenharmony_ci#define REG_SW_RESET CRA(0x7,0xf,0x02) /* Global Soft Reset */ 2062306a36Sopenharmony_ci#define REG_MEM_BIST CRA(0x7,0xf,0x04) /* mem */ 2162306a36Sopenharmony_ci#define REG_IFACE_MODE CRA(0x7,0xf,0x07) /* Interface mode */ 2262306a36Sopenharmony_ci#define REG_MSCH CRA(0x7,0x2,0x06) /* CRC error count */ 2362306a36Sopenharmony_ci#define REG_CRC_CNT CRA(0x7,0x2,0x0a) /* CRC error count */ 2462306a36Sopenharmony_ci#define REG_CRC_CFG CRA(0x7,0x2,0x0b) /* CRC config */ 2562306a36Sopenharmony_ci#define REG_SI_TRANSFER_SEL CRA(0x7,0xf,0x18) /* SI Transfer Select */ 2662306a36Sopenharmony_ci#define REG_PLL_CLK_SPEED CRA(0x7,0xf,0x19) /* Clock Speed Selection */ 2762306a36Sopenharmony_ci#define REG_SYS_CLK_SELECT CRA(0x7,0xf,0x1c) /* System Clock Select */ 2862306a36Sopenharmony_ci#define REG_GPIO_CTRL CRA(0x7,0xf,0x1d) /* GPIO Control */ 2962306a36Sopenharmony_ci#define REG_GPIO_OUT CRA(0x7,0xf,0x1e) /* GPIO Out */ 3062306a36Sopenharmony_ci#define REG_GPIO_IN CRA(0x7,0xf,0x1f) /* GPIO In */ 3162306a36Sopenharmony_ci#define REG_CPU_TRANSFER_SEL CRA(0x7,0xf,0x20) /* CPU Transfer Select */ 3262306a36Sopenharmony_ci#define REG_LOCAL_DATA CRA(0x7,0xf,0xfe) /* Local CPU Data Register */ 3362306a36Sopenharmony_ci#define REG_LOCAL_STATUS CRA(0x7,0xf,0xff) /* Local CPU Status Register */ 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci/* Aggregator registers */ 3662306a36Sopenharmony_ci#define REG_AGGR_SETUP CRA(0x7,0x1,0x00) /* Aggregator Setup */ 3762306a36Sopenharmony_ci#define REG_PMAP_TABLE CRA(0x7,0x1,0x01) /* Port map table */ 3862306a36Sopenharmony_ci#define REG_MPLS_BIT0 CRA(0x7,0x1,0x08) /* MPLS bit0 position */ 3962306a36Sopenharmony_ci#define REG_MPLS_BIT1 CRA(0x7,0x1,0x09) /* MPLS bit1 position */ 4062306a36Sopenharmony_ci#define REG_MPLS_BIT2 CRA(0x7,0x1,0x0a) /* MPLS bit2 position */ 4162306a36Sopenharmony_ci#define REG_MPLS_BIT3 CRA(0x7,0x1,0x0b) /* MPLS bit3 position */ 4262306a36Sopenharmony_ci#define REG_MPLS_BITMASK CRA(0x7,0x1,0x0c) /* MPLS bit mask */ 4362306a36Sopenharmony_ci#define REG_PRE_BIT0POS CRA(0x7,0x1,0x10) /* Preamble bit0 position */ 4462306a36Sopenharmony_ci#define REG_PRE_BIT1POS CRA(0x7,0x1,0x11) /* Preamble bit1 position */ 4562306a36Sopenharmony_ci#define REG_PRE_BIT2POS CRA(0x7,0x1,0x12) /* Preamble bit2 position */ 4662306a36Sopenharmony_ci#define REG_PRE_BIT3POS CRA(0x7,0x1,0x13) /* Preamble bit3 position */ 4762306a36Sopenharmony_ci#define REG_PRE_ERR_CNT CRA(0x7,0x1,0x14) /* Preamble parity error count */ 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci/* BIST registers */ 5062306a36Sopenharmony_ci/*#define REG_RAM_BIST_CMD CRA(0x7,0x2,0x00)*/ /* RAM BIST Command Register */ 5162306a36Sopenharmony_ci/*#define REG_RAM_BIST_RESULT CRA(0x7,0x2,0x01)*/ /* RAM BIST Read Status/Result */ 5262306a36Sopenharmony_ci#define REG_RAM_BIST_CMD CRA(0x7,0x1,0x00) /* RAM BIST Command Register */ 5362306a36Sopenharmony_ci#define REG_RAM_BIST_RESULT CRA(0x7,0x1,0x01) /* RAM BIST Read Status/Result */ 5462306a36Sopenharmony_ci#define BIST_PORT_SELECT 0x00 /* BIST port select */ 5562306a36Sopenharmony_ci#define BIST_COMMAND 0x01 /* BIST enable/disable */ 5662306a36Sopenharmony_ci#define BIST_STATUS 0x02 /* BIST operation status */ 5762306a36Sopenharmony_ci#define BIST_ERR_CNT_LSB 0x03 /* BIST error count lo 8b */ 5862306a36Sopenharmony_ci#define BIST_ERR_CNT_MSB 0x04 /* BIST error count hi 8b */ 5962306a36Sopenharmony_ci#define BIST_ERR_SEL_LSB 0x05 /* BIST error select lo 8b */ 6062306a36Sopenharmony_ci#define BIST_ERR_SEL_MSB 0x06 /* BIST error select hi 8b */ 6162306a36Sopenharmony_ci#define BIST_ERROR_STATE 0x07 /* BIST engine internal state */ 6262306a36Sopenharmony_ci#define BIST_ERR_ADR0 0x08 /* BIST error address lo 8b */ 6362306a36Sopenharmony_ci#define BIST_ERR_ADR1 0x09 /* BIST error address lomid 8b */ 6462306a36Sopenharmony_ci#define BIST_ERR_ADR2 0x0a /* BIST error address himid 8b */ 6562306a36Sopenharmony_ci#define BIST_ERR_ADR3 0x0b /* BIST error address hi 8b */ 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci/* FIFO registers 6862306a36Sopenharmony_ci * ie = 0 for ingress, 1 for egress 6962306a36Sopenharmony_ci * fn = FIFO number, 0-9 7062306a36Sopenharmony_ci */ 7162306a36Sopenharmony_ci#define REG_TEST(ie,fn) CRA(0x2,ie&1,0x00+fn) /* Mode & Test Register */ 7262306a36Sopenharmony_ci#define REG_TOP_BOTTOM(ie,fn) CRA(0x2,ie&1,0x10+fn) /* FIFO Buffer Top & Bottom */ 7362306a36Sopenharmony_ci#define REG_TAIL(ie,fn) CRA(0x2,ie&1,0x20+fn) /* FIFO Write Pointer */ 7462306a36Sopenharmony_ci#define REG_HEAD(ie,fn) CRA(0x2,ie&1,0x30+fn) /* FIFO Read Pointer */ 7562306a36Sopenharmony_ci#define REG_HIGH_LOW_WM(ie,fn) CRA(0x2,ie&1,0x40+fn) /* Flow Control Water Marks */ 7662306a36Sopenharmony_ci#define REG_CT_THRHLD(ie,fn) CRA(0x2,ie&1,0x50+fn) /* Cut Through Threshold */ 7762306a36Sopenharmony_ci#define REG_FIFO_DROP_CNT(ie,fn) CRA(0x2,ie&1,0x60+fn) /* Drop & CRC Error Counter */ 7862306a36Sopenharmony_ci#define REG_DEBUG_BUF_CNT(ie,fn) CRA(0x2,ie&1,0x70+fn) /* Input Side Debug Counter */ 7962306a36Sopenharmony_ci#define REG_BUCKI(fn) CRA(0x2,2,0x20+fn) /* Input Side Debug Counter */ 8062306a36Sopenharmony_ci#define REG_BUCKE(fn) CRA(0x2,3,0x20+fn) /* Input Side Debug Counter */ 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci/* Traffic shaper buckets 8362306a36Sopenharmony_ci * ie = 0 for ingress, 1 for egress 8462306a36Sopenharmony_ci * bn = bucket number 0-10 (yes, 11 buckets) 8562306a36Sopenharmony_ci */ 8662306a36Sopenharmony_ci/* OK, this one's kinda ugly. Some hardware designers are perverse. */ 8762306a36Sopenharmony_ci#define REG_TRAFFIC_SHAPER_BUCKET(ie,bn) CRA(0x2,ie&1,0x0a + (bn>7) | ((bn&7)<<4)) 8862306a36Sopenharmony_ci#define REG_TRAFFIC_SHAPER_CONTROL(ie) CRA(0x2,ie&1,0x3b) 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci#define REG_SRAM_ADR(ie) CRA(0x2,ie&1,0x0e) /* FIFO SRAM address */ 9162306a36Sopenharmony_ci#define REG_SRAM_WR_STRB(ie) CRA(0x2,ie&1,0x1e) /* FIFO SRAM write strobe */ 9262306a36Sopenharmony_ci#define REG_SRAM_RD_STRB(ie) CRA(0x2,ie&1,0x2e) /* FIFO SRAM read strobe */ 9362306a36Sopenharmony_ci#define REG_SRAM_DATA_0(ie) CRA(0x2,ie&1,0x3e) /* FIFO SRAM data lo 8b */ 9462306a36Sopenharmony_ci#define REG_SRAM_DATA_1(ie) CRA(0x2,ie&1,0x4e) /* FIFO SRAM data lomid 8b */ 9562306a36Sopenharmony_ci#define REG_SRAM_DATA_2(ie) CRA(0x2,ie&1,0x5e) /* FIFO SRAM data himid 8b */ 9662306a36Sopenharmony_ci#define REG_SRAM_DATA_3(ie) CRA(0x2,ie&1,0x6e) /* FIFO SRAM data hi 8b */ 9762306a36Sopenharmony_ci#define REG_SRAM_DATA_BLK_TYPE(ie) CRA(0x2,ie&1,0x7e) /* FIFO SRAM tag */ 9862306a36Sopenharmony_ci/* REG_ING_CONTROL equals REG_CONTROL with ie = 0, likewise REG_EGR_CONTROL is ie = 1 */ 9962306a36Sopenharmony_ci#define REG_CONTROL(ie) CRA(0x2,ie&1,0x0f) /* FIFO control */ 10062306a36Sopenharmony_ci#define REG_ING_CONTROL CRA(0x2,0x0,0x0f) /* Ingress control (alias) */ 10162306a36Sopenharmony_ci#define REG_EGR_CONTROL CRA(0x2,0x1,0x0f) /* Egress control (alias) */ 10262306a36Sopenharmony_ci#define REG_AGE_TIMER(ie) CRA(0x2,ie&1,0x1f) /* Aging timer */ 10362306a36Sopenharmony_ci#define REG_AGE_INC(ie) CRA(0x2,ie&1,0x2f) /* Aging increment */ 10462306a36Sopenharmony_ci#define DEBUG_OUT(ie) CRA(0x2,ie&1,0x3f) /* Output debug counter control */ 10562306a36Sopenharmony_ci#define DEBUG_CNT(ie) CRA(0x2,ie&1,0x4f) /* Output debug counter */ 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci/* SPI4 interface */ 10862306a36Sopenharmony_ci#define REG_SPI4_MISC CRA(0x5,0x0,0x00) /* Misc Register */ 10962306a36Sopenharmony_ci#define REG_SPI4_STATUS CRA(0x5,0x0,0x01) /* CML Status */ 11062306a36Sopenharmony_ci#define REG_SPI4_ING_SETUP0 CRA(0x5,0x0,0x02) /* Ingress Status Channel Setup */ 11162306a36Sopenharmony_ci#define REG_SPI4_ING_SETUP1 CRA(0x5,0x0,0x03) /* Ingress Data Training Setup */ 11262306a36Sopenharmony_ci#define REG_SPI4_ING_SETUP2 CRA(0x5,0x0,0x04) /* Ingress Data Burst Size Setup */ 11362306a36Sopenharmony_ci#define REG_SPI4_EGR_SETUP0 CRA(0x5,0x0,0x05) /* Egress Status Channel Setup */ 11462306a36Sopenharmony_ci#define REG_SPI4_DBG_CNT(n) CRA(0x5,0x0,0x10+n) /* Debug counters 0-9 */ 11562306a36Sopenharmony_ci#define REG_SPI4_DBG_SETUP CRA(0x5,0x0,0x1A) /* Debug counters setup */ 11662306a36Sopenharmony_ci#define REG_SPI4_TEST CRA(0x5,0x0,0x20) /* Test Setup Register */ 11762306a36Sopenharmony_ci#define REG_TPGEN_UP0 CRA(0x5,0x0,0x21) /* Test Pattern generator user pattern 0 */ 11862306a36Sopenharmony_ci#define REG_TPGEN_UP1 CRA(0x5,0x0,0x22) /* Test Pattern generator user pattern 1 */ 11962306a36Sopenharmony_ci#define REG_TPCHK_UP0 CRA(0x5,0x0,0x23) /* Test Pattern checker user pattern 0 */ 12062306a36Sopenharmony_ci#define REG_TPCHK_UP1 CRA(0x5,0x0,0x24) /* Test Pattern checker user pattern 1 */ 12162306a36Sopenharmony_ci#define REG_TPSAM_P0 CRA(0x5,0x0,0x25) /* Sampled pattern 0 */ 12262306a36Sopenharmony_ci#define REG_TPSAM_P1 CRA(0x5,0x0,0x26) /* Sampled pattern 1 */ 12362306a36Sopenharmony_ci#define REG_TPERR_CNT CRA(0x5,0x0,0x27) /* Pattern checker error counter */ 12462306a36Sopenharmony_ci#define REG_SPI4_STICKY CRA(0x5,0x0,0x30) /* Sticky bits register */ 12562306a36Sopenharmony_ci#define REG_SPI4_DBG_INH CRA(0x5,0x0,0x31) /* Core egress & ingress inhibit */ 12662306a36Sopenharmony_ci#define REG_SPI4_DBG_STATUS CRA(0x5,0x0,0x32) /* Sampled ingress status */ 12762306a36Sopenharmony_ci#define REG_SPI4_DBG_GRANT CRA(0x5,0x0,0x33) /* Ingress cranted credit value */ 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci#define REG_SPI4_DESKEW CRA(0x5,0x0,0x43) /* Ingress cranted credit value */ 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci/* 10GbE MAC Block Registers */ 13262306a36Sopenharmony_ci/* Note that those registers that are exactly the same for 10GbE as for 13362306a36Sopenharmony_ci * tri-speed are only defined with the version that needs a port number. 13462306a36Sopenharmony_ci * Pass 0xa in those cases. 13562306a36Sopenharmony_ci * 13662306a36Sopenharmony_ci * Also note that despite the presence of a MAC address register, this part 13762306a36Sopenharmony_ci * does no ingress MAC address filtering. That register is used only for 13862306a36Sopenharmony_ci * pause frame detection and generation. 13962306a36Sopenharmony_ci */ 14062306a36Sopenharmony_ci/* 10GbE specific, and different from tri-speed */ 14162306a36Sopenharmony_ci#define REG_MISC_10G CRA(0x1,0xa,0x00) /* Misc 10GbE setup */ 14262306a36Sopenharmony_ci#define REG_PAUSE_10G CRA(0x1,0xa,0x01) /* Pause register */ 14362306a36Sopenharmony_ci#define REG_NORMALIZER_10G CRA(0x1,0xa,0x05) /* 10G normalizer */ 14462306a36Sopenharmony_ci#define REG_STICKY_RX CRA(0x1,0xa,0x06) /* RX debug register */ 14562306a36Sopenharmony_ci#define REG_DENORM_10G CRA(0x1,0xa,0x07) /* Denormalizer */ 14662306a36Sopenharmony_ci#define REG_STICKY_TX CRA(0x1,0xa,0x08) /* TX sticky bits */ 14762306a36Sopenharmony_ci#define REG_MAX_RXHIGH CRA(0x1,0xa,0x0a) /* XGMII lane 0-3 debug */ 14862306a36Sopenharmony_ci#define REG_MAX_RXLOW CRA(0x1,0xa,0x0b) /* XGMII lane 4-7 debug */ 14962306a36Sopenharmony_ci#define REG_MAC_TX_STICKY CRA(0x1,0xa,0x0c) /* MAC Tx state sticky debug */ 15062306a36Sopenharmony_ci#define REG_MAC_TX_RUNNING CRA(0x1,0xa,0x0d) /* MAC Tx state running debug */ 15162306a36Sopenharmony_ci#define REG_TX_ABORT_AGE CRA(0x1,0xa,0x14) /* Aged Tx frames discarded */ 15262306a36Sopenharmony_ci#define REG_TX_ABORT_SHORT CRA(0x1,0xa,0x15) /* Short Tx frames discarded */ 15362306a36Sopenharmony_ci#define REG_TX_ABORT_TAXI CRA(0x1,0xa,0x16) /* Taxi error frames discarded */ 15462306a36Sopenharmony_ci#define REG_TX_ABORT_UNDERRUN CRA(0x1,0xa,0x17) /* Tx Underrun abort counter */ 15562306a36Sopenharmony_ci#define REG_TX_DENORM_DISCARD CRA(0x1,0xa,0x18) /* Tx denormalizer discards */ 15662306a36Sopenharmony_ci#define REG_XAUI_STAT_A CRA(0x1,0xa,0x20) /* XAUI status A */ 15762306a36Sopenharmony_ci#define REG_XAUI_STAT_B CRA(0x1,0xa,0x21) /* XAUI status B */ 15862306a36Sopenharmony_ci#define REG_XAUI_STAT_C CRA(0x1,0xa,0x22) /* XAUI status C */ 15962306a36Sopenharmony_ci#define REG_XAUI_CONF_A CRA(0x1,0xa,0x23) /* XAUI configuration A */ 16062306a36Sopenharmony_ci#define REG_XAUI_CONF_B CRA(0x1,0xa,0x24) /* XAUI configuration B */ 16162306a36Sopenharmony_ci#define REG_XAUI_CODE_GRP_CNT CRA(0x1,0xa,0x25) /* XAUI code group error count */ 16262306a36Sopenharmony_ci#define REG_XAUI_CONF_TEST_A CRA(0x1,0xa,0x26) /* XAUI test register A */ 16362306a36Sopenharmony_ci#define REG_PDERRCNT CRA(0x1,0xa,0x27) /* XAUI test register B */ 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci/* pn = port number 0-9 for tri-speed, 10 for 10GbE */ 16662306a36Sopenharmony_ci/* Both tri-speed and 10GbE */ 16762306a36Sopenharmony_ci#define REG_MAX_LEN(pn) CRA(0x1,pn,0x02) /* Max length */ 16862306a36Sopenharmony_ci#define REG_MAC_HIGH_ADDR(pn) CRA(0x1,pn,0x03) /* Upper 24 bits of MAC addr */ 16962306a36Sopenharmony_ci#define REG_MAC_LOW_ADDR(pn) CRA(0x1,pn,0x04) /* Lower 24 bits of MAC addr */ 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci/* tri-speed only 17262306a36Sopenharmony_ci * pn = port number, 0-9 17362306a36Sopenharmony_ci */ 17462306a36Sopenharmony_ci#define REG_MODE_CFG(pn) CRA(0x1,pn,0x00) /* Mode configuration */ 17562306a36Sopenharmony_ci#define REG_PAUSE_CFG(pn) CRA(0x1,pn,0x01) /* Pause configuration */ 17662306a36Sopenharmony_ci#define REG_NORMALIZER(pn) CRA(0x1,pn,0x05) /* Normalizer */ 17762306a36Sopenharmony_ci#define REG_TBI_STATUS(pn) CRA(0x1,pn,0x06) /* TBI status */ 17862306a36Sopenharmony_ci#define REG_PCS_STATUS_DBG(pn) CRA(0x1,pn,0x07) /* PCS status debug */ 17962306a36Sopenharmony_ci#define REG_PCS_CTRL(pn) CRA(0x1,pn,0x08) /* PCS control */ 18062306a36Sopenharmony_ci#define REG_TBI_CONFIG(pn) CRA(0x1,pn,0x09) /* TBI configuration */ 18162306a36Sopenharmony_ci#define REG_STICK_BIT(pn) CRA(0x1,pn,0x0a) /* Sticky bits */ 18262306a36Sopenharmony_ci#define REG_DEV_SETUP(pn) CRA(0x1,pn,0x0b) /* MAC clock/reset setup */ 18362306a36Sopenharmony_ci#define REG_DROP_CNT(pn) CRA(0x1,pn,0x0c) /* Drop counter */ 18462306a36Sopenharmony_ci#define REG_PORT_POS(pn) CRA(0x1,pn,0x0d) /* Preamble port position */ 18562306a36Sopenharmony_ci#define REG_PORT_FAIL(pn) CRA(0x1,pn,0x0e) /* Preamble port position */ 18662306a36Sopenharmony_ci#define REG_SERDES_CONF(pn) CRA(0x1,pn,0x0f) /* SerDes configuration */ 18762306a36Sopenharmony_ci#define REG_SERDES_TEST(pn) CRA(0x1,pn,0x10) /* SerDes test */ 18862306a36Sopenharmony_ci#define REG_SERDES_STAT(pn) CRA(0x1,pn,0x11) /* SerDes status */ 18962306a36Sopenharmony_ci#define REG_SERDES_COM_CNT(pn) CRA(0x1,pn,0x12) /* SerDes comma counter */ 19062306a36Sopenharmony_ci#define REG_DENORM(pn) CRA(0x1,pn,0x15) /* Frame denormalization */ 19162306a36Sopenharmony_ci#define REG_DBG(pn) CRA(0x1,pn,0x16) /* Device 1G debug */ 19262306a36Sopenharmony_ci#define REG_TX_IFG(pn) CRA(0x1,pn,0x18) /* Tx IFG config */ 19362306a36Sopenharmony_ci#define REG_HDX(pn) CRA(0x1,pn,0x19) /* Half-duplex config */ 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci/* Statistics */ 19662306a36Sopenharmony_ci/* CRA(0x4,pn,reg) */ 19762306a36Sopenharmony_ci/* reg below */ 19862306a36Sopenharmony_ci/* pn = port number, 0-a, a = 10GbE */ 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_cienum { 20162306a36Sopenharmony_ci RxInBytes = 0x00, // # Rx in octets 20262306a36Sopenharmony_ci RxSymbolCarrier = 0x01, // Frames w/ symbol errors 20362306a36Sopenharmony_ci RxPause = 0x02, // # pause frames received 20462306a36Sopenharmony_ci RxUnsupOpcode = 0x03, // # control frames with unsupported opcode 20562306a36Sopenharmony_ci RxOkBytes = 0x04, // # octets in good frames 20662306a36Sopenharmony_ci RxBadBytes = 0x05, // # octets in bad frames 20762306a36Sopenharmony_ci RxUnicast = 0x06, // # good unicast frames 20862306a36Sopenharmony_ci RxMulticast = 0x07, // # good multicast frames 20962306a36Sopenharmony_ci RxBroadcast = 0x08, // # good broadcast frames 21062306a36Sopenharmony_ci Crc = 0x09, // # frames w/ bad CRC only 21162306a36Sopenharmony_ci RxAlignment = 0x0a, // # frames w/ alignment err 21262306a36Sopenharmony_ci RxUndersize = 0x0b, // # frames undersize 21362306a36Sopenharmony_ci RxFragments = 0x0c, // # frames undersize w/ crc err 21462306a36Sopenharmony_ci RxInRangeLengthError = 0x0d, // # frames with length error 21562306a36Sopenharmony_ci RxOutOfRangeError = 0x0e, // # frames with illegal length field 21662306a36Sopenharmony_ci RxOversize = 0x0f, // # frames oversize 21762306a36Sopenharmony_ci RxJabbers = 0x10, // # frames oversize w/ crc err 21862306a36Sopenharmony_ci RxSize64 = 0x11, // # frames 64 octets long 21962306a36Sopenharmony_ci RxSize65To127 = 0x12, // # frames 65-127 octets 22062306a36Sopenharmony_ci RxSize128To255 = 0x13, // # frames 128-255 22162306a36Sopenharmony_ci RxSize256To511 = 0x14, // # frames 256-511 22262306a36Sopenharmony_ci RxSize512To1023 = 0x15, // # frames 512-1023 22362306a36Sopenharmony_ci RxSize1024To1518 = 0x16, // # frames 1024-1518 22462306a36Sopenharmony_ci RxSize1519ToMax = 0x17, // # frames 1519-max 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_ci TxOutBytes = 0x18, // # octets tx 22762306a36Sopenharmony_ci TxPause = 0x19, // # pause frames sent 22862306a36Sopenharmony_ci TxOkBytes = 0x1a, // # octets tx OK 22962306a36Sopenharmony_ci TxUnicast = 0x1b, // # frames unicast 23062306a36Sopenharmony_ci TxMulticast = 0x1c, // # frames multicast 23162306a36Sopenharmony_ci TxBroadcast = 0x1d, // # frames broadcast 23262306a36Sopenharmony_ci TxMultipleColl = 0x1e, // # frames tx after multiple collisions 23362306a36Sopenharmony_ci TxLateColl = 0x1f, // # late collisions detected 23462306a36Sopenharmony_ci TxXcoll = 0x20, // # frames lost, excessive collisions 23562306a36Sopenharmony_ci TxDefer = 0x21, // # frames deferred on first tx attempt 23662306a36Sopenharmony_ci TxXdefer = 0x22, // # frames excessively deferred 23762306a36Sopenharmony_ci TxCsense = 0x23, // carrier sense errors at frame end 23862306a36Sopenharmony_ci TxSize64 = 0x24, // # frames 64 octets long 23962306a36Sopenharmony_ci TxSize65To127 = 0x25, // # frames 65-127 octets 24062306a36Sopenharmony_ci TxSize128To255 = 0x26, // # frames 128-255 24162306a36Sopenharmony_ci TxSize256To511 = 0x27, // # frames 256-511 24262306a36Sopenharmony_ci TxSize512To1023 = 0x28, // # frames 512-1023 24362306a36Sopenharmony_ci TxSize1024To1518 = 0x29, // # frames 1024-1518 24462306a36Sopenharmony_ci TxSize1519ToMax = 0x2a, // # frames 1519-max 24562306a36Sopenharmony_ci TxSingleColl = 0x2b, // # frames tx after single collision 24662306a36Sopenharmony_ci TxBackoff2 = 0x2c, // # frames tx ok after 2 backoffs/collisions 24762306a36Sopenharmony_ci TxBackoff3 = 0x2d, // after 3 backoffs/collisions 24862306a36Sopenharmony_ci TxBackoff4 = 0x2e, // after 4 24962306a36Sopenharmony_ci TxBackoff5 = 0x2f, // after 5 25062306a36Sopenharmony_ci TxBackoff6 = 0x30, // after 6 25162306a36Sopenharmony_ci TxBackoff7 = 0x31, // after 7 25262306a36Sopenharmony_ci TxBackoff8 = 0x32, // after 8 25362306a36Sopenharmony_ci TxBackoff9 = 0x33, // after 9 25462306a36Sopenharmony_ci TxBackoff10 = 0x34, // after 10 25562306a36Sopenharmony_ci TxBackoff11 = 0x35, // after 11 25662306a36Sopenharmony_ci TxBackoff12 = 0x36, // after 12 25762306a36Sopenharmony_ci TxBackoff13 = 0x37, // after 13 25862306a36Sopenharmony_ci TxBackoff14 = 0x38, // after 14 25962306a36Sopenharmony_ci TxBackoff15 = 0x39, // after 15 26062306a36Sopenharmony_ci TxUnderrun = 0x3a, // # frames dropped from underrun 26162306a36Sopenharmony_ci // Hole. See REG_RX_XGMII_PROT_ERR below. 26262306a36Sopenharmony_ci RxIpgShrink = 0x3c, // # of IPG shrinks detected 26362306a36Sopenharmony_ci // Duplicate. See REG_STAT_STICKY10G below. 26462306a36Sopenharmony_ci StatSticky1G = 0x3e, // tri-speed sticky bits 26562306a36Sopenharmony_ci StatInit = 0x3f // Clear all statistics 26662306a36Sopenharmony_ci}; 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci#define REG_RX_XGMII_PROT_ERR CRA(0x4,0xa,0x3b) /* # protocol errors detected on XGMII interface */ 26962306a36Sopenharmony_ci#define REG_STAT_STICKY10G CRA(0x4,0xa,StatSticky1G) /* 10GbE sticky bits */ 27062306a36Sopenharmony_ci 27162306a36Sopenharmony_ci#define REG_RX_OK_BYTES(pn) CRA(0x4,pn,RxOkBytes) 27262306a36Sopenharmony_ci#define REG_RX_BAD_BYTES(pn) CRA(0x4,pn,RxBadBytes) 27362306a36Sopenharmony_ci#define REG_TX_OK_BYTES(pn) CRA(0x4,pn,TxOkBytes) 27462306a36Sopenharmony_ci 27562306a36Sopenharmony_ci/* MII-Management Block registers */ 27662306a36Sopenharmony_ci/* These are for MII-M interface 0, which is the bidirectional LVTTL one. If 27762306a36Sopenharmony_ci * we hooked up to the one with separate directions, the middle 0x0 needs to 27862306a36Sopenharmony_ci * change to 0x1. And the current errata states that MII-M 1 doesn't work. 27962306a36Sopenharmony_ci */ 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_ci#define REG_MIIM_STATUS CRA(0x3,0x0,0x00) /* MII-M Status */ 28262306a36Sopenharmony_ci#define REG_MIIM_CMD CRA(0x3,0x0,0x01) /* MII-M Command */ 28362306a36Sopenharmony_ci#define REG_MIIM_DATA CRA(0x3,0x0,0x02) /* MII-M Data */ 28462306a36Sopenharmony_ci#define REG_MIIM_PRESCALE CRA(0x3,0x0,0x03) /* MII-M MDC Prescale */ 28562306a36Sopenharmony_ci 28662306a36Sopenharmony_ci#define REG_ING_FFILT_UM_EN CRA(0x2, 0, 0xd) 28762306a36Sopenharmony_ci#define REG_ING_FFILT_BE_EN CRA(0x2, 0, 0x1d) 28862306a36Sopenharmony_ci#define REG_ING_FFILT_VAL0 CRA(0x2, 0, 0x2d) 28962306a36Sopenharmony_ci#define REG_ING_FFILT_VAL1 CRA(0x2, 0, 0x3d) 29062306a36Sopenharmony_ci#define REG_ING_FFILT_MASK0 CRA(0x2, 0, 0x4d) 29162306a36Sopenharmony_ci#define REG_ING_FFILT_MASK1 CRA(0x2, 0, 0x5d) 29262306a36Sopenharmony_ci#define REG_ING_FFILT_MASK2 CRA(0x2, 0, 0x6d) 29362306a36Sopenharmony_ci#define REG_ING_FFILT_ETYPE CRA(0x2, 0, 0x7d) 29462306a36Sopenharmony_ci 29562306a36Sopenharmony_ci 29662306a36Sopenharmony_ci/* Whew. */ 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_ci#endif 299