pub_apb.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 _PUB_APB_H_
  13. #define _PUB_APB_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_PUB_APB_SET_OFFSET (256)
  17. #define REG_PUB_APB_CLR_OFFSET (512)
  18. #define REG_PUB_APB_BASE (0x51603000)
  19. typedef volatile struct
  20. {
  21. uint32_t apb_eb; // 0x00000000
  22. uint32_t apb_soft_rst; // 0x00000004
  23. uint32_t debug_ctrl; // 0x00000008
  24. uint32_t slp_ctrl; // 0x0000000c
  25. uint32_t lps_gate_sel; // 0x00000010
  26. uint32_t lps_gate_force; // 0x00000014
  27. uint32_t cgm_psram; // 0x00000018
  28. uint32_t lpc_ctrl0; // 0x0000001c
  29. uint32_t lpc_ctrl1; // 0x00000020
  30. uint32_t pub_anti_hang; // 0x00000024
  31. uint32_t __40[2]; // 0x00000028
  32. uint32_t monitor_clk; // 0x00000030
  33. uint32_t debug_status; // 0x00000034
  34. uint32_t __56[50]; // 0x00000038
  35. uint32_t apb_eb_set; // 0x00000100
  36. uint32_t apb_soft_rst_set; // 0x00000104
  37. uint32_t __264[2]; // 0x00000108
  38. uint32_t lps_gate_sel_set; // 0x00000110
  39. uint32_t lps_gate_force_set; // 0x00000114
  40. uint32_t __280[2]; // 0x00000118
  41. uint32_t lpc_ctrl1_set; // 0x00000120
  42. uint32_t pub_anti_hang_set; // 0x00000124
  43. uint32_t __296[54]; // 0x00000128
  44. uint32_t apb_eb_clr; // 0x00000200
  45. uint32_t apb_soft_rst_clr; // 0x00000204
  46. uint32_t __520[2]; // 0x00000208
  47. uint32_t lps_gate_sel_clr; // 0x00000210
  48. uint32_t lps_gate_force_clr; // 0x00000214
  49. uint32_t __536[2]; // 0x00000218
  50. uint32_t lpc_ctrl1_clr; // 0x00000220
  51. uint32_t pub_anti_hang_clr; // 0x00000224
  52. } HWP_PUB_APB_T;
  53. #define hwp_pubApb ((HWP_PUB_APB_T *)REG_ACCESS_ADDRESS(REG_PUB_APB_BASE))
  54. // apb_eb
  55. typedef union {
  56. uint32_t v;
  57. struct
  58. {
  59. uint32_t pagespy_eb : 1; // [0]
  60. uint32_t mtx_cfg_eb : 1; // [1]
  61. uint32_t reserved_eb : 1; // [2]
  62. uint32_t __31_3 : 29; // [31:3]
  63. } b;
  64. } REG_PUB_APB_APB_EB_T;
  65. // apb_soft_rst
  66. typedef union {
  67. uint32_t v;
  68. struct
  69. {
  70. uint32_t pagespy_soft_rst : 1; // [0]
  71. uint32_t dmc400_soft_rst : 1; // [1]
  72. uint32_t mtx_cfg_rst : 1; // [2]
  73. uint32_t reserved_soft_rst : 1; // [3]
  74. uint32_t __31_4 : 28; // [31:4]
  75. } b;
  76. } REG_PUB_APB_APB_SOFT_RST_T;
  77. // slp_ctrl
  78. typedef union {
  79. uint32_t v;
  80. struct
  81. {
  82. uint32_t wait_num : 16; // [15:0]
  83. uint32_t force_en : 1; // [16]
  84. uint32_t force_reg : 1; // [17]
  85. uint32_t enable : 1; // [18]
  86. uint32_t half_slp_reg : 1; // [19]
  87. uint32_t __31_20 : 12; // [31:20]
  88. } b;
  89. } REG_PUB_APB_SLP_CTRL_T;
  90. // lps_gate_sel
  91. typedef union {
  92. uint32_t v;
  93. struct
  94. {
  95. uint32_t cgm_gate_auto_sel : 10; // [9:0]
  96. uint32_t __31_10 : 22; // [31:10]
  97. } b;
  98. } REG_PUB_APB_LPS_GATE_SEL_T;
  99. // lps_gate_force
  100. typedef union {
  101. uint32_t v;
  102. struct
  103. {
  104. uint32_t cgm_gate_force_en : 10; // [9:0]
  105. uint32_t __31_10 : 22; // [31:10]
  106. } b;
  107. } REG_PUB_APB_LPS_GATE_FORCE_T;
  108. // cgm_psram
  109. typedef union {
  110. uint32_t v;
  111. struct
  112. {
  113. uint32_t __0_0 : 1; // [0]
  114. uint32_t div_1x : 1; // [1]
  115. uint32_t __2_2 : 1; // [2]
  116. uint32_t div_2x : 2; // [4:3]
  117. uint32_t sel_2x : 3; // [7:5]
  118. uint32_t __31_8 : 24; // [31:8]
  119. } b;
  120. } REG_PUB_APB_CGM_PSRAM_T;
  121. // lpc_ctrl0
  122. typedef union {
  123. uint32_t v;
  124. struct
  125. {
  126. uint32_t lp_num : 16; // [15:0]
  127. uint32_t pu_num : 8; // [23:16]
  128. uint32_t __31_24 : 8; // [31:24]
  129. } b;
  130. } REG_PUB_APB_LPC_CTRL0_T;
  131. // lpc_ctrl1
  132. typedef union {
  133. uint32_t v;
  134. struct
  135. {
  136. uint32_t lp_eb : 1; // [0]
  137. uint32_t lp_force : 1; // [1]
  138. uint32_t __31_2 : 30; // [31:2]
  139. } b;
  140. } REG_PUB_APB_LPC_CTRL1_T;
  141. // pub_anti_hang
  142. typedef union {
  143. uint32_t v;
  144. struct
  145. {
  146. uint32_t pagespy_id_sel : 1; // [0]
  147. uint32_t reserved1_en : 1; // [1]
  148. uint32_t reserved2_en : 1; // [2]
  149. uint32_t __3_3 : 1; // [3]
  150. uint32_t error_resp_en : 1; // [4]
  151. uint32_t __31_5 : 27; // [31:5]
  152. } b;
  153. } REG_PUB_APB_PUB_ANTI_HANG_T;
  154. // monitor_clk
  155. typedef union {
  156. uint32_t v;
  157. struct
  158. {
  159. uint32_t gate_en_status : 10; // [9:0], read only
  160. uint32_t __11_10 : 2; // [11:10]
  161. uint32_t cgm_busy_status : 10; // [21:12], read only
  162. uint32_t __31_22 : 10; // [31:22]
  163. } b;
  164. } REG_PUB_APB_MONITOR_CLK_T;
  165. // apb_eb
  166. #define PUB_APB_PAGESPY_EB (1 << 0)
  167. #define PUB_APB_MTX_CFG_EB (1 << 1)
  168. #define PUB_APB_RESERVED_EB (1 << 2)
  169. // apb_soft_rst
  170. #define PUB_APB_PAGESPY_SOFT_RST (1 << 0)
  171. #define PUB_APB_DMC400_SOFT_RST (1 << 1)
  172. #define PUB_APB_MTX_CFG_RST (1 << 2)
  173. #define PUB_APB_RESERVED_SOFT_RST (1 << 3)
  174. // slp_ctrl
  175. #define PUB_APB_WAIT_NUM(n) (((n)&0xffff) << 0)
  176. #define PUB_APB_FORCE_EN (1 << 16)
  177. #define PUB_APB_FORCE_REG (1 << 17)
  178. #define PUB_APB_ENABLE (1 << 18)
  179. #define PUB_APB_HALF_SLP_REG (1 << 19)
  180. // lps_gate_sel
  181. #define PUB_APB_CGM_GATE_AUTO_SEL(n) (((n)&0x3ff) << 0)
  182. // lps_gate_force
  183. #define PUB_APB_CGM_GATE_FORCE_EN(n) (((n)&0x3ff) << 0)
  184. // cgm_psram
  185. #define PUB_APB_DIV_1X (1 << 1)
  186. #define PUB_APB_DIV_2X(n) (((n)&0x3) << 3)
  187. #define PUB_APB_SEL_2X(n) (((n)&0x7) << 5)
  188. // lpc_ctrl0
  189. #define PUB_APB_LP_NUM(n) (((n)&0xffff) << 0)
  190. #define PUB_APB_PU_NUM(n) (((n)&0xff) << 16)
  191. // lpc_ctrl1
  192. #define PUB_APB_LP_EB (1 << 0)
  193. #define PUB_APB_LP_FORCE (1 << 1)
  194. // pub_anti_hang
  195. #define PUB_APB_PAGESPY_ID_SEL (1 << 0)
  196. #define PUB_APB_RESERVED1_EN (1 << 1)
  197. #define PUB_APB_RESERVED2_EN (1 << 2)
  198. #define PUB_APB_ERROR_RESP_EN (1 << 4)
  199. // monitor_clk
  200. #define PUB_APB_GATE_EN_STATUS(n) (((n)&0x3ff) << 0)
  201. #define PUB_APB_CGM_BUSY_STATUS(n) (((n)&0x3ff) << 12)
  202. #endif // _PUB_APB_H_