lps_ifc.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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 _LPS_IFC_H_
  13. #define _LPS_IFC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define LPS_NB_BITS_ADDR (32)
  17. #define LPS_IFC_ADDR_ALIGN (0)
  18. #define LPS_IFC_TC_LEN (23)
  19. #define LPS_IFC_STD_CHAN_NB (2)
  20. #define LPS_IFC_RFSPI_CHAN (0)
  21. #define LPS_IFC_AIF_CHAN (0)
  22. #define LPS_IFC_DBG_CHAN (0)
  23. typedef enum
  24. {
  25. DMA_ID_TX_UART1 = 0,
  26. DMA_ID_RX_UART1 = 1,
  27. } LPS_IFC_REQUEST_IDS_T;
  28. #define REG_LPS_IFC_BASE (0x5170e000)
  29. typedef volatile struct
  30. {
  31. uint32_t get_ch; // 0x00000000
  32. uint32_t dma_status; // 0x00000004
  33. uint32_t debug_status; // 0x00000008
  34. uint32_t ifc_sec; // 0x0000000c
  35. struct // 0x00000010
  36. { //
  37. uint32_t control; // 0x00000000
  38. uint32_t status; // 0x00000004
  39. uint32_t start_addr; // 0x00000008
  40. uint32_t tc; // 0x0000000c
  41. uint32_t tc_threshold; // 0x00000010
  42. } std_ch[2]; //
  43. } HWP_LPS_IFC_T;
  44. #define hwp_lpsIfc ((HWP_LPS_IFC_T *)REG_ACCESS_ADDRESS(REG_LPS_IFC_BASE))
  45. // get_ch
  46. typedef union {
  47. uint32_t v;
  48. struct
  49. {
  50. uint32_t ch_to_use : 5; // [4:0], read only
  51. uint32_t __31_5 : 27; // [31:5]
  52. } b;
  53. } REG_LPS_IFC_GET_CH_T;
  54. // dma_status
  55. typedef union {
  56. uint32_t v;
  57. struct
  58. {
  59. uint32_t ch_enable : 2; // [1:0], read only
  60. uint32_t __15_2 : 14; // [15:2]
  61. uint32_t ch_busy : 2; // [17:16], read only
  62. uint32_t __31_18 : 14; // [31:18]
  63. } b;
  64. } REG_LPS_IFC_DMA_STATUS_T;
  65. // debug_status
  66. typedef union {
  67. uint32_t v;
  68. struct
  69. {
  70. uint32_t dbg_status : 1; // [0], read only
  71. uint32_t __31_1 : 31; // [31:1]
  72. } b;
  73. } REG_LPS_IFC_DEBUG_STATUS_T;
  74. // ifc_sec
  75. typedef union {
  76. uint32_t v;
  77. struct
  78. {
  79. uint32_t std_ch_reg_sec : 2; // [1:0]
  80. uint32_t __15_2 : 14; // [15:2]
  81. uint32_t std_ch_dma_sec : 2; // [17:16]
  82. uint32_t __31_18 : 14; // [31:18]
  83. } b;
  84. } REG_LPS_IFC_IFC_SEC_T;
  85. // control
  86. typedef union {
  87. uint32_t v;
  88. struct
  89. {
  90. uint32_t enable : 1; // [0]
  91. uint32_t disable : 1; // [1]
  92. uint32_t ch_rd_hw_exch : 1; // [2]
  93. uint32_t ch_wr_hw_exch : 1; // [3]
  94. uint32_t autodisable : 1; // [4]
  95. uint32_t size : 1; // [5]
  96. uint32_t __7_6 : 2; // [7:6]
  97. uint32_t req_src : 5; // [12:8]
  98. uint32_t __15_13 : 3; // [15:13]
  99. uint32_t flush : 1; // [16]
  100. uint32_t max_burst_length : 2; // [18:17]
  101. uint32_t __31_19 : 13; // [31:19]
  102. } b;
  103. } REG_LPS_IFC_CONTROL_T;
  104. // status
  105. typedef union {
  106. uint32_t v;
  107. struct
  108. {
  109. uint32_t enable : 1; // [0], read only
  110. uint32_t __3_1 : 3; // [3:1]
  111. uint32_t fifo_empty : 1; // [4], read only
  112. uint32_t __31_5 : 27; // [31:5]
  113. } b;
  114. } REG_LPS_IFC_STATUS_T;
  115. // tc
  116. typedef union {
  117. uint32_t v;
  118. struct
  119. {
  120. uint32_t tc : 23; // [22:0]
  121. uint32_t __31_23 : 9; // [31:23]
  122. } b;
  123. } REG_LPS_IFC_TC_T;
  124. // tc_threshold
  125. typedef union {
  126. uint32_t v;
  127. struct
  128. {
  129. uint32_t tc_threshold : 23; // [22:0]
  130. uint32_t __31_23 : 9; // [31:23]
  131. } b;
  132. } REG_LPS_IFC_TC_THRESHOLD_T;
  133. // get_ch
  134. #define LPS_IFC_CH_TO_USE(n) (((n)&0x1f) << 0)
  135. // dma_status
  136. #define LPS_IFC_CH_ENABLE(n) (((n)&0x3) << 0)
  137. #define LPS_IFC_CH_BUSY(n) (((n)&0x3) << 16)
  138. // debug_status
  139. #define LPS_IFC_DBG_STATUS (1 << 0)
  140. // ifc_sec
  141. #define LPS_IFC_STD_CH_REG_SEC(n) (((n)&0x3) << 0)
  142. #define LPS_IFC_STD_CH_DMA_SEC(n) (((n)&0x3) << 16)
  143. // control
  144. #define LPS_IFC_ENABLE (1 << 0)
  145. #define LPS_IFC_DISABLE (1 << 1)
  146. #define LPS_IFC_CH_RD_HW_EXCH (1 << 2)
  147. #define LPS_IFC_CH_WR_HW_EXCH (1 << 3)
  148. #define LPS_IFC_AUTODISABLE (1 << 4)
  149. #define LPS_IFC_SIZE (1 << 5)
  150. #define LPS_IFC_REQ_SRC(n) (((n)&0x1f) << 8)
  151. #define LPS_IFC_REQ_SRC_DMA_ID_TX_UART1 (0 << 8)
  152. #define LPS_IFC_REQ_SRC_DMA_ID_RX_UART1 (1 << 8)
  153. #define LPS_IFC_FLUSH (1 << 16)
  154. #define LPS_IFC_MAX_BURST_LENGTH(n) (((n)&0x3) << 17)
  155. #define LPS_IFC_REQ_SRC_V_DMA_ID_TX_UART1 (0)
  156. #define LPS_IFC_REQ_SRC_V_DMA_ID_RX_UART1 (1)
  157. // status
  158. #define LPS_IFC_ENABLE (1 << 0)
  159. #define LPS_IFC_FIFO_EMPTY (1 << 4)
  160. // start_addr
  161. #define LPS_IFC_START_ADDR(n) (((n)&0xffffffff) << 0)
  162. // tc
  163. #define LPS_IFC_TC(n) (((n)&0x7fffff) << 0)
  164. // tc_threshold
  165. #define LPS_IFC_TC_THRESHOLD(n) (((n)&0x7fffff) << 0)
  166. #endif // _LPS_IFC_H_