mt7530.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version 2
  5. * of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * Copyright (C) 2013 John Crispin <[email protected]>
  13. * Copyright (C) 2016 Vitaly Chekryzhev <[email protected]>
  14. */
  15. #ifndef _MT7530_H__
  16. #define _MT7530_H__
  17. #define MT7620_MIB_COUNTER_BASE_PORT 0x4000
  18. #define MT7620_MIB_COUNTER_PORT_OFFSET 0x100
  19. #define MT7620_MIB_COUNTER_BASE 0x1010
  20. /* PPE Accounting Group #0 Byte Counter */
  21. #define MT7620_MIB_STATS_PPE_AC_BCNT0 0x000
  22. /* PPE Accounting Group #0 Packet Counter */
  23. #define MT7620_MIB_STATS_PPE_AC_PCNT0 0x004
  24. /* PPE Accounting Group #63 Byte Counter */
  25. #define MT7620_MIB_STATS_PPE_AC_BCNT63 0x1F8
  26. /* PPE Accounting Group #63 Packet Counter */
  27. #define MT7620_MIB_STATS_PPE_AC_PCNT63 0x1FC
  28. /* PPE Meter Group #0 */
  29. #define MT7620_MIB_STATS_PPE_MTR_CNT0 0x200
  30. /* PPE Meter Group #63 */
  31. #define MT7620_MIB_STATS_PPE_MTR_CNT63 0x2FC
  32. /* Transmit good byte count for CPU GDM */
  33. #define MT7620_MIB_STATS_GDM1_TX_GBCNT 0x300
  34. /* Transmit good packet count for CPU GDM (exclude flow control frames) */
  35. #define MT7620_MIB_STATS_GDM1_TX_GPCNT 0x304
  36. /* Transmit abort count for CPU GDM */
  37. #define MT7620_MIB_STATS_GDM1_TX_SKIPCNT 0x308
  38. /* Transmit collision count for CPU GDM */
  39. #define MT7620_MIB_STATS_GDM1_TX_COLCNT 0x30C
  40. /* Received good byte count for CPU GDM */
  41. #define MT7620_MIB_STATS_GDM1_RX_GBCNT1 0x320
  42. /* Received good packet count for CPU GDM (exclude flow control frame) */
  43. #define MT7620_MIB_STATS_GDM1_RX_GPCNT1 0x324
  44. /* Received overflow error packet count for CPU GDM */
  45. #define MT7620_MIB_STATS_GDM1_RX_OERCNT 0x328
  46. /* Received FCS error packet count for CPU GDM */
  47. #define MT7620_MIB_STATS_GDM1_RX_FERCNT 0x32C
  48. /* Received too short error packet count for CPU GDM */
  49. #define MT7620_MIB_STATS_GDM1_RX_SERCNT 0x330
  50. /* Received too long error packet count for CPU GDM */
  51. #define MT7620_MIB_STATS_GDM1_RX_LERCNT 0x334
  52. /* Received IP/TCP/UDP checksum error packet count for CPU GDM */
  53. #define MT7620_MIB_STATS_GDM1_RX_CERCNT 0x338
  54. /* Received flow control pkt count for CPU GDM */
  55. #define MT7620_MIB_STATS_GDM1_RX_FCCNT 0x33C
  56. /* Transmit good byte count for PPE GDM */
  57. #define MT7620_MIB_STATS_GDM2_TX_GBCNT 0x340
  58. /* Transmit good packet count for PPE GDM (exclude flow control frames) */
  59. #define MT7620_MIB_STATS_GDM2_TX_GPCNT 0x344
  60. /* Transmit abort count for PPE GDM */
  61. #define MT7620_MIB_STATS_GDM2_TX_SKIPCNT 0x348
  62. /* Transmit collision count for PPE GDM */
  63. #define MT7620_MIB_STATS_GDM2_TX_COLCNT 0x34C
  64. /* Received good byte count for PPE GDM */
  65. #define MT7620_MIB_STATS_GDM2_RX_GBCNT 0x360
  66. /* Received good packet count for PPE GDM (exclude flow control frame) */
  67. #define MT7620_MIB_STATS_GDM2_RX_GPCNT 0x364
  68. /* Received overflow error packet count for PPE GDM */
  69. #define MT7620_MIB_STATS_GDM2_RX_OERCNT 0x368
  70. /* Received FCS error packet count for PPE GDM */
  71. #define MT7620_MIB_STATS_GDM2_RX_FERCNT 0x36C
  72. /* Received too short error packet count for PPE GDM */
  73. #define MT7620_MIB_STATS_GDM2_RX_SERCNT 0x370
  74. /* Received too long error packet count for PPE GDM */
  75. #define MT7620_MIB_STATS_GDM2_RX_LERCNT 0x374
  76. /* Received IP/TCP/UDP checksum error packet count for PPE GDM */
  77. #define MT7620_MIB_STATS_GDM2_RX_CERCNT 0x378
  78. /* Received flow control pkt count for PPE GDM */
  79. #define MT7620_MIB_STATS_GDM2_RX_FCCNT 0x37C
  80. /* Tx Packet Counter of Port n */
  81. #define MT7620_MIB_STATS_PORT_TGPCN 0x10
  82. /* Tx Bad Octet Counter of Port n */
  83. #define MT7620_MIB_STATS_PORT_TBOCN 0x14
  84. /* Tx Good Octet Counter of Port n */
  85. #define MT7620_MIB_STATS_PORT_TGOCN 0x18
  86. /* Tx Event Packet Counter of Port n */
  87. #define MT7620_MIB_STATS_PORT_TEPCN 0x1C
  88. /* Rx Packet Counter of Port n */
  89. #define MT7620_MIB_STATS_PORT_RGPCN 0x20
  90. /* Rx Bad Octet Counter of Port n */
  91. #define MT7620_MIB_STATS_PORT_RBOCN 0x24
  92. /* Rx Good Octet Counter of Port n */
  93. #define MT7620_MIB_STATS_PORT_RGOCN 0x28
  94. /* Rx Event Packet Counter of Port n */
  95. #define MT7620_MIB_STATS_PORT_REPC1N 0x2C
  96. /* Rx Event Packet Counter of Port n */
  97. #define MT7620_MIB_STATS_PORT_REPC2N 0x30
  98. #define MT7621_MIB_COUNTER_BASE 0x4000
  99. #define MT7621_MIB_COUNTER_PORT_OFFSET 0x100
  100. #define MT7621_STATS_TDPC 0x00
  101. #define MT7621_STATS_TCRC 0x04
  102. #define MT7621_STATS_TUPC 0x08
  103. #define MT7621_STATS_TMPC 0x0C
  104. #define MT7621_STATS_TBPC 0x10
  105. #define MT7621_STATS_TCEC 0x14
  106. #define MT7621_STATS_TSCEC 0x18
  107. #define MT7621_STATS_TMCEC 0x1C
  108. #define MT7621_STATS_TDEC 0x20
  109. #define MT7621_STATS_TLCEC 0x24
  110. #define MT7621_STATS_TXCEC 0x28
  111. #define MT7621_STATS_TPPC 0x2C
  112. #define MT7621_STATS_TL64PC 0x30
  113. #define MT7621_STATS_TL65PC 0x34
  114. #define MT7621_STATS_TL128PC 0x38
  115. #define MT7621_STATS_TL256PC 0x3C
  116. #define MT7621_STATS_TL512PC 0x40
  117. #define MT7621_STATS_TL1024PC 0x44
  118. #define MT7621_STATS_TOC 0x48
  119. #define MT7621_STATS_RDPC 0x60
  120. #define MT7621_STATS_RFPC 0x64
  121. #define MT7621_STATS_RUPC 0x68
  122. #define MT7621_STATS_RMPC 0x6C
  123. #define MT7621_STATS_RBPC 0x70
  124. #define MT7621_STATS_RAEPC 0x74
  125. #define MT7621_STATS_RCEPC 0x78
  126. #define MT7621_STATS_RUSPC 0x7C
  127. #define MT7621_STATS_RFEPC 0x80
  128. #define MT7621_STATS_ROSPC 0x84
  129. #define MT7621_STATS_RJEPC 0x88
  130. #define MT7621_STATS_RPPC 0x8C
  131. #define MT7621_STATS_RL64PC 0x90
  132. #define MT7621_STATS_RL65PC 0x94
  133. #define MT7621_STATS_RL128PC 0x98
  134. #define MT7621_STATS_RL256PC 0x9C
  135. #define MT7621_STATS_RL512PC 0xA0
  136. #define MT7621_STATS_RL1024PC 0xA4
  137. #define MT7621_STATS_ROC 0xA8
  138. #define MT7621_STATS_RDPC_CTRL 0xB0
  139. #define MT7621_STATS_RDPC_ING 0xB4
  140. #define MT7621_STATS_RDPC_ARL 0xB8
  141. int mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vlan);
  142. #endif