dma_device.c 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. /*****************************************************************************
  2. * Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
  3. *
  4. * Unless you and Broadcom execute a separate written software license
  5. * agreement governing use of this software, this software is licensed to you
  6. * under the terms of the GNU General Public License version 2, available at
  7. * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
  8. *
  9. * Notwithstanding the above, under no circumstances may you combine this
  10. * software in any way with any other Broadcom software provided under a
  11. * license other than the GPL, without Broadcom's express prior written
  12. * consent.
  13. *****************************************************************************/
  14. /****************************************************************************/
  15. /**
  16. * @file dma_device.c
  17. *
  18. * @brief private array of DMA_DeviceAttribute_t
  19. */
  20. /****************************************************************************/
  21. DMA_DeviceAttribute_t DMA_gDeviceAttribute[DMA_NUM_DEVICE_ENTRIES] = {
  22. [DMA_DEVICE_MEM_TO_MEM] = /* MEM 2 MEM */
  23. {
  24. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  25. .name = "mem-to-mem",
  26. .config = {
  27. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  28. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  29. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
  30. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  31. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  32. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  33. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  34. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  35. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  36. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  37. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  38. },
  39. },
  40. [DMA_DEVICE_VPM_MEM_TO_MEM] = /* VPM */
  41. {
  42. .flags = DMA_DEVICE_FLAG_IS_DEDICATED | DMA_DEVICE_FLAG_NO_ISR,
  43. .name = "vpm",
  44. .dedicatedController = 0,
  45. .dedicatedChannel = 0,
  46. /* reserve DMA0:0 for VPM */
  47. },
  48. [DMA_DEVICE_NAND_MEM_TO_MEM] = /* NAND */
  49. {
  50. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  51. .name = "nand",
  52. .config = {
  53. .srcPeripheralPort = 0,
  54. .dstPeripheralPort = 0,
  55. .srcStatusRegisterAddress = 0x00000000,
  56. .dstStatusRegisterAddress = 0x00000000,
  57. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
  58. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  59. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  60. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  61. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  62. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  63. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  64. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  65. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  66. .channelPriority = dmacHw_CHANNEL_PRIORITY_6,
  67. },
  68. },
  69. [DMA_DEVICE_PIF_MEM_TO_DEV] = /* PIF TX */
  70. {
  71. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1
  72. | DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO
  73. | DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST | DMA_DEVICE_FLAG_PORT_PER_DMAC,
  74. .name = "pif_tx",
  75. .dmacPort = {14, 5},
  76. .config = {
  77. .srcPeripheralPort = 0, /* SRC: memory */
  78. /* dstPeripheralPort = 5 or 14 */
  79. .srcStatusRegisterAddress = 0x00000000,
  80. .dstStatusRegisterAddress = 0x00000000,
  81. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  82. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  83. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  84. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  85. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  86. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  87. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  88. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  89. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  90. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  91. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  92. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  93. .maxDataPerBlock = 16256,
  94. },
  95. },
  96. [DMA_DEVICE_PIF_DEV_TO_MEM] = /* PIF RX */
  97. {
  98. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1
  99. | DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO
  100. /* DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST */
  101. | DMA_DEVICE_FLAG_PORT_PER_DMAC,
  102. .name = "pif_rx",
  103. .dmacPort = {14, 5},
  104. .config = {
  105. /* srcPeripheralPort = 5 or 14 */
  106. .dstPeripheralPort = 0, /* DST: memory */
  107. .srcStatusRegisterAddress = 0x00000000,
  108. .dstStatusRegisterAddress = 0x00000000,
  109. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  110. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  111. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  112. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  113. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  114. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  115. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  116. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  117. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  118. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  119. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  120. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  121. .maxDataPerBlock = 16256,
  122. },
  123. },
  124. [DMA_DEVICE_I2S0_DEV_TO_MEM] = /* I2S RX */
  125. {
  126. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  127. .name = "i2s0_rx",
  128. .config = {
  129. .srcPeripheralPort = 0, /* SRC: I2S0 */
  130. .dstPeripheralPort = 0, /* DST: memory */
  131. .srcStatusRegisterAddress = 0,
  132. .dstStatusRegisterAddress = 0,
  133. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  134. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  135. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  136. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_16,
  137. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  138. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  139. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
  140. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  141. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  142. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  143. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  144. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  145. },
  146. },
  147. [DMA_DEVICE_I2S0_MEM_TO_DEV] = /* I2S TX */
  148. {
  149. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  150. .name = "i2s0_tx",
  151. .config = {
  152. .srcPeripheralPort = 0, /* SRC: memory */
  153. .dstPeripheralPort = 1, /* DST: I2S0 */
  154. .srcStatusRegisterAddress = 0,
  155. .dstStatusRegisterAddress = 0,
  156. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  157. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  158. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  159. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  160. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_16,
  161. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
  162. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  163. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  164. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  165. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  166. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  167. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  168. },
  169. },
  170. [DMA_DEVICE_I2S1_DEV_TO_MEM] = /* I2S1 RX */
  171. {
  172. .flags = DMA_DEVICE_FLAG_ON_DMA1,
  173. .name = "i2s1_rx",
  174. .config = {
  175. .srcPeripheralPort = 2, /* SRC: I2S1 */
  176. .dstPeripheralPort = 0, /* DST: memory */
  177. .srcStatusRegisterAddress = 0,
  178. .dstStatusRegisterAddress = 0,
  179. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  180. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  181. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  182. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_16,
  183. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  184. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  185. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
  186. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  187. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  188. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  189. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  190. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  191. },
  192. },
  193. [DMA_DEVICE_I2S1_MEM_TO_DEV] = /* I2S1 TX */
  194. {
  195. .flags = DMA_DEVICE_FLAG_ON_DMA1,
  196. .name = "i2s1_tx",
  197. .config = {
  198. .srcPeripheralPort = 0, /* SRC: memory */
  199. .dstPeripheralPort = 3, /* DST: I2S1 */
  200. .srcStatusRegisterAddress = 0,
  201. .dstStatusRegisterAddress = 0,
  202. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  203. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  204. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  205. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  206. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_16,
  207. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
  208. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  209. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  210. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  211. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  212. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  213. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  214. },
  215. },
  216. [DMA_DEVICE_ESW_MEM_TO_DEV] = /* ESW TX */
  217. {
  218. .name = "esw_tx",
  219. .flags = DMA_DEVICE_FLAG_IS_DEDICATED,
  220. .dedicatedController = 1,
  221. .dedicatedChannel = 3,
  222. .config = {
  223. .srcPeripheralPort = 0, /* SRC: memory */
  224. .dstPeripheralPort = 1, /* DST: ESW (MTP) */
  225. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  226. .errorInterrupt = dmacHw_INTERRUPT_DISABLE,
  227. /* DMAx_AHB_SSTATARy */
  228. .srcStatusRegisterAddress = 0x00000000,
  229. /* DMAx_AHB_DSTATARy */
  230. .dstStatusRegisterAddress = 0x30490010,
  231. /* DMAx_AHB_CFGy */
  232. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  233. /* DMAx_AHB_CTLy */
  234. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  235. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  236. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  237. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
  238. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  239. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  240. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  241. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  242. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  243. },
  244. },
  245. [DMA_DEVICE_ESW_DEV_TO_MEM] = /* ESW RX */
  246. {
  247. .name = "esw_rx",
  248. .flags = DMA_DEVICE_FLAG_IS_DEDICATED,
  249. .dedicatedController = 1,
  250. .dedicatedChannel = 2,
  251. .config = {
  252. .srcPeripheralPort = 0, /* SRC: ESW (PTM) */
  253. .dstPeripheralPort = 0, /* DST: memory */
  254. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  255. .errorInterrupt = dmacHw_INTERRUPT_DISABLE,
  256. /* DMAx_AHB_SSTATARy */
  257. .srcStatusRegisterAddress = 0x30480010,
  258. /* DMAx_AHB_DSTATARy */
  259. .dstStatusRegisterAddress = 0x00000000,
  260. /* DMAx_AHB_CFGy */
  261. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  262. /* DMAx_AHB_CTLy */
  263. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  264. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  265. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  266. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  267. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
  268. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  269. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  270. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  271. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  272. },
  273. },
  274. [DMA_DEVICE_APM_CODEC_A_DEV_TO_MEM] = /* APM Codec A Ingress */
  275. {
  276. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  277. .name = "apm_a_rx",
  278. .config = {
  279. .srcPeripheralPort = 2, /* SRC: Codec A Ingress FIFO */
  280. .dstPeripheralPort = 0, /* DST: memory */
  281. .srcStatusRegisterAddress = 0x00000000,
  282. .dstStatusRegisterAddress = 0x00000000,
  283. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  284. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  285. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  286. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  287. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  288. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  289. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  290. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  291. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  292. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  293. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  294. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  295. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  296. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  297. },
  298. },
  299. [DMA_DEVICE_APM_CODEC_A_MEM_TO_DEV] = /* APM Codec A Egress */
  300. {
  301. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  302. .name = "apm_a_tx",
  303. .config = {
  304. .srcPeripheralPort = 0, /* SRC: memory */
  305. .dstPeripheralPort = 3, /* DST: Codec A Egress FIFO */
  306. .srcStatusRegisterAddress = 0x00000000,
  307. .dstStatusRegisterAddress = 0x00000000,
  308. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  309. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  310. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  311. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  312. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  313. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  314. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  315. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  316. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  317. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  318. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  319. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  320. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  321. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  322. },
  323. },
  324. [DMA_DEVICE_APM_CODEC_B_DEV_TO_MEM] = /* APM Codec B Ingress */
  325. {
  326. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  327. .name = "apm_b_rx",
  328. .config = {
  329. .srcPeripheralPort = 4, /* SRC: Codec B Ingress FIFO */
  330. .dstPeripheralPort = 0, /* DST: memory */
  331. .srcStatusRegisterAddress = 0x00000000,
  332. .dstStatusRegisterAddress = 0x00000000,
  333. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  334. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  335. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  336. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  337. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  338. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  339. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  340. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  341. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  342. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  343. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  344. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  345. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  346. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  347. },
  348. },
  349. [DMA_DEVICE_APM_CODEC_B_MEM_TO_DEV] = /* APM Codec B Egress */
  350. {
  351. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  352. .name = "apm_b_tx",
  353. .config = {
  354. .srcPeripheralPort = 0, /* SRC: memory */
  355. .dstPeripheralPort = 5, /* DST: Codec B Egress FIFO */
  356. .srcStatusRegisterAddress = 0x00000000,
  357. .dstStatusRegisterAddress = 0x00000000,
  358. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  359. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  360. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  361. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  362. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  363. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  364. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  365. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  366. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  367. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  368. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  369. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  370. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  371. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  372. },
  373. },
  374. [DMA_DEVICE_APM_CODEC_C_DEV_TO_MEM] = /* APM Codec C Ingress */
  375. {
  376. .flags = DMA_DEVICE_FLAG_ON_DMA1,
  377. .name = "apm_c_rx",
  378. .config = {
  379. .srcPeripheralPort = 4, /* SRC: Codec C Ingress FIFO */
  380. .dstPeripheralPort = 0, /* DST: memory */
  381. .srcStatusRegisterAddress = 0x00000000,
  382. .dstStatusRegisterAddress = 0x00000000,
  383. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  384. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  385. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  386. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  387. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  388. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  389. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  390. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  391. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  392. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  393. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  394. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  395. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  396. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  397. },
  398. },
  399. [DMA_DEVICE_APM_PCM0_DEV_TO_MEM] = /* PCM0 RX */
  400. {
  401. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  402. .name = "pcm0_rx",
  403. .config = {
  404. .srcPeripheralPort = 12, /* SRC: PCM0 */
  405. .dstPeripheralPort = 0, /* DST: memory */
  406. .srcStatusRegisterAddress = 0,
  407. .dstStatusRegisterAddress = 0,
  408. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  409. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  410. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  411. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  412. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  413. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  414. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  415. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  416. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  417. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  418. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  419. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  420. },
  421. },
  422. [DMA_DEVICE_APM_PCM0_MEM_TO_DEV] = /* PCM0 TX */
  423. {
  424. .flags = DMA_DEVICE_FLAG_ON_DMA0,
  425. .name = "pcm0_tx",
  426. .config = {
  427. .srcPeripheralPort = 0, /* SRC: memory */
  428. .dstPeripheralPort = 13, /* DST: PCM0 */
  429. .srcStatusRegisterAddress = 0,
  430. .dstStatusRegisterAddress = 0,
  431. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  432. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  433. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  434. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  435. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  436. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  437. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  438. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  439. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  440. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  441. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  442. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  443. },
  444. },
  445. [DMA_DEVICE_APM_PCM1_DEV_TO_MEM] = /* PCM1 RX */
  446. {
  447. .flags = DMA_DEVICE_FLAG_ON_DMA1,
  448. .name = "pcm1_rx",
  449. .config = {
  450. .srcPeripheralPort = 14, /* SRC: PCM1 */
  451. .dstPeripheralPort = 0, /* DST: memory */
  452. .srcStatusRegisterAddress = 0,
  453. .dstStatusRegisterAddress = 0,
  454. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  455. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  456. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  457. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  458. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  459. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  460. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
  461. .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  462. .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  463. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  464. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  465. .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
  466. },
  467. },
  468. [DMA_DEVICE_APM_PCM1_MEM_TO_DEV] = /* PCM1 TX */
  469. {
  470. .flags = DMA_DEVICE_FLAG_ON_DMA1,
  471. .name = "pcm1_tx",
  472. .config = {
  473. .srcPeripheralPort = 0, /* SRC: memory */
  474. .dstPeripheralPort = 15, /* DST: PCM1 */
  475. .srcStatusRegisterAddress = 0,
  476. .dstStatusRegisterAddress = 0,
  477. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  478. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  479. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  480. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  481. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  482. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
  483. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  484. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  485. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  486. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  487. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  488. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  489. },
  490. },
  491. [DMA_DEVICE_SPUM_DEV_TO_MEM] = /* SPUM RX */
  492. {
  493. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  494. .name = "spum_rx",
  495. .config = {
  496. .srcPeripheralPort = 6, /* SRC: Codec A Ingress FIFO */
  497. .dstPeripheralPort = 0, /* DST: memory */
  498. .srcStatusRegisterAddress = 0x00000000,
  499. .dstStatusRegisterAddress = 0x00000000,
  500. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  501. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  502. .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
  503. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  504. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  505. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  506. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  507. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  508. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  509. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  510. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  511. /* Busrt size **MUST** be 16 for SPUM to work */
  512. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_16,
  513. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_16,
  514. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  515. /* on the RX side, SPU needs to be the flow controller */
  516. .flowControler = dmacHw_FLOW_CONTROL_PERIPHERAL,
  517. },
  518. },
  519. [DMA_DEVICE_SPUM_MEM_TO_DEV] = /* SPUM TX */
  520. {
  521. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  522. .name = "spum_tx",
  523. .config = {
  524. .srcPeripheralPort = 0, /* SRC: memory */
  525. .dstPeripheralPort = 7, /* DST: SPUM */
  526. .srcStatusRegisterAddress = 0x00000000,
  527. .dstStatusRegisterAddress = 0x00000000,
  528. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  529. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  530. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
  531. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  532. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  533. .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
  534. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  535. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  536. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  537. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
  538. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
  539. /* Busrt size **MUST** be 16 for SPUM to work */
  540. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_16,
  541. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_16,
  542. .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
  543. },
  544. },
  545. [DMA_DEVICE_MEM_TO_VRAM] = /* MEM 2 VRAM */
  546. {
  547. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  548. .name = "mem-to-vram",
  549. .config = {
  550. .srcPeripheralPort = 0, /* SRC: memory */
  551. .srcStatusRegisterAddress = 0x00000000,
  552. .dstStatusRegisterAddress = 0x00000000,
  553. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  554. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  555. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
  556. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
  557. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
  558. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  559. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  560. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  561. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  562. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  563. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  564. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  565. },
  566. },
  567. [DMA_DEVICE_VRAM_TO_MEM] = /* VRAM 2 MEM */
  568. {
  569. .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
  570. .name = "vram-to-mem",
  571. .config = {
  572. .dstPeripheralPort = 0, /* DST: memory */
  573. .srcStatusRegisterAddress = 0x00000000,
  574. .dstStatusRegisterAddress = 0x00000000,
  575. .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
  576. .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
  577. .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
  578. .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
  579. .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
  580. .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
  581. .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
  582. .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
  583. .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
  584. .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
  585. .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
  586. .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
  587. },
  588. },
  589. };
  590. EXPORT_SYMBOL(DMA_gDeviceAttribute); /* primarily for dma-test.c */