1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2 // Copyright (c) 2017 Synopsys, Inc. and/or its affiliates.
3 // stmmac Support for 5.xx Ethernet QoS cores
4 
5 #ifndef __DWMAC5_H__
6 #define __DWMAC5_H__
7 
8 #define MAC_DPP_FSM_INT_STATUS		0x00000140
9 #define MAC_AXI_SLV_DPE_ADDR_STATUS	0x00000144
10 #define MAC_FSM_CONTROL			0x00000148
11 #define PRTYEN				BIT(1)
12 #define TMOUTEN				BIT(0)
13 
14 #define MTL_ECC_CONTROL			0x00000cc0
15 #define TSOEE				BIT(4)
16 #define MRXPEE				BIT(3)
17 #define MESTEE				BIT(2)
18 #define MRXEE				BIT(1)
19 #define MTXEE				BIT(0)
20 
21 #define MTL_SAFETY_INT_STATUS		0x00000cc4
22 #define MCSIS				BIT(31)
23 #define MEUIS				BIT(1)
24 #define MECIS				BIT(0)
25 #define MTL_ECC_INT_ENABLE		0x00000cc8
26 #define RPCEIE				BIT(12)
27 #define ECEIE				BIT(8)
28 #define RXCEIE				BIT(4)
29 #define TXCEIE				BIT(0)
30 #define MTL_ECC_INT_STATUS		0x00000ccc
31 #define MTL_DPP_CONTROL			0x00000ce0
32 #define EPSI				BIT(2)
33 #define OPE				BIT(1)
34 #define EDPP				BIT(0)
35 
36 #define DMA_SAFETY_INT_STATUS		0x00001080
37 #define MSUIS				BIT(29)
38 #define MSCIS				BIT(28)
39 #define DEUIS				BIT(1)
40 #define DECIS				BIT(0)
41 #define DMA_ECC_INT_ENABLE		0x00001084
42 #define TCEIE				BIT(0)
43 #define DMA_ECC_INT_STATUS		0x00001088
44 
45 int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp);
46 bool dwmac5_safety_feat_irq_status(struct net_device *ndev,
47 		void __iomem *ioaddr, unsigned int asp,
48 		struct stmmac_safety_stats *stats);
49 const char *dwmac5_safety_feat_dump(struct stmmac_safety_stats *stats,
50 			int index, unsigned long *count);
51 
52 #endif /* __DWMAC5_H__ */
53