hw_udma.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. //*****************************************************************************
  2. //
  3. // Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
  4. //
  5. //
  6. // Redistribution and use in source and binary forms, with or without
  7. // modification, are permitted provided that the following conditions
  8. // are met:
  9. //
  10. // Redistributions of source code must retain the above copyright
  11. // notice, this list of conditions and the following disclaimer.
  12. //
  13. // Redistributions in binary form must reproduce the above copyright
  14. // notice, this list of conditions and the following disclaimer in the
  15. // documentation and/or other materials provided with the
  16. // distribution.
  17. //
  18. // Neither the name of Texas Instruments Incorporated nor the names of
  19. // its contributors may be used to endorse or promote products derived
  20. // from this software without specific prior written permission.
  21. //
  22. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  26. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  27. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  28. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  29. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  30. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. //
  34. //*****************************************************************************
  35. #ifndef __HW_UDMA_H__
  36. #define __HW_UDMA_H__
  37. //*****************************************************************************
  38. //
  39. // The following are defines for the UDMA register offsets.
  40. //
  41. //*****************************************************************************
  42. #define UDMA_O_STAT 0x00000000
  43. #define UDMA_O_CFG 0x00000004
  44. #define UDMA_O_CTLBASE 0x00000008
  45. #define UDMA_O_ALTBASE 0x0000000C
  46. #define UDMA_O_WAITSTAT 0x00000010
  47. #define UDMA_O_SWREQ 0x00000014
  48. #define UDMA_O_USEBURSTSET 0x00000018
  49. #define UDMA_O_USEBURSTCLR 0x0000001C
  50. #define UDMA_O_REQMASKSET 0x00000020
  51. #define UDMA_O_REQMASKCLR 0x00000024
  52. #define UDMA_O_ENASET 0x00000028
  53. #define UDMA_O_ENACLR 0x0000002C
  54. #define UDMA_O_ALTSET 0x00000030
  55. #define UDMA_O_ALTCLR 0x00000034
  56. #define UDMA_O_PRIOSET 0x00000038
  57. #define UDMA_O_PRIOCLR 0x0000003C
  58. #define UDMA_O_ERRCLR 0x0000004C
  59. #define UDMA_O_CHASGN 0x00000500
  60. #define UDMA_O_CHIS 0x00000504
  61. #define UDMA_O_CHMAP0 0x00000510
  62. #define UDMA_O_CHMAP1 0x00000514
  63. #define UDMA_O_CHMAP2 0x00000518
  64. #define UDMA_O_CHMAP3 0x0000051C
  65. #define UDMA_O_PV 0x00000FB0
  66. //******************************************************************************
  67. //
  68. // The following are defines for the bit fields in the UDMA_O_STAT register.
  69. //
  70. //******************************************************************************
  71. #define UDMA_STAT_DMACHANS_M 0x001F0000 // Available uDMA Channels Minus 1
  72. #define UDMA_STAT_DMACHANS_S 16
  73. #define UDMA_STAT_STATE_M 0x000000F0 // Control State Machine Status
  74. // 0x00000090 : UDMA_STAT_STATE_DONE
  75. // : Done 0x00000000 :
  76. // UDMA_STAT_STATE_IDLE : Idle
  77. // 0x00000010 :
  78. // UDMA_STAT_STATE_RD_CTRL : Reading
  79. // channel controller data
  80. // 0x00000030 :
  81. // UDMA_STAT_STATE_RD_DSTENDP :
  82. // Reading destination end pointer
  83. // 0x00000040 :
  84. // UDMA_STAT_STATE_RD_SRCDAT :
  85. // Reading source data 0x00000020 :
  86. // UDMA_STAT_STATE_RD_SRCENDP :
  87. // Reading source end pointer
  88. // 0x00000080 :
  89. // UDMA_STAT_STATE_STALL : Stalled
  90. // 0x000000A0 :
  91. // UDMA_STAT_STATE_UNDEF : Undefined
  92. // 0x00000060 : UDMA_STAT_STATE_WAIT
  93. // : Waiting for uDMA request to
  94. // clear 0x00000070 :
  95. // UDMA_STAT_STATE_WR_CTRL : Writing
  96. // channel controller data
  97. // 0x00000050 :
  98. // UDMA_STAT_STATE_WR_DSTDAT :
  99. // Writing destination data
  100. #define UDMA_STAT_STATE_S 4
  101. #define UDMA_STAT_MASTEN 0x00000001 // Master Enable Status
  102. //******************************************************************************
  103. //
  104. // The following are defines for the bit fields in the UDMA_O_CFG register.
  105. //
  106. //******************************************************************************
  107. #define UDMA_CFG_MASTEN 0x00000001 // Controller Master Enable
  108. //******************************************************************************
  109. //
  110. // The following are defines for the bit fields in the UDMA_O_CTLBASE register.
  111. //
  112. //******************************************************************************
  113. #define UDMA_CTLBASE_ADDR_M 0xFFFFFC00 // Channel Control Base Address
  114. #define UDMA_CTLBASE_ADDR_S 10
  115. //******************************************************************************
  116. //
  117. // The following are defines for the bit fields in the UDMA_O_ALTBASE register.
  118. //
  119. //******************************************************************************
  120. #define UDMA_ALTBASE_ADDR_M 0xFFFFFFFF // Alternate Channel Address
  121. // Pointer
  122. #define UDMA_ALTBASE_ADDR_S 0
  123. //******************************************************************************
  124. //
  125. // The following are defines for the bit fields in the UDMA_O_WAITSTAT register.
  126. //
  127. //******************************************************************************
  128. #define UDMA_WAITSTAT_WAITREQ_M \
  129. 0xFFFFFFFF // Channel [n] Wait Status
  130. #define UDMA_WAITSTAT_WAITREQ_S 0
  131. //******************************************************************************
  132. //
  133. // The following are defines for the bit fields in the UDMA_O_SWREQ register.
  134. //
  135. //******************************************************************************
  136. #define UDMA_SWREQ_M 0xFFFFFFFF // Channel [n] Software Request
  137. #define UDMA_SWREQ_S 0
  138. //******************************************************************************
  139. //
  140. // The following are defines for the bit fields in the
  141. // UDMA_O_USEBURSTSET register.
  142. //
  143. //******************************************************************************
  144. #define UDMA_USEBURSTSET_SET_M \
  145. 0xFFFFFFFF // Channel [n] Useburst Set
  146. #define UDMA_USEBURSTSET_SET_S 0
  147. //******************************************************************************
  148. //
  149. // The following are defines for the bit fields in the
  150. // UDMA_O_USEBURSTCLR register.
  151. //
  152. //******************************************************************************
  153. #define UDMA_USEBURSTCLR_CLR_M \
  154. 0xFFFFFFFF // Channel [n] Useburst Clear
  155. #define UDMA_USEBURSTCLR_CLR_S 0
  156. //******************************************************************************
  157. //
  158. // The following are defines for the bit fields in the UDMA_O_REQMASKSET register.
  159. //
  160. //******************************************************************************
  161. #define UDMA_REQMASKSET_SET_M 0xFFFFFFFF // Channel [n] Request Mask Set
  162. #define UDMA_REQMASKSET_SET_S 0
  163. //******************************************************************************
  164. //
  165. // The following are defines for the bit fields in the UDMA_O_REQMASKCLR register.
  166. //
  167. //******************************************************************************
  168. #define UDMA_REQMASKCLR_CLR_M 0xFFFFFFFF // Channel [n] Request Mask Clear
  169. #define UDMA_REQMASKCLR_CLR_S 0
  170. //******************************************************************************
  171. //
  172. // The following are defines for the bit fields in the UDMA_O_ENASET register.
  173. //
  174. //******************************************************************************
  175. #define UDMA_ENASET_CHENSET_M 0xFFFFFFFF // Channel [n] Enable Set
  176. #define UDMA_ENASET_CHENSET_S 0
  177. //******************************************************************************
  178. //
  179. // The following are defines for the bit fields in the UDMA_O_ENACLR register.
  180. //
  181. //******************************************************************************
  182. #define UDMA_ENACLR_CLR_M 0xFFFFFFFF // Clear Channel [n] Enable Clear
  183. #define UDMA_ENACLR_CLR_S 0
  184. //******************************************************************************
  185. //
  186. // The following are defines for the bit fields in the UDMA_O_ALTSET register.
  187. //
  188. //******************************************************************************
  189. #define UDMA_ALTSET_SET_M 0xFFFFFFFF // Channel [n] Alternate Set
  190. #define UDMA_ALTSET_SET_S 0
  191. //******************************************************************************
  192. //
  193. // The following are defines for the bit fields in the UDMA_O_ALTCLR register.
  194. //
  195. //******************************************************************************
  196. #define UDMA_ALTCLR_CLR_M 0xFFFFFFFF // Channel [n] Alternate Clear
  197. #define UDMA_ALTCLR_CLR_S 0
  198. //******************************************************************************
  199. //
  200. // The following are defines for the bit fields in the UDMA_O_PRIOSET register.
  201. //
  202. //******************************************************************************
  203. #define UDMA_PRIOSET_SET_M 0xFFFFFFFF // Channel [n] Priority Set
  204. #define UDMA_PRIOSET_SET_S 0
  205. //******************************************************************************
  206. //
  207. // The following are defines for the bit fields in the UDMA_O_PRIOCLR register.
  208. //
  209. //******************************************************************************
  210. #define UDMA_PRIOCLR_CLR_M 0xFFFFFFFF // Channel [n] Priority Clear
  211. #define UDMA_PRIOCLR_CLR_S 0
  212. //******************************************************************************
  213. //
  214. // The following are defines for the bit fields in the UDMA_O_ERRCLR register.
  215. //
  216. //******************************************************************************
  217. #define UDMA_ERRCLR_ERRCLR 0x00000001 // uDMA Bus Error Status
  218. //******************************************************************************
  219. //
  220. // The following are defines for the bit fields in the UDMA_O_CHASGN register.
  221. //
  222. //******************************************************************************
  223. #define UDMA_CHASGN_M 0xFFFFFFFF // Channel [n] Assignment Select
  224. #define UDMA_CHASGN_S 0
  225. //******************************************************************************
  226. //
  227. // The following are defines for the bit fields in the UDMA_O_CHIS register.
  228. //
  229. //******************************************************************************
  230. #define UDMA_CHIS_M 0xFFFFFFFF // Channel [n] Interrupt Status
  231. #define UDMA_CHIS_S 0
  232. //******************************************************************************
  233. //
  234. // The following are defines for the bit fields in the UDMA_O_CHMAP0 register.
  235. //
  236. //******************************************************************************
  237. #define UDMA_CHMAP0_CH7SEL_M 0xF0000000 // uDMA Channel 7 Source Select
  238. #define UDMA_CHMAP0_CH7SEL_S 28
  239. #define UDMA_CHMAP0_CH6SEL_M 0x0F000000 // uDMA Channel 6 Source Select
  240. #define UDMA_CHMAP0_CH6SEL_S 24
  241. #define UDMA_CHMAP0_CH5SEL_M 0x00F00000 // uDMA Channel 5 Source Select
  242. #define UDMA_CHMAP0_CH5SEL_S 20
  243. #define UDMA_CHMAP0_CH4SEL_M 0x000F0000 // uDMA Channel 4 Source Select
  244. #define UDMA_CHMAP0_CH4SEL_S 16
  245. #define UDMA_CHMAP0_CH3SEL_M 0x0000F000 // uDMA Channel 3 Source Select
  246. #define UDMA_CHMAP0_CH3SEL_S 12
  247. #define UDMA_CHMAP0_CH2SEL_M 0x00000F00 // uDMA Channel 2 Source Select
  248. #define UDMA_CHMAP0_CH2SEL_S 8
  249. #define UDMA_CHMAP0_CH1SEL_M 0x000000F0 // uDMA Channel 1 Source Select
  250. #define UDMA_CHMAP0_CH1SEL_S 4
  251. #define UDMA_CHMAP0_CH0SEL_M 0x0000000F // uDMA Channel 0 Source Select
  252. #define UDMA_CHMAP0_CH0SEL_S 0
  253. //******************************************************************************
  254. //
  255. // The following are defines for the bit fields in the UDMA_O_CHMAP1 register.
  256. //
  257. //******************************************************************************
  258. #define UDMA_CHMAP1_CH15SEL_M 0xF0000000 // uDMA Channel 15 Source Select
  259. #define UDMA_CHMAP1_CH15SEL_S 28
  260. #define UDMA_CHMAP1_CH14SEL_M 0x0F000000 // uDMA Channel 14 Source Select
  261. #define UDMA_CHMAP1_CH14SEL_S 24
  262. #define UDMA_CHMAP1_CH13SEL_M 0x00F00000 // uDMA Channel 13 Source Select
  263. #define UDMA_CHMAP1_CH13SEL_S 20
  264. #define UDMA_CHMAP1_CH12SEL_M 0x000F0000 // uDMA Channel 12 Source Select
  265. #define UDMA_CHMAP1_CH12SEL_S 16
  266. #define UDMA_CHMAP1_CH11SEL_M 0x0000F000 // uDMA Channel 11 Source Select
  267. #define UDMA_CHMAP1_CH11SEL_S 12
  268. #define UDMA_CHMAP1_CH10SEL_M 0x00000F00 // uDMA Channel 10 Source Select
  269. #define UDMA_CHMAP1_CH10SEL_S 8
  270. #define UDMA_CHMAP1_CH9SEL_M 0x000000F0 // uDMA Channel 9 Source Select
  271. #define UDMA_CHMAP1_CH9SEL_S 4
  272. #define UDMA_CHMAP1_CH8SEL_M 0x0000000F // uDMA Channel 8 Source Select
  273. #define UDMA_CHMAP1_CH8SEL_S 0
  274. //******************************************************************************
  275. //
  276. // The following are defines for the bit fields in the UDMA_O_CHMAP2 register.
  277. //
  278. //******************************************************************************
  279. #define UDMA_CHMAP2_CH23SEL_M 0xF0000000 // uDMA Channel 23 Source Select
  280. #define UDMA_CHMAP2_CH23SEL_S 28
  281. #define UDMA_CHMAP2_CH22SEL_M 0x0F000000 // uDMA Channel 22 Source Select
  282. #define UDMA_CHMAP2_CH22SEL_S 24
  283. #define UDMA_CHMAP2_CH21SEL_M 0x00F00000 // uDMA Channel 21 Source Select
  284. #define UDMA_CHMAP2_CH21SEL_S 20
  285. #define UDMA_CHMAP2_CH20SEL_M 0x000F0000 // uDMA Channel 20 Source Select
  286. #define UDMA_CHMAP2_CH20SEL_S 16
  287. #define UDMA_CHMAP2_CH19SEL_M 0x0000F000 // uDMA Channel 19 Source Select
  288. #define UDMA_CHMAP2_CH19SEL_S 12
  289. #define UDMA_CHMAP2_CH18SEL_M 0x00000F00 // uDMA Channel 18 Source Select
  290. #define UDMA_CHMAP2_CH18SEL_S 8
  291. #define UDMA_CHMAP2_CH17SEL_M 0x000000F0 // uDMA Channel 17 Source Select
  292. #define UDMA_CHMAP2_CH17SEL_S 4
  293. #define UDMA_CHMAP2_CH16SEL_M 0x0000000F // uDMA Channel 16 Source Select
  294. #define UDMA_CHMAP2_CH16SEL_S 0
  295. //******************************************************************************
  296. //
  297. // The following are defines for the bit fields in the UDMA_O_CHMAP3 register.
  298. //
  299. //******************************************************************************
  300. #define UDMA_CHMAP3_CH31SEL_M 0xF0000000 // uDMA Channel 31 Source Select
  301. #define UDMA_CHMAP3_CH31SEL_S 28
  302. #define UDMA_CHMAP3_CH30SEL_M 0x0F000000 // uDMA Channel 30 Source Select
  303. #define UDMA_CHMAP3_CH30SEL_S 24
  304. #define UDMA_CHMAP3_CH29SEL_M 0x00F00000 // uDMA Channel 29 Source Select
  305. #define UDMA_CHMAP3_CH29SEL_S 20
  306. #define UDMA_CHMAP3_CH28SEL_M 0x000F0000 // uDMA Channel 28 Source Select
  307. #define UDMA_CHMAP3_CH28SEL_S 16
  308. #define UDMA_CHMAP3_CH27SEL_M 0x0000F000 // uDMA Channel 27 Source Select
  309. #define UDMA_CHMAP3_CH27SEL_S 12
  310. #define UDMA_CHMAP3_CH26SEL_M 0x00000F00 // uDMA Channel 26 Source Select
  311. #define UDMA_CHMAP3_CH26SEL_S 8
  312. #define UDMA_CHMAP3_CH25SEL_M 0x000000F0 // uDMA Channel 25 Source Select
  313. #define UDMA_CHMAP3_CH25SEL_S 4
  314. #define UDMA_CHMAP3_CH24SEL_M 0x0000000F // uDMA Channel 24 Source Select
  315. #define UDMA_CHMAP3_CH24SEL_S 0
  316. //******************************************************************************
  317. //
  318. // The following are defines for the bit fields in the UDMA_O_PV register.
  319. //
  320. //******************************************************************************
  321. #define UDMA_PV_MAJOR_M 0x0000FF00 // Major Revision
  322. #define UDMA_PV_MAJOR_S 8
  323. #define UDMA_PV_MINOR_M 0x000000FF // Minor Revision
  324. #define UDMA_PV_MINOR_S 0
  325. #endif // __HW_UDMA_H__