rfad.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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 _RFAD_H_
  13. #define _RFAD_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_RFAD_BASE (0x18100000)
  17. typedef volatile struct
  18. {
  19. uint32_t mod_en; // 0x00000000
  20. uint32_t ram_addr_map_cfg; // 0x00000004
  21. uint32_t gpo_immdata; // 0x00000008
  22. uint32_t spi_immdata; // 0x0000000c
  23. uint32_t spi_cfg; // 0x00000010
  24. uint32_t spi_rxdata; // 0x00000014
  25. uint32_t debug_data; // 0x00000018
  26. uint32_t rf_gpo_ctrl; // 0x0000001c
  27. uint32_t framl_rfad; // 0x00000020
  28. uint32_t framc_err_up; // 0x00000024
  29. uint32_t data_time_err_up; // 0x00000028
  30. uint32_t framc_err_dn; // 0x0000002c
  31. uint32_t data_time_err_dn; // 0x00000030
  32. uint32_t framl_err; // 0x00000034
  33. uint32_t dont_insert__err_up; // 0x00000038
  34. uint32_t dont_insert__err_dn; // 0x0000003c
  35. uint32_t __64[1008]; // 0x00000040
  36. uint32_t down_mem; // 0x00001000
  37. uint32_t __4100[1023]; // 0x00001004
  38. uint32_t up_mem; // 0x00002000
  39. } HWP_RFAD_T;
  40. #define hwp_rfad ((HWP_RFAD_T *)REG_ACCESS_ADDRESS(REG_RFAD_BASE))
  41. // mod_en
  42. typedef union {
  43. uint32_t v;
  44. struct
  45. {
  46. uint32_t mod_dn_en : 1; // [0]
  47. uint32_t mod_up_en : 1; // [1]
  48. uint32_t __31_2 : 30; // [31:2]
  49. } b;
  50. } REG_RFAD_MOD_EN_T;
  51. // ram_addr_map_cfg
  52. typedef union {
  53. uint32_t v;
  54. struct
  55. {
  56. uint32_t ram2_start_addr_dn : 8; // [7:0]
  57. uint32_t ram3_start_addr_dn : 8; // [15:8]
  58. uint32_t ram2_start_addr_up : 8; // [23:16]
  59. uint32_t ram3_start_addr_up : 8; // [31:24]
  60. } b;
  61. } REG_RFAD_RAM_ADDR_MAP_CFG_T;
  62. // gpo_immdata
  63. typedef union {
  64. uint32_t v;
  65. struct
  66. {
  67. uint32_t gpo : 14; // [13:0]
  68. uint32_t spi_rw : 1; // [14]
  69. uint32_t spi_sel : 1; // [15]
  70. uint32_t up_sel : 1; // [16]
  71. uint32_t __31_17 : 15; // [31:17]
  72. } b;
  73. } REG_RFAD_GPO_IMMDATA_T;
  74. // spi_cfg
  75. typedef union {
  76. uint32_t v;
  77. struct
  78. {
  79. uint32_t tx_data_len : 5; // [4:0]
  80. uint32_t rx_data_len : 5; // [9:5]
  81. uint32_t spol : 1; // [10]
  82. uint32_t cpol : 1; // [11]
  83. uint32_t cpha : 1; // [12]
  84. uint32_t sec : 1; // [13]
  85. uint32_t rd_edge : 1; // [14]
  86. uint32_t rd_inter : 2; // [16:15]
  87. uint32_t ms : 1; // [17]
  88. uint32_t dux : 1; // [18]
  89. uint32_t cs_inv : 1; // [19]
  90. uint32_t frq_div_wr : 3; // [22:20]
  91. uint32_t frq_div_rd : 3; // [25:23]
  92. uint32_t distance : 4; // [29:26]
  93. uint32_t __31_30 : 2; // [31:30]
  94. } b;
  95. } REG_RFAD_SPI_CFG_T;
  96. // debug_data
  97. typedef union {
  98. uint32_t v;
  99. struct
  100. {
  101. uint32_t ram_rd_addr_dn : 9; // [8:0], read only
  102. uint32_t __11_9 : 3; // [11:9]
  103. uint32_t time_err_dn : 1; // [12], read only
  104. uint32_t addr_err_dn : 1; // [13], read only
  105. uint32_t insert_err_dn_flag : 1; // [14], read only
  106. uint32_t framc_err_dn_flag : 1; // [15], read only
  107. uint32_t ram_rd_addr_up : 9; // [24:16], read only
  108. uint32_t __27_25 : 3; // [27:25]
  109. uint32_t time_err_up : 1; // [28], read only
  110. uint32_t addr_err_up : 1; // [29], read only
  111. uint32_t insert_err_up_flag : 1; // [30], read only
  112. uint32_t framc_err_up_flag : 1; // [31], read only
  113. } b;
  114. } REG_RFAD_DEBUG_DATA_T;
  115. // framl_rfad
  116. typedef union {
  117. uint32_t v;
  118. struct
  119. {
  120. uint32_t framc_rfad : 16; // [15:0]
  121. uint32_t dn_en : 1; // [16]
  122. uint32_t up_en : 1; // [17]
  123. uint32_t dont_insert_en : 1; // [18]
  124. uint32_t __31_19 : 13; // [31:19]
  125. } b;
  126. } REG_RFAD_FRAML_RFAD_T;
  127. // framc_err_up
  128. typedef union {
  129. uint32_t v;
  130. struct
  131. {
  132. uint32_t framc_err_up : 24; // [23:0], read only
  133. uint32_t framc_err_up_flag : 1; // [24], read only
  134. uint32_t __31_25 : 7; // [31:25]
  135. } b;
  136. } REG_RFAD_FRAMC_ERR_UP_T;
  137. // data_time_err_up
  138. typedef union {
  139. uint32_t v;
  140. struct
  141. {
  142. uint32_t data_time_err_up : 24; // [23:0], read only
  143. uint32_t ram_rd_addr_up : 8; // [31:24], read only
  144. } b;
  145. } REG_RFAD_DATA_TIME_ERR_UP_T;
  146. // framc_err_dn
  147. typedef union {
  148. uint32_t v;
  149. struct
  150. {
  151. uint32_t framc_err_dn : 24; // [23:0], read only
  152. uint32_t framc_err_dn_flag : 1; // [24], read only
  153. uint32_t __31_25 : 7; // [31:25]
  154. } b;
  155. } REG_RFAD_FRAMC_ERR_DN_T;
  156. // data_time_err_dn
  157. typedef union {
  158. uint32_t v;
  159. struct
  160. {
  161. uint32_t data_time_err_dn : 24; // [23:0], read only
  162. uint32_t ram_rd_addr_dn : 8; // [31:24], read only
  163. } b;
  164. } REG_RFAD_DATA_TIME_ERR_DN_T;
  165. // framl_err
  166. typedef union {
  167. uint32_t v;
  168. struct
  169. {
  170. uint32_t framl_err_dn : 16; // [15:0], read only
  171. uint32_t framl_err_up : 16; // [31:16], read only
  172. } b;
  173. } REG_RFAD_FRAML_ERR_T;
  174. // dont_insert__err_up
  175. typedef union {
  176. uint32_t v;
  177. struct
  178. {
  179. uint32_t framc_err_up : 24; // [23:0], read only
  180. uint32_t ram_rd_addr_up : 8; // [31:24], read only
  181. } b;
  182. } REG_RFAD_DONT_INSERT__ERR_UP_T;
  183. // dont_insert__err_dn
  184. typedef union {
  185. uint32_t v;
  186. struct
  187. {
  188. uint32_t framc_err_dn : 24; // [23:0], read only
  189. uint32_t ram_rd_addr_dn : 8; // [31:24], read only
  190. } b;
  191. } REG_RFAD_DONT_INSERT__ERR_DN_T;
  192. // mod_en
  193. #define RFAD_MOD_DN_EN (1 << 0)
  194. #define RFAD_MOD_UP_EN (1 << 1)
  195. // ram_addr_map_cfg
  196. #define RFAD_RAM2_START_ADDR_DN(n) (((n)&0xff) << 0)
  197. #define RFAD_RAM3_START_ADDR_DN(n) (((n)&0xff) << 8)
  198. #define RFAD_RAM2_START_ADDR_UP(n) (((n)&0xff) << 16)
  199. #define RFAD_RAM3_START_ADDR_UP(n) (((n)&0xff) << 24)
  200. // gpo_immdata
  201. #define RFAD_GPO(n) (((n)&0x3fff) << 0)
  202. #define RFAD_SPI_RW (1 << 14)
  203. #define RFAD_SPI_SEL (1 << 15)
  204. #define RFAD_UP_SEL (1 << 16)
  205. // spi_cfg
  206. #define RFAD_TX_DATA_LEN(n) (((n)&0x1f) << 0)
  207. #define RFAD_RX_DATA_LEN(n) (((n)&0x1f) << 5)
  208. #define RFAD_SPOL (1 << 10)
  209. #define RFAD_CPOL (1 << 11)
  210. #define RFAD_CPHA (1 << 12)
  211. #define RFAD_SEC (1 << 13)
  212. #define RFAD_RD_EDGE (1 << 14)
  213. #define RFAD_RD_INTER(n) (((n)&0x3) << 15)
  214. #define RFAD_MS (1 << 17)
  215. #define RFAD_DUX (1 << 18)
  216. #define RFAD_CS_INV (1 << 19)
  217. #define RFAD_FRQ_DIV_WR(n) (((n)&0x7) << 20)
  218. #define RFAD_FRQ_DIV_RD(n) (((n)&0x7) << 23)
  219. #define RFAD_DISTANCE(n) (((n)&0xf) << 26)
  220. // debug_data
  221. #define RFAD_DEBUG_DATA_RAM_RD_ADDR_DN(n) (((n)&0x1ff) << 0)
  222. #define RFAD_TIME_ERR_DN (1 << 12)
  223. #define RFAD_ADDR_ERR_DN (1 << 13)
  224. #define RFAD_INSERT_ERR_DN_FLAG (1 << 14)
  225. #define RFAD_DEBUG_DATA_FRAMC_ERR_DN_FLAG (1 << 15)
  226. #define RFAD_DEBUG_DATA_RAM_RD_ADDR_UP(n) (((n)&0x1ff) << 16)
  227. #define RFAD_TIME_ERR_UP (1 << 28)
  228. #define RFAD_ADDR_ERR_UP (1 << 29)
  229. #define RFAD_INSERT_ERR_UP_FLAG (1 << 30)
  230. #define RFAD_DEBUG_DATA_FRAMC_ERR_UP_FLAG (1 << 31)
  231. // framl_rfad
  232. #define RFAD_FRAMC_RFAD(n) (((n)&0xffff) << 0)
  233. #define RFAD_DN_EN (1 << 16)
  234. #define RFAD_UP_EN (1 << 17)
  235. #define RFAD_DONT_INSERT_EN (1 << 18)
  236. // framc_err_up
  237. #define RFAD_FRAMC_ERR_UP(n) (((n)&0xffffff) << 0)
  238. #define RFAD_FRAMC_ERR_UP_FRAMC_ERR_UP_FLAG (1 << 24)
  239. // data_time_err_up
  240. #define RFAD_DATA_TIME_ERR_UP(n) (((n)&0xffffff) << 0)
  241. #define RFAD_DATA_TIME_ERR_UP_RAM_RD_ADDR_UP(n) (((n)&0xff) << 24)
  242. // framc_err_dn
  243. #define RFAD_FRAMC_ERR_DN(n) (((n)&0xffffff) << 0)
  244. #define RFAD_FRAMC_ERR_DN_FRAMC_ERR_DN_FLAG (1 << 24)
  245. // data_time_err_dn
  246. #define RFAD_DATA_TIME_ERR_DN(n) (((n)&0xffffff) << 0)
  247. #define RFAD_DATA_TIME_ERR_DN_RAM_RD_ADDR_DN(n) (((n)&0xff) << 24)
  248. // framl_err
  249. #define RFAD_FRAML_ERR_DN(n) (((n)&0xffff) << 0)
  250. #define RFAD_FRAML_ERR_UP(n) (((n)&0xffff) << 16)
  251. // dont_insert__err_up
  252. #define RFAD_FRAMC_ERR_UP(n) (((n)&0xffffff) << 0)
  253. #define RFAD_DONT_INSERT__ERR_UP_RAM_RD_ADDR_UP(n) (((n)&0xff) << 24)
  254. // dont_insert__err_dn
  255. #define RFAD_FRAMC_ERR_DN(n) (((n)&0xffffff) << 0)
  256. #define RFAD_DONT_INSERT__ERR_DN_RAM_RD_ADDR_DN(n) (((n)&0xff) << 24)
  257. #endif // _RFAD_H_