mmc.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. * TC956X ethernet driver.
  3. *
  4. * mmc.h
  5. *
  6. * Copyright (C) 2011 STMicroelectronics Ltd
  7. * Copyright (C) 2021 Toshiba Electronic Devices & Storage Corporation
  8. *
  9. * This file has been derived from the STMicro Linux driver,
  10. * and developed or modified for TC956X.
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2, or (at your option)
  15. * any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. */
  26. /*! History:
  27. * 20 Jan 2021 : Initial Version
  28. * VERSION : 00-01
  29. *
  30. * 15 Mar 2021 : Base lined
  31. * VERSION : 01-00
  32. * 26 Oct 2021 : 1. Added EEE mmc counters for MAC COntrolled mode.
  33. * VERSION : 01-00-19
  34. * 24 Nov 2021 : 1. EEE update for runtime configuration and LPI interrupt disabled.
  35. * VERSION : 01-00-24
  36. */
  37. #ifndef __MMC_H__
  38. #define __MMC_H__
  39. /* MMC control register */
  40. /* When set, all counter are reset */
  41. #define MMC_CNTRL_COUNTER_RESET 0x1
  42. /* When set, do not roll over zero after reaching the max value*/
  43. #define MMC_CNTRL_COUNTER_STOP_ROLLOVER 0x2
  44. #define MMC_CNTRL_RESET_ON_READ 0x4 /* Reset after reading */
  45. #define MMC_CNTRL_COUNTER_FREEZER 0x8 /* Freeze counter values to the
  46. * current value.
  47. */
  48. #define MMC_CNTRL_PRESET 0x10
  49. #define MMC_CNTRL_FULL_HALF_PRESET 0x20
  50. #define MMC_GMAC4_OFFSET (MAC_OFFSET + 0x700)
  51. #define MMC_GMAC3_X_OFFSET (MAC_OFFSET + 0x100)
  52. #define MMC_XGMAC_OFFSET (MAC_OFFSET + 0x800)
  53. #define MMC_GMAC4_OFFSET_BASE (0x700)
  54. #define MMC_GMAC3_X_OFFSET_BASE (0x100)
  55. #define MMC_XGMAC_OFFSET_BASE (0x800)
  56. struct tc956xmac_counters {
  57. u64 mmc_tx_broadcastframe_g;
  58. u64 mmc_tx_multicastframe_g;
  59. u64 mmc_tx_64_octets_gb;
  60. u64 mmc_tx_framecount_gb;
  61. u64 mmc_tx_65_to_127_octets_gb;
  62. u64 mmc_tx_128_to_255_octets_gb;
  63. u64 mmc_tx_256_to_511_octets_gb;
  64. u64 mmc_tx_octetcount_gb;
  65. u64 mmc_tx_512_to_1023_octets_gb;
  66. u64 mmc_tx_1024_to_max_octets_gb;
  67. u64 mmc_tx_unicast_gb;
  68. u64 mmc_tx_multicast_gb;
  69. u64 mmc_tx_broadcast_gb;
  70. u64 mmc_tx_underflow_error;
  71. u64 mmc_tx_singlecol_g;
  72. u64 mmc_tx_multicol_g;
  73. u64 mmc_tx_deferred;
  74. u64 mmc_tx_latecol;
  75. u64 mmc_tx_exesscol;
  76. u64 mmc_tx_carrier_error;
  77. u64 mmc_tx_octetcount_g;
  78. u64 mmc_tx_framecount_g;
  79. u64 mmc_tx_excessdef;
  80. u64 mmc_tx_pause_frame;
  81. u64 mmc_tx_vlan_frame_g;
  82. u64 mmc_tx_lpi_us_cntr;
  83. u64 mmc_tx_lpi_tran_cntr;
  84. u64 mmc_rx_lpi_us_cntr;
  85. u64 mmc_rx_lpi_tran_cntr;
  86. u64 mmc_tx_per_priority_pkt;
  87. u64 mmc_tx_per_priority_pfc_pkt;
  88. u64 mmc_tx_per_priority_gpfc_pkt;
  89. u64 mmc_tx_per_priority_octet_gb;
  90. /* MMC RX counter registers */
  91. u64 mmc_rx_framecount_gb;
  92. u64 mmc_rx_octetcount_gb;
  93. u64 mmc_rx_octetcount_g;
  94. u64 mmc_rx_broadcastframe_g;
  95. u64 mmc_rx_multicastframe_g;
  96. u64 mmc_rx_crc_error;
  97. u64 mmc_rx_align_error;
  98. u64 mmc_rx_run_error;
  99. u64 mmc_rx_jabber_error;
  100. u64 mmc_rx_undersize_g;
  101. u64 mmc_rx_oversize_g;
  102. u64 mmc_rx_64_octets_gb;
  103. u64 mmc_rx_65_to_127_octets_gb;
  104. u64 mmc_rx_128_to_255_octets_gb;
  105. u64 mmc_rx_256_to_511_octets_gb;
  106. u64 mmc_rx_512_to_1023_octets_gb;
  107. u64 mmc_rx_1024_to_max_octets_gb;
  108. u64 mmc_rx_unicast_g;
  109. u64 mmc_rx_length_error;
  110. u64 mmc_rx_autofrangetype;
  111. u64 mmc_rx_pause_frames;
  112. u64 mmc_rx_fifo_overflow;
  113. u64 mmc_rx_vlan_frames_gb;
  114. u64 mmc_rx_watchdog_error;
  115. u64 mmc_rx_per_priority_pkt;
  116. u64 mmc_rx_per_priority_pkt_bad;
  117. u64 mmc_rx_per_priority_pkt_pfc;
  118. u64 mmc_rx_per_priority_octet;
  119. /* IPC */
  120. u64 mmc_rx_ipc_intr_mask;
  121. u64 mmc_rx_ipc_intr;
  122. /* IPv4 */
  123. u64 mmc_rx_ipv4_gd;
  124. u64 mmc_rx_ipv4_hderr;
  125. u64 mmc_rx_ipv4_nopay;
  126. u64 mmc_rx_ipv4_frag;
  127. u64 mmc_rx_ipv4_udsbl;
  128. u64 mmc_rx_ipv4_gd_octets;
  129. u64 mmc_rx_ipv4_hderr_octets;
  130. u64 mmc_rx_ipv4_nopay_octets;
  131. u64 mmc_rx_ipv4_frag_octets;
  132. u64 mmc_rx_ipv4_udsbl_octets;
  133. /* IPV6 */
  134. u64 mmc_rx_ipv6_gd_octets;
  135. u64 mmc_rx_ipv6_hderr_octets;
  136. u64 mmc_rx_ipv6_nopay_octets;
  137. u64 mmc_rx_ipv6_gd;
  138. u64 mmc_rx_ipv6_hderr;
  139. u64 mmc_rx_ipv6_nopay;
  140. /* Protocols */
  141. u64 mmc_rx_udp_gd;
  142. u64 mmc_rx_udp_err;
  143. u64 mmc_rx_tcp_gd;
  144. u64 mmc_rx_tcp_err;
  145. u64 mmc_rx_icmp_gd;
  146. u64 mmc_rx_icmp_err;
  147. u64 mmc_rx_udp_gd_octets;
  148. u64 mmc_rx_udp_err_octets;
  149. u64 mmc_rx_tcp_gd_octets;
  150. u64 mmc_rx_tcp_err_octets;
  151. u64 mmc_rx_icmp_gd_octets;
  152. u64 mmc_rx_icmp_err_octets;
  153. /* FPE */
  154. u64 mmc_tx_fpe_fragment_cntr;
  155. u64 mmc_tx_hold_req_cntr;
  156. u64 mmc_rx_packet_assembly_err_cntr;
  157. u64 mmc_rx_packet_smd_err_cntr;
  158. u64 mmc_rx_packet_assembly_ok_cntr;
  159. u64 mmc_rx_fpe_fragment_cntr;
  160. };
  161. #endif /* __MMC_H__ */