Back to home page

OSCL-LXR

 
 

    


0001 /* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
0002  *
0003  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
0004  *
0005  * This program is dual-licensed; you may select either version 2 of
0006  * the GNU General Public License ("GPL") or BSD license ("BSD").
0007  *
0008  * This Synopsys DWC XLGMAC software driver and associated documentation
0009  * (hereinafter the "Software") is an unsupported proprietary work of
0010  * Synopsys, Inc. unless otherwise expressly agreed to in writing between
0011  * Synopsys and you. The Software IS NOT an item of Licensed Software or a
0012  * Licensed Product under any End User Software License Agreement or
0013  * Agreement for Licensed Products with Synopsys or any supplement thereto.
0014  * Synopsys is a registered trademark of Synopsys, Inc. Other names included
0015  * in the SOFTWARE may be the trademarks of their respective owners.
0016  */
0017 
0018 #ifndef __DWC_XLGMAC_REG_H__
0019 #define __DWC_XLGMAC_REG_H__
0020 
0021 /* MAC register offsets */
0022 #define MAC_TCR             0x0000
0023 #define MAC_RCR             0x0004
0024 #define MAC_PFR             0x0008
0025 #define MAC_HTR0            0x0010
0026 #define MAC_VLANTR          0x0050
0027 #define MAC_VLANHTR         0x0058
0028 #define MAC_VLANIR          0x0060
0029 #define MAC_Q0TFCR          0x0070
0030 #define MAC_RFCR            0x0090
0031 #define MAC_RQC0R           0x00a0
0032 #define MAC_RQC1R           0x00a4
0033 #define MAC_RQC2R           0x00a8
0034 #define MAC_RQC3R           0x00ac
0035 #define MAC_ISR             0x00b0
0036 #define MAC_IER             0x00b4
0037 #define MAC_VR              0x0110
0038 #define MAC_HWF0R           0x011c
0039 #define MAC_HWF1R           0x0120
0040 #define MAC_HWF2R           0x0124
0041 #define MAC_MACA0HR         0x0300
0042 #define MAC_MACA0LR         0x0304
0043 #define MAC_MACA1HR         0x0308
0044 #define MAC_MACA1LR         0x030c
0045 #define MAC_RSSCR           0x0c80
0046 #define MAC_RSSAR           0x0c88
0047 #define MAC_RSSDR           0x0c8c
0048 
0049 #define MAC_QTFCR_INC           4
0050 #define MAC_MACA_INC            4
0051 #define MAC_HTR_INC         4
0052 #define MAC_RQC2_INC            4
0053 #define MAC_RQC2_Q_PER_REG      4
0054 
0055 /* MAC register entry bit positions and sizes */
0056 #define MAC_HWF0R_ADDMACADRSEL_POS  18
0057 #define MAC_HWF0R_ADDMACADRSEL_LEN  5
0058 #define MAC_HWF0R_ARPOFFSEL_POS     9
0059 #define MAC_HWF0R_ARPOFFSEL_LEN     1
0060 #define MAC_HWF0R_EEESEL_POS        13
0061 #define MAC_HWF0R_EEESEL_LEN        1
0062 #define MAC_HWF0R_PHYIFSEL_POS      1
0063 #define MAC_HWF0R_PHYIFSEL_LEN      2
0064 #define MAC_HWF0R_MGKSEL_POS        7
0065 #define MAC_HWF0R_MGKSEL_LEN        1
0066 #define MAC_HWF0R_MMCSEL_POS        8
0067 #define MAC_HWF0R_MMCSEL_LEN        1
0068 #define MAC_HWF0R_RWKSEL_POS        6
0069 #define MAC_HWF0R_RWKSEL_LEN        1
0070 #define MAC_HWF0R_RXCOESEL_POS      16
0071 #define MAC_HWF0R_RXCOESEL_LEN      1
0072 #define MAC_HWF0R_SAVLANINS_POS     27
0073 #define MAC_HWF0R_SAVLANINS_LEN     1
0074 #define MAC_HWF0R_SMASEL_POS        5
0075 #define MAC_HWF0R_SMASEL_LEN        1
0076 #define MAC_HWF0R_TSSEL_POS     12
0077 #define MAC_HWF0R_TSSEL_LEN     1
0078 #define MAC_HWF0R_TSSTSSEL_POS      25
0079 #define MAC_HWF0R_TSSTSSEL_LEN      2
0080 #define MAC_HWF0R_TXCOESEL_POS      14
0081 #define MAC_HWF0R_TXCOESEL_LEN      1
0082 #define MAC_HWF0R_VLHASH_POS        4
0083 #define MAC_HWF0R_VLHASH_LEN        1
0084 #define MAC_HWF1R_ADDR64_POS        14
0085 #define MAC_HWF1R_ADDR64_LEN        2
0086 #define MAC_HWF1R_ADVTHWORD_POS     13
0087 #define MAC_HWF1R_ADVTHWORD_LEN     1
0088 #define MAC_HWF1R_DBGMEMA_POS       19
0089 #define MAC_HWF1R_DBGMEMA_LEN       1
0090 #define MAC_HWF1R_DCBEN_POS     16
0091 #define MAC_HWF1R_DCBEN_LEN     1
0092 #define MAC_HWF1R_HASHTBLSZ_POS     24
0093 #define MAC_HWF1R_HASHTBLSZ_LEN     3
0094 #define MAC_HWF1R_L3L4FNUM_POS      27
0095 #define MAC_HWF1R_L3L4FNUM_LEN      4
0096 #define MAC_HWF1R_NUMTC_POS     21
0097 #define MAC_HWF1R_NUMTC_LEN     3
0098 #define MAC_HWF1R_RSSEN_POS     20
0099 #define MAC_HWF1R_RSSEN_LEN     1
0100 #define MAC_HWF1R_RXFIFOSIZE_POS    0
0101 #define MAC_HWF1R_RXFIFOSIZE_LEN    5
0102 #define MAC_HWF1R_SPHEN_POS     17
0103 #define MAC_HWF1R_SPHEN_LEN     1
0104 #define MAC_HWF1R_TSOEN_POS     18
0105 #define MAC_HWF1R_TSOEN_LEN     1
0106 #define MAC_HWF1R_TXFIFOSIZE_POS    6
0107 #define MAC_HWF1R_TXFIFOSIZE_LEN    5
0108 #define MAC_HWF2R_AUXSNAPNUM_POS    28
0109 #define MAC_HWF2R_AUXSNAPNUM_LEN    3
0110 #define MAC_HWF2R_PPSOUTNUM_POS     24
0111 #define MAC_HWF2R_PPSOUTNUM_LEN     3
0112 #define MAC_HWF2R_RXCHCNT_POS       12
0113 #define MAC_HWF2R_RXCHCNT_LEN       4
0114 #define MAC_HWF2R_RXQCNT_POS        0
0115 #define MAC_HWF2R_RXQCNT_LEN        4
0116 #define MAC_HWF2R_TXCHCNT_POS       18
0117 #define MAC_HWF2R_TXCHCNT_LEN       4
0118 #define MAC_HWF2R_TXQCNT_POS        6
0119 #define MAC_HWF2R_TXQCNT_LEN        4
0120 #define MAC_IER_TSIE_POS        12
0121 #define MAC_IER_TSIE_LEN        1
0122 #define MAC_ISR_MMCRXIS_POS     9
0123 #define MAC_ISR_MMCRXIS_LEN     1
0124 #define MAC_ISR_MMCTXIS_POS     10
0125 #define MAC_ISR_MMCTXIS_LEN     1
0126 #define MAC_ISR_PMTIS_POS       4
0127 #define MAC_ISR_PMTIS_LEN       1
0128 #define MAC_ISR_TSIS_POS        12
0129 #define MAC_ISR_TSIS_LEN        1
0130 #define MAC_MACA1HR_AE_POS      31
0131 #define MAC_MACA1HR_AE_LEN      1
0132 #define MAC_PFR_HMC_POS         2
0133 #define MAC_PFR_HMC_LEN         1
0134 #define MAC_PFR_HPF_POS         10
0135 #define MAC_PFR_HPF_LEN         1
0136 #define MAC_PFR_HUC_POS         1
0137 #define MAC_PFR_HUC_LEN         1
0138 #define MAC_PFR_PM_POS          4
0139 #define MAC_PFR_PM_LEN          1
0140 #define MAC_PFR_PR_POS          0
0141 #define MAC_PFR_PR_LEN          1
0142 #define MAC_PFR_VTFE_POS        16
0143 #define MAC_PFR_VTFE_LEN        1
0144 #define MAC_Q0TFCR_PT_POS       16
0145 #define MAC_Q0TFCR_PT_LEN       16
0146 #define MAC_Q0TFCR_TFE_POS      1
0147 #define MAC_Q0TFCR_TFE_LEN      1
0148 #define MAC_RCR_ACS_POS         1
0149 #define MAC_RCR_ACS_LEN         1
0150 #define MAC_RCR_CST_POS         2
0151 #define MAC_RCR_CST_LEN         1
0152 #define MAC_RCR_DCRCC_POS       3
0153 #define MAC_RCR_DCRCC_LEN       1
0154 #define MAC_RCR_HDSMS_POS       12
0155 #define MAC_RCR_HDSMS_LEN       3
0156 #define MAC_RCR_IPC_POS         9
0157 #define MAC_RCR_IPC_LEN         1
0158 #define MAC_RCR_JE_POS          8
0159 #define MAC_RCR_JE_LEN          1
0160 #define MAC_RCR_LM_POS          10
0161 #define MAC_RCR_LM_LEN          1
0162 #define MAC_RCR_RE_POS          0
0163 #define MAC_RCR_RE_LEN          1
0164 #define MAC_RFCR_PFCE_POS       8
0165 #define MAC_RFCR_PFCE_LEN       1
0166 #define MAC_RFCR_RFE_POS        0
0167 #define MAC_RFCR_RFE_LEN        1
0168 #define MAC_RFCR_UP_POS         1
0169 #define MAC_RFCR_UP_LEN         1
0170 #define MAC_RQC0R_RXQ0EN_POS        0
0171 #define MAC_RQC0R_RXQ0EN_LEN        2
0172 #define MAC_RSSAR_ADDRT_POS     2
0173 #define MAC_RSSAR_ADDRT_LEN     1
0174 #define MAC_RSSAR_CT_POS        1
0175 #define MAC_RSSAR_CT_LEN        1
0176 #define MAC_RSSAR_OB_POS        0
0177 #define MAC_RSSAR_OB_LEN        1
0178 #define MAC_RSSAR_RSSIA_POS     8
0179 #define MAC_RSSAR_RSSIA_LEN     8
0180 #define MAC_RSSCR_IP2TE_POS     1
0181 #define MAC_RSSCR_IP2TE_LEN     1
0182 #define MAC_RSSCR_RSSE_POS      0
0183 #define MAC_RSSCR_RSSE_LEN      1
0184 #define MAC_RSSCR_TCP4TE_POS        2
0185 #define MAC_RSSCR_TCP4TE_LEN        1
0186 #define MAC_RSSCR_UDP4TE_POS        3
0187 #define MAC_RSSCR_UDP4TE_LEN        1
0188 #define MAC_RSSDR_DMCH_POS      0
0189 #define MAC_RSSDR_DMCH_LEN      4
0190 #define MAC_TCR_SS_POS          28
0191 #define MAC_TCR_SS_LEN          3
0192 #define MAC_TCR_TE_POS          0
0193 #define MAC_TCR_TE_LEN          1
0194 #define MAC_VLANHTR_VLHT_POS        0
0195 #define MAC_VLANHTR_VLHT_LEN        16
0196 #define MAC_VLANIR_VLTI_POS     20
0197 #define MAC_VLANIR_VLTI_LEN     1
0198 #define MAC_VLANIR_CSVL_POS     19
0199 #define MAC_VLANIR_CSVL_LEN     1
0200 #define MAC_VLANTR_DOVLTC_POS       20
0201 #define MAC_VLANTR_DOVLTC_LEN       1
0202 #define MAC_VLANTR_ERSVLM_POS       19
0203 #define MAC_VLANTR_ERSVLM_LEN       1
0204 #define MAC_VLANTR_ESVL_POS     18
0205 #define MAC_VLANTR_ESVL_LEN     1
0206 #define MAC_VLANTR_ETV_POS      16
0207 #define MAC_VLANTR_ETV_LEN      1
0208 #define MAC_VLANTR_EVLS_POS     21
0209 #define MAC_VLANTR_EVLS_LEN     2
0210 #define MAC_VLANTR_EVLRXS_POS       24
0211 #define MAC_VLANTR_EVLRXS_LEN       1
0212 #define MAC_VLANTR_VL_POS       0
0213 #define MAC_VLANTR_VL_LEN       16
0214 #define MAC_VLANTR_VTHM_POS     25
0215 #define MAC_VLANTR_VTHM_LEN     1
0216 #define MAC_VLANTR_VTIM_POS     17
0217 #define MAC_VLANTR_VTIM_LEN     1
0218 #define MAC_VR_DEVID_POS        8
0219 #define MAC_VR_DEVID_LEN        8
0220 #define MAC_VR_SNPSVER_POS      0
0221 #define MAC_VR_SNPSVER_LEN      8
0222 #define MAC_VR_USERVER_POS      16
0223 #define MAC_VR_USERVER_LEN      8
0224 
0225 /* MMC register offsets */
0226 #define MMC_CR              0x0800
0227 #define MMC_RISR            0x0804
0228 #define MMC_TISR            0x0808
0229 #define MMC_RIER            0x080c
0230 #define MMC_TIER            0x0810
0231 #define MMC_TXOCTETCOUNT_GB_LO      0x0814
0232 #define MMC_TXFRAMECOUNT_GB_LO      0x081c
0233 #define MMC_TXBROADCASTFRAMES_G_LO  0x0824
0234 #define MMC_TXMULTICASTFRAMES_G_LO  0x082c
0235 #define MMC_TX64OCTETS_GB_LO        0x0834
0236 #define MMC_TX65TO127OCTETS_GB_LO   0x083c
0237 #define MMC_TX128TO255OCTETS_GB_LO  0x0844
0238 #define MMC_TX256TO511OCTETS_GB_LO  0x084c
0239 #define MMC_TX512TO1023OCTETS_GB_LO 0x0854
0240 #define MMC_TX1024TOMAXOCTETS_GB_LO 0x085c
0241 #define MMC_TXUNICASTFRAMES_GB_LO   0x0864
0242 #define MMC_TXMULTICASTFRAMES_GB_LO 0x086c
0243 #define MMC_TXBROADCASTFRAMES_GB_LO 0x0874
0244 #define MMC_TXUNDERFLOWERROR_LO     0x087c
0245 #define MMC_TXOCTETCOUNT_G_LO       0x0884
0246 #define MMC_TXFRAMECOUNT_G_LO       0x088c
0247 #define MMC_TXPAUSEFRAMES_LO        0x0894
0248 #define MMC_TXVLANFRAMES_G_LO       0x089c
0249 #define MMC_RXFRAMECOUNT_GB_LO      0x0900
0250 #define MMC_RXOCTETCOUNT_GB_LO      0x0908
0251 #define MMC_RXOCTETCOUNT_G_LO       0x0910
0252 #define MMC_RXBROADCASTFRAMES_G_LO  0x0918
0253 #define MMC_RXMULTICASTFRAMES_G_LO  0x0920
0254 #define MMC_RXCRCERROR_LO       0x0928
0255 #define MMC_RXRUNTERROR         0x0930
0256 #define MMC_RXJABBERERROR       0x0934
0257 #define MMC_RXUNDERSIZE_G       0x0938
0258 #define MMC_RXOVERSIZE_G        0x093c
0259 #define MMC_RX64OCTETS_GB_LO        0x0940
0260 #define MMC_RX65TO127OCTETS_GB_LO   0x0948
0261 #define MMC_RX128TO255OCTETS_GB_LO  0x0950
0262 #define MMC_RX256TO511OCTETS_GB_LO  0x0958
0263 #define MMC_RX512TO1023OCTETS_GB_LO 0x0960
0264 #define MMC_RX1024TOMAXOCTETS_GB_LO 0x0968
0265 #define MMC_RXUNICASTFRAMES_G_LO    0x0970
0266 #define MMC_RXLENGTHERROR_LO        0x0978
0267 #define MMC_RXOUTOFRANGETYPE_LO     0x0980
0268 #define MMC_RXPAUSEFRAMES_LO        0x0988
0269 #define MMC_RXFIFOOVERFLOW_LO       0x0990
0270 #define MMC_RXVLANFRAMES_GB_LO      0x0998
0271 #define MMC_RXWATCHDOGERROR     0x09a0
0272 
0273 /* MMC register entry bit positions and sizes */
0274 #define MMC_CR_CR_POS               0
0275 #define MMC_CR_CR_LEN               1
0276 #define MMC_CR_CSR_POS              1
0277 #define MMC_CR_CSR_LEN              1
0278 #define MMC_CR_ROR_POS              2
0279 #define MMC_CR_ROR_LEN              1
0280 #define MMC_CR_MCF_POS              3
0281 #define MMC_CR_MCF_LEN              1
0282 #define MMC_CR_MCT_POS              4
0283 #define MMC_CR_MCT_LEN              2
0284 #define MMC_RIER_ALL_INTERRUPTS_POS     0
0285 #define MMC_RIER_ALL_INTERRUPTS_LEN     23
0286 #define MMC_RISR_RXFRAMECOUNT_GB_POS        0
0287 #define MMC_RISR_RXFRAMECOUNT_GB_LEN        1
0288 #define MMC_RISR_RXOCTETCOUNT_GB_POS        1
0289 #define MMC_RISR_RXOCTETCOUNT_GB_LEN        1
0290 #define MMC_RISR_RXOCTETCOUNT_G_POS     2
0291 #define MMC_RISR_RXOCTETCOUNT_G_LEN     1
0292 #define MMC_RISR_RXBROADCASTFRAMES_G_POS    3
0293 #define MMC_RISR_RXBROADCASTFRAMES_G_LEN    1
0294 #define MMC_RISR_RXMULTICASTFRAMES_G_POS    4
0295 #define MMC_RISR_RXMULTICASTFRAMES_G_LEN    1
0296 #define MMC_RISR_RXCRCERROR_POS         5
0297 #define MMC_RISR_RXCRCERROR_LEN         1
0298 #define MMC_RISR_RXRUNTERROR_POS        6
0299 #define MMC_RISR_RXRUNTERROR_LEN        1
0300 #define MMC_RISR_RXJABBERERROR_POS      7
0301 #define MMC_RISR_RXJABBERERROR_LEN      1
0302 #define MMC_RISR_RXUNDERSIZE_G_POS      8
0303 #define MMC_RISR_RXUNDERSIZE_G_LEN      1
0304 #define MMC_RISR_RXOVERSIZE_G_POS       9
0305 #define MMC_RISR_RXOVERSIZE_G_LEN       1
0306 #define MMC_RISR_RX64OCTETS_GB_POS      10
0307 #define MMC_RISR_RX64OCTETS_GB_LEN      1
0308 #define MMC_RISR_RX65TO127OCTETS_GB_POS     11
0309 #define MMC_RISR_RX65TO127OCTETS_GB_LEN     1
0310 #define MMC_RISR_RX128TO255OCTETS_GB_POS    12
0311 #define MMC_RISR_RX128TO255OCTETS_GB_LEN    1
0312 #define MMC_RISR_RX256TO511OCTETS_GB_POS    13
0313 #define MMC_RISR_RX256TO511OCTETS_GB_LEN    1
0314 #define MMC_RISR_RX512TO1023OCTETS_GB_POS   14
0315 #define MMC_RISR_RX512TO1023OCTETS_GB_LEN   1
0316 #define MMC_RISR_RX1024TOMAXOCTETS_GB_POS   15
0317 #define MMC_RISR_RX1024TOMAXOCTETS_GB_LEN   1
0318 #define MMC_RISR_RXUNICASTFRAMES_G_POS      16
0319 #define MMC_RISR_RXUNICASTFRAMES_G_LEN      1
0320 #define MMC_RISR_RXLENGTHERROR_POS      17
0321 #define MMC_RISR_RXLENGTHERROR_LEN      1
0322 #define MMC_RISR_RXOUTOFRANGETYPE_POS       18
0323 #define MMC_RISR_RXOUTOFRANGETYPE_LEN       1
0324 #define MMC_RISR_RXPAUSEFRAMES_POS      19
0325 #define MMC_RISR_RXPAUSEFRAMES_LEN      1
0326 #define MMC_RISR_RXFIFOOVERFLOW_POS     20
0327 #define MMC_RISR_RXFIFOOVERFLOW_LEN     1
0328 #define MMC_RISR_RXVLANFRAMES_GB_POS        21
0329 #define MMC_RISR_RXVLANFRAMES_GB_LEN        1
0330 #define MMC_RISR_RXWATCHDOGERROR_POS        22
0331 #define MMC_RISR_RXWATCHDOGERROR_LEN        1
0332 #define MMC_TIER_ALL_INTERRUPTS_POS     0
0333 #define MMC_TIER_ALL_INTERRUPTS_LEN     18
0334 #define MMC_TISR_TXOCTETCOUNT_GB_POS        0
0335 #define MMC_TISR_TXOCTETCOUNT_GB_LEN        1
0336 #define MMC_TISR_TXFRAMECOUNT_GB_POS        1
0337 #define MMC_TISR_TXFRAMECOUNT_GB_LEN        1
0338 #define MMC_TISR_TXBROADCASTFRAMES_G_POS    2
0339 #define MMC_TISR_TXBROADCASTFRAMES_G_LEN    1
0340 #define MMC_TISR_TXMULTICASTFRAMES_G_POS    3
0341 #define MMC_TISR_TXMULTICASTFRAMES_G_LEN    1
0342 #define MMC_TISR_TX64OCTETS_GB_POS      4
0343 #define MMC_TISR_TX64OCTETS_GB_LEN      1
0344 #define MMC_TISR_TX65TO127OCTETS_GB_POS     5
0345 #define MMC_TISR_TX65TO127OCTETS_GB_LEN     1
0346 #define MMC_TISR_TX128TO255OCTETS_GB_POS    6
0347 #define MMC_TISR_TX128TO255OCTETS_GB_LEN    1
0348 #define MMC_TISR_TX256TO511OCTETS_GB_POS    7
0349 #define MMC_TISR_TX256TO511OCTETS_GB_LEN    1
0350 #define MMC_TISR_TX512TO1023OCTETS_GB_POS   8
0351 #define MMC_TISR_TX512TO1023OCTETS_GB_LEN   1
0352 #define MMC_TISR_TX1024TOMAXOCTETS_GB_POS   9
0353 #define MMC_TISR_TX1024TOMAXOCTETS_GB_LEN   1
0354 #define MMC_TISR_TXUNICASTFRAMES_GB_POS     10
0355 #define MMC_TISR_TXUNICASTFRAMES_GB_LEN     1
0356 #define MMC_TISR_TXMULTICASTFRAMES_GB_POS   11
0357 #define MMC_TISR_TXMULTICASTFRAMES_GB_LEN   1
0358 #define MMC_TISR_TXBROADCASTFRAMES_GB_POS   12
0359 #define MMC_TISR_TXBROADCASTFRAMES_GB_LEN   1
0360 #define MMC_TISR_TXUNDERFLOWERROR_POS       13
0361 #define MMC_TISR_TXUNDERFLOWERROR_LEN       1
0362 #define MMC_TISR_TXOCTETCOUNT_G_POS     14
0363 #define MMC_TISR_TXOCTETCOUNT_G_LEN     1
0364 #define MMC_TISR_TXFRAMECOUNT_G_POS     15
0365 #define MMC_TISR_TXFRAMECOUNT_G_LEN     1
0366 #define MMC_TISR_TXPAUSEFRAMES_POS      16
0367 #define MMC_TISR_TXPAUSEFRAMES_LEN      1
0368 #define MMC_TISR_TXVLANFRAMES_G_POS     17
0369 #define MMC_TISR_TXVLANFRAMES_G_LEN     1
0370 
0371 /* MTL register offsets */
0372 #define MTL_OMR             0x1000
0373 #define MTL_FDDR            0x1010
0374 #define MTL_RQDCM0R         0x1030
0375 
0376 #define MTL_RQDCM_INC           4
0377 #define MTL_RQDCM_Q_PER_REG     4
0378 
0379 /* MTL register entry bit positions and sizes */
0380 #define MTL_OMR_ETSALG_POS      5
0381 #define MTL_OMR_ETSALG_LEN      2
0382 #define MTL_OMR_RAA_POS         2
0383 #define MTL_OMR_RAA_LEN         1
0384 
0385 /* MTL queue register offsets
0386  *   Multiple queues can be active.  The first queue has registers
0387  *   that begin at 0x1100.  Each subsequent queue has registers that
0388  *   are accessed using an offset of 0x80 from the previous queue.
0389  */
0390 #define MTL_Q_BASE          0x1100
0391 #define MTL_Q_INC           0x80
0392 
0393 #define MTL_Q_TQOMR         0x00
0394 #define MTL_Q_RQOMR         0x40
0395 #define MTL_Q_RQDR          0x48
0396 #define MTL_Q_RQFCR         0x50
0397 #define MTL_Q_IER           0x70
0398 #define MTL_Q_ISR           0x74
0399 
0400 /* MTL queue register entry bit positions and sizes */
0401 #define MTL_Q_RQDR_PRXQ_POS     16
0402 #define MTL_Q_RQDR_PRXQ_LEN     14
0403 #define MTL_Q_RQDR_RXQSTS_POS       4
0404 #define MTL_Q_RQDR_RXQSTS_LEN       2
0405 #define MTL_Q_RQFCR_RFA_POS     1
0406 #define MTL_Q_RQFCR_RFA_LEN     6
0407 #define MTL_Q_RQFCR_RFD_POS     17
0408 #define MTL_Q_RQFCR_RFD_LEN     6
0409 #define MTL_Q_RQOMR_EHFC_POS        7
0410 #define MTL_Q_RQOMR_EHFC_LEN        1
0411 #define MTL_Q_RQOMR_RQS_POS     16
0412 #define MTL_Q_RQOMR_RQS_LEN     9
0413 #define MTL_Q_RQOMR_RSF_POS     5
0414 #define MTL_Q_RQOMR_RSF_LEN     1
0415 #define MTL_Q_RQOMR_FEP_POS     4
0416 #define MTL_Q_RQOMR_FEP_LEN     1
0417 #define MTL_Q_RQOMR_FUP_POS     3
0418 #define MTL_Q_RQOMR_FUP_LEN     1
0419 #define MTL_Q_RQOMR_RTC_POS     0
0420 #define MTL_Q_RQOMR_RTC_LEN     2
0421 #define MTL_Q_TQOMR_FTQ_POS     0
0422 #define MTL_Q_TQOMR_FTQ_LEN     1
0423 #define MTL_Q_TQOMR_Q2TCMAP_POS     8
0424 #define MTL_Q_TQOMR_Q2TCMAP_LEN     3
0425 #define MTL_Q_TQOMR_TQS_POS     16
0426 #define MTL_Q_TQOMR_TQS_LEN     10
0427 #define MTL_Q_TQOMR_TSF_POS     1
0428 #define MTL_Q_TQOMR_TSF_LEN     1
0429 #define MTL_Q_TQOMR_TTC_POS     4
0430 #define MTL_Q_TQOMR_TTC_LEN     3
0431 #define MTL_Q_TQOMR_TXQEN_POS       2
0432 #define MTL_Q_TQOMR_TXQEN_LEN       2
0433 
0434 /* MTL queue register value */
0435 #define MTL_RSF_DISABLE         0x00
0436 #define MTL_RSF_ENABLE          0x01
0437 #define MTL_TSF_DISABLE         0x00
0438 #define MTL_TSF_ENABLE          0x01
0439 
0440 #define MTL_RX_THRESHOLD_64     0x00
0441 #define MTL_RX_THRESHOLD_96     0x02
0442 #define MTL_RX_THRESHOLD_128        0x03
0443 #define MTL_TX_THRESHOLD_64     0x00
0444 #define MTL_TX_THRESHOLD_96     0x02
0445 #define MTL_TX_THRESHOLD_128        0x03
0446 #define MTL_TX_THRESHOLD_192        0x04
0447 #define MTL_TX_THRESHOLD_256        0x05
0448 #define MTL_TX_THRESHOLD_384        0x06
0449 #define MTL_TX_THRESHOLD_512        0x07
0450 
0451 #define MTL_ETSALG_WRR          0x00
0452 #define MTL_ETSALG_WFQ          0x01
0453 #define MTL_ETSALG_DWRR         0x02
0454 #define MTL_RAA_SP          0x00
0455 #define MTL_RAA_WSP         0x01
0456 
0457 #define MTL_Q_DISABLED          0x00
0458 #define MTL_Q_ENABLED           0x02
0459 
0460 #define MTL_RQDCM0R_Q0MDMACH        0x0
0461 #define MTL_RQDCM0R_Q1MDMACH        0x00000100
0462 #define MTL_RQDCM0R_Q2MDMACH        0x00020000
0463 #define MTL_RQDCM0R_Q3MDMACH        0x03000000
0464 #define MTL_RQDCM1R_Q4MDMACH        0x00000004
0465 #define MTL_RQDCM1R_Q5MDMACH        0x00000500
0466 #define MTL_RQDCM1R_Q6MDMACH        0x00060000
0467 #define MTL_RQDCM1R_Q7MDMACH        0x07000000
0468 #define MTL_RQDCM2R_Q8MDMACH        0x00000008
0469 #define MTL_RQDCM2R_Q9MDMACH        0x00000900
0470 #define MTL_RQDCM2R_Q10MDMACH       0x000A0000
0471 #define MTL_RQDCM2R_Q11MDMACH       0x0B000000
0472 
0473 /* MTL traffic class register offsets
0474  *   Multiple traffic classes can be active.  The first class has registers
0475  *   that begin at 0x1100.  Each subsequent queue has registers that
0476  *   are accessed using an offset of 0x80 from the previous queue.
0477  */
0478 #define MTL_TC_BASE         MTL_Q_BASE
0479 #define MTL_TC_INC          MTL_Q_INC
0480 
0481 #define MTL_TC_ETSCR            0x10
0482 #define MTL_TC_ETSSR            0x14
0483 #define MTL_TC_QWR          0x18
0484 
0485 /* MTL traffic class register entry bit positions and sizes */
0486 #define MTL_TC_ETSCR_TSA_POS        0
0487 #define MTL_TC_ETSCR_TSA_LEN        2
0488 #define MTL_TC_QWR_QW_POS       0
0489 #define MTL_TC_QWR_QW_LEN       21
0490 
0491 /* MTL traffic class register value */
0492 #define MTL_TSA_SP          0x00
0493 #define MTL_TSA_ETS         0x02
0494 
0495 /* DMA register offsets */
0496 #define DMA_MR              0x3000
0497 #define DMA_SBMR            0x3004
0498 #define DMA_ISR             0x3008
0499 #define DMA_DSR0            0x3020
0500 #define DMA_DSR1            0x3024
0501 
0502 /* DMA register entry bit positions and sizes */
0503 #define DMA_ISR_MACIS_POS       17
0504 #define DMA_ISR_MACIS_LEN       1
0505 #define DMA_ISR_MTLIS_POS       16
0506 #define DMA_ISR_MTLIS_LEN       1
0507 #define DMA_MR_SWR_POS          0
0508 #define DMA_MR_SWR_LEN          1
0509 #define DMA_SBMR_EAME_POS       11
0510 #define DMA_SBMR_EAME_LEN       1
0511 #define DMA_SBMR_BLEN_64_POS        5
0512 #define DMA_SBMR_BLEN_64_LEN        1
0513 #define DMA_SBMR_BLEN_128_POS       6
0514 #define DMA_SBMR_BLEN_128_LEN       1
0515 #define DMA_SBMR_BLEN_256_POS       7
0516 #define DMA_SBMR_BLEN_256_LEN       1
0517 #define DMA_SBMR_UNDEF_POS      0
0518 #define DMA_SBMR_UNDEF_LEN      1
0519 
0520 /* DMA register values */
0521 #define DMA_DSR_RPS_LEN         4
0522 #define DMA_DSR_TPS_LEN         4
0523 #define DMA_DSR_Q_LEN           (DMA_DSR_RPS_LEN + DMA_DSR_TPS_LEN)
0524 #define DMA_DSR0_TPS_START      12
0525 #define DMA_DSRX_FIRST_QUEUE        3
0526 #define DMA_DSRX_INC            4
0527 #define DMA_DSRX_QPR            4
0528 #define DMA_DSRX_TPS_START      4
0529 #define DMA_TPS_STOPPED         0x00
0530 #define DMA_TPS_SUSPENDED       0x06
0531 
0532 /* DMA channel register offsets
0533  *   Multiple channels can be active.  The first channel has registers
0534  *   that begin at 0x3100.  Each subsequent channel has registers that
0535  *   are accessed using an offset of 0x80 from the previous channel.
0536  */
0537 #define DMA_CH_BASE         0x3100
0538 #define DMA_CH_INC          0x80
0539 
0540 #define DMA_CH_CR           0x00
0541 #define DMA_CH_TCR          0x04
0542 #define DMA_CH_RCR          0x08
0543 #define DMA_CH_TDLR_HI          0x10
0544 #define DMA_CH_TDLR_LO          0x14
0545 #define DMA_CH_RDLR_HI          0x18
0546 #define DMA_CH_RDLR_LO          0x1c
0547 #define DMA_CH_TDTR_LO          0x24
0548 #define DMA_CH_RDTR_LO          0x2c
0549 #define DMA_CH_TDRLR            0x30
0550 #define DMA_CH_RDRLR            0x34
0551 #define DMA_CH_IER          0x38
0552 #define DMA_CH_RIWT         0x3c
0553 #define DMA_CH_SR           0x60
0554 
0555 /* DMA channel register entry bit positions and sizes */
0556 #define DMA_CH_CR_PBLX8_POS     16
0557 #define DMA_CH_CR_PBLX8_LEN     1
0558 #define DMA_CH_CR_SPH_POS       24
0559 #define DMA_CH_CR_SPH_LEN       1
0560 #define DMA_CH_IER_AIE_POS      15
0561 #define DMA_CH_IER_AIE_LEN      1
0562 #define DMA_CH_IER_FBEE_POS     12
0563 #define DMA_CH_IER_FBEE_LEN     1
0564 #define DMA_CH_IER_NIE_POS      16
0565 #define DMA_CH_IER_NIE_LEN      1
0566 #define DMA_CH_IER_RBUE_POS     7
0567 #define DMA_CH_IER_RBUE_LEN     1
0568 #define DMA_CH_IER_RIE_POS      6
0569 #define DMA_CH_IER_RIE_LEN      1
0570 #define DMA_CH_IER_RSE_POS      8
0571 #define DMA_CH_IER_RSE_LEN      1
0572 #define DMA_CH_IER_TBUE_POS     2
0573 #define DMA_CH_IER_TBUE_LEN     1
0574 #define DMA_CH_IER_TIE_POS      0
0575 #define DMA_CH_IER_TIE_LEN      1
0576 #define DMA_CH_IER_TXSE_POS     1
0577 #define DMA_CH_IER_TXSE_LEN     1
0578 #define DMA_CH_RCR_PBL_POS      16
0579 #define DMA_CH_RCR_PBL_LEN      6
0580 #define DMA_CH_RCR_RBSZ_POS     1
0581 #define DMA_CH_RCR_RBSZ_LEN     14
0582 #define DMA_CH_RCR_SR_POS       0
0583 #define DMA_CH_RCR_SR_LEN       1
0584 #define DMA_CH_RIWT_RWT_POS     0
0585 #define DMA_CH_RIWT_RWT_LEN     8
0586 #define DMA_CH_SR_FBE_POS       12
0587 #define DMA_CH_SR_FBE_LEN       1
0588 #define DMA_CH_SR_RBU_POS       7
0589 #define DMA_CH_SR_RBU_LEN       1
0590 #define DMA_CH_SR_RI_POS        6
0591 #define DMA_CH_SR_RI_LEN        1
0592 #define DMA_CH_SR_RPS_POS       8
0593 #define DMA_CH_SR_RPS_LEN       1
0594 #define DMA_CH_SR_TBU_POS       2
0595 #define DMA_CH_SR_TBU_LEN       1
0596 #define DMA_CH_SR_TI_POS        0
0597 #define DMA_CH_SR_TI_LEN        1
0598 #define DMA_CH_SR_TPS_POS       1
0599 #define DMA_CH_SR_TPS_LEN       1
0600 #define DMA_CH_TCR_OSP_POS      4
0601 #define DMA_CH_TCR_OSP_LEN      1
0602 #define DMA_CH_TCR_PBL_POS      16
0603 #define DMA_CH_TCR_PBL_LEN      6
0604 #define DMA_CH_TCR_ST_POS       0
0605 #define DMA_CH_TCR_ST_LEN       1
0606 #define DMA_CH_TCR_TSE_POS      12
0607 #define DMA_CH_TCR_TSE_LEN      1
0608 
0609 /* DMA channel register values */
0610 #define DMA_OSP_DISABLE         0x00
0611 #define DMA_OSP_ENABLE          0x01
0612 #define DMA_PBL_1           1
0613 #define DMA_PBL_2           2
0614 #define DMA_PBL_4           4
0615 #define DMA_PBL_8           8
0616 #define DMA_PBL_16          16
0617 #define DMA_PBL_32          32
0618 #define DMA_PBL_64          64
0619 #define DMA_PBL_128         128
0620 #define DMA_PBL_256         256
0621 #define DMA_PBL_X8_DISABLE      0x00
0622 #define DMA_PBL_X8_ENABLE       0x01
0623 
0624 /* Descriptor/Packet entry bit positions and sizes */
0625 #define RX_PACKET_ERRORS_CRC_POS        2
0626 #define RX_PACKET_ERRORS_CRC_LEN        1
0627 #define RX_PACKET_ERRORS_FRAME_POS      3
0628 #define RX_PACKET_ERRORS_FRAME_LEN      1
0629 #define RX_PACKET_ERRORS_LENGTH_POS     0
0630 #define RX_PACKET_ERRORS_LENGTH_LEN     1
0631 #define RX_PACKET_ERRORS_OVERRUN_POS        1
0632 #define RX_PACKET_ERRORS_OVERRUN_LEN        1
0633 
0634 #define RX_PACKET_ATTRIBUTES_CSUM_DONE_POS  0
0635 #define RX_PACKET_ATTRIBUTES_CSUM_DONE_LEN  1
0636 #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_POS  1
0637 #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN  1
0638 #define RX_PACKET_ATTRIBUTES_INCOMPLETE_POS 2
0639 #define RX_PACKET_ATTRIBUTES_INCOMPLETE_LEN 1
0640 #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_POS   3
0641 #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_LEN   1
0642 #define RX_PACKET_ATTRIBUTES_CONTEXT_POS    4
0643 #define RX_PACKET_ATTRIBUTES_CONTEXT_LEN    1
0644 #define RX_PACKET_ATTRIBUTES_RX_TSTAMP_POS  5
0645 #define RX_PACKET_ATTRIBUTES_RX_TSTAMP_LEN  1
0646 #define RX_PACKET_ATTRIBUTES_RSS_HASH_POS   6
0647 #define RX_PACKET_ATTRIBUTES_RSS_HASH_LEN   1
0648 
0649 #define RX_NORMAL_DESC0_OVT_POS         0
0650 #define RX_NORMAL_DESC0_OVT_LEN         16
0651 #define RX_NORMAL_DESC2_HL_POS          0
0652 #define RX_NORMAL_DESC2_HL_LEN          10
0653 #define RX_NORMAL_DESC3_CDA_POS         27
0654 #define RX_NORMAL_DESC3_CDA_LEN         1
0655 #define RX_NORMAL_DESC3_CTXT_POS        30
0656 #define RX_NORMAL_DESC3_CTXT_LEN        1
0657 #define RX_NORMAL_DESC3_ES_POS          15
0658 #define RX_NORMAL_DESC3_ES_LEN          1
0659 #define RX_NORMAL_DESC3_ETLT_POS        16
0660 #define RX_NORMAL_DESC3_ETLT_LEN        4
0661 #define RX_NORMAL_DESC3_FD_POS          29
0662 #define RX_NORMAL_DESC3_FD_LEN          1
0663 #define RX_NORMAL_DESC3_INTE_POS        30
0664 #define RX_NORMAL_DESC3_INTE_LEN        1
0665 #define RX_NORMAL_DESC3_L34T_POS        20
0666 #define RX_NORMAL_DESC3_L34T_LEN        4
0667 #define RX_NORMAL_DESC3_LD_POS          28
0668 #define RX_NORMAL_DESC3_LD_LEN          1
0669 #define RX_NORMAL_DESC3_OWN_POS         31
0670 #define RX_NORMAL_DESC3_OWN_LEN         1
0671 #define RX_NORMAL_DESC3_PL_POS          0
0672 #define RX_NORMAL_DESC3_PL_LEN          14
0673 #define RX_NORMAL_DESC3_RSV_POS         26
0674 #define RX_NORMAL_DESC3_RSV_LEN         1
0675 
0676 #define RX_DESC3_L34T_IPV4_TCP          1
0677 #define RX_DESC3_L34T_IPV4_UDP          2
0678 #define RX_DESC3_L34T_IPV4_ICMP         3
0679 #define RX_DESC3_L34T_IPV6_TCP          9
0680 #define RX_DESC3_L34T_IPV6_UDP          10
0681 #define RX_DESC3_L34T_IPV6_ICMP         11
0682 
0683 #define RX_CONTEXT_DESC3_TSA_POS        4
0684 #define RX_CONTEXT_DESC3_TSA_LEN        1
0685 #define RX_CONTEXT_DESC3_TSD_POS        6
0686 #define RX_CONTEXT_DESC3_TSD_LEN        1
0687 
0688 #define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_POS    0
0689 #define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_LEN    1
0690 #define TX_PACKET_ATTRIBUTES_TSO_ENABLE_POS 1
0691 #define TX_PACKET_ATTRIBUTES_TSO_ENABLE_LEN 1
0692 #define TX_PACKET_ATTRIBUTES_VLAN_CTAG_POS  2
0693 #define TX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN  1
0694 #define TX_PACKET_ATTRIBUTES_PTP_POS        3
0695 #define TX_PACKET_ATTRIBUTES_PTP_LEN        1
0696 
0697 #define TX_CONTEXT_DESC2_MSS_POS        0
0698 #define TX_CONTEXT_DESC2_MSS_LEN        15
0699 #define TX_CONTEXT_DESC3_CTXT_POS       30
0700 #define TX_CONTEXT_DESC3_CTXT_LEN       1
0701 #define TX_CONTEXT_DESC3_TCMSSV_POS     26
0702 #define TX_CONTEXT_DESC3_TCMSSV_LEN     1
0703 #define TX_CONTEXT_DESC3_VLTV_POS       16
0704 #define TX_CONTEXT_DESC3_VLTV_LEN       1
0705 #define TX_CONTEXT_DESC3_VT_POS         0
0706 #define TX_CONTEXT_DESC3_VT_LEN         16
0707 
0708 #define TX_NORMAL_DESC2_HL_B1L_POS      0
0709 #define TX_NORMAL_DESC2_HL_B1L_LEN      14
0710 #define TX_NORMAL_DESC2_IC_POS          31
0711 #define TX_NORMAL_DESC2_IC_LEN          1
0712 #define TX_NORMAL_DESC2_TTSE_POS        30
0713 #define TX_NORMAL_DESC2_TTSE_LEN        1
0714 #define TX_NORMAL_DESC2_VTIR_POS        14
0715 #define TX_NORMAL_DESC2_VTIR_LEN        2
0716 #define TX_NORMAL_DESC3_CIC_POS         16
0717 #define TX_NORMAL_DESC3_CIC_LEN         2
0718 #define TX_NORMAL_DESC3_CPC_POS         26
0719 #define TX_NORMAL_DESC3_CPC_LEN         2
0720 #define TX_NORMAL_DESC3_CTXT_POS        30
0721 #define TX_NORMAL_DESC3_CTXT_LEN        1
0722 #define TX_NORMAL_DESC3_FD_POS          29
0723 #define TX_NORMAL_DESC3_FD_LEN          1
0724 #define TX_NORMAL_DESC3_FL_POS          0
0725 #define TX_NORMAL_DESC3_FL_LEN          15
0726 #define TX_NORMAL_DESC3_LD_POS          28
0727 #define TX_NORMAL_DESC3_LD_LEN          1
0728 #define TX_NORMAL_DESC3_OWN_POS         31
0729 #define TX_NORMAL_DESC3_OWN_LEN         1
0730 #define TX_NORMAL_DESC3_TCPHDRLEN_POS       19
0731 #define TX_NORMAL_DESC3_TCPHDRLEN_LEN       4
0732 #define TX_NORMAL_DESC3_TCPPL_POS       0
0733 #define TX_NORMAL_DESC3_TCPPL_LEN       18
0734 #define TX_NORMAL_DESC3_TSE_POS         18
0735 #define TX_NORMAL_DESC3_TSE_LEN         1
0736 
0737 #define TX_NORMAL_DESC2_VLAN_INSERT     0x2
0738 
0739 #define XLGMAC_MTL_REG(pdata, n, reg)                   \
0740     ((pdata)->mac_regs + MTL_Q_BASE + ((n) * MTL_Q_INC) + (reg))
0741 
0742 #define XLGMAC_DMA_REG(channel, reg)    ((channel)->dma_regs + (reg))
0743 
0744 #endif /* __DWC_XLGMAC_REG_H__ */