scc.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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 _SCC_H_
  13. #define _SCC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_SCC_BASE (0x51505000)
  17. typedef volatile struct
  18. {
  19. uint32_t scc_tune_lmt_cfg; // 0x00000000
  20. uint32_t scc_tune_status; // 0x00000004
  21. uint32_t scc_cfg; // 0x00000008
  22. uint32_t scc_tune_step_cfg; // 0x0000000c
  23. uint32_t scc_wait_cfg; // 0x00000010
  24. uint32_t scc_int_cfg; // 0x00000014
  25. uint32_t scc_tune_mark; // 0x00000018
  26. uint32_t scc_fsm_sts; // 0x0000001c
  27. uint32_t scc_rosc_mode; // 0x00000020
  28. uint32_t scc_rosc_cfg; // 0x00000024
  29. uint32_t scc_rosc_ctrl; // 0x00000028
  30. uint32_t scc_rosc_rpt; // 0x0000002c
  31. uint32_t scc_rosc_sw_rst; // 0x00000030
  32. } HWP_SCC_T;
  33. #define hwp_scc ((HWP_SCC_T *)REG_ACCESS_ADDRESS(REG_SCC_BASE))
  34. // scc_tune_lmt_cfg
  35. typedef union {
  36. uint32_t v;
  37. struct
  38. {
  39. uint32_t volt_tune_val_min : 8; // [7:0]
  40. uint32_t volt_tune_val_max : 8; // [15:8]
  41. uint32_t __31_16 : 16; // [31:16]
  42. } b;
  43. } REG_SCC_SCC_TUNE_LMT_CFG_T;
  44. // scc_tune_status
  45. typedef union {
  46. uint32_t v;
  47. struct
  48. {
  49. uint32_t volt_obs_val : 8; // [7:0], read only
  50. uint32_t volt_tune_val : 8; // [15:8], read only
  51. uint32_t __31_16 : 16; // [31:16]
  52. } b;
  53. } REG_SCC_SCC_TUNE_STATUS_T;
  54. // scc_cfg
  55. typedef union {
  56. uint32_t v;
  57. struct
  58. {
  59. uint32_t volt_obs_forbid_en : 1; // [0]
  60. uint32_t __3_1 : 3; // [3:1]
  61. uint32_t volt_tune_forbid_en : 1; // [4]
  62. uint32_t __7_5 : 3; // [7:5]
  63. uint32_t pause_occur_err_en : 1; // [8]
  64. uint32_t __29_9 : 21; // [29:9]
  65. uint32_t volt1_select_override : 1; // [30]
  66. uint32_t volt0_select_override : 1; // [31]
  67. } b;
  68. } REG_SCC_SCC_CFG_T;
  69. // scc_tune_step_cfg
  70. typedef union {
  71. uint32_t v;
  72. struct
  73. {
  74. uint32_t volt_tune_up_step : 9; // [8:0]
  75. uint32_t __15_9 : 7; // [15:9]
  76. uint32_t volt_tune_down_step : 9; // [24:16]
  77. uint32_t __31_25 : 7; // [31:25]
  78. } b;
  79. } REG_SCC_SCC_TUNE_STEP_CFG_T;
  80. // scc_wait_cfg
  81. typedef union {
  82. uint32_t v;
  83. struct
  84. {
  85. uint32_t volt_stb_wait_num : 16; // [15:0]
  86. uint32_t rnd_intval_wait_num : 16; // [31:16]
  87. } b;
  88. } REG_SCC_SCC_WAIT_CFG_T;
  89. // scc_int_cfg
  90. typedef union {
  91. uint32_t v;
  92. struct
  93. {
  94. uint32_t scc_tune_err_int_en : 1; // [0]
  95. uint32_t scc_tune_done_int_en : 1; // [1]
  96. uint32_t __3_2 : 2; // [3:2]
  97. uint32_t scc_tune_err_int_clr : 1; // [4]
  98. uint32_t scc_tune_done_int_clr : 1; // [5]
  99. uint32_t __7_6 : 2; // [7:6]
  100. uint32_t scc_tune_err_int_raw_status : 1; // [8], read only
  101. uint32_t scc_tune_done_int_raw_status : 1; // [9], read only
  102. uint32_t __11_10 : 2; // [11:10]
  103. uint32_t scc_tune_err_int_mask_status : 1; // [12], read only
  104. uint32_t scc_tune_done_int_mask_status : 1; // [13], read only
  105. uint32_t __31_14 : 18; // [31:14]
  106. } b;
  107. } REG_SCC_SCC_INT_CFG_T;
  108. // scc_tune_mark
  109. typedef union {
  110. uint32_t v;
  111. struct
  112. {
  113. uint32_t scc_tune_up_mark : 16; // [15:0]
  114. uint32_t scc_tune_dwn_mark : 16; // [31:16]
  115. } b;
  116. } REG_SCC_SCC_TUNE_MARK_T;
  117. // scc_fsm_sts
  118. typedef union {
  119. uint32_t v;
  120. struct
  121. {
  122. uint32_t scc_fsm_sts : 5; // [4:0], read only
  123. uint32_t __31_5 : 27; // [31:5]
  124. } b;
  125. } REG_SCC_SCC_FSM_STS_T;
  126. // scc_rosc_mode
  127. typedef union {
  128. uint32_t v;
  129. struct
  130. {
  131. uint32_t scc_rosc_repeat_mode : 1; // [0]
  132. uint32_t scc_all_rosc_seq : 1; // [1]
  133. uint32_t scc_all_rosc_chain : 1; // [2]
  134. uint32_t __11_3 : 9; // [11:3]
  135. uint32_t scc_rpt_read_ctrl : 1; // [12]
  136. uint32_t __28_13 : 16; // [28:13]
  137. uint32_t scc_init_halt_bypass : 1; // [29]
  138. uint32_t scc_tune_bypass : 1; // [30]
  139. uint32_t scc_idle_mode : 1; // [31]
  140. } b;
  141. } REG_SCC_SCC_ROSC_MODE_T;
  142. // scc_rosc_cfg
  143. typedef union {
  144. uint32_t v;
  145. struct
  146. {
  147. uint32_t scc_rosc_sel_x : 4; // [3:0]
  148. uint32_t scc_rosc_sel_y : 4; // [7:4]
  149. uint32_t scc_rosc_sel_z : 4; // [11:8]
  150. uint32_t scc_rosc_duration : 20; // [31:12]
  151. } b;
  152. } REG_SCC_SCC_ROSC_CFG_T;
  153. // scc_rosc_ctrl
  154. typedef union {
  155. uint32_t v;
  156. struct
  157. {
  158. uint32_t scc_rosc_run : 1; // [0]
  159. uint32_t scc_rosc_gr_enable : 1; // [1]
  160. uint32_t __30_2 : 29; // [30:2]
  161. uint32_t scc_rpt_read_nxt : 1; // [31]
  162. } b;
  163. } REG_SCC_SCC_ROSC_CTRL_T;
  164. // scc_rosc_rpt
  165. typedef union {
  166. uint32_t v;
  167. struct
  168. {
  169. uint32_t scc_rosc_cnt : 20; // [19:0], read only
  170. uint32_t scc_rosc_setting : 5; // [24:20], read only
  171. uint32_t __29_25 : 5; // [29:25]
  172. uint32_t scc_rosc_rpt_valid : 1; // [30], read only
  173. uint32_t scc_init_pat_fail : 1; // [31], read only
  174. } b;
  175. } REG_SCC_SCC_ROSC_RPT_T;
  176. // scc_rosc_sw_rst
  177. typedef union {
  178. uint32_t v;
  179. struct
  180. {
  181. uint32_t scc_rosc_sw_rst : 2; // [1:0]
  182. uint32_t __31_2 : 30; // [31:2]
  183. } b;
  184. } REG_SCC_SCC_ROSC_SW_RST_T;
  185. // scc_tune_lmt_cfg
  186. #define SCC_VOLT_TUNE_VAL_MIN(n) (((n)&0xff) << 0)
  187. #define SCC_VOLT_TUNE_VAL_MAX(n) (((n)&0xff) << 8)
  188. // scc_tune_status
  189. #define SCC_VOLT_OBS_VAL(n) (((n)&0xff) << 0)
  190. #define SCC_VOLT_TUNE_VAL(n) (((n)&0xff) << 8)
  191. // scc_cfg
  192. #define SCC_VOLT_OBS_FORBID_EN (1 << 0)
  193. #define SCC_VOLT_TUNE_FORBID_EN (1 << 4)
  194. #define SCC_PAUSE_OCCUR_ERR_EN (1 << 8)
  195. #define SCC_VOLT1_SELECT_OVERRIDE (1 << 30)
  196. #define SCC_VOLT0_SELECT_OVERRIDE (1 << 31)
  197. // scc_tune_step_cfg
  198. #define SCC_VOLT_TUNE_UP_STEP(n) (((n)&0x1ff) << 0)
  199. #define SCC_VOLT_TUNE_DOWN_STEP(n) (((n)&0x1ff) << 16)
  200. // scc_wait_cfg
  201. #define SCC_VOLT_STB_WAIT_NUM(n) (((n)&0xffff) << 0)
  202. #define SCC_RND_INTVAL_WAIT_NUM(n) (((n)&0xffff) << 16)
  203. // scc_int_cfg
  204. #define SCC_SCC_TUNE_ERR_INT_EN (1 << 0)
  205. #define SCC_SCC_TUNE_DONE_INT_EN (1 << 1)
  206. #define SCC_SCC_TUNE_ERR_INT_CLR (1 << 4)
  207. #define SCC_SCC_TUNE_DONE_INT_CLR (1 << 5)
  208. #define SCC_SCC_TUNE_ERR_INT_RAW_STATUS (1 << 8)
  209. #define SCC_SCC_TUNE_DONE_INT_RAW_STATUS (1 << 9)
  210. #define SCC_SCC_TUNE_ERR_INT_MASK_STATUS (1 << 12)
  211. #define SCC_SCC_TUNE_DONE_INT_MASK_STATUS (1 << 13)
  212. // scc_tune_mark
  213. #define SCC_SCC_TUNE_UP_MARK(n) (((n)&0xffff) << 0)
  214. #define SCC_SCC_TUNE_DWN_MARK(n) (((n)&0xffff) << 16)
  215. // scc_fsm_sts
  216. #define SCC_SCC_FSM_STS(n) (((n)&0x1f) << 0)
  217. // scc_rosc_mode
  218. #define SCC_SCC_ROSC_REPEAT_MODE (1 << 0)
  219. #define SCC_SCC_ALL_ROSC_SEQ (1 << 1)
  220. #define SCC_SCC_ALL_ROSC_CHAIN (1 << 2)
  221. #define SCC_SCC_RPT_READ_CTRL (1 << 12)
  222. #define SCC_SCC_INIT_HALT_BYPASS (1 << 29)
  223. #define SCC_SCC_TUNE_BYPASS (1 << 30)
  224. #define SCC_SCC_IDLE_MODE (1 << 31)
  225. // scc_rosc_cfg
  226. #define SCC_SCC_ROSC_SEL_X(n) (((n)&0xf) << 0)
  227. #define SCC_SCC_ROSC_SEL_Y(n) (((n)&0xf) << 4)
  228. #define SCC_SCC_ROSC_SEL_Z(n) (((n)&0xf) << 8)
  229. #define SCC_SCC_ROSC_DURATION(n) (((n)&0xfffff) << 12)
  230. // scc_rosc_ctrl
  231. #define SCC_SCC_ROSC_RUN (1 << 0)
  232. #define SCC_SCC_ROSC_GR_ENABLE (1 << 1)
  233. #define SCC_SCC_RPT_READ_NXT (1 << 31)
  234. // scc_rosc_rpt
  235. #define SCC_SCC_ROSC_CNT(n) (((n)&0xfffff) << 0)
  236. #define SCC_SCC_ROSC_SETTING(n) (((n)&0x1f) << 20)
  237. #define SCC_SCC_ROSC_RPT_VALID (1 << 30)
  238. #define SCC_SCC_INIT_PAT_FAIL (1 << 31)
  239. // scc_rosc_sw_rst
  240. #define SCC_SCC_ROSC_SW_RST(n) (((n)&0x3) << 0)
  241. #endif // _SCC_H_