dwmac5.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. #ifndef __DWMAC5_H__
  5. #define __DWMAC5_H__
  6. #define MAC_DPP_FSM_INT_STATUS 0x00000140
  7. #define MAC_AXI_SLV_DPE_ADDR_STATUS 0x00000144
  8. #define MAC_FSM_CONTROL 0x00000148
  9. #define PRTYEN BIT(1)
  10. #define TMOUTEN BIT(0)
  11. #define MAC_PPS_CONTROL 0x00000b70
  12. #define PPS_MAXIDX(x) ((((x) + 1) * 8) - 1)
  13. #define PPS_MINIDX(x) ((x) * 8)
  14. #define PPSx_MASK(x) GENMASK(PPS_MAXIDX(x), PPS_MINIDX(x))
  15. #define MCGRENx(x) BIT(PPS_MAXIDX(x))
  16. #define TRGTMODSELx(x, val) \
  17. GENMASK(PPS_MAXIDX(x) - 1, PPS_MAXIDX(x) - 2) & \
  18. ((val) << (PPS_MAXIDX(x) - 2))
  19. #define PPSCMDx(x, val) \
  20. GENMASK(PPS_MINIDX(x) + 3, PPS_MINIDX(x)) & \
  21. ((val) << PPS_MINIDX(x))
  22. #define PPSEN0 BIT(4)
  23. #define MAC_PPSx_TARGET_TIME_SEC(x) (0x00000b80 + ((x) * 0x10))
  24. #define MAC_PPSx_TARGET_TIME_NSEC(x) (0x00000b84 + ((x) * 0x10))
  25. #define TRGTBUSY0 BIT(31)
  26. #define TTSL0 GENMASK(30, 0)
  27. #define MAC_PPSx_INTERVAL(x) (0x00000b88 + ((x) * 0x10))
  28. #define MAC_PPSx_WIDTH(x) (0x00000b8c + ((x) * 0x10))
  29. #define MTL_RXP_CONTROL_STATUS 0x00000ca0
  30. #define RXPI BIT(31)
  31. #define NPE GENMASK(23, 16)
  32. #define NVE GENMASK(7, 0)
  33. #define MTL_RXP_IACC_CTRL_STATUS 0x00000cb0
  34. #define STARTBUSY BIT(31)
  35. #define RXPEIEC GENMASK(22, 21)
  36. #define RXPEIEE BIT(20)
  37. #define WRRDN BIT(16)
  38. #define ADDR GENMASK(15, 0)
  39. #define MTL_RXP_IACC_DATA 0x00000cb4
  40. #define MTL_ECC_CONTROL 0x00000cc0
  41. #define TSOEE BIT(4)
  42. #define MRXPEE BIT(3)
  43. #define MESTEE BIT(2)
  44. #define MRXEE BIT(1)
  45. #define MTXEE BIT(0)
  46. #define MTL_SAFETY_INT_STATUS 0x00000cc4
  47. #define MCSIS BIT(31)
  48. #define MEUIS BIT(1)
  49. #define MECIS BIT(0)
  50. #define MTL_ECC_INT_ENABLE 0x00000cc8
  51. #define RPCEIE BIT(12)
  52. #define ECEIE BIT(8)
  53. #define RXCEIE BIT(4)
  54. #define TXCEIE BIT(0)
  55. #define MTL_ECC_INT_STATUS 0x00000ccc
  56. #define MTL_DPP_CONTROL 0x00000ce0
  57. #define EPSI BIT(2)
  58. #define OPE BIT(1)
  59. #define EDPP BIT(0)
  60. #define DMA_SAFETY_INT_STATUS 0x00001080
  61. #define MSUIS BIT(29)
  62. #define MSCIS BIT(28)
  63. #define DEUIS BIT(1)
  64. #define DECIS BIT(0)
  65. #define DMA_ECC_INT_ENABLE 0x00001084
  66. #define TCEIE BIT(0)
  67. #define DMA_ECC_INT_STATUS 0x00001088
  68. int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp);
  69. int dwmac5_safety_feat_irq_status(struct net_device *ndev,
  70. void __iomem *ioaddr, unsigned int asp,
  71. struct stmmac_safety_stats *stats);
  72. int dwmac5_safety_feat_dump(struct stmmac_safety_stats *stats,
  73. int index, unsigned long *count, const char **desc);
  74. int dwmac5_rxp_config(void __iomem *ioaddr, struct stmmac_tc_entry *entries,
  75. unsigned int count);
  76. int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
  77. struct stmmac_pps_cfg *cfg, bool enable,
  78. u32 sub_second_inc, u32 systime_flags);
  79. #endif /* __DWMAC5_H__ */