ap_clk.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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 _AP_CLK_H_
  13. #define _AP_CLK_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_AP_CLK_BASE (0x0480a000)
  17. typedef volatile struct
  18. {
  19. uint32_t __0[9]; // 0x00000000
  20. uint32_t cgm_ap_a5_div_cfg; // 0x00000024
  21. uint32_t cgm_ap_a5_sel_cfg; // 0x00000028
  22. uint32_t __44[1]; // 0x0000002c
  23. uint32_t cgm_ap_bus_div_cfg; // 0x00000030
  24. uint32_t __52[3]; // 0x00000034
  25. uint32_t cgm_uart4_bf_div_sel_cfg; // 0x00000040
  26. uint32_t __68[2]; // 0x00000044
  27. uint32_t cgm_uart5_bf_div_sel_cfg; // 0x0000004c
  28. uint32_t __80[2]; // 0x00000050
  29. uint32_t cgm_uart6_bf_div_sel_cfg; // 0x00000058
  30. uint32_t __92[2]; // 0x0000005c
  31. uint32_t cgm_spiflash1_sel_cfg; // 0x00000064
  32. uint32_t __104[2]; // 0x00000068
  33. uint32_t cgm_spiflash2_sel_cfg; // 0x00000070
  34. uint32_t __116[1]; // 0x00000074
  35. uint32_t cgm_camera_pix_div_cfg; // 0x00000078
  36. uint32_t cgm_camera_pix_sel_cfg; // 0x0000007c
  37. uint32_t __128[1]; // 0x00000080
  38. uint32_t cgm_camera_ref_div_cfg; // 0x00000084
  39. uint32_t cgm_camera_ref_sel_cfg; // 0x00000088
  40. uint32_t __140[1]; // 0x0000008c
  41. uint32_t cgm_camera_csi_div_cfg; // 0x00000090
  42. uint32_t cgm_camera_csi_sel_cfg; // 0x00000094
  43. uint32_t __152[2]; // 0x00000098
  44. uint32_t cgm_camera_csi_data_hs_sel_cfg; // 0x000000a0
  45. uint32_t __164[2]; // 0x000000a4
  46. uint32_t cgm_spi1_sel_cfg; // 0x000000ac
  47. uint32_t __176[2]; // 0x000000b0
  48. uint32_t cgm_i2c1_sel_cfg; // 0x000000b8
  49. uint32_t __188[2]; // 0x000000bc
  50. uint32_t cgm_i2c2_sel_cfg; // 0x000000c4
  51. uint32_t __200[2]; // 0x000000c8
  52. uint32_t cgm_gpt3_sel_cfg; // 0x000000d0
  53. uint32_t __212[5]; // 0x000000d4
  54. uint32_t cgm_26m_sel_cfg; // 0x000000e8
  55. uint32_t __236[3]; // 0x000000ec
  56. uint32_t cgm_busy_src_monitor_cfg0; // 0x000000f8
  57. uint32_t cgm_busy_src_monitor_cfg1; // 0x000000fc
  58. uint32_t cgm_busy_src_monitor_cfg2; // 0x00000100
  59. } HWP_AP_CLK_T;
  60. #define hwp_apClk ((HWP_AP_CLK_T *)REG_ACCESS_ADDRESS(REG_AP_CLK_BASE))
  61. // cgm_ap_a5_div_cfg
  62. typedef union {
  63. uint32_t v;
  64. struct
  65. {
  66. uint32_t cgm_ap_a5_div : 2; // [1:0]
  67. uint32_t __31_2 : 30; // [31:2]
  68. } b;
  69. } REG_AP_CLK_CGM_AP_A5_DIV_CFG_T;
  70. // cgm_ap_a5_sel_cfg
  71. typedef union {
  72. uint32_t v;
  73. struct
  74. {
  75. uint32_t cgm_ap_a5_sel : 3; // [2:0]
  76. uint32_t __31_3 : 29; // [31:3]
  77. } b;
  78. } REG_AP_CLK_CGM_AP_A5_SEL_CFG_T;
  79. // cgm_ap_bus_div_cfg
  80. typedef union {
  81. uint32_t v;
  82. struct
  83. {
  84. uint32_t cgm_ap_bus_div : 2; // [1:0]
  85. uint32_t __31_2 : 30; // [31:2]
  86. } b;
  87. } REG_AP_CLK_CGM_AP_BUS_DIV_CFG_T;
  88. // cgm_uart4_bf_div_sel_cfg
  89. typedef union {
  90. uint32_t v;
  91. struct
  92. {
  93. uint32_t cgm_uart4_bf_div_sel : 3; // [2:0]
  94. uint32_t __31_3 : 29; // [31:3]
  95. } b;
  96. } REG_AP_CLK_CGM_UART4_BF_DIV_SEL_CFG_T;
  97. // cgm_uart5_bf_div_sel_cfg
  98. typedef union {
  99. uint32_t v;
  100. struct
  101. {
  102. uint32_t cgm_uart5_bf_div_sel : 3; // [2:0]
  103. uint32_t __31_3 : 29; // [31:3]
  104. } b;
  105. } REG_AP_CLK_CGM_UART5_BF_DIV_SEL_CFG_T;
  106. // cgm_uart6_bf_div_sel_cfg
  107. typedef union {
  108. uint32_t v;
  109. struct
  110. {
  111. uint32_t cgm_uart6_bf_div_sel : 3; // [2:0]
  112. uint32_t __31_3 : 29; // [31:3]
  113. } b;
  114. } REG_AP_CLK_CGM_UART6_BF_DIV_SEL_CFG_T;
  115. // cgm_spiflash1_sel_cfg
  116. typedef union {
  117. uint32_t v;
  118. struct
  119. {
  120. uint32_t cgm_spiflash1_sel : 3; // [2:0]
  121. uint32_t __31_3 : 29; // [31:3]
  122. } b;
  123. } REG_AP_CLK_CGM_SPIFLASH1_SEL_CFG_T;
  124. // cgm_spiflash2_sel_cfg
  125. typedef union {
  126. uint32_t v;
  127. struct
  128. {
  129. uint32_t cgm_spiflash2_sel : 3; // [2:0]
  130. uint32_t __31_3 : 29; // [31:3]
  131. } b;
  132. } REG_AP_CLK_CGM_SPIFLASH2_SEL_CFG_T;
  133. // cgm_camera_pix_div_cfg
  134. typedef union {
  135. uint32_t v;
  136. struct
  137. {
  138. uint32_t cgm_camera_pix_div : 11; // [10:0]
  139. uint32_t __31_11 : 21; // [31:11]
  140. } b;
  141. } REG_AP_CLK_CGM_CAMERA_PIX_DIV_CFG_T;
  142. // cgm_camera_pix_sel_cfg
  143. typedef union {
  144. uint32_t v;
  145. struct
  146. {
  147. uint32_t cgm_camera_pix_sel : 3; // [2:0]
  148. uint32_t __31_3 : 29; // [31:3]
  149. } b;
  150. } REG_AP_CLK_CGM_CAMERA_PIX_SEL_CFG_T;
  151. // cgm_camera_ref_div_cfg
  152. typedef union {
  153. uint32_t v;
  154. struct
  155. {
  156. uint32_t cgm_camera_ref_div : 11; // [10:0]
  157. uint32_t __31_11 : 21; // [31:11]
  158. } b;
  159. } REG_AP_CLK_CGM_CAMERA_REF_DIV_CFG_T;
  160. // cgm_camera_ref_sel_cfg
  161. typedef union {
  162. uint32_t v;
  163. struct
  164. {
  165. uint32_t cgm_camera_ref_sel : 3; // [2:0]
  166. uint32_t __31_3 : 29; // [31:3]
  167. } b;
  168. } REG_AP_CLK_CGM_CAMERA_REF_SEL_CFG_T;
  169. // cgm_camera_csi_div_cfg
  170. typedef union {
  171. uint32_t v;
  172. struct
  173. {
  174. uint32_t cgm_camera_csi_div : 11; // [10:0]
  175. uint32_t __31_11 : 21; // [31:11]
  176. } b;
  177. } REG_AP_CLK_CGM_CAMERA_CSI_DIV_CFG_T;
  178. // cgm_camera_csi_sel_cfg
  179. typedef union {
  180. uint32_t v;
  181. struct
  182. {
  183. uint32_t cgm_camera_csi_sel : 3; // [2:0]
  184. uint32_t __31_3 : 29; // [31:3]
  185. } b;
  186. } REG_AP_CLK_CGM_CAMERA_CSI_SEL_CFG_T;
  187. // cgm_camera_csi_data_hs_sel_cfg
  188. typedef union {
  189. uint32_t v;
  190. struct
  191. {
  192. uint32_t __15_0 : 16; // [15:0]
  193. uint32_t cgm_camera_csi_data_hs_pad_sel : 1; // [16]
  194. uint32_t __31_17 : 15; // [31:17]
  195. } b;
  196. } REG_AP_CLK_CGM_CAMERA_CSI_DATA_HS_SEL_CFG_T;
  197. // cgm_spi1_sel_cfg
  198. typedef union {
  199. uint32_t v;
  200. struct
  201. {
  202. uint32_t cgm_spi1_sel : 3; // [2:0]
  203. uint32_t __31_3 : 29; // [31:3]
  204. } b;
  205. } REG_AP_CLK_CGM_SPI1_SEL_CFG_T;
  206. // cgm_i2c1_sel_cfg
  207. typedef union {
  208. uint32_t v;
  209. struct
  210. {
  211. uint32_t cgm_i2c1_sel : 3; // [2:0]
  212. uint32_t __31_3 : 29; // [31:3]
  213. } b;
  214. } REG_AP_CLK_CGM_I2C1_SEL_CFG_T;
  215. // cgm_i2c2_sel_cfg
  216. typedef union {
  217. uint32_t v;
  218. struct
  219. {
  220. uint32_t cgm_i2c2_sel : 3; // [2:0]
  221. uint32_t __31_3 : 29; // [31:3]
  222. } b;
  223. } REG_AP_CLK_CGM_I2C2_SEL_CFG_T;
  224. // cgm_gpt3_sel_cfg
  225. typedef union {
  226. uint32_t v;
  227. struct
  228. {
  229. uint32_t cgm_gpt3_sel : 3; // [2:0]
  230. uint32_t __31_3 : 29; // [31:3]
  231. } b;
  232. } REG_AP_CLK_CGM_GPT3_SEL_CFG_T;
  233. // cgm_26m_sel_cfg
  234. typedef union {
  235. uint32_t v;
  236. struct
  237. {
  238. uint32_t cgm_26m_sel : 2; // [1:0]
  239. uint32_t __31_2 : 30; // [31:2]
  240. } b;
  241. } REG_AP_CLK_CGM_26M_SEL_CFG_T;
  242. // cgm_busy_src_monitor_cfg2
  243. typedef union {
  244. uint32_t v;
  245. struct
  246. {
  247. uint32_t cgm_busy_src_monitor2 : 17; // [16:0], read only
  248. uint32_t __31_17 : 15; // [31:17]
  249. } b;
  250. } REG_AP_CLK_CGM_BUSY_SRC_MONITOR_CFG2_T;
  251. // cgm_ap_a5_div_cfg
  252. #define AP_CLK_CGM_AP_A5_DIV(n) (((n)&0x3) << 0)
  253. // cgm_ap_a5_sel_cfg
  254. #define AP_CLK_CGM_AP_A5_SEL(n) (((n)&0x7) << 0)
  255. // cgm_ap_bus_div_cfg
  256. #define AP_CLK_CGM_AP_BUS_DIV(n) (((n)&0x3) << 0)
  257. // cgm_uart4_bf_div_sel_cfg
  258. #define AP_CLK_CGM_UART4_BF_DIV_SEL(n) (((n)&0x7) << 0)
  259. // cgm_uart5_bf_div_sel_cfg
  260. #define AP_CLK_CGM_UART5_BF_DIV_SEL(n) (((n)&0x7) << 0)
  261. // cgm_uart6_bf_div_sel_cfg
  262. #define AP_CLK_CGM_UART6_BF_DIV_SEL(n) (((n)&0x7) << 0)
  263. // cgm_spiflash1_sel_cfg
  264. #define AP_CLK_CGM_SPIFLASH1_SEL(n) (((n)&0x7) << 0)
  265. // cgm_spiflash2_sel_cfg
  266. #define AP_CLK_CGM_SPIFLASH2_SEL(n) (((n)&0x7) << 0)
  267. // cgm_camera_pix_div_cfg
  268. #define AP_CLK_CGM_CAMERA_PIX_DIV(n) (((n)&0x7ff) << 0)
  269. // cgm_camera_pix_sel_cfg
  270. #define AP_CLK_CGM_CAMERA_PIX_SEL(n) (((n)&0x7) << 0)
  271. // cgm_camera_ref_div_cfg
  272. #define AP_CLK_CGM_CAMERA_REF_DIV(n) (((n)&0x7ff) << 0)
  273. // cgm_camera_ref_sel_cfg
  274. #define AP_CLK_CGM_CAMERA_REF_SEL(n) (((n)&0x7) << 0)
  275. // cgm_camera_csi_div_cfg
  276. #define AP_CLK_CGM_CAMERA_CSI_DIV(n) (((n)&0x7ff) << 0)
  277. // cgm_camera_csi_sel_cfg
  278. #define AP_CLK_CGM_CAMERA_CSI_SEL(n) (((n)&0x7) << 0)
  279. // cgm_camera_csi_data_hs_sel_cfg
  280. #define AP_CLK_CGM_CAMERA_CSI_DATA_HS_PAD_SEL (1 << 16)
  281. // cgm_spi1_sel_cfg
  282. #define AP_CLK_CGM_SPI1_SEL(n) (((n)&0x7) << 0)
  283. // cgm_i2c1_sel_cfg
  284. #define AP_CLK_CGM_I2C1_SEL(n) (((n)&0x7) << 0)
  285. // cgm_i2c2_sel_cfg
  286. #define AP_CLK_CGM_I2C2_SEL(n) (((n)&0x7) << 0)
  287. // cgm_gpt3_sel_cfg
  288. #define AP_CLK_CGM_GPT3_SEL(n) (((n)&0x7) << 0)
  289. // cgm_26m_sel_cfg
  290. #define AP_CLK_CGM_26M_SEL(n) (((n)&0x3) << 0)
  291. // cgm_busy_src_monitor_cfg2
  292. #define AP_CLK_CGM_BUSY_SRC_MONITOR2(n) (((n)&0x1ffff) << 0)
  293. #endif // _AP_CLK_H_