busmon.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _BUSMON_H_
  13. #define _BUSMON_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_AP_BUSMON_BASE (0x04802000)
  17. #define REG_CP_BUSMON_BASE (0x14004000)
  18. typedef volatile struct
  19. {
  20. uint32_t mon_ctrl; // 0x00000000
  21. uint32_t mon_conf; // 0x00000004
  22. uint32_t mon_time; // 0x00000008
  23. uint32_t mon_cont; // 0x0000000c
  24. uint32_t mon_int_en; // 0x00000010
  25. uint32_t mon_int_flag; // 0x00000014
  26. uint32_t mon_m0_start_addr0; // 0x00000018
  27. uint32_t mon_m0_end_addr0; // 0x0000001c
  28. uint32_t mon_m0_addr_wid; // 0x00000020
  29. uint32_t __36[2]; // 0x00000024
  30. uint32_t mon_lock_time; // 0x0000002c
  31. uint32_t mon_rcommand0; // 0x00000030
  32. uint32_t mon_rdata0; // 0x00000034
  33. uint32_t mon_wcommand0; // 0x00000038
  34. uint32_t mon_wdata0; // 0x0000003c
  35. uint32_t mon_rcommand1; // 0x00000040
  36. uint32_t mon_rdata1; // 0x00000044
  37. uint32_t mon_wcommand1; // 0x00000048
  38. uint32_t mon_wdata1; // 0x0000004c
  39. uint32_t mon_rcommand2; // 0x00000050
  40. uint32_t mon_rdata2; // 0x00000054
  41. uint32_t mon_wcommand2; // 0x00000058
  42. uint32_t mon_wdata2; // 0x0000005c
  43. uint32_t mon_rcommand3; // 0x00000060
  44. uint32_t mon_rdata3; // 0x00000064
  45. uint32_t mon_wcommand3; // 0x00000068
  46. uint32_t mon_wdata3; // 0x0000006c
  47. uint32_t mon_rcommand4; // 0x00000070
  48. uint32_t mon_rdata4; // 0x00000074
  49. uint32_t mon_wcommand4; // 0x00000078
  50. uint32_t mon_wdata4; // 0x0000007c
  51. uint32_t mon_m0_start_addr1; // 0x00000080
  52. uint32_t mon_m0_end_addr1; // 0x00000084
  53. uint32_t mon_m0_start_addr2; // 0x00000088
  54. uint32_t mon_m0_end_addr2; // 0x0000008c
  55. uint32_t mon_m0_start_addr3; // 0x00000090
  56. uint32_t mon_m0_end_addr3; // 0x00000094
  57. uint32_t mon_m0_addr; // 0x00000098
  58. } HWP_BUSMON_T;
  59. #define hwp_apBusmon ((HWP_BUSMON_T *)REG_ACCESS_ADDRESS(REG_AP_BUSMON_BASE))
  60. #define hwp_cpBusmon ((HWP_BUSMON_T *)REG_ACCESS_ADDRESS(REG_CP_BUSMON_BASE))
  61. // mon_ctrl
  62. typedef union {
  63. uint32_t v;
  64. struct
  65. {
  66. uint32_t busmon_ctrl : 1; // [0]
  67. uint32_t __31_1 : 31; // [31:1]
  68. } b;
  69. } REG_BUSMON_MON_CTRL_T;
  70. // mon_conf
  71. typedef union {
  72. uint32_t v;
  73. struct
  74. {
  75. uint32_t gint_en : 1; // [0]
  76. uint32_t mon_lock_en : 1; // [1]
  77. uint32_t mon_time_en : 1; // [2]
  78. uint32_t mon_cont_en : 1; // [3]
  79. uint32_t mon_num_en : 1; // [4]
  80. uint32_t mon_in_addr_en : 1; // [5]
  81. uint32_t wbusy_en : 1; // [6]
  82. uint32_t rbusy_en : 1; // [7]
  83. uint32_t busy_en : 1; // [8]
  84. uint32_t mon_ext_addr_en : 1; // [9]
  85. uint32_t __31_10 : 22; // [31:10]
  86. } b;
  87. } REG_BUSMON_MON_CONF_T;
  88. // mon_int_en
  89. typedef union {
  90. uint32_t v;
  91. struct
  92. {
  93. uint32_t lock_int_en : 1; // [0]
  94. uint32_t timer_int_en : 1; // [1]
  95. uint32_t num_int_en : 1; // [2]
  96. uint32_t addr_int_en : 1; // [3]
  97. uint32_t __31_4 : 28; // [31:4]
  98. } b;
  99. } REG_BUSMON_MON_INT_EN_T;
  100. // mon_int_flag
  101. typedef union {
  102. uint32_t v;
  103. struct
  104. {
  105. uint32_t m0_lcok_int : 1; // [0], write clear
  106. uint32_t m1_lcok_int : 1; // [1], write clear
  107. uint32_t m2_lcok_int : 1; // [2], write clear
  108. uint32_t m3_lcok_int : 1; // [3], write clear
  109. uint32_t m4_lcok_int : 1; // [4], write clear
  110. uint32_t timer_cint : 1; // [5], write clear
  111. uint32_t m0_wnum_int : 1; // [6], write clear
  112. uint32_t m0_rnum_int : 1; // [7], write clear
  113. uint32_t m1_wnum_int : 1; // [8], write clear
  114. uint32_t m1_rnum_int : 1; // [9], write clear
  115. uint32_t m2_wnum_int : 1; // [10], write clear
  116. uint32_t m2_rnum_int : 1; // [11], write clear
  117. uint32_t m3_wnum_int : 1; // [12], write clear
  118. uint32_t m3_rnum_int : 1; // [13], write clear
  119. uint32_t m4_wnum_int : 1; // [14], write clear
  120. uint32_t m4_rnum_int : 1; // [15], write clear
  121. uint32_t addr_int : 1; // [16], write clear
  122. uint32_t timer_int : 1; // [17], write clear
  123. uint32_t __31_18 : 14; // [31:18]
  124. } b;
  125. } REG_BUSMON_MON_INT_FLAG_T;
  126. // mon_m0_addr_wid
  127. typedef union {
  128. uint32_t v;
  129. struct
  130. {
  131. uint32_t wa_id : 8; // [7:0], read only
  132. uint32_t __31_8 : 24; // [31:8]
  133. } b;
  134. } REG_BUSMON_MON_M0_ADDR_WID_T;
  135. // mon_lock_time
  136. typedef union {
  137. uint32_t v;
  138. struct
  139. {
  140. uint32_t lock_value : 16; // [15:0]
  141. uint32_t __31_16 : 16; // [31:16]
  142. } b;
  143. } REG_BUSMON_MON_LOCK_TIME_T;
  144. // mon_ctrl
  145. #define BUSMON_BUSMON_CTRL (1 << 0)
  146. // mon_conf
  147. #define BUSMON_GINT_EN (1 << 0)
  148. #define BUSMON_MON_LOCK_EN (1 << 1)
  149. #define BUSMON_MON_TIME_EN (1 << 2)
  150. #define BUSMON_MON_CONT_EN (1 << 3)
  151. #define BUSMON_MON_NUM_EN (1 << 4)
  152. #define BUSMON_MON_IN_ADDR_EN (1 << 5)
  153. #define BUSMON_WBUSY_EN (1 << 6)
  154. #define BUSMON_RBUSY_EN (1 << 7)
  155. #define BUSMON_BUSY_EN (1 << 8)
  156. #define BUSMON_MON_EXT_ADDR_EN (1 << 9)
  157. // mon_int_en
  158. #define BUSMON_LOCK_INT_EN (1 << 0)
  159. #define BUSMON_TIMER_INT_EN (1 << 1)
  160. #define BUSMON_NUM_INT_EN (1 << 2)
  161. #define BUSMON_ADDR_INT_EN (1 << 3)
  162. // mon_int_flag
  163. #define BUSMON_M0_LCOK_INT (1 << 0)
  164. #define BUSMON_M1_LCOK_INT (1 << 1)
  165. #define BUSMON_M2_LCOK_INT (1 << 2)
  166. #define BUSMON_M3_LCOK_INT (1 << 3)
  167. #define BUSMON_M4_LCOK_INT (1 << 4)
  168. #define BUSMON_TIMER_CINT (1 << 5)
  169. #define BUSMON_M0_WNUM_INT (1 << 6)
  170. #define BUSMON_M0_RNUM_INT (1 << 7)
  171. #define BUSMON_M1_WNUM_INT (1 << 8)
  172. #define BUSMON_M1_RNUM_INT (1 << 9)
  173. #define BUSMON_M2_WNUM_INT (1 << 10)
  174. #define BUSMON_M2_RNUM_INT (1 << 11)
  175. #define BUSMON_M3_WNUM_INT (1 << 12)
  176. #define BUSMON_M3_RNUM_INT (1 << 13)
  177. #define BUSMON_M4_WNUM_INT (1 << 14)
  178. #define BUSMON_M4_RNUM_INT (1 << 15)
  179. #define BUSMON_ADDR_INT (1 << 16)
  180. #define BUSMON_TIMER_INT (1 << 17)
  181. // mon_m0_addr_wid
  182. #define BUSMON_WA_ID(n) (((n)&0xff) << 0)
  183. // mon_lock_time
  184. #define BUSMON_LOCK_VALUE(n) (((n)&0xffff) << 0)
  185. #endif // _BUSMON_H_