0001
0002
0003 #ifndef _VSC7321_REG_H_
0004 #define _VSC7321_REG_H_
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #define CRA(blk,sub,adr) ((((blk) & 0x7) << 13) | (((sub) & 0xf) << 9) | (((adr) & 0xff) << 1))
0015
0016
0017 #define REG_CHIP_ID CRA(0x7,0xf,0x00)
0018 #define REG_BLADE_ID CRA(0x7,0xf,0x01)
0019 #define REG_SW_RESET CRA(0x7,0xf,0x02)
0020 #define REG_MEM_BIST CRA(0x7,0xf,0x04)
0021 #define REG_IFACE_MODE CRA(0x7,0xf,0x07)
0022 #define REG_MSCH CRA(0x7,0x2,0x06)
0023 #define REG_CRC_CNT CRA(0x7,0x2,0x0a)
0024 #define REG_CRC_CFG CRA(0x7,0x2,0x0b)
0025 #define REG_SI_TRANSFER_SEL CRA(0x7,0xf,0x18)
0026 #define REG_PLL_CLK_SPEED CRA(0x7,0xf,0x19)
0027 #define REG_SYS_CLK_SELECT CRA(0x7,0xf,0x1c)
0028 #define REG_GPIO_CTRL CRA(0x7,0xf,0x1d)
0029 #define REG_GPIO_OUT CRA(0x7,0xf,0x1e)
0030 #define REG_GPIO_IN CRA(0x7,0xf,0x1f)
0031 #define REG_CPU_TRANSFER_SEL CRA(0x7,0xf,0x20)
0032 #define REG_LOCAL_DATA CRA(0x7,0xf,0xfe)
0033 #define REG_LOCAL_STATUS CRA(0x7,0xf,0xff)
0034
0035
0036 #define REG_AGGR_SETUP CRA(0x7,0x1,0x00)
0037 #define REG_PMAP_TABLE CRA(0x7,0x1,0x01)
0038 #define REG_MPLS_BIT0 CRA(0x7,0x1,0x08)
0039 #define REG_MPLS_BIT1 CRA(0x7,0x1,0x09)
0040 #define REG_MPLS_BIT2 CRA(0x7,0x1,0x0a)
0041 #define REG_MPLS_BIT3 CRA(0x7,0x1,0x0b)
0042 #define REG_MPLS_BITMASK CRA(0x7,0x1,0x0c)
0043 #define REG_PRE_BIT0POS CRA(0x7,0x1,0x10)
0044 #define REG_PRE_BIT1POS CRA(0x7,0x1,0x11)
0045 #define REG_PRE_BIT2POS CRA(0x7,0x1,0x12)
0046 #define REG_PRE_BIT3POS CRA(0x7,0x1,0x13)
0047 #define REG_PRE_ERR_CNT CRA(0x7,0x1,0x14)
0048
0049
0050
0051
0052 #define REG_RAM_BIST_CMD CRA(0x7,0x1,0x00)
0053 #define REG_RAM_BIST_RESULT CRA(0x7,0x1,0x01)
0054 #define BIST_PORT_SELECT 0x00
0055 #define BIST_COMMAND 0x01
0056 #define BIST_STATUS 0x02
0057 #define BIST_ERR_CNT_LSB 0x03
0058 #define BIST_ERR_CNT_MSB 0x04
0059 #define BIST_ERR_SEL_LSB 0x05
0060 #define BIST_ERR_SEL_MSB 0x06
0061 #define BIST_ERROR_STATE 0x07
0062 #define BIST_ERR_ADR0 0x08
0063 #define BIST_ERR_ADR1 0x09
0064 #define BIST_ERR_ADR2 0x0a
0065 #define BIST_ERR_ADR3 0x0b
0066
0067
0068
0069
0070
0071 #define REG_TEST(ie,fn) CRA(0x2,ie&1,0x00+fn)
0072 #define REG_TOP_BOTTOM(ie,fn) CRA(0x2,ie&1,0x10+fn)
0073 #define REG_TAIL(ie,fn) CRA(0x2,ie&1,0x20+fn)
0074 #define REG_HEAD(ie,fn) CRA(0x2,ie&1,0x30+fn)
0075 #define REG_HIGH_LOW_WM(ie,fn) CRA(0x2,ie&1,0x40+fn)
0076 #define REG_CT_THRHLD(ie,fn) CRA(0x2,ie&1,0x50+fn)
0077 #define REG_FIFO_DROP_CNT(ie,fn) CRA(0x2,ie&1,0x60+fn)
0078 #define REG_DEBUG_BUF_CNT(ie,fn) CRA(0x2,ie&1,0x70+fn)
0079 #define REG_BUCKI(fn) CRA(0x2,2,0x20+fn)
0080 #define REG_BUCKE(fn) CRA(0x2,3,0x20+fn)
0081
0082
0083
0084
0085
0086
0087 #define REG_TRAFFIC_SHAPER_BUCKET(ie,bn) CRA(0x2,ie&1,0x0a + (bn>7) | ((bn&7)<<4))
0088 #define REG_TRAFFIC_SHAPER_CONTROL(ie) CRA(0x2,ie&1,0x3b)
0089
0090 #define REG_SRAM_ADR(ie) CRA(0x2,ie&1,0x0e)
0091 #define REG_SRAM_WR_STRB(ie) CRA(0x2,ie&1,0x1e)
0092 #define REG_SRAM_RD_STRB(ie) CRA(0x2,ie&1,0x2e)
0093 #define REG_SRAM_DATA_0(ie) CRA(0x2,ie&1,0x3e)
0094 #define REG_SRAM_DATA_1(ie) CRA(0x2,ie&1,0x4e)
0095 #define REG_SRAM_DATA_2(ie) CRA(0x2,ie&1,0x5e)
0096 #define REG_SRAM_DATA_3(ie) CRA(0x2,ie&1,0x6e)
0097 #define REG_SRAM_DATA_BLK_TYPE(ie) CRA(0x2,ie&1,0x7e)
0098
0099 #define REG_CONTROL(ie) CRA(0x2,ie&1,0x0f)
0100 #define REG_ING_CONTROL CRA(0x2,0x0,0x0f)
0101 #define REG_EGR_CONTROL CRA(0x2,0x1,0x0f)
0102 #define REG_AGE_TIMER(ie) CRA(0x2,ie&1,0x1f)
0103 #define REG_AGE_INC(ie) CRA(0x2,ie&1,0x2f)
0104 #define DEBUG_OUT(ie) CRA(0x2,ie&1,0x3f)
0105 #define DEBUG_CNT(ie) CRA(0x2,ie&1,0x4f)
0106
0107
0108 #define REG_SPI4_MISC CRA(0x5,0x0,0x00)
0109 #define REG_SPI4_STATUS CRA(0x5,0x0,0x01)
0110 #define REG_SPI4_ING_SETUP0 CRA(0x5,0x0,0x02)
0111 #define REG_SPI4_ING_SETUP1 CRA(0x5,0x0,0x03)
0112 #define REG_SPI4_ING_SETUP2 CRA(0x5,0x0,0x04)
0113 #define REG_SPI4_EGR_SETUP0 CRA(0x5,0x0,0x05)
0114 #define REG_SPI4_DBG_CNT(n) CRA(0x5,0x0,0x10+n)
0115 #define REG_SPI4_DBG_SETUP CRA(0x5,0x0,0x1A)
0116 #define REG_SPI4_TEST CRA(0x5,0x0,0x20)
0117 #define REG_TPGEN_UP0 CRA(0x5,0x0,0x21)
0118 #define REG_TPGEN_UP1 CRA(0x5,0x0,0x22)
0119 #define REG_TPCHK_UP0 CRA(0x5,0x0,0x23)
0120 #define REG_TPCHK_UP1 CRA(0x5,0x0,0x24)
0121 #define REG_TPSAM_P0 CRA(0x5,0x0,0x25)
0122 #define REG_TPSAM_P1 CRA(0x5,0x0,0x26)
0123 #define REG_TPERR_CNT CRA(0x5,0x0,0x27)
0124 #define REG_SPI4_STICKY CRA(0x5,0x0,0x30)
0125 #define REG_SPI4_DBG_INH CRA(0x5,0x0,0x31)
0126 #define REG_SPI4_DBG_STATUS CRA(0x5,0x0,0x32)
0127 #define REG_SPI4_DBG_GRANT CRA(0x5,0x0,0x33)
0128
0129 #define REG_SPI4_DESKEW CRA(0x5,0x0,0x43)
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141 #define REG_MISC_10G CRA(0x1,0xa,0x00)
0142 #define REG_PAUSE_10G CRA(0x1,0xa,0x01)
0143 #define REG_NORMALIZER_10G CRA(0x1,0xa,0x05)
0144 #define REG_STICKY_RX CRA(0x1,0xa,0x06)
0145 #define REG_DENORM_10G CRA(0x1,0xa,0x07)
0146 #define REG_STICKY_TX CRA(0x1,0xa,0x08)
0147 #define REG_MAX_RXHIGH CRA(0x1,0xa,0x0a)
0148 #define REG_MAX_RXLOW CRA(0x1,0xa,0x0b)
0149 #define REG_MAC_TX_STICKY CRA(0x1,0xa,0x0c)
0150 #define REG_MAC_TX_RUNNING CRA(0x1,0xa,0x0d)
0151 #define REG_TX_ABORT_AGE CRA(0x1,0xa,0x14)
0152 #define REG_TX_ABORT_SHORT CRA(0x1,0xa,0x15)
0153 #define REG_TX_ABORT_TAXI CRA(0x1,0xa,0x16)
0154 #define REG_TX_ABORT_UNDERRUN CRA(0x1,0xa,0x17)
0155 #define REG_TX_DENORM_DISCARD CRA(0x1,0xa,0x18)
0156 #define REG_XAUI_STAT_A CRA(0x1,0xa,0x20)
0157 #define REG_XAUI_STAT_B CRA(0x1,0xa,0x21)
0158 #define REG_XAUI_STAT_C CRA(0x1,0xa,0x22)
0159 #define REG_XAUI_CONF_A CRA(0x1,0xa,0x23)
0160 #define REG_XAUI_CONF_B CRA(0x1,0xa,0x24)
0161 #define REG_XAUI_CODE_GRP_CNT CRA(0x1,0xa,0x25)
0162 #define REG_XAUI_CONF_TEST_A CRA(0x1,0xa,0x26)
0163 #define REG_PDERRCNT CRA(0x1,0xa,0x27)
0164
0165
0166
0167 #define REG_MAX_LEN(pn) CRA(0x1,pn,0x02)
0168 #define REG_MAC_HIGH_ADDR(pn) CRA(0x1,pn,0x03)
0169 #define REG_MAC_LOW_ADDR(pn) CRA(0x1,pn,0x04)
0170
0171
0172
0173
0174 #define REG_MODE_CFG(pn) CRA(0x1,pn,0x00)
0175 #define REG_PAUSE_CFG(pn) CRA(0x1,pn,0x01)
0176 #define REG_NORMALIZER(pn) CRA(0x1,pn,0x05)
0177 #define REG_TBI_STATUS(pn) CRA(0x1,pn,0x06)
0178 #define REG_PCS_STATUS_DBG(pn) CRA(0x1,pn,0x07)
0179 #define REG_PCS_CTRL(pn) CRA(0x1,pn,0x08)
0180 #define REG_TBI_CONFIG(pn) CRA(0x1,pn,0x09)
0181 #define REG_STICK_BIT(pn) CRA(0x1,pn,0x0a)
0182 #define REG_DEV_SETUP(pn) CRA(0x1,pn,0x0b)
0183 #define REG_DROP_CNT(pn) CRA(0x1,pn,0x0c)
0184 #define REG_PORT_POS(pn) CRA(0x1,pn,0x0d)
0185 #define REG_PORT_FAIL(pn) CRA(0x1,pn,0x0e)
0186 #define REG_SERDES_CONF(pn) CRA(0x1,pn,0x0f)
0187 #define REG_SERDES_TEST(pn) CRA(0x1,pn,0x10)
0188 #define REG_SERDES_STAT(pn) CRA(0x1,pn,0x11)
0189 #define REG_SERDES_COM_CNT(pn) CRA(0x1,pn,0x12)
0190 #define REG_DENORM(pn) CRA(0x1,pn,0x15)
0191 #define REG_DBG(pn) CRA(0x1,pn,0x16)
0192 #define REG_TX_IFG(pn) CRA(0x1,pn,0x18)
0193 #define REG_HDX(pn) CRA(0x1,pn,0x19)
0194
0195
0196
0197
0198
0199
0200 enum {
0201 RxInBytes = 0x00,
0202 RxSymbolCarrier = 0x01,
0203 RxPause = 0x02,
0204 RxUnsupOpcode = 0x03,
0205 RxOkBytes = 0x04,
0206 RxBadBytes = 0x05,
0207 RxUnicast = 0x06,
0208 RxMulticast = 0x07,
0209 RxBroadcast = 0x08,
0210 Crc = 0x09,
0211 RxAlignment = 0x0a,
0212 RxUndersize = 0x0b,
0213 RxFragments = 0x0c,
0214 RxInRangeLengthError = 0x0d,
0215 RxOutOfRangeError = 0x0e,
0216 RxOversize = 0x0f,
0217 RxJabbers = 0x10,
0218 RxSize64 = 0x11,
0219 RxSize65To127 = 0x12,
0220 RxSize128To255 = 0x13,
0221 RxSize256To511 = 0x14,
0222 RxSize512To1023 = 0x15,
0223 RxSize1024To1518 = 0x16,
0224 RxSize1519ToMax = 0x17,
0225
0226 TxOutBytes = 0x18,
0227 TxPause = 0x19,
0228 TxOkBytes = 0x1a,
0229 TxUnicast = 0x1b,
0230 TxMulticast = 0x1c,
0231 TxBroadcast = 0x1d,
0232 TxMultipleColl = 0x1e,
0233 TxLateColl = 0x1f,
0234 TxXcoll = 0x20,
0235 TxDefer = 0x21,
0236 TxXdefer = 0x22,
0237 TxCsense = 0x23,
0238 TxSize64 = 0x24,
0239 TxSize65To127 = 0x25,
0240 TxSize128To255 = 0x26,
0241 TxSize256To511 = 0x27,
0242 TxSize512To1023 = 0x28,
0243 TxSize1024To1518 = 0x29,
0244 TxSize1519ToMax = 0x2a,
0245 TxSingleColl = 0x2b,
0246 TxBackoff2 = 0x2c,
0247 TxBackoff3 = 0x2d,
0248 TxBackoff4 = 0x2e,
0249 TxBackoff5 = 0x2f,
0250 TxBackoff6 = 0x30,
0251 TxBackoff7 = 0x31,
0252 TxBackoff8 = 0x32,
0253 TxBackoff9 = 0x33,
0254 TxBackoff10 = 0x34,
0255 TxBackoff11 = 0x35,
0256 TxBackoff12 = 0x36,
0257 TxBackoff13 = 0x37,
0258 TxBackoff14 = 0x38,
0259 TxBackoff15 = 0x39,
0260 TxUnderrun = 0x3a,
0261
0262 RxIpgShrink = 0x3c,
0263
0264 StatSticky1G = 0x3e,
0265 StatInit = 0x3f
0266 };
0267
0268 #define REG_RX_XGMII_PROT_ERR CRA(0x4,0xa,0x3b)
0269 #define REG_STAT_STICKY10G CRA(0x4,0xa,StatSticky1G)
0270
0271 #define REG_RX_OK_BYTES(pn) CRA(0x4,pn,RxOkBytes)
0272 #define REG_RX_BAD_BYTES(pn) CRA(0x4,pn,RxBadBytes)
0273 #define REG_TX_OK_BYTES(pn) CRA(0x4,pn,TxOkBytes)
0274
0275
0276
0277
0278
0279
0280
0281 #define REG_MIIM_STATUS CRA(0x3,0x0,0x00)
0282 #define REG_MIIM_CMD CRA(0x3,0x0,0x01)
0283 #define REG_MIIM_DATA CRA(0x3,0x0,0x02)
0284 #define REG_MIIM_PRESCALE CRA(0x3,0x0,0x03)
0285
0286 #define REG_ING_FFILT_UM_EN CRA(0x2, 0, 0xd)
0287 #define REG_ING_FFILT_BE_EN CRA(0x2, 0, 0x1d)
0288 #define REG_ING_FFILT_VAL0 CRA(0x2, 0, 0x2d)
0289 #define REG_ING_FFILT_VAL1 CRA(0x2, 0, 0x3d)
0290 #define REG_ING_FFILT_MASK0 CRA(0x2, 0, 0x4d)
0291 #define REG_ING_FFILT_MASK1 CRA(0x2, 0, 0x5d)
0292 #define REG_ING_FFILT_MASK2 CRA(0x2, 0, 0x6d)
0293 #define REG_ING_FFILT_ETYPE CRA(0x2, 0, 0x7d)
0294
0295
0296
0297
0298 #endif