162306a36Sopenharmony_ci/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * This program is dual-licensed; you may select either version 2 of
662306a36Sopenharmony_ci * the GNU General Public License ("GPL") or BSD license ("BSD").
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * This Synopsys DWC XLGMAC software driver and associated documentation
962306a36Sopenharmony_ci * (hereinafter the "Software") is an unsupported proprietary work of
1062306a36Sopenharmony_ci * Synopsys, Inc. unless otherwise expressly agreed to in writing between
1162306a36Sopenharmony_ci * Synopsys and you. The Software IS NOT an item of Licensed Software or a
1262306a36Sopenharmony_ci * Licensed Product under any End User Software License Agreement or
1362306a36Sopenharmony_ci * Agreement for Licensed Products with Synopsys or any supplement thereto.
1462306a36Sopenharmony_ci * Synopsys is a registered trademark of Synopsys, Inc. Other names included
1562306a36Sopenharmony_ci * in the SOFTWARE may be the trademarks of their respective owners.
1662306a36Sopenharmony_ci */
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#ifndef __DWC_XLGMAC_REG_H__
1962306a36Sopenharmony_ci#define __DWC_XLGMAC_REG_H__
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/* MAC register offsets */
2262306a36Sopenharmony_ci#define MAC_TCR				0x0000
2362306a36Sopenharmony_ci#define MAC_RCR				0x0004
2462306a36Sopenharmony_ci#define MAC_PFR				0x0008
2562306a36Sopenharmony_ci#define MAC_HTR0			0x0010
2662306a36Sopenharmony_ci#define MAC_VLANTR			0x0050
2762306a36Sopenharmony_ci#define MAC_VLANHTR			0x0058
2862306a36Sopenharmony_ci#define MAC_VLANIR			0x0060
2962306a36Sopenharmony_ci#define MAC_Q0TFCR			0x0070
3062306a36Sopenharmony_ci#define MAC_RFCR			0x0090
3162306a36Sopenharmony_ci#define MAC_RQC0R			0x00a0
3262306a36Sopenharmony_ci#define MAC_RQC1R			0x00a4
3362306a36Sopenharmony_ci#define MAC_RQC2R			0x00a8
3462306a36Sopenharmony_ci#define MAC_RQC3R			0x00ac
3562306a36Sopenharmony_ci#define MAC_ISR				0x00b0
3662306a36Sopenharmony_ci#define MAC_IER				0x00b4
3762306a36Sopenharmony_ci#define MAC_VR				0x0110
3862306a36Sopenharmony_ci#define MAC_HWF0R			0x011c
3962306a36Sopenharmony_ci#define MAC_HWF1R			0x0120
4062306a36Sopenharmony_ci#define MAC_HWF2R			0x0124
4162306a36Sopenharmony_ci#define MAC_MACA0HR			0x0300
4262306a36Sopenharmony_ci#define MAC_MACA0LR			0x0304
4362306a36Sopenharmony_ci#define MAC_MACA1HR			0x0308
4462306a36Sopenharmony_ci#define MAC_MACA1LR			0x030c
4562306a36Sopenharmony_ci#define MAC_RSSCR			0x0c80
4662306a36Sopenharmony_ci#define MAC_RSSAR			0x0c88
4762306a36Sopenharmony_ci#define MAC_RSSDR			0x0c8c
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define MAC_QTFCR_INC			4
5062306a36Sopenharmony_ci#define MAC_MACA_INC			4
5162306a36Sopenharmony_ci#define MAC_HTR_INC			4
5262306a36Sopenharmony_ci#define MAC_RQC2_INC			4
5362306a36Sopenharmony_ci#define MAC_RQC2_Q_PER_REG		4
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/* MAC register entry bit positions and sizes */
5662306a36Sopenharmony_ci#define MAC_HWF0R_ADDMACADRSEL_POS	18
5762306a36Sopenharmony_ci#define MAC_HWF0R_ADDMACADRSEL_LEN	5
5862306a36Sopenharmony_ci#define MAC_HWF0R_ARPOFFSEL_POS		9
5962306a36Sopenharmony_ci#define MAC_HWF0R_ARPOFFSEL_LEN		1
6062306a36Sopenharmony_ci#define MAC_HWF0R_EEESEL_POS		13
6162306a36Sopenharmony_ci#define MAC_HWF0R_EEESEL_LEN		1
6262306a36Sopenharmony_ci#define MAC_HWF0R_PHYIFSEL_POS		1
6362306a36Sopenharmony_ci#define MAC_HWF0R_PHYIFSEL_LEN		2
6462306a36Sopenharmony_ci#define MAC_HWF0R_MGKSEL_POS		7
6562306a36Sopenharmony_ci#define MAC_HWF0R_MGKSEL_LEN		1
6662306a36Sopenharmony_ci#define MAC_HWF0R_MMCSEL_POS		8
6762306a36Sopenharmony_ci#define MAC_HWF0R_MMCSEL_LEN		1
6862306a36Sopenharmony_ci#define MAC_HWF0R_RWKSEL_POS		6
6962306a36Sopenharmony_ci#define MAC_HWF0R_RWKSEL_LEN		1
7062306a36Sopenharmony_ci#define MAC_HWF0R_RXCOESEL_POS		16
7162306a36Sopenharmony_ci#define MAC_HWF0R_RXCOESEL_LEN		1
7262306a36Sopenharmony_ci#define MAC_HWF0R_SAVLANINS_POS		27
7362306a36Sopenharmony_ci#define MAC_HWF0R_SAVLANINS_LEN		1
7462306a36Sopenharmony_ci#define MAC_HWF0R_SMASEL_POS		5
7562306a36Sopenharmony_ci#define MAC_HWF0R_SMASEL_LEN		1
7662306a36Sopenharmony_ci#define MAC_HWF0R_TSSEL_POS		12
7762306a36Sopenharmony_ci#define MAC_HWF0R_TSSEL_LEN		1
7862306a36Sopenharmony_ci#define MAC_HWF0R_TSSTSSEL_POS		25
7962306a36Sopenharmony_ci#define MAC_HWF0R_TSSTSSEL_LEN		2
8062306a36Sopenharmony_ci#define MAC_HWF0R_TXCOESEL_POS		14
8162306a36Sopenharmony_ci#define MAC_HWF0R_TXCOESEL_LEN		1
8262306a36Sopenharmony_ci#define MAC_HWF0R_VLHASH_POS		4
8362306a36Sopenharmony_ci#define MAC_HWF0R_VLHASH_LEN		1
8462306a36Sopenharmony_ci#define MAC_HWF1R_ADDR64_POS		14
8562306a36Sopenharmony_ci#define MAC_HWF1R_ADDR64_LEN		2
8662306a36Sopenharmony_ci#define MAC_HWF1R_ADVTHWORD_POS		13
8762306a36Sopenharmony_ci#define MAC_HWF1R_ADVTHWORD_LEN		1
8862306a36Sopenharmony_ci#define MAC_HWF1R_DBGMEMA_POS		19
8962306a36Sopenharmony_ci#define MAC_HWF1R_DBGMEMA_LEN		1
9062306a36Sopenharmony_ci#define MAC_HWF1R_DCBEN_POS		16
9162306a36Sopenharmony_ci#define MAC_HWF1R_DCBEN_LEN		1
9262306a36Sopenharmony_ci#define MAC_HWF1R_HASHTBLSZ_POS		24
9362306a36Sopenharmony_ci#define MAC_HWF1R_HASHTBLSZ_LEN		3
9462306a36Sopenharmony_ci#define MAC_HWF1R_L3L4FNUM_POS		27
9562306a36Sopenharmony_ci#define MAC_HWF1R_L3L4FNUM_LEN		4
9662306a36Sopenharmony_ci#define MAC_HWF1R_NUMTC_POS		21
9762306a36Sopenharmony_ci#define MAC_HWF1R_NUMTC_LEN		3
9862306a36Sopenharmony_ci#define MAC_HWF1R_RSSEN_POS		20
9962306a36Sopenharmony_ci#define MAC_HWF1R_RSSEN_LEN		1
10062306a36Sopenharmony_ci#define MAC_HWF1R_RXFIFOSIZE_POS	0
10162306a36Sopenharmony_ci#define MAC_HWF1R_RXFIFOSIZE_LEN	5
10262306a36Sopenharmony_ci#define MAC_HWF1R_SPHEN_POS		17
10362306a36Sopenharmony_ci#define MAC_HWF1R_SPHEN_LEN		1
10462306a36Sopenharmony_ci#define MAC_HWF1R_TSOEN_POS		18
10562306a36Sopenharmony_ci#define MAC_HWF1R_TSOEN_LEN		1
10662306a36Sopenharmony_ci#define MAC_HWF1R_TXFIFOSIZE_POS	6
10762306a36Sopenharmony_ci#define MAC_HWF1R_TXFIFOSIZE_LEN	5
10862306a36Sopenharmony_ci#define MAC_HWF2R_AUXSNAPNUM_POS	28
10962306a36Sopenharmony_ci#define MAC_HWF2R_AUXSNAPNUM_LEN	3
11062306a36Sopenharmony_ci#define MAC_HWF2R_PPSOUTNUM_POS		24
11162306a36Sopenharmony_ci#define MAC_HWF2R_PPSOUTNUM_LEN		3
11262306a36Sopenharmony_ci#define MAC_HWF2R_RXCHCNT_POS		12
11362306a36Sopenharmony_ci#define MAC_HWF2R_RXCHCNT_LEN		4
11462306a36Sopenharmony_ci#define MAC_HWF2R_RXQCNT_POS		0
11562306a36Sopenharmony_ci#define MAC_HWF2R_RXQCNT_LEN		4
11662306a36Sopenharmony_ci#define MAC_HWF2R_TXCHCNT_POS		18
11762306a36Sopenharmony_ci#define MAC_HWF2R_TXCHCNT_LEN		4
11862306a36Sopenharmony_ci#define MAC_HWF2R_TXQCNT_POS		6
11962306a36Sopenharmony_ci#define MAC_HWF2R_TXQCNT_LEN		4
12062306a36Sopenharmony_ci#define MAC_IER_TSIE_POS		12
12162306a36Sopenharmony_ci#define MAC_IER_TSIE_LEN		1
12262306a36Sopenharmony_ci#define MAC_ISR_MMCRXIS_POS		9
12362306a36Sopenharmony_ci#define MAC_ISR_MMCRXIS_LEN		1
12462306a36Sopenharmony_ci#define MAC_ISR_MMCTXIS_POS		10
12562306a36Sopenharmony_ci#define MAC_ISR_MMCTXIS_LEN		1
12662306a36Sopenharmony_ci#define MAC_ISR_PMTIS_POS		4
12762306a36Sopenharmony_ci#define MAC_ISR_PMTIS_LEN		1
12862306a36Sopenharmony_ci#define MAC_ISR_TSIS_POS		12
12962306a36Sopenharmony_ci#define MAC_ISR_TSIS_LEN		1
13062306a36Sopenharmony_ci#define MAC_MACA1HR_AE_POS		31
13162306a36Sopenharmony_ci#define MAC_MACA1HR_AE_LEN		1
13262306a36Sopenharmony_ci#define MAC_PFR_HMC_POS			2
13362306a36Sopenharmony_ci#define MAC_PFR_HMC_LEN			1
13462306a36Sopenharmony_ci#define MAC_PFR_HPF_POS			10
13562306a36Sopenharmony_ci#define MAC_PFR_HPF_LEN			1
13662306a36Sopenharmony_ci#define MAC_PFR_HUC_POS			1
13762306a36Sopenharmony_ci#define MAC_PFR_HUC_LEN			1
13862306a36Sopenharmony_ci#define MAC_PFR_PM_POS			4
13962306a36Sopenharmony_ci#define MAC_PFR_PM_LEN			1
14062306a36Sopenharmony_ci#define MAC_PFR_PR_POS			0
14162306a36Sopenharmony_ci#define MAC_PFR_PR_LEN			1
14262306a36Sopenharmony_ci#define MAC_PFR_VTFE_POS		16
14362306a36Sopenharmony_ci#define MAC_PFR_VTFE_LEN		1
14462306a36Sopenharmony_ci#define MAC_Q0TFCR_PT_POS		16
14562306a36Sopenharmony_ci#define MAC_Q0TFCR_PT_LEN		16
14662306a36Sopenharmony_ci#define MAC_Q0TFCR_TFE_POS		1
14762306a36Sopenharmony_ci#define MAC_Q0TFCR_TFE_LEN		1
14862306a36Sopenharmony_ci#define MAC_RCR_ACS_POS			1
14962306a36Sopenharmony_ci#define MAC_RCR_ACS_LEN			1
15062306a36Sopenharmony_ci#define MAC_RCR_CST_POS			2
15162306a36Sopenharmony_ci#define MAC_RCR_CST_LEN			1
15262306a36Sopenharmony_ci#define MAC_RCR_DCRCC_POS		3
15362306a36Sopenharmony_ci#define MAC_RCR_DCRCC_LEN		1
15462306a36Sopenharmony_ci#define MAC_RCR_HDSMS_POS		12
15562306a36Sopenharmony_ci#define MAC_RCR_HDSMS_LEN		3
15662306a36Sopenharmony_ci#define MAC_RCR_IPC_POS			9
15762306a36Sopenharmony_ci#define MAC_RCR_IPC_LEN			1
15862306a36Sopenharmony_ci#define MAC_RCR_JE_POS			8
15962306a36Sopenharmony_ci#define MAC_RCR_JE_LEN			1
16062306a36Sopenharmony_ci#define MAC_RCR_LM_POS			10
16162306a36Sopenharmony_ci#define MAC_RCR_LM_LEN			1
16262306a36Sopenharmony_ci#define MAC_RCR_RE_POS			0
16362306a36Sopenharmony_ci#define MAC_RCR_RE_LEN			1
16462306a36Sopenharmony_ci#define MAC_RFCR_PFCE_POS		8
16562306a36Sopenharmony_ci#define MAC_RFCR_PFCE_LEN		1
16662306a36Sopenharmony_ci#define MAC_RFCR_RFE_POS		0
16762306a36Sopenharmony_ci#define MAC_RFCR_RFE_LEN		1
16862306a36Sopenharmony_ci#define MAC_RFCR_UP_POS			1
16962306a36Sopenharmony_ci#define MAC_RFCR_UP_LEN			1
17062306a36Sopenharmony_ci#define MAC_RQC0R_RXQ0EN_POS		0
17162306a36Sopenharmony_ci#define MAC_RQC0R_RXQ0EN_LEN		2
17262306a36Sopenharmony_ci#define MAC_RSSAR_ADDRT_POS		2
17362306a36Sopenharmony_ci#define MAC_RSSAR_ADDRT_LEN		1
17462306a36Sopenharmony_ci#define MAC_RSSAR_CT_POS		1
17562306a36Sopenharmony_ci#define MAC_RSSAR_CT_LEN		1
17662306a36Sopenharmony_ci#define MAC_RSSAR_OB_POS		0
17762306a36Sopenharmony_ci#define MAC_RSSAR_OB_LEN		1
17862306a36Sopenharmony_ci#define MAC_RSSAR_RSSIA_POS		8
17962306a36Sopenharmony_ci#define MAC_RSSAR_RSSIA_LEN		8
18062306a36Sopenharmony_ci#define MAC_RSSCR_IP2TE_POS		1
18162306a36Sopenharmony_ci#define MAC_RSSCR_IP2TE_LEN		1
18262306a36Sopenharmony_ci#define MAC_RSSCR_RSSE_POS		0
18362306a36Sopenharmony_ci#define MAC_RSSCR_RSSE_LEN		1
18462306a36Sopenharmony_ci#define MAC_RSSCR_TCP4TE_POS		2
18562306a36Sopenharmony_ci#define MAC_RSSCR_TCP4TE_LEN		1
18662306a36Sopenharmony_ci#define MAC_RSSCR_UDP4TE_POS		3
18762306a36Sopenharmony_ci#define MAC_RSSCR_UDP4TE_LEN		1
18862306a36Sopenharmony_ci#define MAC_RSSDR_DMCH_POS		0
18962306a36Sopenharmony_ci#define MAC_RSSDR_DMCH_LEN		4
19062306a36Sopenharmony_ci#define MAC_TCR_SS_POS			28
19162306a36Sopenharmony_ci#define MAC_TCR_SS_LEN			3
19262306a36Sopenharmony_ci#define MAC_TCR_TE_POS			0
19362306a36Sopenharmony_ci#define MAC_TCR_TE_LEN			1
19462306a36Sopenharmony_ci#define MAC_VLANHTR_VLHT_POS		0
19562306a36Sopenharmony_ci#define MAC_VLANHTR_VLHT_LEN		16
19662306a36Sopenharmony_ci#define MAC_VLANIR_VLTI_POS		20
19762306a36Sopenharmony_ci#define MAC_VLANIR_VLTI_LEN		1
19862306a36Sopenharmony_ci#define MAC_VLANIR_CSVL_POS		19
19962306a36Sopenharmony_ci#define MAC_VLANIR_CSVL_LEN		1
20062306a36Sopenharmony_ci#define MAC_VLANTR_DOVLTC_POS		20
20162306a36Sopenharmony_ci#define MAC_VLANTR_DOVLTC_LEN		1
20262306a36Sopenharmony_ci#define MAC_VLANTR_ERSVLM_POS		19
20362306a36Sopenharmony_ci#define MAC_VLANTR_ERSVLM_LEN		1
20462306a36Sopenharmony_ci#define MAC_VLANTR_ESVL_POS		18
20562306a36Sopenharmony_ci#define MAC_VLANTR_ESVL_LEN		1
20662306a36Sopenharmony_ci#define MAC_VLANTR_ETV_POS		16
20762306a36Sopenharmony_ci#define MAC_VLANTR_ETV_LEN		1
20862306a36Sopenharmony_ci#define MAC_VLANTR_EVLS_POS		21
20962306a36Sopenharmony_ci#define MAC_VLANTR_EVLS_LEN		2
21062306a36Sopenharmony_ci#define MAC_VLANTR_EVLRXS_POS		24
21162306a36Sopenharmony_ci#define MAC_VLANTR_EVLRXS_LEN		1
21262306a36Sopenharmony_ci#define MAC_VLANTR_VL_POS		0
21362306a36Sopenharmony_ci#define MAC_VLANTR_VL_LEN		16
21462306a36Sopenharmony_ci#define MAC_VLANTR_VTHM_POS		25
21562306a36Sopenharmony_ci#define MAC_VLANTR_VTHM_LEN		1
21662306a36Sopenharmony_ci#define MAC_VLANTR_VTIM_POS		17
21762306a36Sopenharmony_ci#define MAC_VLANTR_VTIM_LEN		1
21862306a36Sopenharmony_ci#define MAC_VR_DEVID_POS		8
21962306a36Sopenharmony_ci#define MAC_VR_DEVID_LEN		8
22062306a36Sopenharmony_ci#define MAC_VR_SNPSVER_POS		0
22162306a36Sopenharmony_ci#define MAC_VR_SNPSVER_LEN		8
22262306a36Sopenharmony_ci#define MAC_VR_USERVER_POS		16
22362306a36Sopenharmony_ci#define MAC_VR_USERVER_LEN		8
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci/* MMC register offsets */
22662306a36Sopenharmony_ci#define MMC_CR				0x0800
22762306a36Sopenharmony_ci#define MMC_RISR			0x0804
22862306a36Sopenharmony_ci#define MMC_TISR			0x0808
22962306a36Sopenharmony_ci#define MMC_RIER			0x080c
23062306a36Sopenharmony_ci#define MMC_TIER			0x0810
23162306a36Sopenharmony_ci#define MMC_TXOCTETCOUNT_GB_LO		0x0814
23262306a36Sopenharmony_ci#define MMC_TXFRAMECOUNT_GB_LO		0x081c
23362306a36Sopenharmony_ci#define MMC_TXBROADCASTFRAMES_G_LO	0x0824
23462306a36Sopenharmony_ci#define MMC_TXMULTICASTFRAMES_G_LO	0x082c
23562306a36Sopenharmony_ci#define MMC_TX64OCTETS_GB_LO		0x0834
23662306a36Sopenharmony_ci#define MMC_TX65TO127OCTETS_GB_LO	0x083c
23762306a36Sopenharmony_ci#define MMC_TX128TO255OCTETS_GB_LO	0x0844
23862306a36Sopenharmony_ci#define MMC_TX256TO511OCTETS_GB_LO	0x084c
23962306a36Sopenharmony_ci#define MMC_TX512TO1023OCTETS_GB_LO	0x0854
24062306a36Sopenharmony_ci#define MMC_TX1024TOMAXOCTETS_GB_LO	0x085c
24162306a36Sopenharmony_ci#define MMC_TXUNICASTFRAMES_GB_LO	0x0864
24262306a36Sopenharmony_ci#define MMC_TXMULTICASTFRAMES_GB_LO	0x086c
24362306a36Sopenharmony_ci#define MMC_TXBROADCASTFRAMES_GB_LO	0x0874
24462306a36Sopenharmony_ci#define MMC_TXUNDERFLOWERROR_LO		0x087c
24562306a36Sopenharmony_ci#define MMC_TXOCTETCOUNT_G_LO		0x0884
24662306a36Sopenharmony_ci#define MMC_TXFRAMECOUNT_G_LO		0x088c
24762306a36Sopenharmony_ci#define MMC_TXPAUSEFRAMES_LO		0x0894
24862306a36Sopenharmony_ci#define MMC_TXVLANFRAMES_G_LO		0x089c
24962306a36Sopenharmony_ci#define MMC_RXFRAMECOUNT_GB_LO		0x0900
25062306a36Sopenharmony_ci#define MMC_RXOCTETCOUNT_GB_LO		0x0908
25162306a36Sopenharmony_ci#define MMC_RXOCTETCOUNT_G_LO		0x0910
25262306a36Sopenharmony_ci#define MMC_RXBROADCASTFRAMES_G_LO	0x0918
25362306a36Sopenharmony_ci#define MMC_RXMULTICASTFRAMES_G_LO	0x0920
25462306a36Sopenharmony_ci#define MMC_RXCRCERROR_LO		0x0928
25562306a36Sopenharmony_ci#define MMC_RXRUNTERROR			0x0930
25662306a36Sopenharmony_ci#define MMC_RXJABBERERROR		0x0934
25762306a36Sopenharmony_ci#define MMC_RXUNDERSIZE_G		0x0938
25862306a36Sopenharmony_ci#define MMC_RXOVERSIZE_G		0x093c
25962306a36Sopenharmony_ci#define MMC_RX64OCTETS_GB_LO		0x0940
26062306a36Sopenharmony_ci#define MMC_RX65TO127OCTETS_GB_LO	0x0948
26162306a36Sopenharmony_ci#define MMC_RX128TO255OCTETS_GB_LO	0x0950
26262306a36Sopenharmony_ci#define MMC_RX256TO511OCTETS_GB_LO	0x0958
26362306a36Sopenharmony_ci#define MMC_RX512TO1023OCTETS_GB_LO	0x0960
26462306a36Sopenharmony_ci#define MMC_RX1024TOMAXOCTETS_GB_LO	0x0968
26562306a36Sopenharmony_ci#define MMC_RXUNICASTFRAMES_G_LO	0x0970
26662306a36Sopenharmony_ci#define MMC_RXLENGTHERROR_LO		0x0978
26762306a36Sopenharmony_ci#define MMC_RXOUTOFRANGETYPE_LO		0x0980
26862306a36Sopenharmony_ci#define MMC_RXPAUSEFRAMES_LO		0x0988
26962306a36Sopenharmony_ci#define MMC_RXFIFOOVERFLOW_LO		0x0990
27062306a36Sopenharmony_ci#define MMC_RXVLANFRAMES_GB_LO		0x0998
27162306a36Sopenharmony_ci#define MMC_RXWATCHDOGERROR		0x09a0
27262306a36Sopenharmony_ci
27362306a36Sopenharmony_ci/* MMC register entry bit positions and sizes */
27462306a36Sopenharmony_ci#define MMC_CR_CR_POS				0
27562306a36Sopenharmony_ci#define MMC_CR_CR_LEN				1
27662306a36Sopenharmony_ci#define MMC_CR_CSR_POS				1
27762306a36Sopenharmony_ci#define MMC_CR_CSR_LEN				1
27862306a36Sopenharmony_ci#define MMC_CR_ROR_POS				2
27962306a36Sopenharmony_ci#define MMC_CR_ROR_LEN				1
28062306a36Sopenharmony_ci#define MMC_CR_MCF_POS				3
28162306a36Sopenharmony_ci#define MMC_CR_MCF_LEN				1
28262306a36Sopenharmony_ci#define MMC_CR_MCT_POS				4
28362306a36Sopenharmony_ci#define MMC_CR_MCT_LEN				2
28462306a36Sopenharmony_ci#define MMC_RIER_ALL_INTERRUPTS_POS		0
28562306a36Sopenharmony_ci#define MMC_RIER_ALL_INTERRUPTS_LEN		23
28662306a36Sopenharmony_ci#define MMC_RISR_RXFRAMECOUNT_GB_POS		0
28762306a36Sopenharmony_ci#define MMC_RISR_RXFRAMECOUNT_GB_LEN		1
28862306a36Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_GB_POS		1
28962306a36Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_GB_LEN		1
29062306a36Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_G_POS		2
29162306a36Sopenharmony_ci#define MMC_RISR_RXOCTETCOUNT_G_LEN		1
29262306a36Sopenharmony_ci#define MMC_RISR_RXBROADCASTFRAMES_G_POS	3
29362306a36Sopenharmony_ci#define MMC_RISR_RXBROADCASTFRAMES_G_LEN	1
29462306a36Sopenharmony_ci#define MMC_RISR_RXMULTICASTFRAMES_G_POS	4
29562306a36Sopenharmony_ci#define MMC_RISR_RXMULTICASTFRAMES_G_LEN	1
29662306a36Sopenharmony_ci#define MMC_RISR_RXCRCERROR_POS			5
29762306a36Sopenharmony_ci#define MMC_RISR_RXCRCERROR_LEN			1
29862306a36Sopenharmony_ci#define MMC_RISR_RXRUNTERROR_POS		6
29962306a36Sopenharmony_ci#define MMC_RISR_RXRUNTERROR_LEN		1
30062306a36Sopenharmony_ci#define MMC_RISR_RXJABBERERROR_POS		7
30162306a36Sopenharmony_ci#define MMC_RISR_RXJABBERERROR_LEN		1
30262306a36Sopenharmony_ci#define MMC_RISR_RXUNDERSIZE_G_POS		8
30362306a36Sopenharmony_ci#define MMC_RISR_RXUNDERSIZE_G_LEN		1
30462306a36Sopenharmony_ci#define MMC_RISR_RXOVERSIZE_G_POS		9
30562306a36Sopenharmony_ci#define MMC_RISR_RXOVERSIZE_G_LEN		1
30662306a36Sopenharmony_ci#define MMC_RISR_RX64OCTETS_GB_POS		10
30762306a36Sopenharmony_ci#define MMC_RISR_RX64OCTETS_GB_LEN		1
30862306a36Sopenharmony_ci#define MMC_RISR_RX65TO127OCTETS_GB_POS		11
30962306a36Sopenharmony_ci#define MMC_RISR_RX65TO127OCTETS_GB_LEN		1
31062306a36Sopenharmony_ci#define MMC_RISR_RX128TO255OCTETS_GB_POS	12
31162306a36Sopenharmony_ci#define MMC_RISR_RX128TO255OCTETS_GB_LEN	1
31262306a36Sopenharmony_ci#define MMC_RISR_RX256TO511OCTETS_GB_POS	13
31362306a36Sopenharmony_ci#define MMC_RISR_RX256TO511OCTETS_GB_LEN	1
31462306a36Sopenharmony_ci#define MMC_RISR_RX512TO1023OCTETS_GB_POS	14
31562306a36Sopenharmony_ci#define MMC_RISR_RX512TO1023OCTETS_GB_LEN	1
31662306a36Sopenharmony_ci#define MMC_RISR_RX1024TOMAXOCTETS_GB_POS	15
31762306a36Sopenharmony_ci#define MMC_RISR_RX1024TOMAXOCTETS_GB_LEN	1
31862306a36Sopenharmony_ci#define MMC_RISR_RXUNICASTFRAMES_G_POS		16
31962306a36Sopenharmony_ci#define MMC_RISR_RXUNICASTFRAMES_G_LEN		1
32062306a36Sopenharmony_ci#define MMC_RISR_RXLENGTHERROR_POS		17
32162306a36Sopenharmony_ci#define MMC_RISR_RXLENGTHERROR_LEN		1
32262306a36Sopenharmony_ci#define MMC_RISR_RXOUTOFRANGETYPE_POS		18
32362306a36Sopenharmony_ci#define MMC_RISR_RXOUTOFRANGETYPE_LEN		1
32462306a36Sopenharmony_ci#define MMC_RISR_RXPAUSEFRAMES_POS		19
32562306a36Sopenharmony_ci#define MMC_RISR_RXPAUSEFRAMES_LEN		1
32662306a36Sopenharmony_ci#define MMC_RISR_RXFIFOOVERFLOW_POS		20
32762306a36Sopenharmony_ci#define MMC_RISR_RXFIFOOVERFLOW_LEN		1
32862306a36Sopenharmony_ci#define MMC_RISR_RXVLANFRAMES_GB_POS		21
32962306a36Sopenharmony_ci#define MMC_RISR_RXVLANFRAMES_GB_LEN		1
33062306a36Sopenharmony_ci#define MMC_RISR_RXWATCHDOGERROR_POS		22
33162306a36Sopenharmony_ci#define MMC_RISR_RXWATCHDOGERROR_LEN		1
33262306a36Sopenharmony_ci#define MMC_TIER_ALL_INTERRUPTS_POS		0
33362306a36Sopenharmony_ci#define MMC_TIER_ALL_INTERRUPTS_LEN		18
33462306a36Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_GB_POS		0
33562306a36Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_GB_LEN		1
33662306a36Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_GB_POS		1
33762306a36Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_GB_LEN		1
33862306a36Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_G_POS	2
33962306a36Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_G_LEN	1
34062306a36Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_G_POS	3
34162306a36Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_G_LEN	1
34262306a36Sopenharmony_ci#define MMC_TISR_TX64OCTETS_GB_POS		4
34362306a36Sopenharmony_ci#define MMC_TISR_TX64OCTETS_GB_LEN		1
34462306a36Sopenharmony_ci#define MMC_TISR_TX65TO127OCTETS_GB_POS		5
34562306a36Sopenharmony_ci#define MMC_TISR_TX65TO127OCTETS_GB_LEN		1
34662306a36Sopenharmony_ci#define MMC_TISR_TX128TO255OCTETS_GB_POS	6
34762306a36Sopenharmony_ci#define MMC_TISR_TX128TO255OCTETS_GB_LEN	1
34862306a36Sopenharmony_ci#define MMC_TISR_TX256TO511OCTETS_GB_POS	7
34962306a36Sopenharmony_ci#define MMC_TISR_TX256TO511OCTETS_GB_LEN	1
35062306a36Sopenharmony_ci#define MMC_TISR_TX512TO1023OCTETS_GB_POS	8
35162306a36Sopenharmony_ci#define MMC_TISR_TX512TO1023OCTETS_GB_LEN	1
35262306a36Sopenharmony_ci#define MMC_TISR_TX1024TOMAXOCTETS_GB_POS	9
35362306a36Sopenharmony_ci#define MMC_TISR_TX1024TOMAXOCTETS_GB_LEN	1
35462306a36Sopenharmony_ci#define MMC_TISR_TXUNICASTFRAMES_GB_POS		10
35562306a36Sopenharmony_ci#define MMC_TISR_TXUNICASTFRAMES_GB_LEN		1
35662306a36Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_GB_POS	11
35762306a36Sopenharmony_ci#define MMC_TISR_TXMULTICASTFRAMES_GB_LEN	1
35862306a36Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_GB_POS	12
35962306a36Sopenharmony_ci#define MMC_TISR_TXBROADCASTFRAMES_GB_LEN	1
36062306a36Sopenharmony_ci#define MMC_TISR_TXUNDERFLOWERROR_POS		13
36162306a36Sopenharmony_ci#define MMC_TISR_TXUNDERFLOWERROR_LEN		1
36262306a36Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_G_POS		14
36362306a36Sopenharmony_ci#define MMC_TISR_TXOCTETCOUNT_G_LEN		1
36462306a36Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_G_POS		15
36562306a36Sopenharmony_ci#define MMC_TISR_TXFRAMECOUNT_G_LEN		1
36662306a36Sopenharmony_ci#define MMC_TISR_TXPAUSEFRAMES_POS		16
36762306a36Sopenharmony_ci#define MMC_TISR_TXPAUSEFRAMES_LEN		1
36862306a36Sopenharmony_ci#define MMC_TISR_TXVLANFRAMES_G_POS		17
36962306a36Sopenharmony_ci#define MMC_TISR_TXVLANFRAMES_G_LEN		1
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_ci/* MTL register offsets */
37262306a36Sopenharmony_ci#define MTL_OMR				0x1000
37362306a36Sopenharmony_ci#define MTL_FDDR			0x1010
37462306a36Sopenharmony_ci#define MTL_RQDCM0R			0x1030
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_ci#define MTL_RQDCM_INC			4
37762306a36Sopenharmony_ci#define MTL_RQDCM_Q_PER_REG		4
37862306a36Sopenharmony_ci
37962306a36Sopenharmony_ci/* MTL register entry bit positions and sizes */
38062306a36Sopenharmony_ci#define MTL_OMR_ETSALG_POS		5
38162306a36Sopenharmony_ci#define MTL_OMR_ETSALG_LEN		2
38262306a36Sopenharmony_ci#define MTL_OMR_RAA_POS			2
38362306a36Sopenharmony_ci#define MTL_OMR_RAA_LEN			1
38462306a36Sopenharmony_ci
38562306a36Sopenharmony_ci/* MTL queue register offsets
38662306a36Sopenharmony_ci *   Multiple queues can be active.  The first queue has registers
38762306a36Sopenharmony_ci *   that begin at 0x1100.  Each subsequent queue has registers that
38862306a36Sopenharmony_ci *   are accessed using an offset of 0x80 from the previous queue.
38962306a36Sopenharmony_ci */
39062306a36Sopenharmony_ci#define MTL_Q_BASE			0x1100
39162306a36Sopenharmony_ci#define MTL_Q_INC			0x80
39262306a36Sopenharmony_ci
39362306a36Sopenharmony_ci#define MTL_Q_TQOMR			0x00
39462306a36Sopenharmony_ci#define MTL_Q_RQOMR			0x40
39562306a36Sopenharmony_ci#define MTL_Q_RQDR			0x48
39662306a36Sopenharmony_ci#define MTL_Q_RQFCR			0x50
39762306a36Sopenharmony_ci#define MTL_Q_IER			0x70
39862306a36Sopenharmony_ci#define MTL_Q_ISR			0x74
39962306a36Sopenharmony_ci
40062306a36Sopenharmony_ci/* MTL queue register entry bit positions and sizes */
40162306a36Sopenharmony_ci#define MTL_Q_RQDR_PRXQ_POS		16
40262306a36Sopenharmony_ci#define MTL_Q_RQDR_PRXQ_LEN		14
40362306a36Sopenharmony_ci#define MTL_Q_RQDR_RXQSTS_POS		4
40462306a36Sopenharmony_ci#define MTL_Q_RQDR_RXQSTS_LEN		2
40562306a36Sopenharmony_ci#define MTL_Q_RQFCR_RFA_POS		1
40662306a36Sopenharmony_ci#define MTL_Q_RQFCR_RFA_LEN		6
40762306a36Sopenharmony_ci#define MTL_Q_RQFCR_RFD_POS		17
40862306a36Sopenharmony_ci#define MTL_Q_RQFCR_RFD_LEN		6
40962306a36Sopenharmony_ci#define MTL_Q_RQOMR_EHFC_POS		7
41062306a36Sopenharmony_ci#define MTL_Q_RQOMR_EHFC_LEN		1
41162306a36Sopenharmony_ci#define MTL_Q_RQOMR_RQS_POS		16
41262306a36Sopenharmony_ci#define MTL_Q_RQOMR_RQS_LEN		9
41362306a36Sopenharmony_ci#define MTL_Q_RQOMR_RSF_POS		5
41462306a36Sopenharmony_ci#define MTL_Q_RQOMR_RSF_LEN		1
41562306a36Sopenharmony_ci#define MTL_Q_RQOMR_FEP_POS		4
41662306a36Sopenharmony_ci#define MTL_Q_RQOMR_FEP_LEN		1
41762306a36Sopenharmony_ci#define MTL_Q_RQOMR_FUP_POS		3
41862306a36Sopenharmony_ci#define MTL_Q_RQOMR_FUP_LEN		1
41962306a36Sopenharmony_ci#define MTL_Q_RQOMR_RTC_POS		0
42062306a36Sopenharmony_ci#define MTL_Q_RQOMR_RTC_LEN		2
42162306a36Sopenharmony_ci#define MTL_Q_TQOMR_FTQ_POS		0
42262306a36Sopenharmony_ci#define MTL_Q_TQOMR_FTQ_LEN		1
42362306a36Sopenharmony_ci#define MTL_Q_TQOMR_Q2TCMAP_POS		8
42462306a36Sopenharmony_ci#define MTL_Q_TQOMR_Q2TCMAP_LEN		3
42562306a36Sopenharmony_ci#define MTL_Q_TQOMR_TQS_POS		16
42662306a36Sopenharmony_ci#define MTL_Q_TQOMR_TQS_LEN		10
42762306a36Sopenharmony_ci#define MTL_Q_TQOMR_TSF_POS		1
42862306a36Sopenharmony_ci#define MTL_Q_TQOMR_TSF_LEN		1
42962306a36Sopenharmony_ci#define MTL_Q_TQOMR_TTC_POS		4
43062306a36Sopenharmony_ci#define MTL_Q_TQOMR_TTC_LEN		3
43162306a36Sopenharmony_ci#define MTL_Q_TQOMR_TXQEN_POS		2
43262306a36Sopenharmony_ci#define MTL_Q_TQOMR_TXQEN_LEN		2
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_ci/* MTL queue register value */
43562306a36Sopenharmony_ci#define MTL_RSF_DISABLE			0x00
43662306a36Sopenharmony_ci#define MTL_RSF_ENABLE			0x01
43762306a36Sopenharmony_ci#define MTL_TSF_DISABLE			0x00
43862306a36Sopenharmony_ci#define MTL_TSF_ENABLE			0x01
43962306a36Sopenharmony_ci
44062306a36Sopenharmony_ci#define MTL_RX_THRESHOLD_64		0x00
44162306a36Sopenharmony_ci#define MTL_RX_THRESHOLD_96		0x02
44262306a36Sopenharmony_ci#define MTL_RX_THRESHOLD_128		0x03
44362306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_64		0x00
44462306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_96		0x02
44562306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_128		0x03
44662306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_192		0x04
44762306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_256		0x05
44862306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_384		0x06
44962306a36Sopenharmony_ci#define MTL_TX_THRESHOLD_512		0x07
45062306a36Sopenharmony_ci
45162306a36Sopenharmony_ci#define MTL_ETSALG_WRR			0x00
45262306a36Sopenharmony_ci#define MTL_ETSALG_WFQ			0x01
45362306a36Sopenharmony_ci#define MTL_ETSALG_DWRR			0x02
45462306a36Sopenharmony_ci#define MTL_RAA_SP			0x00
45562306a36Sopenharmony_ci#define MTL_RAA_WSP			0x01
45662306a36Sopenharmony_ci
45762306a36Sopenharmony_ci#define MTL_Q_DISABLED			0x00
45862306a36Sopenharmony_ci#define MTL_Q_ENABLED			0x02
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_ci#define MTL_RQDCM0R_Q0MDMACH		0x0
46162306a36Sopenharmony_ci#define MTL_RQDCM0R_Q1MDMACH		0x00000100
46262306a36Sopenharmony_ci#define MTL_RQDCM0R_Q2MDMACH		0x00020000
46362306a36Sopenharmony_ci#define MTL_RQDCM0R_Q3MDMACH		0x03000000
46462306a36Sopenharmony_ci#define MTL_RQDCM1R_Q4MDMACH		0x00000004
46562306a36Sopenharmony_ci#define MTL_RQDCM1R_Q5MDMACH		0x00000500
46662306a36Sopenharmony_ci#define MTL_RQDCM1R_Q6MDMACH		0x00060000
46762306a36Sopenharmony_ci#define MTL_RQDCM1R_Q7MDMACH		0x07000000
46862306a36Sopenharmony_ci#define MTL_RQDCM2R_Q8MDMACH		0x00000008
46962306a36Sopenharmony_ci#define MTL_RQDCM2R_Q9MDMACH		0x00000900
47062306a36Sopenharmony_ci#define MTL_RQDCM2R_Q10MDMACH		0x000A0000
47162306a36Sopenharmony_ci#define MTL_RQDCM2R_Q11MDMACH		0x0B000000
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_ci/* MTL traffic class register offsets
47462306a36Sopenharmony_ci *   Multiple traffic classes can be active.  The first class has registers
47562306a36Sopenharmony_ci *   that begin at 0x1100.  Each subsequent queue has registers that
47662306a36Sopenharmony_ci *   are accessed using an offset of 0x80 from the previous queue.
47762306a36Sopenharmony_ci */
47862306a36Sopenharmony_ci#define MTL_TC_BASE			MTL_Q_BASE
47962306a36Sopenharmony_ci#define MTL_TC_INC			MTL_Q_INC
48062306a36Sopenharmony_ci
48162306a36Sopenharmony_ci#define MTL_TC_ETSCR			0x10
48262306a36Sopenharmony_ci#define MTL_TC_ETSSR			0x14
48362306a36Sopenharmony_ci#define MTL_TC_QWR			0x18
48462306a36Sopenharmony_ci
48562306a36Sopenharmony_ci/* MTL traffic class register entry bit positions and sizes */
48662306a36Sopenharmony_ci#define MTL_TC_ETSCR_TSA_POS		0
48762306a36Sopenharmony_ci#define MTL_TC_ETSCR_TSA_LEN		2
48862306a36Sopenharmony_ci#define MTL_TC_QWR_QW_POS		0
48962306a36Sopenharmony_ci#define MTL_TC_QWR_QW_LEN		21
49062306a36Sopenharmony_ci
49162306a36Sopenharmony_ci/* MTL traffic class register value */
49262306a36Sopenharmony_ci#define MTL_TSA_SP			0x00
49362306a36Sopenharmony_ci#define MTL_TSA_ETS			0x02
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_ci/* DMA register offsets */
49662306a36Sopenharmony_ci#define DMA_MR				0x3000
49762306a36Sopenharmony_ci#define DMA_SBMR			0x3004
49862306a36Sopenharmony_ci#define DMA_ISR				0x3008
49962306a36Sopenharmony_ci#define DMA_DSR0			0x3020
50062306a36Sopenharmony_ci#define DMA_DSR1			0x3024
50162306a36Sopenharmony_ci
50262306a36Sopenharmony_ci/* DMA register entry bit positions and sizes */
50362306a36Sopenharmony_ci#define DMA_ISR_MACIS_POS		17
50462306a36Sopenharmony_ci#define DMA_ISR_MACIS_LEN		1
50562306a36Sopenharmony_ci#define DMA_ISR_MTLIS_POS		16
50662306a36Sopenharmony_ci#define DMA_ISR_MTLIS_LEN		1
50762306a36Sopenharmony_ci#define DMA_MR_SWR_POS			0
50862306a36Sopenharmony_ci#define DMA_MR_SWR_LEN			1
50962306a36Sopenharmony_ci#define DMA_SBMR_EAME_POS		11
51062306a36Sopenharmony_ci#define DMA_SBMR_EAME_LEN		1
51162306a36Sopenharmony_ci#define DMA_SBMR_BLEN_64_POS		5
51262306a36Sopenharmony_ci#define DMA_SBMR_BLEN_64_LEN		1
51362306a36Sopenharmony_ci#define DMA_SBMR_BLEN_128_POS		6
51462306a36Sopenharmony_ci#define DMA_SBMR_BLEN_128_LEN		1
51562306a36Sopenharmony_ci#define DMA_SBMR_BLEN_256_POS		7
51662306a36Sopenharmony_ci#define DMA_SBMR_BLEN_256_LEN		1
51762306a36Sopenharmony_ci#define DMA_SBMR_UNDEF_POS		0
51862306a36Sopenharmony_ci#define DMA_SBMR_UNDEF_LEN		1
51962306a36Sopenharmony_ci
52062306a36Sopenharmony_ci/* DMA register values */
52162306a36Sopenharmony_ci#define DMA_DSR_RPS_LEN			4
52262306a36Sopenharmony_ci#define DMA_DSR_TPS_LEN			4
52362306a36Sopenharmony_ci#define DMA_DSR_Q_LEN			(DMA_DSR_RPS_LEN + DMA_DSR_TPS_LEN)
52462306a36Sopenharmony_ci#define DMA_DSR0_TPS_START		12
52562306a36Sopenharmony_ci#define DMA_DSRX_FIRST_QUEUE		3
52662306a36Sopenharmony_ci#define DMA_DSRX_INC			4
52762306a36Sopenharmony_ci#define DMA_DSRX_QPR			4
52862306a36Sopenharmony_ci#define DMA_DSRX_TPS_START		4
52962306a36Sopenharmony_ci#define DMA_TPS_STOPPED			0x00
53062306a36Sopenharmony_ci#define DMA_TPS_SUSPENDED		0x06
53162306a36Sopenharmony_ci
53262306a36Sopenharmony_ci/* DMA channel register offsets
53362306a36Sopenharmony_ci *   Multiple channels can be active.  The first channel has registers
53462306a36Sopenharmony_ci *   that begin at 0x3100.  Each subsequent channel has registers that
53562306a36Sopenharmony_ci *   are accessed using an offset of 0x80 from the previous channel.
53662306a36Sopenharmony_ci */
53762306a36Sopenharmony_ci#define DMA_CH_BASE			0x3100
53862306a36Sopenharmony_ci#define DMA_CH_INC			0x80
53962306a36Sopenharmony_ci
54062306a36Sopenharmony_ci#define DMA_CH_CR			0x00
54162306a36Sopenharmony_ci#define DMA_CH_TCR			0x04
54262306a36Sopenharmony_ci#define DMA_CH_RCR			0x08
54362306a36Sopenharmony_ci#define DMA_CH_TDLR_HI			0x10
54462306a36Sopenharmony_ci#define DMA_CH_TDLR_LO			0x14
54562306a36Sopenharmony_ci#define DMA_CH_RDLR_HI			0x18
54662306a36Sopenharmony_ci#define DMA_CH_RDLR_LO			0x1c
54762306a36Sopenharmony_ci#define DMA_CH_TDTR_LO			0x24
54862306a36Sopenharmony_ci#define DMA_CH_RDTR_LO			0x2c
54962306a36Sopenharmony_ci#define DMA_CH_TDRLR			0x30
55062306a36Sopenharmony_ci#define DMA_CH_RDRLR			0x34
55162306a36Sopenharmony_ci#define DMA_CH_IER			0x38
55262306a36Sopenharmony_ci#define DMA_CH_RIWT			0x3c
55362306a36Sopenharmony_ci#define DMA_CH_SR			0x60
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_ci/* DMA channel register entry bit positions and sizes */
55662306a36Sopenharmony_ci#define DMA_CH_CR_PBLX8_POS		16
55762306a36Sopenharmony_ci#define DMA_CH_CR_PBLX8_LEN		1
55862306a36Sopenharmony_ci#define DMA_CH_CR_SPH_POS		24
55962306a36Sopenharmony_ci#define DMA_CH_CR_SPH_LEN		1
56062306a36Sopenharmony_ci#define DMA_CH_IER_AIE_POS		15
56162306a36Sopenharmony_ci#define DMA_CH_IER_AIE_LEN		1
56262306a36Sopenharmony_ci#define DMA_CH_IER_FBEE_POS		12
56362306a36Sopenharmony_ci#define DMA_CH_IER_FBEE_LEN		1
56462306a36Sopenharmony_ci#define DMA_CH_IER_NIE_POS		16
56562306a36Sopenharmony_ci#define DMA_CH_IER_NIE_LEN		1
56662306a36Sopenharmony_ci#define DMA_CH_IER_RBUE_POS		7
56762306a36Sopenharmony_ci#define DMA_CH_IER_RBUE_LEN		1
56862306a36Sopenharmony_ci#define DMA_CH_IER_RIE_POS		6
56962306a36Sopenharmony_ci#define DMA_CH_IER_RIE_LEN		1
57062306a36Sopenharmony_ci#define DMA_CH_IER_RSE_POS		8
57162306a36Sopenharmony_ci#define DMA_CH_IER_RSE_LEN		1
57262306a36Sopenharmony_ci#define DMA_CH_IER_TBUE_POS		2
57362306a36Sopenharmony_ci#define DMA_CH_IER_TBUE_LEN		1
57462306a36Sopenharmony_ci#define DMA_CH_IER_TIE_POS		0
57562306a36Sopenharmony_ci#define DMA_CH_IER_TIE_LEN		1
57662306a36Sopenharmony_ci#define DMA_CH_IER_TXSE_POS		1
57762306a36Sopenharmony_ci#define DMA_CH_IER_TXSE_LEN		1
57862306a36Sopenharmony_ci#define DMA_CH_RCR_PBL_POS		16
57962306a36Sopenharmony_ci#define DMA_CH_RCR_PBL_LEN		6
58062306a36Sopenharmony_ci#define DMA_CH_RCR_RBSZ_POS		1
58162306a36Sopenharmony_ci#define DMA_CH_RCR_RBSZ_LEN		14
58262306a36Sopenharmony_ci#define DMA_CH_RCR_SR_POS		0
58362306a36Sopenharmony_ci#define DMA_CH_RCR_SR_LEN		1
58462306a36Sopenharmony_ci#define DMA_CH_RIWT_RWT_POS		0
58562306a36Sopenharmony_ci#define DMA_CH_RIWT_RWT_LEN		8
58662306a36Sopenharmony_ci#define DMA_CH_SR_FBE_POS		12
58762306a36Sopenharmony_ci#define DMA_CH_SR_FBE_LEN		1
58862306a36Sopenharmony_ci#define DMA_CH_SR_RBU_POS		7
58962306a36Sopenharmony_ci#define DMA_CH_SR_RBU_LEN		1
59062306a36Sopenharmony_ci#define DMA_CH_SR_RI_POS		6
59162306a36Sopenharmony_ci#define DMA_CH_SR_RI_LEN		1
59262306a36Sopenharmony_ci#define DMA_CH_SR_RPS_POS		8
59362306a36Sopenharmony_ci#define DMA_CH_SR_RPS_LEN		1
59462306a36Sopenharmony_ci#define DMA_CH_SR_TBU_POS		2
59562306a36Sopenharmony_ci#define DMA_CH_SR_TBU_LEN		1
59662306a36Sopenharmony_ci#define DMA_CH_SR_TI_POS		0
59762306a36Sopenharmony_ci#define DMA_CH_SR_TI_LEN		1
59862306a36Sopenharmony_ci#define DMA_CH_SR_TPS_POS		1
59962306a36Sopenharmony_ci#define DMA_CH_SR_TPS_LEN		1
60062306a36Sopenharmony_ci#define DMA_CH_TCR_OSP_POS		4
60162306a36Sopenharmony_ci#define DMA_CH_TCR_OSP_LEN		1
60262306a36Sopenharmony_ci#define DMA_CH_TCR_PBL_POS		16
60362306a36Sopenharmony_ci#define DMA_CH_TCR_PBL_LEN		6
60462306a36Sopenharmony_ci#define DMA_CH_TCR_ST_POS		0
60562306a36Sopenharmony_ci#define DMA_CH_TCR_ST_LEN		1
60662306a36Sopenharmony_ci#define DMA_CH_TCR_TSE_POS		12
60762306a36Sopenharmony_ci#define DMA_CH_TCR_TSE_LEN		1
60862306a36Sopenharmony_ci
60962306a36Sopenharmony_ci/* DMA channel register values */
61062306a36Sopenharmony_ci#define DMA_OSP_DISABLE			0x00
61162306a36Sopenharmony_ci#define DMA_OSP_ENABLE			0x01
61262306a36Sopenharmony_ci#define DMA_PBL_1			1
61362306a36Sopenharmony_ci#define DMA_PBL_2			2
61462306a36Sopenharmony_ci#define DMA_PBL_4			4
61562306a36Sopenharmony_ci#define DMA_PBL_8			8
61662306a36Sopenharmony_ci#define DMA_PBL_16			16
61762306a36Sopenharmony_ci#define DMA_PBL_32			32
61862306a36Sopenharmony_ci#define DMA_PBL_64			64
61962306a36Sopenharmony_ci#define DMA_PBL_128			128
62062306a36Sopenharmony_ci#define DMA_PBL_256			256
62162306a36Sopenharmony_ci#define DMA_PBL_X8_DISABLE		0x00
62262306a36Sopenharmony_ci#define DMA_PBL_X8_ENABLE		0x01
62362306a36Sopenharmony_ci
62462306a36Sopenharmony_ci/* Descriptor/Packet entry bit positions and sizes */
62562306a36Sopenharmony_ci#define RX_PACKET_ERRORS_CRC_POS		2
62662306a36Sopenharmony_ci#define RX_PACKET_ERRORS_CRC_LEN		1
62762306a36Sopenharmony_ci#define RX_PACKET_ERRORS_FRAME_POS		3
62862306a36Sopenharmony_ci#define RX_PACKET_ERRORS_FRAME_LEN		1
62962306a36Sopenharmony_ci#define RX_PACKET_ERRORS_LENGTH_POS		0
63062306a36Sopenharmony_ci#define RX_PACKET_ERRORS_LENGTH_LEN		1
63162306a36Sopenharmony_ci#define RX_PACKET_ERRORS_OVERRUN_POS		1
63262306a36Sopenharmony_ci#define RX_PACKET_ERRORS_OVERRUN_LEN		1
63362306a36Sopenharmony_ci
63462306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CSUM_DONE_POS	0
63562306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CSUM_DONE_LEN	1
63662306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_POS	1
63762306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN	1
63862306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_INCOMPLETE_POS	2
63962306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_INCOMPLETE_LEN	1
64062306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_POS	3
64162306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_LEN	1
64262306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_POS	4
64362306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_CONTEXT_LEN	1
64462306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_POS	5
64562306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_LEN	1
64662306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RSS_HASH_POS	6
64762306a36Sopenharmony_ci#define RX_PACKET_ATTRIBUTES_RSS_HASH_LEN	1
64862306a36Sopenharmony_ci
64962306a36Sopenharmony_ci#define RX_NORMAL_DESC0_OVT_POS			0
65062306a36Sopenharmony_ci#define RX_NORMAL_DESC0_OVT_LEN			16
65162306a36Sopenharmony_ci#define RX_NORMAL_DESC2_HL_POS			0
65262306a36Sopenharmony_ci#define RX_NORMAL_DESC2_HL_LEN			10
65362306a36Sopenharmony_ci#define RX_NORMAL_DESC3_CDA_POS			27
65462306a36Sopenharmony_ci#define RX_NORMAL_DESC3_CDA_LEN			1
65562306a36Sopenharmony_ci#define RX_NORMAL_DESC3_CTXT_POS		30
65662306a36Sopenharmony_ci#define RX_NORMAL_DESC3_CTXT_LEN		1
65762306a36Sopenharmony_ci#define RX_NORMAL_DESC3_ES_POS			15
65862306a36Sopenharmony_ci#define RX_NORMAL_DESC3_ES_LEN			1
65962306a36Sopenharmony_ci#define RX_NORMAL_DESC3_ETLT_POS		16
66062306a36Sopenharmony_ci#define RX_NORMAL_DESC3_ETLT_LEN		4
66162306a36Sopenharmony_ci#define RX_NORMAL_DESC3_FD_POS			29
66262306a36Sopenharmony_ci#define RX_NORMAL_DESC3_FD_LEN			1
66362306a36Sopenharmony_ci#define RX_NORMAL_DESC3_INTE_POS		30
66462306a36Sopenharmony_ci#define RX_NORMAL_DESC3_INTE_LEN		1
66562306a36Sopenharmony_ci#define RX_NORMAL_DESC3_L34T_POS		20
66662306a36Sopenharmony_ci#define RX_NORMAL_DESC3_L34T_LEN		4
66762306a36Sopenharmony_ci#define RX_NORMAL_DESC3_LD_POS			28
66862306a36Sopenharmony_ci#define RX_NORMAL_DESC3_LD_LEN			1
66962306a36Sopenharmony_ci#define RX_NORMAL_DESC3_OWN_POS			31
67062306a36Sopenharmony_ci#define RX_NORMAL_DESC3_OWN_LEN			1
67162306a36Sopenharmony_ci#define RX_NORMAL_DESC3_PL_POS			0
67262306a36Sopenharmony_ci#define RX_NORMAL_DESC3_PL_LEN			14
67362306a36Sopenharmony_ci#define RX_NORMAL_DESC3_RSV_POS			26
67462306a36Sopenharmony_ci#define RX_NORMAL_DESC3_RSV_LEN			1
67562306a36Sopenharmony_ci
67662306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV4_TCP			1
67762306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV4_UDP			2
67862306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV4_ICMP			3
67962306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV6_TCP			9
68062306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV6_UDP			10
68162306a36Sopenharmony_ci#define RX_DESC3_L34T_IPV6_ICMP			11
68262306a36Sopenharmony_ci
68362306a36Sopenharmony_ci#define RX_CONTEXT_DESC3_TSA_POS		4
68462306a36Sopenharmony_ci#define RX_CONTEXT_DESC3_TSA_LEN		1
68562306a36Sopenharmony_ci#define RX_CONTEXT_DESC3_TSD_POS		6
68662306a36Sopenharmony_ci#define RX_CONTEXT_DESC3_TSD_LEN		1
68762306a36Sopenharmony_ci
68862306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_POS	0
68962306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_LEN	1
69062306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_POS	1
69162306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_LEN	1
69262306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_POS	2
69362306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN	1
69462306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_PTP_POS		3
69562306a36Sopenharmony_ci#define TX_PACKET_ATTRIBUTES_PTP_LEN		1
69662306a36Sopenharmony_ci
69762306a36Sopenharmony_ci#define TX_CONTEXT_DESC2_MSS_POS		0
69862306a36Sopenharmony_ci#define TX_CONTEXT_DESC2_MSS_LEN		15
69962306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_CTXT_POS		30
70062306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_CTXT_LEN		1
70162306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_TCMSSV_POS		26
70262306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_TCMSSV_LEN		1
70362306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_VLTV_POS		16
70462306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_VLTV_LEN		1
70562306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_VT_POS			0
70662306a36Sopenharmony_ci#define TX_CONTEXT_DESC3_VT_LEN			16
70762306a36Sopenharmony_ci
70862306a36Sopenharmony_ci#define TX_NORMAL_DESC2_HL_B1L_POS		0
70962306a36Sopenharmony_ci#define TX_NORMAL_DESC2_HL_B1L_LEN		14
71062306a36Sopenharmony_ci#define TX_NORMAL_DESC2_IC_POS			31
71162306a36Sopenharmony_ci#define TX_NORMAL_DESC2_IC_LEN			1
71262306a36Sopenharmony_ci#define TX_NORMAL_DESC2_TTSE_POS		30
71362306a36Sopenharmony_ci#define TX_NORMAL_DESC2_TTSE_LEN		1
71462306a36Sopenharmony_ci#define TX_NORMAL_DESC2_VTIR_POS		14
71562306a36Sopenharmony_ci#define TX_NORMAL_DESC2_VTIR_LEN		2
71662306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CIC_POS			16
71762306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CIC_LEN			2
71862306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CPC_POS			26
71962306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CPC_LEN			2
72062306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CTXT_POS		30
72162306a36Sopenharmony_ci#define TX_NORMAL_DESC3_CTXT_LEN		1
72262306a36Sopenharmony_ci#define TX_NORMAL_DESC3_FD_POS			29
72362306a36Sopenharmony_ci#define TX_NORMAL_DESC3_FD_LEN			1
72462306a36Sopenharmony_ci#define TX_NORMAL_DESC3_FL_POS			0
72562306a36Sopenharmony_ci#define TX_NORMAL_DESC3_FL_LEN			15
72662306a36Sopenharmony_ci#define TX_NORMAL_DESC3_LD_POS			28
72762306a36Sopenharmony_ci#define TX_NORMAL_DESC3_LD_LEN			1
72862306a36Sopenharmony_ci#define TX_NORMAL_DESC3_OWN_POS			31
72962306a36Sopenharmony_ci#define TX_NORMAL_DESC3_OWN_LEN			1
73062306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TCPHDRLEN_POS		19
73162306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TCPHDRLEN_LEN		4
73262306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TCPPL_POS		0
73362306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TCPPL_LEN		18
73462306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TSE_POS			18
73562306a36Sopenharmony_ci#define TX_NORMAL_DESC3_TSE_LEN			1
73662306a36Sopenharmony_ci
73762306a36Sopenharmony_ci#define TX_NORMAL_DESC2_VLAN_INSERT		0x2
73862306a36Sopenharmony_ci
73962306a36Sopenharmony_ci#define XLGMAC_MTL_REG(pdata, n, reg)					\
74062306a36Sopenharmony_ci	((pdata)->mac_regs + MTL_Q_BASE + ((n) * MTL_Q_INC) + (reg))
74162306a36Sopenharmony_ci
74262306a36Sopenharmony_ci#define XLGMAC_DMA_REG(channel, reg)	((channel)->dma_regs + (reg))
74362306a36Sopenharmony_ci
74462306a36Sopenharmony_ci#endif /* __DWC_XLGMAC_REG_H__ */
745