aon_ifc.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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 _AON_IFC_H_
  13. #define _AON_IFC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define AON_NB_BITS_ADDR (32)
  17. #define AON_IFC_ADDR_ALIGN (0)
  18. #define AON_IFC_TC_LEN (23)
  19. #define AON_IFC_STD_CHAN_NB (6)
  20. #define AON_IFC_RFSPI_CHAN (0)
  21. #define AON_IFC_AIF_CHAN (2)
  22. #define AON_IFC_DBG_CHAN (1)
  23. #define AON_APB1_IFC_AHB_MAXSPACE (20)
  24. #define AON_APB1_IFC_ADDR_ALIGN (2)
  25. typedef enum
  26. {
  27. DMA_ID_TX_UART2 = 0,
  28. DMA_ID_RX_UART2 = 1,
  29. DMA_ID_TX_UART3 = 2,
  30. DMA_ID_RX_UART3 = 3,
  31. DMA_ID_TX_DBG_UART = 4,
  32. DMA_ID_RX_DBG_UART = 5,
  33. } AON_IFC_REQUEST_IDS_T;
  34. #define REG_AON_IFC_BASE (0x5140e000)
  35. typedef volatile struct
  36. {
  37. uint32_t get_ch; // 0x00000000
  38. uint32_t dma_status; // 0x00000004
  39. uint32_t debug_status; // 0x00000008
  40. uint32_t ifc_sec; // 0x0000000c
  41. struct // 0x00000010
  42. { //
  43. uint32_t control; // 0x00000000
  44. uint32_t status; // 0x00000004
  45. uint32_t start_addr; // 0x00000008
  46. uint32_t tc; // 0x0000000c
  47. uint32_t tc_threshold; // 0x00000010
  48. } std_ch[6]; //
  49. } HWP_AON_IFC_T;
  50. #define hwp_aonIfc ((HWP_AON_IFC_T *)REG_ACCESS_ADDRESS(REG_AON_IFC_BASE))
  51. typedef volatile struct
  52. {
  53. struct // 0x00000000
  54. { //
  55. uint32_t control; // 0x00000000
  56. uint32_t status; // 0x00000004
  57. uint32_t start_addr; // 0x00000008
  58. uint32_t fifo_size; // 0x0000000c
  59. uint32_t __16[1]; // 0x00000010
  60. uint32_t int_mask; // 0x00000014
  61. uint32_t int_clear; // 0x00000018
  62. uint32_t cur_ahb_addr; // 0x0000001c
  63. } ch[2]; //
  64. } HWP_AUDIO_IFC_T;
  65. // get_ch
  66. typedef union {
  67. uint32_t v;
  68. struct
  69. {
  70. uint32_t ch_to_use : 5; // [4:0], read only
  71. uint32_t __31_5 : 27; // [31:5]
  72. } b;
  73. } REG_AON_IFC_GET_CH_T;
  74. // dma_status
  75. typedef union {
  76. uint32_t v;
  77. struct
  78. {
  79. uint32_t ch_enable : 6; // [5:0], read only
  80. uint32_t __15_6 : 10; // [15:6]
  81. uint32_t ch_busy : 6; // [21:16], read only
  82. uint32_t __31_22 : 10; // [31:22]
  83. } b;
  84. } REG_AON_IFC_DMA_STATUS_T;
  85. // debug_status
  86. typedef union {
  87. uint32_t v;
  88. struct
  89. {
  90. uint32_t dbg_status : 1; // [0], read only
  91. uint32_t __31_1 : 31; // [31:1]
  92. } b;
  93. } REG_AON_IFC_DEBUG_STATUS_T;
  94. // ifc_sec
  95. typedef union {
  96. uint32_t v;
  97. struct
  98. {
  99. uint32_t std_ch_reg_sec : 6; // [5:0]
  100. uint32_t aif_ch_reg_sec : 2; // [7:6]
  101. uint32_t __15_8 : 8; // [15:8]
  102. uint32_t std_ch_dma_sec : 6; // [21:16]
  103. uint32_t aif_ch_dma_sec : 2; // [23:22]
  104. uint32_t dbg_ch_dma_sec : 1; // [24]
  105. uint32_t __31_25 : 7; // [31:25]
  106. } b;
  107. } REG_AON_IFC_IFC_SEC_T;
  108. // control
  109. typedef union {
  110. uint32_t v;
  111. struct
  112. {
  113. uint32_t enable : 1; // [0]
  114. uint32_t disable : 1; // [1]
  115. uint32_t ch_rd_hw_exch : 1; // [2]
  116. uint32_t ch_wr_hw_exch : 1; // [3]
  117. uint32_t autodisable : 1; // [4]
  118. uint32_t size : 1; // [5]
  119. uint32_t __7_6 : 2; // [7:6]
  120. uint32_t req_src : 5; // [12:8]
  121. uint32_t __15_13 : 3; // [15:13]
  122. uint32_t flush : 1; // [16]
  123. uint32_t max_burst_length : 2; // [18:17]
  124. uint32_t __31_19 : 13; // [31:19]
  125. } b;
  126. } REG_AON_IFC_CONTROL_T;
  127. // status
  128. typedef union {
  129. uint32_t v;
  130. struct
  131. {
  132. uint32_t enable : 1; // [0], read only
  133. uint32_t __3_1 : 3; // [3:1]
  134. uint32_t fifo_empty : 1; // [4], read only
  135. uint32_t __31_5 : 27; // [31:5]
  136. } b;
  137. } REG_AON_IFC_STATUS_T;
  138. // tc
  139. typedef union {
  140. uint32_t v;
  141. struct
  142. {
  143. uint32_t tc : 23; // [22:0]
  144. uint32_t __31_23 : 9; // [31:23]
  145. } b;
  146. } REG_AON_IFC_TC_T;
  147. // tc_threshold
  148. typedef union {
  149. uint32_t v;
  150. struct
  151. {
  152. uint32_t tc_threshold : 23; // [22:0]
  153. uint32_t __31_23 : 9; // [31:23]
  154. } b;
  155. } REG_AON_IFC_TC_THRESHOLD_T;
  156. // control
  157. typedef union {
  158. uint32_t v;
  159. struct
  160. {
  161. uint32_t enable : 1; // [0]
  162. uint32_t disable : 1; // [1]
  163. uint32_t __3_2 : 2; // [3:2]
  164. uint32_t auto_disable : 1; // [4]
  165. uint32_t __31_5 : 27; // [31:5]
  166. } b;
  167. } REG_AUDIO_IFC_CONTROL_T;
  168. // status
  169. typedef union {
  170. uint32_t v;
  171. struct
  172. {
  173. uint32_t enable : 1; // [0], read only
  174. uint32_t __3_1 : 3; // [3:1]
  175. uint32_t fifo_empty : 1; // [4], read only
  176. uint32_t __7_5 : 3; // [7:5]
  177. uint32_t cause_ief : 1; // [8], read only
  178. uint32_t cause_ihf : 1; // [9], read only
  179. uint32_t cause_i4f : 1; // [10], read only
  180. uint32_t cause_i3_4f : 1; // [11], read only
  181. uint32_t cause_ahb_error : 1; // [12], read only
  182. uint32_t __15_13 : 3; // [15:13]
  183. uint32_t ief : 1; // [16], read only
  184. uint32_t ihf : 1; // [17], read only
  185. uint32_t i4f : 1; // [18], read only
  186. uint32_t i3_4f : 1; // [19], read only
  187. uint32_t ahb_error : 1; // [20], read only
  188. uint32_t ch_idle : 1; // [21], read only
  189. uint32_t __31_22 : 10; // [31:22]
  190. } b;
  191. } REG_AUDIO_IFC_STATUS_T;
  192. // start_addr
  193. typedef union {
  194. uint32_t v;
  195. struct
  196. {
  197. uint32_t __1_0 : 2; // [1:0]
  198. uint32_t start_addr : 30; // [31:2]
  199. } b;
  200. } REG_AUDIO_IFC_START_ADDR_T;
  201. // fifo_size
  202. typedef union {
  203. uint32_t v;
  204. struct
  205. {
  206. uint32_t __3_0 : 4; // [3:0]
  207. uint32_t fifo_size : 16; // [19:4]
  208. uint32_t __31_20 : 12; // [31:20]
  209. } b;
  210. } REG_AUDIO_IFC_FIFO_SIZE_T;
  211. // int_mask
  212. typedef union {
  213. uint32_t v;
  214. struct
  215. {
  216. uint32_t __7_0 : 8; // [7:0]
  217. uint32_t end_fifo : 1; // [8]
  218. uint32_t half_fifo : 1; // [9]
  219. uint32_t quarter_fifo : 1; // [10]
  220. uint32_t three_quarter_fifo : 1; // [11]
  221. uint32_t ahb_error : 1; // [12]
  222. uint32_t __31_13 : 19; // [31:13]
  223. } b;
  224. } REG_AUDIO_IFC_INT_MASK_T;
  225. // int_clear
  226. typedef union {
  227. uint32_t v;
  228. struct
  229. {
  230. uint32_t __7_0 : 8; // [7:0]
  231. uint32_t end_fifo : 1; // [8], write clear
  232. uint32_t half_fifo : 1; // [9], write clear
  233. uint32_t quarter_fifo : 1; // [10], write clear
  234. uint32_t three_quarter_fifo : 1; // [11], write clear
  235. uint32_t ahb_error : 1; // [12], write clear
  236. uint32_t __31_13 : 19; // [31:13]
  237. } b;
  238. } REG_AUDIO_IFC_INT_CLEAR_T;
  239. // get_ch
  240. #define AON_IFC_CH_TO_USE(n) (((n)&0x1f) << 0)
  241. // dma_status
  242. #define AON_IFC_CH_ENABLE(n) (((n)&0x3f) << 0)
  243. #define AON_IFC_CH_BUSY(n) (((n)&0x3f) << 16)
  244. // debug_status
  245. #define AON_IFC_DBG_STATUS (1 << 0)
  246. // ifc_sec
  247. #define AON_IFC_STD_CH_REG_SEC(n) (((n)&0x3f) << 0)
  248. #define AON_IFC_AIF_CH_REG_SEC(n) (((n)&0x3) << 6)
  249. #define AON_IFC_STD_CH_DMA_SEC(n) (((n)&0x3f) << 16)
  250. #define AON_IFC_AIF_CH_DMA_SEC(n) (((n)&0x3) << 22)
  251. #define AON_IFC_DBG_CH_DMA_SEC (1 << 24)
  252. // control
  253. #define AON_IFC_ENABLE (1 << 0)
  254. #define AON_IFC_DISABLE (1 << 1)
  255. #define AON_IFC_CH_RD_HW_EXCH (1 << 2)
  256. #define AON_IFC_CH_WR_HW_EXCH (1 << 3)
  257. #define AON_IFC_AUTODISABLE (1 << 4)
  258. #define AON_IFC_SIZE (1 << 5)
  259. #define AON_IFC_REQ_SRC(n) (((n)&0x1f) << 8)
  260. #define AON_IFC_REQ_SRC_DMA_ID_TX_UART2 (0 << 8)
  261. #define AON_IFC_REQ_SRC_DMA_ID_RX_UART2 (1 << 8)
  262. #define AON_IFC_REQ_SRC_DMA_ID_TX_UART3 (2 << 8)
  263. #define AON_IFC_REQ_SRC_DMA_ID_RX_UART3 (3 << 8)
  264. #define AON_IFC_REQ_SRC_DMA_ID_TX_DBG_UART (4 << 8)
  265. #define AON_IFC_REQ_SRC_DMA_ID_RX_DBG_UART (5 << 8)
  266. #define AON_IFC_FLUSH (1 << 16)
  267. #define AON_IFC_MAX_BURST_LENGTH(n) (((n)&0x3) << 17)
  268. #define AON_IFC_REQ_SRC_V_DMA_ID_TX_UART2 (0)
  269. #define AON_IFC_REQ_SRC_V_DMA_ID_RX_UART2 (1)
  270. #define AON_IFC_REQ_SRC_V_DMA_ID_TX_UART3 (2)
  271. #define AON_IFC_REQ_SRC_V_DMA_ID_RX_UART3 (3)
  272. #define AON_IFC_REQ_SRC_V_DMA_ID_TX_DBG_UART (4)
  273. #define AON_IFC_REQ_SRC_V_DMA_ID_RX_DBG_UART (5)
  274. // status
  275. #define AON_IFC_ENABLE (1 << 0)
  276. #define AON_IFC_FIFO_EMPTY (1 << 4)
  277. // start_addr
  278. #define AON_IFC_START_ADDR(n) (((n)&0xffffffff) << 0)
  279. // tc
  280. #define AON_IFC_TC(n) (((n)&0x7fffff) << 0)
  281. // tc_threshold
  282. #define AON_IFC_TC_THRESHOLD(n) (((n)&0x7fffff) << 0)
  283. // control
  284. #define AUDIO_IFC_ENABLE (1 << 0)
  285. #define AUDIO_IFC_DISABLE (1 << 1)
  286. #define AUDIO_IFC_AUTO_DISABLE (1 << 4)
  287. // status
  288. #define AUDIO_IFC_ENABLE (1 << 0)
  289. #define AUDIO_IFC_FIFO_EMPTY (1 << 4)
  290. #define AUDIO_IFC_CAUSE_IEF (1 << 8)
  291. #define AUDIO_IFC_CAUSE_IHF (1 << 9)
  292. #define AUDIO_IFC_CAUSE_I4F (1 << 10)
  293. #define AUDIO_IFC_CAUSE_I3_4F (1 << 11)
  294. #define AUDIO_IFC_CAUSE_AHB_ERROR (1 << 12)
  295. #define AUDIO_IFC_IEF (1 << 16)
  296. #define AUDIO_IFC_IHF (1 << 17)
  297. #define AUDIO_IFC_I4F (1 << 18)
  298. #define AUDIO_IFC_I3_4F (1 << 19)
  299. #define AUDIO_IFC_STATUS_AHB_ERROR (1 << 20)
  300. #define AUDIO_IFC_CH_IDLE (1 << 21)
  301. // start_addr
  302. #define AUDIO_IFC_START_ADDR(n) (((n)&0x3fffffff) << 2)
  303. // fifo_size
  304. #define AUDIO_IFC_FIFO_SIZE(n) (((n)&0xffff) << 4)
  305. // int_mask
  306. #define AUDIO_IFC_END_FIFO (1 << 8)
  307. #define AUDIO_IFC_HALF_FIFO (1 << 9)
  308. #define AUDIO_IFC_QUARTER_FIFO (1 << 10)
  309. #define AUDIO_IFC_THREE_QUARTER_FIFO (1 << 11)
  310. #define AUDIO_IFC_INT_MASK_AHB_ERROR (1 << 12)
  311. // int_clear
  312. #define AUDIO_IFC_END_FIFO (1 << 8)
  313. #define AUDIO_IFC_HALF_FIFO (1 << 9)
  314. #define AUDIO_IFC_QUARTER_FIFO (1 << 10)
  315. #define AUDIO_IFC_THREE_QUARTER_FIFO (1 << 11)
  316. #define AUDIO_IFC_INT_CLEAR_AHB_ERROR (1 << 12)
  317. // cur_ahb_addr
  318. #define AUDIO_IFC_CUR_AHB_ADDR(n) (((n)&0xffffffff) << 0)
  319. #endif // _AON_IFC_H_