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_RXP_CONTROL_STATUS		0x00000ca0
15 #define RXPI				BIT(31)
16 #define NPE				GENMASK(23, 16)
17 #define NVE				GENMASK(7, 0)
18 #define MTL_RXP_IACC_CTRL_STATUS	0x00000cb0
19 #define STARTBUSY			BIT(31)
20 #define RXPEIEC				GENMASK(22, 21)
21 #define RXPEIEE				BIT(20)
22 #define WRRDN				BIT(16)
23 #define ADDR				GENMASK(15, 0)
24 #define MTL_RXP_IACC_DATA		0x00000cb4
25 #define MTL_ECC_CONTROL			0x00000cc0
26 #define TSOEE				BIT(4)
27 #define MRXPEE				BIT(3)
28 #define MESTEE				BIT(2)
29 #define MRXEE				BIT(1)
30 #define MTXEE				BIT(0)
31 
32 #define MTL_SAFETY_INT_STATUS		0x00000cc4
33 #define MCSIS				BIT(31)
34 #define MEUIS				BIT(1)
35 #define MECIS				BIT(0)
36 #define MTL_ECC_INT_ENABLE		0x00000cc8
37 #define RPCEIE				BIT(12)
38 #define ECEIE				BIT(8)
39 #define RXCEIE				BIT(4)
40 #define TXCEIE				BIT(0)
41 #define MTL_ECC_INT_STATUS		0x00000ccc
42 #define MTL_DPP_CONTROL			0x00000ce0
43 #define EPSI				BIT(2)
44 #define OPE				BIT(1)
45 #define EDPP				BIT(0)
46 
47 #define DMA_SAFETY_INT_STATUS		0x00001080
48 #define MSUIS				BIT(29)
49 #define MSCIS				BIT(28)
50 #define DEUIS				BIT(1)
51 #define DECIS				BIT(0)
52 #define DMA_ECC_INT_ENABLE		0x00001084
53 #define TCEIE				BIT(0)
54 #define DMA_ECC_INT_STATUS		0x00001088
55 
56 int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp);
57 int dwmac5_safety_feat_irq_status(struct net_device *ndev,
58 		void __iomem *ioaddr, unsigned int asp,
59 		struct stmmac_safety_stats *stats);
60 int dwmac5_safety_feat_dump(struct stmmac_safety_stats *stats,
61 			int index, unsigned long *count, const char **desc);
62 int dwmac5_rxp_config(void __iomem *ioaddr, struct stmmac_tc_entry *entries,
63 		      unsigned int count);
64 
65 #endif /* __DWMAC5_H__ */
66