cp_ifc.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 _CP_IFC_H_
  13. #define _CP_IFC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define CP_NB_BITS_ADDR (32)
  17. #define CP_IFC_ADDR_ALIGN (0)
  18. #define CP_IFC_TC_LEN (23)
  19. #define CP_IFC_STD_CHAN_NB (4)
  20. #define CP_IFC_RFSPI_CHAN (0)
  21. #define CP_IFC_AIF_CHAN (0)
  22. #define CP_IFC_DBG_CHAN (0)
  23. typedef enum
  24. {
  25. DMA_ID_TX_SCI1 = 0,
  26. DMA_ID_RX_SCI1 = 1,
  27. DMA_ID_TX_SCI2 = 2,
  28. DMA_ID_RX_SCI2 = 3,
  29. } CP_IFC_REQUEST_IDS_T;
  30. #define REG_CP_IFC_BASE (0x14002000)
  31. typedef volatile struct
  32. {
  33. uint32_t get_ch; // 0x00000000
  34. uint32_t dma_status; // 0x00000004
  35. uint32_t debug_status; // 0x00000008
  36. uint32_t ifc_sec; // 0x0000000c
  37. struct // 0x00000010
  38. { //
  39. uint32_t control; // 0x00000000
  40. uint32_t status; // 0x00000004
  41. uint32_t start_addr; // 0x00000008
  42. uint32_t tc; // 0x0000000c
  43. uint32_t tc_threshold; // 0x00000010
  44. } std_ch[4]; //
  45. } HWP_CP_IFC_T;
  46. #define hwp_cpIfc ((HWP_CP_IFC_T *)REG_ACCESS_ADDRESS(REG_CP_IFC_BASE))
  47. // get_ch
  48. typedef union {
  49. uint32_t v;
  50. struct
  51. {
  52. uint32_t ch_to_use : 5; // [4:0], read only
  53. uint32_t __31_5 : 27; // [31:5]
  54. } b;
  55. } REG_CP_IFC_GET_CH_T;
  56. // dma_status
  57. typedef union {
  58. uint32_t v;
  59. struct
  60. {
  61. uint32_t ch_enable : 4; // [3:0], read only
  62. uint32_t __15_4 : 12; // [15:4]
  63. uint32_t ch_busy : 4; // [19:16], read only
  64. uint32_t __31_20 : 12; // [31:20]
  65. } b;
  66. } REG_CP_IFC_DMA_STATUS_T;
  67. // debug_status
  68. typedef union {
  69. uint32_t v;
  70. struct
  71. {
  72. uint32_t dbg_status : 1; // [0], read only
  73. uint32_t __31_1 : 31; // [31:1]
  74. } b;
  75. } REG_CP_IFC_DEBUG_STATUS_T;
  76. // ifc_sec
  77. typedef union {
  78. uint32_t v;
  79. struct
  80. {
  81. uint32_t std_ch_reg_sec : 4; // [3:0]
  82. uint32_t __15_4 : 12; // [15:4]
  83. uint32_t std_ch_dma_sec : 4; // [19:16]
  84. uint32_t __31_20 : 12; // [31:20]
  85. } b;
  86. } REG_CP_IFC_IFC_SEC_T;
  87. // control
  88. typedef union {
  89. uint32_t v;
  90. struct
  91. {
  92. uint32_t enable : 1; // [0]
  93. uint32_t disable : 1; // [1]
  94. uint32_t ch_rd_hw_exch : 1; // [2]
  95. uint32_t ch_wr_hw_exch : 1; // [3]
  96. uint32_t autodisable : 1; // [4]
  97. uint32_t size : 1; // [5]
  98. uint32_t __7_6 : 2; // [7:6]
  99. uint32_t req_src : 5; // [12:8]
  100. uint32_t __15_13 : 3; // [15:13]
  101. uint32_t flush : 1; // [16]
  102. uint32_t max_burst_length : 2; // [18:17]
  103. uint32_t __31_19 : 13; // [31:19]
  104. } b;
  105. } REG_CP_IFC_CONTROL_T;
  106. // status
  107. typedef union {
  108. uint32_t v;
  109. struct
  110. {
  111. uint32_t enable : 1; // [0], read only
  112. uint32_t __3_1 : 3; // [3:1]
  113. uint32_t fifo_empty : 1; // [4], read only
  114. uint32_t __31_5 : 27; // [31:5]
  115. } b;
  116. } REG_CP_IFC_STATUS_T;
  117. // tc
  118. typedef union {
  119. uint32_t v;
  120. struct
  121. {
  122. uint32_t tc : 23; // [22:0]
  123. uint32_t __31_23 : 9; // [31:23]
  124. } b;
  125. } REG_CP_IFC_TC_T;
  126. // tc_threshold
  127. typedef union {
  128. uint32_t v;
  129. struct
  130. {
  131. uint32_t tc_threshold : 23; // [22:0]
  132. uint32_t __31_23 : 9; // [31:23]
  133. } b;
  134. } REG_CP_IFC_TC_THRESHOLD_T;
  135. // get_ch
  136. #define CP_IFC_CH_TO_USE(n) (((n)&0x1f) << 0)
  137. // dma_status
  138. #define CP_IFC_CH_ENABLE(n) (((n)&0xf) << 0)
  139. #define CP_IFC_CH_BUSY(n) (((n)&0xf) << 16)
  140. // debug_status
  141. #define CP_IFC_DBG_STATUS (1 << 0)
  142. // ifc_sec
  143. #define CP_IFC_STD_CH_REG_SEC(n) (((n)&0xf) << 0)
  144. #define CP_IFC_STD_CH_DMA_SEC(n) (((n)&0xf) << 16)
  145. // control
  146. #define CP_IFC_ENABLE (1 << 0)
  147. #define CP_IFC_DISABLE (1 << 1)
  148. #define CP_IFC_CH_RD_HW_EXCH (1 << 2)
  149. #define CP_IFC_CH_WR_HW_EXCH (1 << 3)
  150. #define CP_IFC_AUTODISABLE (1 << 4)
  151. #define CP_IFC_SIZE (1 << 5)
  152. #define CP_IFC_REQ_SRC(n) (((n)&0x1f) << 8)
  153. #define CP_IFC_REQ_SRC_DMA_ID_TX_SCI1 (0 << 8)
  154. #define CP_IFC_REQ_SRC_DMA_ID_RX_SCI1 (1 << 8)
  155. #define CP_IFC_REQ_SRC_DMA_ID_TX_SCI2 (2 << 8)
  156. #define CP_IFC_REQ_SRC_DMA_ID_RX_SCI2 (3 << 8)
  157. #define CP_IFC_FLUSH (1 << 16)
  158. #define CP_IFC_MAX_BURST_LENGTH(n) (((n)&0x3) << 17)
  159. #define CP_IFC_REQ_SRC_V_DMA_ID_TX_SCI1 (0)
  160. #define CP_IFC_REQ_SRC_V_DMA_ID_RX_SCI1 (1)
  161. #define CP_IFC_REQ_SRC_V_DMA_ID_TX_SCI2 (2)
  162. #define CP_IFC_REQ_SRC_V_DMA_ID_RX_SCI2 (3)
  163. // status
  164. #define CP_IFC_ENABLE (1 << 0)
  165. #define CP_IFC_FIFO_EMPTY (1 << 4)
  166. // start_addr
  167. #define CP_IFC_START_ADDR(n) (((n)&0xffffffff) << 0)
  168. // tc
  169. #define CP_IFC_TC(n) (((n)&0x7fffff) << 0)
  170. // tc_threshold
  171. #define CP_IFC_TC_THRESHOLD(n) (((n)&0x7fffff) << 0)
  172. #endif // _CP_IFC_H_