18c2ecf20Sopenharmony_ci/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver 28c2ecf20Sopenharmony_ci * 38c2ecf20Sopenharmony_ci * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com) 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * This program is dual-licensed; you may select either version 2 of 68c2ecf20Sopenharmony_ci * the GNU General Public License ("GPL") or BSD license ("BSD"). 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * This Synopsys DWC XLGMAC software driver and associated documentation 98c2ecf20Sopenharmony_ci * (hereinafter the "Software") is an unsupported proprietary work of 108c2ecf20Sopenharmony_ci * Synopsys, Inc. unless otherwise expressly agreed to in writing between 118c2ecf20Sopenharmony_ci * Synopsys and you. The Software IS NOT an item of Licensed Software or a 128c2ecf20Sopenharmony_ci * Licensed Product under any End User Software License Agreement or 138c2ecf20Sopenharmony_ci * Agreement for Licensed Products with Synopsys or any supplement thereto. 148c2ecf20Sopenharmony_ci * Synopsys is a registered trademark of Synopsys, Inc. Other names included 158c2ecf20Sopenharmony_ci * in the SOFTWARE may be the trademarks of their respective owners. 168c2ecf20Sopenharmony_ci */ 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#ifndef __DWC_XLGMAC_REG_H__ 198c2ecf20Sopenharmony_ci#define __DWC_XLGMAC_REG_H__ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* MAC register offsets */ 228c2ecf20Sopenharmony_ci#define MAC_TCR 0x0000 238c2ecf20Sopenharmony_ci#define MAC_RCR 0x0004 248c2ecf20Sopenharmony_ci#define MAC_PFR 0x0008 258c2ecf20Sopenharmony_ci#define MAC_HTR0 0x0010 268c2ecf20Sopenharmony_ci#define MAC_VLANTR 0x0050 278c2ecf20Sopenharmony_ci#define MAC_VLANHTR 0x0058 288c2ecf20Sopenharmony_ci#define MAC_VLANIR 0x0060 298c2ecf20Sopenharmony_ci#define MAC_Q0TFCR 0x0070 308c2ecf20Sopenharmony_ci#define MAC_RFCR 0x0090 318c2ecf20Sopenharmony_ci#define MAC_RQC0R 0x00a0 328c2ecf20Sopenharmony_ci#define MAC_RQC1R 0x00a4 338c2ecf20Sopenharmony_ci#define MAC_RQC2R 0x00a8 348c2ecf20Sopenharmony_ci#define MAC_RQC3R 0x00ac 358c2ecf20Sopenharmony_ci#define MAC_ISR 0x00b0 368c2ecf20Sopenharmony_ci#define MAC_IER 0x00b4 378c2ecf20Sopenharmony_ci#define MAC_VR 0x0110 388c2ecf20Sopenharmony_ci#define MAC_HWF0R 0x011c 398c2ecf20Sopenharmony_ci#define MAC_HWF1R 0x0120 408c2ecf20Sopenharmony_ci#define MAC_HWF2R 0x0124 418c2ecf20Sopenharmony_ci#define MAC_MACA0HR 0x0300 428c2ecf20Sopenharmony_ci#define MAC_MACA0LR 0x0304 438c2ecf20Sopenharmony_ci#define MAC_MACA1HR 0x0308 448c2ecf20Sopenharmony_ci#define MAC_MACA1LR 0x030c 458c2ecf20Sopenharmony_ci#define MAC_RSSCR 0x0c80 468c2ecf20Sopenharmony_ci#define MAC_RSSAR 0x0c88 478c2ecf20Sopenharmony_ci#define MAC_RSSDR 0x0c8c 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define MAC_QTFCR_INC 4 508c2ecf20Sopenharmony_ci#define MAC_MACA_INC 4 518c2ecf20Sopenharmony_ci#define MAC_HTR_INC 4 528c2ecf20Sopenharmony_ci#define MAC_RQC2_INC 4 538c2ecf20Sopenharmony_ci#define MAC_RQC2_Q_PER_REG 4 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci/* MAC register entry bit positions and sizes */ 568c2ecf20Sopenharmony_ci#define MAC_HWF0R_ADDMACADRSEL_POS 18 578c2ecf20Sopenharmony_ci#define MAC_HWF0R_ADDMACADRSEL_LEN 5 588c2ecf20Sopenharmony_ci#define MAC_HWF0R_ARPOFFSEL_POS 9 598c2ecf20Sopenharmony_ci#define MAC_HWF0R_ARPOFFSEL_LEN 1 608c2ecf20Sopenharmony_ci#define MAC_HWF0R_EEESEL_POS 13 618c2ecf20Sopenharmony_ci#define MAC_HWF0R_EEESEL_LEN 1 628c2ecf20Sopenharmony_ci#define MAC_HWF0R_PHYIFSEL_POS 1 638c2ecf20Sopenharmony_ci#define MAC_HWF0R_PHYIFSEL_LEN 2 648c2ecf20Sopenharmony_ci#define MAC_HWF0R_MGKSEL_POS 7 658c2ecf20Sopenharmony_ci#define MAC_HWF0R_MGKSEL_LEN 1 668c2ecf20Sopenharmony_ci#define MAC_HWF0R_MMCSEL_POS 8 678c2ecf20Sopenharmony_ci#define MAC_HWF0R_MMCSEL_LEN 1 688c2ecf20Sopenharmony_ci#define MAC_HWF0R_RWKSEL_POS 6 698c2ecf20Sopenharmony_ci#define MAC_HWF0R_RWKSEL_LEN 1 708c2ecf20Sopenharmony_ci#define MAC_HWF0R_RXCOESEL_POS 16 718c2ecf20Sopenharmony_ci#define MAC_HWF0R_RXCOESEL_LEN 1 728c2ecf20Sopenharmony_ci#define MAC_HWF0R_SAVLANINS_POS 27 738c2ecf20Sopenharmony_ci#define MAC_HWF0R_SAVLANINS_LEN 1 748c2ecf20Sopenharmony_ci#define MAC_HWF0R_SMASEL_POS 5 758c2ecf20Sopenharmony_ci#define MAC_HWF0R_SMASEL_LEN 1 768c2ecf20Sopenharmony_ci#define MAC_HWF0R_TSSEL_POS 12 778c2ecf20Sopenharmony_ci#define MAC_HWF0R_TSSEL_LEN 1 788c2ecf20Sopenharmony_ci#define MAC_HWF0R_TSSTSSEL_POS 25 798c2ecf20Sopenharmony_ci#define MAC_HWF0R_TSSTSSEL_LEN 2 808c2ecf20Sopenharmony_ci#define MAC_HWF0R_TXCOESEL_POS 14 818c2ecf20Sopenharmony_ci#define MAC_HWF0R_TXCOESEL_LEN 1 828c2ecf20Sopenharmony_ci#define MAC_HWF0R_VLHASH_POS 4 838c2ecf20Sopenharmony_ci#define MAC_HWF0R_VLHASH_LEN 1 848c2ecf20Sopenharmony_ci#define MAC_HWF1R_ADDR64_POS 14 858c2ecf20Sopenharmony_ci#define MAC_HWF1R_ADDR64_LEN 2 868c2ecf20Sopenharmony_ci#define MAC_HWF1R_ADVTHWORD_POS 13 878c2ecf20Sopenharmony_ci#define MAC_HWF1R_ADVTHWORD_LEN 1 888c2ecf20Sopenharmony_ci#define MAC_HWF1R_DBGMEMA_POS 19 898c2ecf20Sopenharmony_ci#define MAC_HWF1R_DBGMEMA_LEN 1 908c2ecf20Sopenharmony_ci#define MAC_HWF1R_DCBEN_POS 16 918c2ecf20Sopenharmony_ci#define MAC_HWF1R_DCBEN_LEN 1 928c2ecf20Sopenharmony_ci#define MAC_HWF1R_HASHTBLSZ_POS 24 938c2ecf20Sopenharmony_ci#define MAC_HWF1R_HASHTBLSZ_LEN 3 948c2ecf20Sopenharmony_ci#define MAC_HWF1R_L3L4FNUM_POS 27 958c2ecf20Sopenharmony_ci#define MAC_HWF1R_L3L4FNUM_LEN 4 968c2ecf20Sopenharmony_ci#define MAC_HWF1R_NUMTC_POS 21 978c2ecf20Sopenharmony_ci#define MAC_HWF1R_NUMTC_LEN 3 988c2ecf20Sopenharmony_ci#define MAC_HWF1R_RSSEN_POS 20 998c2ecf20Sopenharmony_ci#define MAC_HWF1R_RSSEN_LEN 1 1008c2ecf20Sopenharmony_ci#define MAC_HWF1R_RXFIFOSIZE_POS 0 1018c2ecf20Sopenharmony_ci#define MAC_HWF1R_RXFIFOSIZE_LEN 5 1028c2ecf20Sopenharmony_ci#define MAC_HWF1R_SPHEN_POS 17 1038c2ecf20Sopenharmony_ci#define MAC_HWF1R_SPHEN_LEN 1 1048c2ecf20Sopenharmony_ci#define MAC_HWF1R_TSOEN_POS 18 1058c2ecf20Sopenharmony_ci#define MAC_HWF1R_TSOEN_LEN 1 1068c2ecf20Sopenharmony_ci#define MAC_HWF1R_TXFIFOSIZE_POS 6 1078c2ecf20Sopenharmony_ci#define MAC_HWF1R_TXFIFOSIZE_LEN 5 1088c2ecf20Sopenharmony_ci#define MAC_HWF2R_AUXSNAPNUM_POS 28 1098c2ecf20Sopenharmony_ci#define MAC_HWF2R_AUXSNAPNUM_LEN 3 1108c2ecf20Sopenharmony_ci#define MAC_HWF2R_PPSOUTNUM_POS 24 1118c2ecf20Sopenharmony_ci#define MAC_HWF2R_PPSOUTNUM_LEN 3 1128c2ecf20Sopenharmony_ci#define MAC_HWF2R_RXCHCNT_POS 12 1138c2ecf20Sopenharmony_ci#define MAC_HWF2R_RXCHCNT_LEN 4 1148c2ecf20Sopenharmony_ci#define MAC_HWF2R_RXQCNT_POS 0 1158c2ecf20Sopenharmony_ci#define MAC_HWF2R_RXQCNT_LEN 4 1168c2ecf20Sopenharmony_ci#define MAC_HWF2R_TXCHCNT_POS 18 1178c2ecf20Sopenharmony_ci#define MAC_HWF2R_TXCHCNT_LEN 4 1188c2ecf20Sopenharmony_ci#define MAC_HWF2R_TXQCNT_POS 6 1198c2ecf20Sopenharmony_ci#define MAC_HWF2R_TXQCNT_LEN 4 1208c2ecf20Sopenharmony_ci#define MAC_IER_TSIE_POS 12 1218c2ecf20Sopenharmony_ci#define MAC_IER_TSIE_LEN 1 1228c2ecf20Sopenharmony_ci#define MAC_ISR_MMCRXIS_POS 9 1238c2ecf20Sopenharmony_ci#define MAC_ISR_MMCRXIS_LEN 1 1248c2ecf20Sopenharmony_ci#define MAC_ISR_MMCTXIS_POS 10 1258c2ecf20Sopenharmony_ci#define MAC_ISR_MMCTXIS_LEN 1 1268c2ecf20Sopenharmony_ci#define MAC_ISR_PMTIS_POS 4 1278c2ecf20Sopenharmony_ci#define MAC_ISR_PMTIS_LEN 1 1288c2ecf20Sopenharmony_ci#define MAC_ISR_TSIS_POS 12 1298c2ecf20Sopenharmony_ci#define MAC_ISR_TSIS_LEN 1 1308c2ecf20Sopenharmony_ci#define MAC_MACA1HR_AE_POS 31 1318c2ecf20Sopenharmony_ci#define MAC_MACA1HR_AE_LEN 1 1328c2ecf20Sopenharmony_ci#define MAC_PFR_HMC_POS 2 1338c2ecf20Sopenharmony_ci#define MAC_PFR_HMC_LEN 1 1348c2ecf20Sopenharmony_ci#define MAC_PFR_HPF_POS 10 1358c2ecf20Sopenharmony_ci#define MAC_PFR_HPF_LEN 1 1368c2ecf20Sopenharmony_ci#define MAC_PFR_HUC_POS 1 1378c2ecf20Sopenharmony_ci#define MAC_PFR_HUC_LEN 1 1388c2ecf20Sopenharmony_ci#define MAC_PFR_PM_POS 4 1398c2ecf20Sopenharmony_ci#define MAC_PFR_PM_LEN 1 1408c2ecf20Sopenharmony_ci#define MAC_PFR_PR_POS 0 1418c2ecf20Sopenharmony_ci#define MAC_PFR_PR_LEN 1 1428c2ecf20Sopenharmony_ci#define MAC_PFR_VTFE_POS 16 1438c2ecf20Sopenharmony_ci#define MAC_PFR_VTFE_LEN 1 1448c2ecf20Sopenharmony_ci#define MAC_Q0TFCR_PT_POS 16 1458c2ecf20Sopenharmony_ci#define MAC_Q0TFCR_PT_LEN 16 1468c2ecf20Sopenharmony_ci#define MAC_Q0TFCR_TFE_POS 1 1478c2ecf20Sopenharmony_ci#define MAC_Q0TFCR_TFE_LEN 1 1488c2ecf20Sopenharmony_ci#define MAC_RCR_ACS_POS 1 1498c2ecf20Sopenharmony_ci#define MAC_RCR_ACS_LEN 1 1508c2ecf20Sopenharmony_ci#define MAC_RCR_CST_POS 2 1518c2ecf20Sopenharmony_ci#define MAC_RCR_CST_LEN 1 1528c2ecf20Sopenharmony_ci#define MAC_RCR_DCRCC_POS 3 1538c2ecf20Sopenharmony_ci#define MAC_RCR_DCRCC_LEN 1 1548c2ecf20Sopenharmony_ci#define MAC_RCR_HDSMS_POS 12 1558c2ecf20Sopenharmony_ci#define MAC_RCR_HDSMS_LEN 3 1568c2ecf20Sopenharmony_ci#define MAC_RCR_IPC_POS 9 1578c2ecf20Sopenharmony_ci#define MAC_RCR_IPC_LEN 1 1588c2ecf20Sopenharmony_ci#define MAC_RCR_JE_POS 8 1598c2ecf20Sopenharmony_ci#define MAC_RCR_JE_LEN 1 1608c2ecf20Sopenharmony_ci#define MAC_RCR_LM_POS 10 1618c2ecf20Sopenharmony_ci#define MAC_RCR_LM_LEN 1 1628c2ecf20Sopenharmony_ci#define MAC_RCR_RE_POS 0 1638c2ecf20Sopenharmony_ci#define MAC_RCR_RE_LEN 1 1648c2ecf20Sopenharmony_ci#define MAC_RFCR_PFCE_POS 8 1658c2ecf20Sopenharmony_ci#define MAC_RFCR_PFCE_LEN 1 1668c2ecf20Sopenharmony_ci#define MAC_RFCR_RFE_POS 0 1678c2ecf20Sopenharmony_ci#define MAC_RFCR_RFE_LEN 1 1688c2ecf20Sopenharmony_ci#define MAC_RFCR_UP_POS 1 1698c2ecf20Sopenharmony_ci#define MAC_RFCR_UP_LEN 1 1708c2ecf20Sopenharmony_ci#define MAC_RQC0R_RXQ0EN_POS 0 1718c2ecf20Sopenharmony_ci#define MAC_RQC0R_RXQ0EN_LEN 2 1728c2ecf20Sopenharmony_ci#define MAC_RSSAR_ADDRT_POS 2 1738c2ecf20Sopenharmony_ci#define MAC_RSSAR_ADDRT_LEN 1 1748c2ecf20Sopenharmony_ci#define MAC_RSSAR_CT_POS 1 1758c2ecf20Sopenharmony_ci#define MAC_RSSAR_CT_LEN 1 1768c2ecf20Sopenharmony_ci#define MAC_RSSAR_OB_POS 0 1778c2ecf20Sopenharmony_ci#define MAC_RSSAR_OB_LEN 1 1788c2ecf20Sopenharmony_ci#define MAC_RSSAR_RSSIA_POS 8 1798c2ecf20Sopenharmony_ci#define MAC_RSSAR_RSSIA_LEN 8 1808c2ecf20Sopenharmony_ci#define MAC_RSSCR_IP2TE_POS 1 1818c2ecf20Sopenharmony_ci#define MAC_RSSCR_IP2TE_LEN 1 1828c2ecf20Sopenharmony_ci#define MAC_RSSCR_RSSE_POS 0 1838c2ecf20Sopenharmony_ci#define MAC_RSSCR_RSSE_LEN 1 1848c2ecf20Sopenharmony_ci#define MAC_RSSCR_TCP4TE_POS 2 1858c2ecf20Sopenharmony_ci#define MAC_RSSCR_TCP4TE_LEN 1 1868c2ecf20Sopenharmony_ci#define MAC_RSSCR_UDP4TE_POS 3 1878c2ecf20Sopenharmony_ci#define MAC_RSSCR_UDP4TE_LEN 1 1888c2ecf20Sopenharmony_ci#define MAC_RSSDR_DMCH_POS 0 1898c2ecf20Sopenharmony_ci#define MAC_RSSDR_DMCH_LEN 4 1908c2ecf20Sopenharmony_ci#define MAC_TCR_SS_POS 28 1918c2ecf20Sopenharmony_ci#define MAC_TCR_SS_LEN 3 1928c2ecf20Sopenharmony_ci#define MAC_TCR_TE_POS 0 1938c2ecf20Sopenharmony_ci#define MAC_TCR_TE_LEN 1 1948c2ecf20Sopenharmony_ci#define MAC_VLANHTR_VLHT_POS 0 1958c2ecf20Sopenharmony_ci#define MAC_VLANHTR_VLHT_LEN 16 1968c2ecf20Sopenharmony_ci#define MAC_VLANIR_VLTI_POS 20 1978c2ecf20Sopenharmony_ci#define MAC_VLANIR_VLTI_LEN 1 1988c2ecf20Sopenharmony_ci#define MAC_VLANIR_CSVL_POS 19 1998c2ecf20Sopenharmony_ci#define MAC_VLANIR_CSVL_LEN 1 2008c2ecf20Sopenharmony_ci#define MAC_VLANTR_DOVLTC_POS 20 2018c2ecf20Sopenharmony_ci#define MAC_VLANTR_DOVLTC_LEN 1 2028c2ecf20Sopenharmony_ci#define MAC_VLANTR_ERSVLM_POS 19 2038c2ecf20Sopenharmony_ci#define MAC_VLANTR_ERSVLM_LEN 1 2048c2ecf20Sopenharmony_ci#define MAC_VLANTR_ESVL_POS 18 2058c2ecf20Sopenharmony_ci#define MAC_VLANTR_ESVL_LEN 1 2068c2ecf20Sopenharmony_ci#define MAC_VLANTR_ETV_POS 16 2078c2ecf20Sopenharmony_ci#define MAC_VLANTR_ETV_LEN 1 2088c2ecf20Sopenharmony_ci#define MAC_VLANTR_EVLS_POS 21 2098c2ecf20Sopenharmony_ci#define MAC_VLANTR_EVLS_LEN 2 2108c2ecf20Sopenharmony_ci#define MAC_VLANTR_EVLRXS_POS 24 2118c2ecf20Sopenharmony_ci#define MAC_VLANTR_EVLRXS_LEN 1 2128c2ecf20Sopenharmony_ci#define MAC_VLANTR_VL_POS 0 2138c2ecf20Sopenharmony_ci#define MAC_VLANTR_VL_LEN 16 2148c2ecf20Sopenharmony_ci#define MAC_VLANTR_VTHM_POS 25 2158c2ecf20Sopenharmony_ci#define MAC_VLANTR_VTHM_LEN 1 2168c2ecf20Sopenharmony_ci#define MAC_VLANTR_VTIM_POS 17 2178c2ecf20Sopenharmony_ci#define MAC_VLANTR_VTIM_LEN 1 2188c2ecf20Sopenharmony_ci#define MAC_VR_DEVID_POS 8 2198c2ecf20Sopenharmony_ci#define MAC_VR_DEVID_LEN 8 2208c2ecf20Sopenharmony_ci#define MAC_VR_SNPSVER_POS 0 2218c2ecf20Sopenharmony_ci#define MAC_VR_SNPSVER_LEN 8 2228c2ecf20Sopenharmony_ci#define MAC_VR_USERVER_POS 16 2238c2ecf20Sopenharmony_ci#define MAC_VR_USERVER_LEN 8 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_ci/* MMC register offsets */ 2268c2ecf20Sopenharmony_ci#define MMC_CR 0x0800 2278c2ecf20Sopenharmony_ci#define MMC_RISR 0x0804 2288c2ecf20Sopenharmony_ci#define MMC_TISR 0x0808 2298c2ecf20Sopenharmony_ci#define MMC_RIER 0x080c 2308c2ecf20Sopenharmony_ci#define MMC_TIER 0x0810 2318c2ecf20Sopenharmony_ci#define MMC_TXOCTETCOUNT_GB_LO 0x0814 2328c2ecf20Sopenharmony_ci#define MMC_TXFRAMECOUNT_GB_LO 0x081c 2338c2ecf20Sopenharmony_ci#define MMC_TXBROADCASTFRAMES_G_LO 0x0824 2348c2ecf20Sopenharmony_ci#define MMC_TXMULTICASTFRAMES_G_LO 0x082c 2358c2ecf20Sopenharmony_ci#define MMC_TX64OCTETS_GB_LO 0x0834 2368c2ecf20Sopenharmony_ci#define MMC_TX65TO127OCTETS_GB_LO 0x083c 2378c2ecf20Sopenharmony_ci#define MMC_TX128TO255OCTETS_GB_LO 0x0844 2388c2ecf20Sopenharmony_ci#define MMC_TX256TO511OCTETS_GB_LO 0x084c 2398c2ecf20Sopenharmony_ci#define MMC_TX512TO1023OCTETS_GB_LO 0x0854 2408c2ecf20Sopenharmony_ci#define MMC_TX1024TOMAXOCTETS_GB_LO 0x085c 2418c2ecf20Sopenharmony_ci#define MMC_TXUNICASTFRAMES_GB_LO 0x0864 2428c2ecf20Sopenharmony_ci#define MMC_TXMULTICASTFRAMES_GB_LO 0x086c 2438c2ecf20Sopenharmony_ci#define MMC_TXBROADCASTFRAMES_GB_LO 0x0874 2448c2ecf20Sopenharmony_ci#define MMC_TXUNDERFLOWERROR_LO 0x087c 2458c2ecf20Sopenharmony_ci#define MMC_TXOCTETCOUNT_G_LO 0x0884 2468c2ecf20Sopenharmony_ci#define MMC_TXFRAMECOUNT_G_LO 0x088c 2478c2ecf20Sopenharmony_ci#define MMC_TXPAUSEFRAMES_LO 0x0894 2488c2ecf20Sopenharmony_ci#define MMC_TXVLANFRAMES_G_LO 0x089c 2498c2ecf20Sopenharmony_ci#define MMC_RXFRAMECOUNT_GB_LO 0x0900 2508c2ecf20Sopenharmony_ci#define MMC_RXOCTETCOUNT_GB_LO 0x0908 2518c2ecf20Sopenharmony_ci#define MMC_RXOCTETCOUNT_G_LO 0x0910 2528c2ecf20Sopenharmony_ci#define MMC_RXBROADCASTFRAMES_G_LO 0x0918 2538c2ecf20Sopenharmony_ci#define MMC_RXMULTICASTFRAMES_G_LO 0x0920 2548c2ecf20Sopenharmony_ci#define MMC_RXCRCERROR_LO 0x0928 2558c2ecf20Sopenharmony_ci#define MMC_RXRUNTERROR 0x0930 2568c2ecf20Sopenharmony_ci#define MMC_RXJABBERERROR 0x0934 2578c2ecf20Sopenharmony_ci#define MMC_RXUNDERSIZE_G 0x0938 2588c2ecf20Sopenharmony_ci#define MMC_RXOVERSIZE_G 0x093c 2598c2ecf20Sopenharmony_ci#define MMC_RX64OCTETS_GB_LO 0x0940 2608c2ecf20Sopenharmony_ci#define MMC_RX65TO127OCTETS_GB_LO 0x0948 2618c2ecf20Sopenharmony_ci#define MMC_RX128TO255OCTETS_GB_LO 0x0950 2628c2ecf20Sopenharmony_ci#define MMC_RX256TO511OCTETS_GB_LO 0x0958 2638c2ecf20Sopenharmony_ci#define MMC_RX512TO1023OCTETS_GB_LO 0x0960 2648c2ecf20Sopenharmony_ci#define MMC_RX1024TOMAXOCTETS_GB_LO 0x0968 2658c2ecf20Sopenharmony_ci#define MMC_RXUNICASTFRAMES_G_LO 0x0970 2668c2ecf20Sopenharmony_ci#define MMC_RXLENGTHERROR_LO 0x0978 2678c2ecf20Sopenharmony_ci#define MMC_RXOUTOFRANGETYPE_LO 0x0980 2688c2ecf20Sopenharmony_ci#define MMC_RXPAUSEFRAMES_LO 0x0988 2698c2ecf20Sopenharmony_ci#define MMC_RXFIFOOVERFLOW_LO 0x0990 2708c2ecf20Sopenharmony_ci#define MMC_RXVLANFRAMES_GB_LO 0x0998 2718c2ecf20Sopenharmony_ci#define MMC_RXWATCHDOGERROR 0x09a0 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ci/* MMC register entry bit positions and sizes */ 2748c2ecf20Sopenharmony_ci#define MMC_CR_CR_POS 0 2758c2ecf20Sopenharmony_ci#define MMC_CR_CR_LEN 1 2768c2ecf20Sopenharmony_ci#define MMC_CR_CSR_POS 1 2778c2ecf20Sopenharmony_ci#define MMC_CR_CSR_LEN 1 2788c2ecf20Sopenharmony_ci#define MMC_CR_ROR_POS 2 2798c2ecf20Sopenharmony_ci#define MMC_CR_ROR_LEN 1 2808c2ecf20Sopenharmony_ci#define MMC_CR_MCF_POS 3 2818c2ecf20Sopenharmony_ci#define MMC_CR_MCF_LEN 1 2828c2ecf20Sopenharmony_ci#define MMC_CR_MCT_POS 4 2838c2ecf20Sopenharmony_ci#define MMC_CR_MCT_LEN 2 2848c2ecf20Sopenharmony_ci#define MMC_RIER_ALL_INTERRUPTS_POS 0 2858c2ecf20Sopenharmony_ci#define MMC_RIER_ALL_INTERRUPTS_LEN 23 2868c2ecf20Sopenharmony_ci#define MMC_RISR_RXFRAMECOUNT_GB_POS 0 2878c2ecf20Sopenharmony_ci#define MMC_RISR_RXFRAMECOUNT_GB_LEN 1 2888c2ecf20Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_GB_POS 1 2898c2ecf20Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_GB_LEN 1 2908c2ecf20Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_G_POS 2 2918c2ecf20Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_G_LEN 1 2928c2ecf20Sopenharmony_ci#define MMC_RISR_RXBROADCASTFRAMES_G_POS 3 2938c2ecf20Sopenharmony_ci#define MMC_RISR_RXBROADCASTFRAMES_G_LEN 1 2948c2ecf20Sopenharmony_ci#define MMC_RISR_RXMULTICASTFRAMES_G_POS 4 2958c2ecf20Sopenharmony_ci#define MMC_RISR_RXMULTICASTFRAMES_G_LEN 1 2968c2ecf20Sopenharmony_ci#define MMC_RISR_RXCRCERROR_POS 5 2978c2ecf20Sopenharmony_ci#define MMC_RISR_RXCRCERROR_LEN 1 2988c2ecf20Sopenharmony_ci#define MMC_RISR_RXRUNTERROR_POS 6 2998c2ecf20Sopenharmony_ci#define MMC_RISR_RXRUNTERROR_LEN 1 3008c2ecf20Sopenharmony_ci#define MMC_RISR_RXJABBERERROR_POS 7 3018c2ecf20Sopenharmony_ci#define MMC_RISR_RXJABBERERROR_LEN 1 3028c2ecf20Sopenharmony_ci#define MMC_RISR_RXUNDERSIZE_G_POS 8 3038c2ecf20Sopenharmony_ci#define MMC_RISR_RXUNDERSIZE_G_LEN 1 3048c2ecf20Sopenharmony_ci#define MMC_RISR_RXOVERSIZE_G_POS 9 3058c2ecf20Sopenharmony_ci#define MMC_RISR_RXOVERSIZE_G_LEN 1 3068c2ecf20Sopenharmony_ci#define MMC_RISR_RX64OCTETS_GB_POS 10 3078c2ecf20Sopenharmony_ci#define MMC_RISR_RX64OCTETS_GB_LEN 1 3088c2ecf20Sopenharmony_ci#define MMC_RISR_RX65TO127OCTETS_GB_POS 11 3098c2ecf20Sopenharmony_ci#define MMC_RISR_RX65TO127OCTETS_GB_LEN 1 3108c2ecf20Sopenharmony_ci#define MMC_RISR_RX128TO255OCTETS_GB_POS 12 3118c2ecf20Sopenharmony_ci#define MMC_RISR_RX128TO255OCTETS_GB_LEN 1 3128c2ecf20Sopenharmony_ci#define MMC_RISR_RX256TO511OCTETS_GB_POS 13 3138c2ecf20Sopenharmony_ci#define MMC_RISR_RX256TO511OCTETS_GB_LEN 1 3148c2ecf20Sopenharmony_ci#define MMC_RISR_RX512TO1023OCTETS_GB_POS 14 3158c2ecf20Sopenharmony_ci#define MMC_RISR_RX512TO1023OCTETS_GB_LEN 1 3168c2ecf20Sopenharmony_ci#define MMC_RISR_RX1024TOMAXOCTETS_GB_POS 15 3178c2ecf20Sopenharmony_ci#define MMC_RISR_RX1024TOMAXOCTETS_GB_LEN 1 3188c2ecf20Sopenharmony_ci#define MMC_RISR_RXUNICASTFRAMES_G_POS 16 3198c2ecf20Sopenharmony_ci#define MMC_RISR_RXUNICASTFRAMES_G_LEN 1 3208c2ecf20Sopenharmony_ci#define MMC_RISR_RXLENGTHERROR_POS 17 3218c2ecf20Sopenharmony_ci#define MMC_RISR_RXLENGTHERROR_LEN 1 3228c2ecf20Sopenharmony_ci#define MMC_RISR_RXOUTOFRANGETYPE_POS 18 3238c2ecf20Sopenharmony_ci#define MMC_RISR_RXOUTOFRANGETYPE_LEN 1 3248c2ecf20Sopenharmony_ci#define MMC_RISR_RXPAUSEFRAMES_POS 19 3258c2ecf20Sopenharmony_ci#define MMC_RISR_RXPAUSEFRAMES_LEN 1 3268c2ecf20Sopenharmony_ci#define MMC_RISR_RXFIFOOVERFLOW_POS 20 3278c2ecf20Sopenharmony_ci#define MMC_RISR_RXFIFOOVERFLOW_LEN 1 3288c2ecf20Sopenharmony_ci#define MMC_RISR_RXVLANFRAMES_GB_POS 21 3298c2ecf20Sopenharmony_ci#define MMC_RISR_RXVLANFRAMES_GB_LEN 1 3308c2ecf20Sopenharmony_ci#define MMC_RISR_RXWATCHDOGERROR_POS 22 3318c2ecf20Sopenharmony_ci#define MMC_RISR_RXWATCHDOGERROR_LEN 1 3328c2ecf20Sopenharmony_ci#define MMC_TIER_ALL_INTERRUPTS_POS 0 3338c2ecf20Sopenharmony_ci#define MMC_TIER_ALL_INTERRUPTS_LEN 18 3348c2ecf20Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_GB_POS 0 3358c2ecf20Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_GB_LEN 1 3368c2ecf20Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_GB_POS 1 3378c2ecf20Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_GB_LEN 1 3388c2ecf20Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_G_POS 2 3398c2ecf20Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_G_LEN 1 3408c2ecf20Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_G_POS 3 3418c2ecf20Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_G_LEN 1 3428c2ecf20Sopenharmony_ci#define MMC_TISR_TX64OCTETS_GB_POS 4 3438c2ecf20Sopenharmony_ci#define MMC_TISR_TX64OCTETS_GB_LEN 1 3448c2ecf20Sopenharmony_ci#define MMC_TISR_TX65TO127OCTETS_GB_POS 5 3458c2ecf20Sopenharmony_ci#define MMC_TISR_TX65TO127OCTETS_GB_LEN 1 3468c2ecf20Sopenharmony_ci#define MMC_TISR_TX128TO255OCTETS_GB_POS 6 3478c2ecf20Sopenharmony_ci#define MMC_TISR_TX128TO255OCTETS_GB_LEN 1 3488c2ecf20Sopenharmony_ci#define MMC_TISR_TX256TO511OCTETS_GB_POS 7 3498c2ecf20Sopenharmony_ci#define MMC_TISR_TX256TO511OCTETS_GB_LEN 1 3508c2ecf20Sopenharmony_ci#define MMC_TISR_TX512TO1023OCTETS_GB_POS 8 3518c2ecf20Sopenharmony_ci#define MMC_TISR_TX512TO1023OCTETS_GB_LEN 1 3528c2ecf20Sopenharmony_ci#define MMC_TISR_TX1024TOMAXOCTETS_GB_POS 9 3538c2ecf20Sopenharmony_ci#define MMC_TISR_TX1024TOMAXOCTETS_GB_LEN 1 3548c2ecf20Sopenharmony_ci#define MMC_TISR_TXUNICASTFRAMES_GB_POS 10 3558c2ecf20Sopenharmony_ci#define MMC_TISR_TXUNICASTFRAMES_GB_LEN 1 3568c2ecf20Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_GB_POS 11 3578c2ecf20Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_GB_LEN 1 3588c2ecf20Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_GB_POS 12 3598c2ecf20Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_GB_LEN 1 3608c2ecf20Sopenharmony_ci#define MMC_TISR_TXUNDERFLOWERROR_POS 13 3618c2ecf20Sopenharmony_ci#define MMC_TISR_TXUNDERFLOWERROR_LEN 1 3628c2ecf20Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_G_POS 14 3638c2ecf20Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_G_LEN 1 3648c2ecf20Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_G_POS 15 3658c2ecf20Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_G_LEN 1 3668c2ecf20Sopenharmony_ci#define MMC_TISR_TXPAUSEFRAMES_POS 16 3678c2ecf20Sopenharmony_ci#define MMC_TISR_TXPAUSEFRAMES_LEN 1 3688c2ecf20Sopenharmony_ci#define MMC_TISR_TXVLANFRAMES_G_POS 17 3698c2ecf20Sopenharmony_ci#define MMC_TISR_TXVLANFRAMES_G_LEN 1 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci/* MTL register offsets */ 3728c2ecf20Sopenharmony_ci#define MTL_OMR 0x1000 3738c2ecf20Sopenharmony_ci#define MTL_FDDR 0x1010 3748c2ecf20Sopenharmony_ci#define MTL_RQDCM0R 0x1030 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci#define MTL_RQDCM_INC 4 3778c2ecf20Sopenharmony_ci#define MTL_RQDCM_Q_PER_REG 4 3788c2ecf20Sopenharmony_ci 3798c2ecf20Sopenharmony_ci/* MTL register entry bit positions and sizes */ 3808c2ecf20Sopenharmony_ci#define MTL_OMR_ETSALG_POS 5 3818c2ecf20Sopenharmony_ci#define MTL_OMR_ETSALG_LEN 2 3828c2ecf20Sopenharmony_ci#define MTL_OMR_RAA_POS 2 3838c2ecf20Sopenharmony_ci#define MTL_OMR_RAA_LEN 1 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci/* MTL queue register offsets 3868c2ecf20Sopenharmony_ci * Multiple queues can be active. The first queue has registers 3878c2ecf20Sopenharmony_ci * that begin at 0x1100. Each subsequent queue has registers that 3888c2ecf20Sopenharmony_ci * are accessed using an offset of 0x80 from the previous queue. 3898c2ecf20Sopenharmony_ci */ 3908c2ecf20Sopenharmony_ci#define MTL_Q_BASE 0x1100 3918c2ecf20Sopenharmony_ci#define MTL_Q_INC 0x80 3928c2ecf20Sopenharmony_ci 3938c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR 0x00 3948c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR 0x40 3958c2ecf20Sopenharmony_ci#define MTL_Q_RQDR 0x48 3968c2ecf20Sopenharmony_ci#define MTL_Q_RQFCR 0x50 3978c2ecf20Sopenharmony_ci#define MTL_Q_IER 0x70 3988c2ecf20Sopenharmony_ci#define MTL_Q_ISR 0x74 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci/* MTL queue register entry bit positions and sizes */ 4018c2ecf20Sopenharmony_ci#define MTL_Q_RQDR_PRXQ_POS 16 4028c2ecf20Sopenharmony_ci#define MTL_Q_RQDR_PRXQ_LEN 14 4038c2ecf20Sopenharmony_ci#define MTL_Q_RQDR_RXQSTS_POS 4 4048c2ecf20Sopenharmony_ci#define MTL_Q_RQDR_RXQSTS_LEN 2 4058c2ecf20Sopenharmony_ci#define MTL_Q_RQFCR_RFA_POS 1 4068c2ecf20Sopenharmony_ci#define MTL_Q_RQFCR_RFA_LEN 6 4078c2ecf20Sopenharmony_ci#define MTL_Q_RQFCR_RFD_POS 17 4088c2ecf20Sopenharmony_ci#define MTL_Q_RQFCR_RFD_LEN 6 4098c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_EHFC_POS 7 4108c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_EHFC_LEN 1 4118c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RQS_POS 16 4128c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RQS_LEN 9 4138c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RSF_POS 5 4148c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RSF_LEN 1 4158c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_FEP_POS 4 4168c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_FEP_LEN 1 4178c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_FUP_POS 3 4188c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_FUP_LEN 1 4198c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RTC_POS 0 4208c2ecf20Sopenharmony_ci#define MTL_Q_RQOMR_RTC_LEN 2 4218c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_FTQ_POS 0 4228c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_FTQ_LEN 1 4238c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_Q2TCMAP_POS 8 4248c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_Q2TCMAP_LEN 3 4258c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TQS_POS 16 4268c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TQS_LEN 10 4278c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TSF_POS 1 4288c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TSF_LEN 1 4298c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TTC_POS 4 4308c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TTC_LEN 3 4318c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TXQEN_POS 2 4328c2ecf20Sopenharmony_ci#define MTL_Q_TQOMR_TXQEN_LEN 2 4338c2ecf20Sopenharmony_ci 4348c2ecf20Sopenharmony_ci/* MTL queue register value */ 4358c2ecf20Sopenharmony_ci#define MTL_RSF_DISABLE 0x00 4368c2ecf20Sopenharmony_ci#define MTL_RSF_ENABLE 0x01 4378c2ecf20Sopenharmony_ci#define MTL_TSF_DISABLE 0x00 4388c2ecf20Sopenharmony_ci#define MTL_TSF_ENABLE 0x01 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci#define MTL_RX_THRESHOLD_64 0x00 4418c2ecf20Sopenharmony_ci#define MTL_RX_THRESHOLD_96 0x02 4428c2ecf20Sopenharmony_ci#define MTL_RX_THRESHOLD_128 0x03 4438c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_64 0x00 4448c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_96 0x02 4458c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_128 0x03 4468c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_192 0x04 4478c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_256 0x05 4488c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_384 0x06 4498c2ecf20Sopenharmony_ci#define MTL_TX_THRESHOLD_512 0x07 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_ci#define MTL_ETSALG_WRR 0x00 4528c2ecf20Sopenharmony_ci#define MTL_ETSALG_WFQ 0x01 4538c2ecf20Sopenharmony_ci#define MTL_ETSALG_DWRR 0x02 4548c2ecf20Sopenharmony_ci#define MTL_RAA_SP 0x00 4558c2ecf20Sopenharmony_ci#define MTL_RAA_WSP 0x01 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define MTL_Q_DISABLED 0x00 4588c2ecf20Sopenharmony_ci#define MTL_Q_ENABLED 0x02 4598c2ecf20Sopenharmony_ci 4608c2ecf20Sopenharmony_ci#define MTL_RQDCM0R_Q0MDMACH 0x0 4618c2ecf20Sopenharmony_ci#define MTL_RQDCM0R_Q1MDMACH 0x00000100 4628c2ecf20Sopenharmony_ci#define MTL_RQDCM0R_Q2MDMACH 0x00020000 4638c2ecf20Sopenharmony_ci#define MTL_RQDCM0R_Q3MDMACH 0x03000000 4648c2ecf20Sopenharmony_ci#define MTL_RQDCM1R_Q4MDMACH 0x00000004 4658c2ecf20Sopenharmony_ci#define MTL_RQDCM1R_Q5MDMACH 0x00000500 4668c2ecf20Sopenharmony_ci#define MTL_RQDCM1R_Q6MDMACH 0x00060000 4678c2ecf20Sopenharmony_ci#define MTL_RQDCM1R_Q7MDMACH 0x07000000 4688c2ecf20Sopenharmony_ci#define MTL_RQDCM2R_Q8MDMACH 0x00000008 4698c2ecf20Sopenharmony_ci#define MTL_RQDCM2R_Q9MDMACH 0x00000900 4708c2ecf20Sopenharmony_ci#define MTL_RQDCM2R_Q10MDMACH 0x000A0000 4718c2ecf20Sopenharmony_ci#define MTL_RQDCM2R_Q11MDMACH 0x0B000000 4728c2ecf20Sopenharmony_ci 4738c2ecf20Sopenharmony_ci/* MTL traffic class register offsets 4748c2ecf20Sopenharmony_ci * Multiple traffic classes can be active. The first class has registers 4758c2ecf20Sopenharmony_ci * that begin at 0x1100. Each subsequent queue has registers that 4768c2ecf20Sopenharmony_ci * are accessed using an offset of 0x80 from the previous queue. 4778c2ecf20Sopenharmony_ci */ 4788c2ecf20Sopenharmony_ci#define MTL_TC_BASE MTL_Q_BASE 4798c2ecf20Sopenharmony_ci#define MTL_TC_INC MTL_Q_INC 4808c2ecf20Sopenharmony_ci 4818c2ecf20Sopenharmony_ci#define MTL_TC_ETSCR 0x10 4828c2ecf20Sopenharmony_ci#define MTL_TC_ETSSR 0x14 4838c2ecf20Sopenharmony_ci#define MTL_TC_QWR 0x18 4848c2ecf20Sopenharmony_ci 4858c2ecf20Sopenharmony_ci/* MTL traffic class register entry bit positions and sizes */ 4868c2ecf20Sopenharmony_ci#define MTL_TC_ETSCR_TSA_POS 0 4878c2ecf20Sopenharmony_ci#define MTL_TC_ETSCR_TSA_LEN 2 4888c2ecf20Sopenharmony_ci#define MTL_TC_QWR_QW_POS 0 4898c2ecf20Sopenharmony_ci#define MTL_TC_QWR_QW_LEN 21 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_ci/* MTL traffic class register value */ 4928c2ecf20Sopenharmony_ci#define MTL_TSA_SP 0x00 4938c2ecf20Sopenharmony_ci#define MTL_TSA_ETS 0x02 4948c2ecf20Sopenharmony_ci 4958c2ecf20Sopenharmony_ci/* DMA register offsets */ 4968c2ecf20Sopenharmony_ci#define DMA_MR 0x3000 4978c2ecf20Sopenharmony_ci#define DMA_SBMR 0x3004 4988c2ecf20Sopenharmony_ci#define DMA_ISR 0x3008 4998c2ecf20Sopenharmony_ci#define DMA_DSR0 0x3020 5008c2ecf20Sopenharmony_ci#define DMA_DSR1 0x3024 5018c2ecf20Sopenharmony_ci 5028c2ecf20Sopenharmony_ci/* DMA register entry bit positions and sizes */ 5038c2ecf20Sopenharmony_ci#define DMA_ISR_MACIS_POS 17 5048c2ecf20Sopenharmony_ci#define DMA_ISR_MACIS_LEN 1 5058c2ecf20Sopenharmony_ci#define DMA_ISR_MTLIS_POS 16 5068c2ecf20Sopenharmony_ci#define DMA_ISR_MTLIS_LEN 1 5078c2ecf20Sopenharmony_ci#define DMA_MR_SWR_POS 0 5088c2ecf20Sopenharmony_ci#define DMA_MR_SWR_LEN 1 5098c2ecf20Sopenharmony_ci#define DMA_SBMR_EAME_POS 11 5108c2ecf20Sopenharmony_ci#define DMA_SBMR_EAME_LEN 1 5118c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_64_POS 5 5128c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_64_LEN 1 5138c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_128_POS 6 5148c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_128_LEN 1 5158c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_256_POS 7 5168c2ecf20Sopenharmony_ci#define DMA_SBMR_BLEN_256_LEN 1 5178c2ecf20Sopenharmony_ci#define DMA_SBMR_UNDEF_POS 0 5188c2ecf20Sopenharmony_ci#define DMA_SBMR_UNDEF_LEN 1 5198c2ecf20Sopenharmony_ci 5208c2ecf20Sopenharmony_ci/* DMA register values */ 5218c2ecf20Sopenharmony_ci#define DMA_DSR_RPS_LEN 4 5228c2ecf20Sopenharmony_ci#define DMA_DSR_TPS_LEN 4 5238c2ecf20Sopenharmony_ci#define DMA_DSR_Q_LEN (DMA_DSR_RPS_LEN + DMA_DSR_TPS_LEN) 5248c2ecf20Sopenharmony_ci#define DMA_DSR0_TPS_START 12 5258c2ecf20Sopenharmony_ci#define DMA_DSRX_FIRST_QUEUE 3 5268c2ecf20Sopenharmony_ci#define DMA_DSRX_INC 4 5278c2ecf20Sopenharmony_ci#define DMA_DSRX_QPR 4 5288c2ecf20Sopenharmony_ci#define DMA_DSRX_TPS_START 4 5298c2ecf20Sopenharmony_ci#define DMA_TPS_STOPPED 0x00 5308c2ecf20Sopenharmony_ci#define DMA_TPS_SUSPENDED 0x06 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci/* DMA channel register offsets 5338c2ecf20Sopenharmony_ci * Multiple channels can be active. The first channel has registers 5348c2ecf20Sopenharmony_ci * that begin at 0x3100. Each subsequent channel has registers that 5358c2ecf20Sopenharmony_ci * are accessed using an offset of 0x80 from the previous channel. 5368c2ecf20Sopenharmony_ci */ 5378c2ecf20Sopenharmony_ci#define DMA_CH_BASE 0x3100 5388c2ecf20Sopenharmony_ci#define DMA_CH_INC 0x80 5398c2ecf20Sopenharmony_ci 5408c2ecf20Sopenharmony_ci#define DMA_CH_CR 0x00 5418c2ecf20Sopenharmony_ci#define DMA_CH_TCR 0x04 5428c2ecf20Sopenharmony_ci#define DMA_CH_RCR 0x08 5438c2ecf20Sopenharmony_ci#define DMA_CH_TDLR_HI 0x10 5448c2ecf20Sopenharmony_ci#define DMA_CH_TDLR_LO 0x14 5458c2ecf20Sopenharmony_ci#define DMA_CH_RDLR_HI 0x18 5468c2ecf20Sopenharmony_ci#define DMA_CH_RDLR_LO 0x1c 5478c2ecf20Sopenharmony_ci#define DMA_CH_TDTR_LO 0x24 5488c2ecf20Sopenharmony_ci#define DMA_CH_RDTR_LO 0x2c 5498c2ecf20Sopenharmony_ci#define DMA_CH_TDRLR 0x30 5508c2ecf20Sopenharmony_ci#define DMA_CH_RDRLR 0x34 5518c2ecf20Sopenharmony_ci#define DMA_CH_IER 0x38 5528c2ecf20Sopenharmony_ci#define DMA_CH_RIWT 0x3c 5538c2ecf20Sopenharmony_ci#define DMA_CH_SR 0x60 5548c2ecf20Sopenharmony_ci 5558c2ecf20Sopenharmony_ci/* DMA channel register entry bit positions and sizes */ 5568c2ecf20Sopenharmony_ci#define DMA_CH_CR_PBLX8_POS 16 5578c2ecf20Sopenharmony_ci#define DMA_CH_CR_PBLX8_LEN 1 5588c2ecf20Sopenharmony_ci#define DMA_CH_CR_SPH_POS 24 5598c2ecf20Sopenharmony_ci#define DMA_CH_CR_SPH_LEN 1 5608c2ecf20Sopenharmony_ci#define DMA_CH_IER_AIE_POS 15 5618c2ecf20Sopenharmony_ci#define DMA_CH_IER_AIE_LEN 1 5628c2ecf20Sopenharmony_ci#define DMA_CH_IER_FBEE_POS 12 5638c2ecf20Sopenharmony_ci#define DMA_CH_IER_FBEE_LEN 1 5648c2ecf20Sopenharmony_ci#define DMA_CH_IER_NIE_POS 16 5658c2ecf20Sopenharmony_ci#define DMA_CH_IER_NIE_LEN 1 5668c2ecf20Sopenharmony_ci#define DMA_CH_IER_RBUE_POS 7 5678c2ecf20Sopenharmony_ci#define DMA_CH_IER_RBUE_LEN 1 5688c2ecf20Sopenharmony_ci#define DMA_CH_IER_RIE_POS 6 5698c2ecf20Sopenharmony_ci#define DMA_CH_IER_RIE_LEN 1 5708c2ecf20Sopenharmony_ci#define DMA_CH_IER_RSE_POS 8 5718c2ecf20Sopenharmony_ci#define DMA_CH_IER_RSE_LEN 1 5728c2ecf20Sopenharmony_ci#define DMA_CH_IER_TBUE_POS 2 5738c2ecf20Sopenharmony_ci#define DMA_CH_IER_TBUE_LEN 1 5748c2ecf20Sopenharmony_ci#define DMA_CH_IER_TIE_POS 0 5758c2ecf20Sopenharmony_ci#define DMA_CH_IER_TIE_LEN 1 5768c2ecf20Sopenharmony_ci#define DMA_CH_IER_TXSE_POS 1 5778c2ecf20Sopenharmony_ci#define DMA_CH_IER_TXSE_LEN 1 5788c2ecf20Sopenharmony_ci#define DMA_CH_RCR_PBL_POS 16 5798c2ecf20Sopenharmony_ci#define DMA_CH_RCR_PBL_LEN 6 5808c2ecf20Sopenharmony_ci#define DMA_CH_RCR_RBSZ_POS 1 5818c2ecf20Sopenharmony_ci#define DMA_CH_RCR_RBSZ_LEN 14 5828c2ecf20Sopenharmony_ci#define DMA_CH_RCR_SR_POS 0 5838c2ecf20Sopenharmony_ci#define DMA_CH_RCR_SR_LEN 1 5848c2ecf20Sopenharmony_ci#define DMA_CH_RIWT_RWT_POS 0 5858c2ecf20Sopenharmony_ci#define DMA_CH_RIWT_RWT_LEN 8 5868c2ecf20Sopenharmony_ci#define DMA_CH_SR_FBE_POS 12 5878c2ecf20Sopenharmony_ci#define DMA_CH_SR_FBE_LEN 1 5888c2ecf20Sopenharmony_ci#define DMA_CH_SR_RBU_POS 7 5898c2ecf20Sopenharmony_ci#define DMA_CH_SR_RBU_LEN 1 5908c2ecf20Sopenharmony_ci#define DMA_CH_SR_RI_POS 6 5918c2ecf20Sopenharmony_ci#define DMA_CH_SR_RI_LEN 1 5928c2ecf20Sopenharmony_ci#define DMA_CH_SR_RPS_POS 8 5938c2ecf20Sopenharmony_ci#define DMA_CH_SR_RPS_LEN 1 5948c2ecf20Sopenharmony_ci#define DMA_CH_SR_TBU_POS 2 5958c2ecf20Sopenharmony_ci#define DMA_CH_SR_TBU_LEN 1 5968c2ecf20Sopenharmony_ci#define DMA_CH_SR_TI_POS 0 5978c2ecf20Sopenharmony_ci#define DMA_CH_SR_TI_LEN 1 5988c2ecf20Sopenharmony_ci#define DMA_CH_SR_TPS_POS 1 5998c2ecf20Sopenharmony_ci#define DMA_CH_SR_TPS_LEN 1 6008c2ecf20Sopenharmony_ci#define DMA_CH_TCR_OSP_POS 4 6018c2ecf20Sopenharmony_ci#define DMA_CH_TCR_OSP_LEN 1 6028c2ecf20Sopenharmony_ci#define DMA_CH_TCR_PBL_POS 16 6038c2ecf20Sopenharmony_ci#define DMA_CH_TCR_PBL_LEN 6 6048c2ecf20Sopenharmony_ci#define DMA_CH_TCR_ST_POS 0 6058c2ecf20Sopenharmony_ci#define DMA_CH_TCR_ST_LEN 1 6068c2ecf20Sopenharmony_ci#define DMA_CH_TCR_TSE_POS 12 6078c2ecf20Sopenharmony_ci#define DMA_CH_TCR_TSE_LEN 1 6088c2ecf20Sopenharmony_ci 6098c2ecf20Sopenharmony_ci/* DMA channel register values */ 6108c2ecf20Sopenharmony_ci#define DMA_OSP_DISABLE 0x00 6118c2ecf20Sopenharmony_ci#define DMA_OSP_ENABLE 0x01 6128c2ecf20Sopenharmony_ci#define DMA_PBL_1 1 6138c2ecf20Sopenharmony_ci#define DMA_PBL_2 2 6148c2ecf20Sopenharmony_ci#define DMA_PBL_4 4 6158c2ecf20Sopenharmony_ci#define DMA_PBL_8 8 6168c2ecf20Sopenharmony_ci#define DMA_PBL_16 16 6178c2ecf20Sopenharmony_ci#define DMA_PBL_32 32 6188c2ecf20Sopenharmony_ci#define DMA_PBL_64 64 6198c2ecf20Sopenharmony_ci#define DMA_PBL_128 128 6208c2ecf20Sopenharmony_ci#define DMA_PBL_256 256 6218c2ecf20Sopenharmony_ci#define DMA_PBL_X8_DISABLE 0x00 6228c2ecf20Sopenharmony_ci#define DMA_PBL_X8_ENABLE 0x01 6238c2ecf20Sopenharmony_ci 6248c2ecf20Sopenharmony_ci/* Descriptor/Packet entry bit positions and sizes */ 6258c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_CRC_POS 2 6268c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_CRC_LEN 1 6278c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_FRAME_POS 3 6288c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_FRAME_LEN 1 6298c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_LENGTH_POS 0 6308c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_LENGTH_LEN 1 6318c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_OVERRUN_POS 1 6328c2ecf20Sopenharmony_ci#define RX_PACKET_ERRORS_OVERRUN_LEN 1 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CSUM_DONE_POS 0 6358c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CSUM_DONE_LEN 1 6368c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_POS 1 6378c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN 1 6388c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_INCOMPLETE_POS 2 6398c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_INCOMPLETE_LEN 1 6408c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_POS 3 6418c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_LEN 1 6428c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_POS 4 6438c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_LEN 1 6448c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_POS 5 6458c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_LEN 1 6468c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RSS_HASH_POS 6 6478c2ecf20Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RSS_HASH_LEN 1 6488c2ecf20Sopenharmony_ci 6498c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC0_OVT_POS 0 6508c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC0_OVT_LEN 16 6518c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC2_HL_POS 0 6528c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC2_HL_LEN 10 6538c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_CDA_POS 27 6548c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_CDA_LEN 1 6558c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_CTXT_POS 30 6568c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_CTXT_LEN 1 6578c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_ES_POS 15 6588c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_ES_LEN 1 6598c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_ETLT_POS 16 6608c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_ETLT_LEN 4 6618c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_FD_POS 29 6628c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_FD_LEN 1 6638c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_INTE_POS 30 6648c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_INTE_LEN 1 6658c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_L34T_POS 20 6668c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_L34T_LEN 4 6678c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_LD_POS 28 6688c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_LD_LEN 1 6698c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_OWN_POS 31 6708c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_OWN_LEN 1 6718c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_PL_POS 0 6728c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_PL_LEN 14 6738c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_RSV_POS 26 6748c2ecf20Sopenharmony_ci#define RX_NORMAL_DESC3_RSV_LEN 1 6758c2ecf20Sopenharmony_ci 6768c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV4_TCP 1 6778c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV4_UDP 2 6788c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV4_ICMP 3 6798c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV6_TCP 9 6808c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV6_UDP 10 6818c2ecf20Sopenharmony_ci#define RX_DESC3_L34T_IPV6_ICMP 11 6828c2ecf20Sopenharmony_ci 6838c2ecf20Sopenharmony_ci#define RX_CONTEXT_DESC3_TSA_POS 4 6848c2ecf20Sopenharmony_ci#define RX_CONTEXT_DESC3_TSA_LEN 1 6858c2ecf20Sopenharmony_ci#define RX_CONTEXT_DESC3_TSD_POS 6 6868c2ecf20Sopenharmony_ci#define RX_CONTEXT_DESC3_TSD_LEN 1 6878c2ecf20Sopenharmony_ci 6888c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_POS 0 6898c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_LEN 1 6908c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_POS 1 6918c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_LEN 1 6928c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_POS 2 6938c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN 1 6948c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_PTP_POS 3 6958c2ecf20Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_PTP_LEN 1 6968c2ecf20Sopenharmony_ci 6978c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC2_MSS_POS 0 6988c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC2_MSS_LEN 15 6998c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_CTXT_POS 30 7008c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_CTXT_LEN 1 7018c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_TCMSSV_POS 26 7028c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_TCMSSV_LEN 1 7038c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_VLTV_POS 16 7048c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_VLTV_LEN 1 7058c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_VT_POS 0 7068c2ecf20Sopenharmony_ci#define TX_CONTEXT_DESC3_VT_LEN 16 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_HL_B1L_POS 0 7098c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_HL_B1L_LEN 14 7108c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_IC_POS 31 7118c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_IC_LEN 1 7128c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_TTSE_POS 30 7138c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_TTSE_LEN 1 7148c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_VTIR_POS 14 7158c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_VTIR_LEN 2 7168c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CIC_POS 16 7178c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CIC_LEN 2 7188c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CPC_POS 26 7198c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CPC_LEN 2 7208c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CTXT_POS 30 7218c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_CTXT_LEN 1 7228c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_FD_POS 29 7238c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_FD_LEN 1 7248c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_FL_POS 0 7258c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_FL_LEN 15 7268c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_LD_POS 28 7278c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_LD_LEN 1 7288c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_OWN_POS 31 7298c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_OWN_LEN 1 7308c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TCPHDRLEN_POS 19 7318c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TCPHDRLEN_LEN 4 7328c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TCPPL_POS 0 7338c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TCPPL_LEN 18 7348c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TSE_POS 18 7358c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC3_TSE_LEN 1 7368c2ecf20Sopenharmony_ci 7378c2ecf20Sopenharmony_ci#define TX_NORMAL_DESC2_VLAN_INSERT 0x2 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_ci#define XLGMAC_MTL_REG(pdata, n, reg) \ 7408c2ecf20Sopenharmony_ci ((pdata)->mac_regs + MTL_Q_BASE + ((n) * MTL_Q_INC) + (reg)) 7418c2ecf20Sopenharmony_ci 7428c2ecf20Sopenharmony_ci#define XLGMAC_DMA_REG(channel, reg) ((channel)->dma_regs + (reg)) 7438c2ecf20Sopenharmony_ci 7448c2ecf20Sopenharmony_ci#endif /* __DWC_XLGMAC_REG_H__ */ 745