llcc_perfmon.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /* Copyright (c) 2017, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  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. #ifndef _SOC_QCOM_LLCC_PERFMON_H_
  13. #define _SOC_QCOM_LLCC_PERFMON_H_
  14. #define LLCC_COMMON_STATUS0 (0x3000C)
  15. /* FEAC */
  16. #define FEAC_PROF_FILTER_0_CFG5 (0x037014)
  17. #define FEAC_PROF_FILTER_0_CFG6 (0x037018)
  18. #define FEAC_PROF_EVENT_n_CFG(n) (0x037060 + 4 * n)
  19. #define FEAC_PROF_CFG (0x0370A0)
  20. /* FERC */
  21. #define FERC_PROF_FILTER_0_CFG0 (0x03B000)
  22. #define FERC_PROF_EVENT_n_CFG(n) (0x03B020 + 4 * n)
  23. #define FERC_PROF_CFG (0x03B060)
  24. /* FEWC */
  25. #define FEWC_PROF_FILTER_0_CFG0 (0x033000)
  26. #define FEWC_PROF_EVENT_n_CFG(n) (0x033020 + 4 * n)
  27. /* BEAC */
  28. #define BEAC_PROF_FILTER_0_CFG5 (0x049014)
  29. #define BEAC_PROF_EVENT_n_CFG(n) (0x049040 + 4 * n)
  30. #define BEAC_PROF_CFG (0x049080)
  31. /* BERC */
  32. #define BERC_PROF_FILTER_0_CFG0 (0x039000)
  33. #define BERC_PROF_EVENT_n_CFG(n) (0x039020 + 4 * n)
  34. #define BERC_PROF_CFG (0x039060)
  35. /* TRP */
  36. #define TRP_PROF_FILTER_0_CFG1 (0x024004)
  37. #define TRP_PROF_EVENT_n_CFG(n) (0x024020 + 4 * n)
  38. #define TRP_SCID_n_STATUS(n) (0x000004 + 0x1000 * n)
  39. /* DRP */
  40. #define DRP_PROF_EVENT_n_CFG(n) (0x044010 + 4 * n)
  41. #define DRP_PROF_CFG (0x044050)
  42. /* PMGR */
  43. #define PMGR_PROF_EVENT_n_CFG(n) (0x03F000 + 4 * n)
  44. #define PERFMON_COUNTER_n_CONFIG(n) (0x031020 + 4 * n)
  45. #define PERFMON_MODE (0x03100C)
  46. #define PERFMON_DUMP (0x031010)
  47. #define BROADCAST_COUNTER_n_VALUE(n) (0x031060 + 4 * n)
  48. #define LLCC_COUNTER_n_VALUE(n) (0x031060 + 4 * n)
  49. #define EVENT_NUM_MAX (64)
  50. #define SCID_MAX (32)
  51. /* Perfmon */
  52. #define CLEAR_ON_ENABLE BIT(31)
  53. #define CLEAR_ON_DUMP BIT(30)
  54. #define FREEZE_ON_SATURATE BIT(29)
  55. #define CHAINING_EN BIT(28)
  56. #define COUNT_CLOCK_EVENT BIT(24)
  57. #define EVENT_SELECT_SHIFT (16)
  58. #define PERFMON_EVENT_SELECT_MASK GENMASK(EVENT_SELECT_SHIFT + 4,\
  59. EVENT_SELECT_SHIFT)
  60. #define PORT_SELECT_SHIFT (0)
  61. #define PERFMON_PORT_SELECT_MASK GENMASK(PORT_SELECT_SHIFT + 3,\
  62. PORT_SELECT_SHIFT)
  63. #define MANUAL_MODE (0)
  64. #define TIMED_MODE (1)
  65. #define TRIGGER_MODE (2)
  66. #define MONITOR_EN_SHIFT (15)
  67. #define MONITOR_EN BIT(MONITOR_EN_SHIFT)
  68. #define PERFMON_MODE_MONITOR_EN_MASK GENMASK(MONITOR_EN_SHIFT + 0,\
  69. MONITOR_EN_SHIFT)
  70. #define MONITOR_MODE_SHIFT (0)
  71. #define PERFMON_MODE_MONITOR_MODE_MASK GENMASK(MONITOR_MODE_SHIFT + 0,\
  72. MONITOR_MODE_SHIFT)
  73. #define MONITOR_DUMP BIT(0)
  74. /* COMMON */
  75. #define BYTE_SCALING (1024)
  76. #define BEAT_SCALING (32)
  77. #define LB_CNT_SHIFT (28)
  78. #define LB_CNT_MASK GENMASK(LB_CNT_SHIFT + 3, \
  79. LB_CNT_SHIFT)
  80. #define BYTE_SCALING_SHIFT (16)
  81. #define PROF_CFG_BYTE_SCALING_MASK GENMASK(BYTE_SCALING_SHIFT + 11,\
  82. BYTE_SCALING_SHIFT)
  83. #define BEAT_SCALING_SHIFT (8)
  84. #define PROF_CFG_BEAT_SCALING_MASK GENMASK(BEAT_SCALING_SHIFT + 7,\
  85. BEAT_SCALING_SHIFT)
  86. #define PROF_EN_SHIFT (0)
  87. #define PROF_EN BIT(PROF_EN_SHIFT)
  88. #define PROF_CFG_EN_MASK GENMASK(PROF_EN_SHIFT + 0,\
  89. PROF_EN_SHIFT)
  90. #define FILTER_EN_SHIFT (31)
  91. #define FILTER_EN BIT(FILTER_EN_SHIFT)
  92. #define FILTER_EN_MASK GENMASK(FILTER_EN_SHIFT + 0,\
  93. FILTER_EN_SHIFT)
  94. #define FILTER_0 (0)
  95. #define FILTER_0_MASK GENMASK(FILTER_0 + 0, \
  96. FILTER_0)
  97. #define FILTER_1 (1)
  98. #define FILTER_1_MASK GENMASK(FILTER_1 + 0, \
  99. FILTER_1)
  100. #define FILTER_SEL_SHIFT (16)
  101. #define FILTER_SEL_MASK GENMASK(FILTER_SEL_SHIFT + 0,\
  102. FILTER_SEL_SHIFT)
  103. #define EVENT_SEL_SHIFT (0)
  104. #define EVENT_SEL_MASK GENMASK(EVENT_SEL_SHIFT + 5,\
  105. EVENT_SEL_SHIFT)
  106. #define MID_MASK_SHIFT (16)
  107. #define MID_MASK_MASK GENMASK(MID_MASK_SHIFT + 15, \
  108. MID_MASK_SHIFT)
  109. #define MID_MATCH_SHIFT (0)
  110. #define MID_MATCH_MASK GENMASK(MID_MATCH_SHIFT + 15, \
  111. MID_MATCH_SHIFT)
  112. #define SCID_MASK_SHIFT (16)
  113. #define SCID_MASK_MASK GENMASK(SCID_MASK_SHIFT + 15, \
  114. SCID_MASK_SHIFT)
  115. #define SCID_MATCH_SHIFT (0)
  116. #define SCID_MATCH_MASK GENMASK(SCID_MATCH_SHIFT + 15, \
  117. SCID_MATCH_SHIFT)
  118. #define PROFTAG_MASK_SHIFT (2)
  119. #define PROFTAG_MASK_MASK GENMASK(PROFTAG_MASK_SHIFT + 1,\
  120. PROFTAG_MASK_SHIFT)
  121. #define PROFTAG_MATCH_SHIFT (0)
  122. #define PROFTAG_MATCH_MASK GENMASK(PROFTAG_MATCH_SHIFT + 1,\
  123. PROFTAG_MATCH_SHIFT)
  124. /* FEAC */
  125. #define FEAC_SCALING_FILTER_SEL_SHIFT (2)
  126. #define FEAC_SCALING_FILTER_SEL_MASK GENMASK(FEAC_SCALING_FILTER_SEL_SHIFT \
  127. + 0, \
  128. FEAC_SCALING_FILTER_SEL_SHIFT)
  129. #define FEAC_SCALING_FILTER_EN_SHIFT (1)
  130. #define FEAC_SCALING_FILTER_EN BIT(FEAC_SCALING_FILTER_EN_SHIFT)
  131. #define FEAC_SCALING_FILTER_EN_MASK GENMASK(FEAC_SCALING_FILTER_EN_SHIFT \
  132. + 0, \
  133. FEAC_SCALING_FILTER_EN_SHIFT)
  134. /* BEAC */
  135. #define BEAC_PROFTAG_MASK_SHIFT (14)
  136. #define BEAC_PROFTAG_MASK_MASK GENMASK(BEAC_PROFTAG_MASK_SHIFT + 1,\
  137. BEAC_PROFTAG_MASK_SHIFT)
  138. #define BEAC_PROFTAG_MATCH_SHIFT (12)
  139. #define BEAC_PROFTAG_MATCH_MASK GENMASK(BEAC_PROFTAG_MATCH_SHIFT + 1,\
  140. BEAC_PROFTAG_MATCH_SHIFT)
  141. #define BEAC_MC_PROFTAG_SHIFT (1)
  142. #define BEAC_MC_PROFTAG_MASK GENMASK(BEAC_MC_PROFTAG_SHIFT + 1,\
  143. BEAC_MC_PROFTAG_SHIFT)
  144. /* TRP */
  145. #define TRP_SCID_MATCH_SHIFT (0)
  146. #define TRP_SCID_MATCH_MASK GENMASK(TRP_SCID_MATCH_SHIFT + 4,\
  147. TRP_SCID_MATCH_SHIFT)
  148. #define TRP_SCID_MASK_SHIFT (8)
  149. #define TRP_SCID_MASK_MASK GENMASK(TRP_SCID_MASK_SHIFT + 4,\
  150. TRP_SCID_MASK_SHIFT)
  151. #define TRP_WAY_ID_MATCH_SHIFT (16)
  152. #define TRP_WAY_ID_MATCH_MASK GENMASK(TRP_WAY_ID_MATCH_SHIFT + 3,\
  153. TRP_WAY_ID_MATCH_SHIFT)
  154. #define TRP_WAY_ID_MASK_SHIFT (20)
  155. #define TRP_WAY_ID_MASK_MASK GENMASK(TRP_WAY_ID_MASK_SHIFT + 3,\
  156. TRP_WAY_ID_MASK_SHIFT)
  157. #define TRP_PROFTAG_MATCH_SHIFT (24)
  158. #define TRP_PROFTAG_MATCH_MASK GENMASK(TRP_PROFTAG_MATCH_SHIFT + 1,\
  159. TRP_PROFTAG_MATCH_SHIFT)
  160. #define TRP_PROFTAG_MASK_SHIFT (28)
  161. #define TRP_PROFTAG_MASK_MASK GENMASK(TRP_PROFTAG_MASK_SHIFT + 1,\
  162. TRP_PROFTAG_MASK_SHIFT)
  163. #define TRP_SCID_STATUS_ACTIVE_SHIFT (0)
  164. #define TRP_SCID_STATUS_ACTIVE_MASK GENMASK( \
  165. TRP_SCID_STATUS_ACTIVE_SHIFT \
  166. + 0, \
  167. TRP_SCID_STATUS_ACTIVE_SHIFT)
  168. #define TRP_SCID_STATUS_DEACTIVE_SHIFT (1)
  169. #define TRP_SCID_STATUS_CURRENT_CAP_SHIFT (16)
  170. #define TRP_SCID_STATUS_CURRENT_CAP_MASK GENMASK( \
  171. TRP_SCID_STATUS_CURRENT_CAP_SHIFT \
  172. + 13, \
  173. TRP_SCID_STATUS_CURRENT_CAP_SHIFT)
  174. #endif /* _SOC_QCOM_LLCC_PERFMON_H_ */