aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/dma-jz4780.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index adf4d5efced6..7683de9fb9ee 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -95,17 +95,12 @@
95 * @dtc: transfer count (number of blocks of the transfer size specified in DCM 95 * @dtc: transfer count (number of blocks of the transfer size specified in DCM
96 * to transfer) in the low 24 bits, offset of the next descriptor from the 96 * to transfer) in the low 24 bits, offset of the next descriptor from the
97 * descriptor base address in the upper 8 bits. 97 * descriptor base address in the upper 8 bits.
98 * @sd: target/source stride difference (in stride transfer mode).
99 * @drt: request type
100 */ 98 */
101struct jz4780_dma_hwdesc { 99struct jz4780_dma_hwdesc {
102 uint32_t dcm; 100 uint32_t dcm;
103 uint32_t dsa; 101 uint32_t dsa;
104 uint32_t dta; 102 uint32_t dta;
105 uint32_t dtc; 103 uint32_t dtc;
106 uint32_t sd;
107 uint32_t drt;
108 uint32_t reserved[2];
109}; 104};
110 105
111/* Size of allocations for hardware descriptor blocks. */ 106/* Size of allocations for hardware descriptor blocks. */
@@ -281,7 +276,6 @@ static int jz4780_dma_setup_hwdesc(struct jz4780_dma_chan *jzchan,
281 desc->dcm = JZ_DMA_DCM_SAI; 276 desc->dcm = JZ_DMA_DCM_SAI;
282 desc->dsa = addr; 277 desc->dsa = addr;
283 desc->dta = config->dst_addr; 278 desc->dta = config->dst_addr;
284 desc->drt = jzchan->transfer_type;
285 279
286 width = config->dst_addr_width; 280 width = config->dst_addr_width;
287 maxburst = config->dst_maxburst; 281 maxburst = config->dst_maxburst;
@@ -289,7 +283,6 @@ static int jz4780_dma_setup_hwdesc(struct jz4780_dma_chan *jzchan,
289 desc->dcm = JZ_DMA_DCM_DAI; 283 desc->dcm = JZ_DMA_DCM_DAI;
290 desc->dsa = config->src_addr; 284 desc->dsa = config->src_addr;
291 desc->dta = addr; 285 desc->dta = addr;
292 desc->drt = jzchan->transfer_type;
293 286
294 width = config->src_addr_width; 287 width = config->src_addr_width;
295 maxburst = config->src_maxburst; 288 maxburst = config->src_maxburst;
@@ -434,9 +427,10 @@ static struct dma_async_tx_descriptor *jz4780_dma_prep_dma_memcpy(
434 tsz = jz4780_dma_transfer_size(dest | src | len, 427 tsz = jz4780_dma_transfer_size(dest | src | len,
435 &jzchan->transfer_shift); 428 &jzchan->transfer_shift);
436 429
430 jzchan->transfer_type = JZ_DMA_DRT_AUTO;
431
437 desc->desc[0].dsa = src; 432 desc->desc[0].dsa = src;
438 desc->desc[0].dta = dest; 433 desc->desc[0].dta = dest;
439 desc->desc[0].drt = JZ_DMA_DRT_AUTO;
440 desc->desc[0].dcm = JZ_DMA_DCM_TIE | JZ_DMA_DCM_SAI | JZ_DMA_DCM_DAI | 434 desc->desc[0].dcm = JZ_DMA_DCM_TIE | JZ_DMA_DCM_SAI | JZ_DMA_DCM_DAI |
441 tsz << JZ_DMA_DCM_TSZ_SHIFT | 435 tsz << JZ_DMA_DCM_TSZ_SHIFT |
442 JZ_DMA_WIDTH_32_BIT << JZ_DMA_DCM_SP_SHIFT | 436 JZ_DMA_WIDTH_32_BIT << JZ_DMA_DCM_SP_SHIFT |
@@ -491,9 +485,12 @@ static void jz4780_dma_begin(struct jz4780_dma_chan *jzchan)
491 (jzchan->curr_hwdesc + 1) % jzchan->desc->count; 485 (jzchan->curr_hwdesc + 1) % jzchan->desc->count;
492 } 486 }
493 487
494 /* Use 8-word descriptors. */ 488 /* Use 4-word descriptors. */
495 jz4780_dma_chn_writel(jzdma, jzchan->id, 489 jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 0);
496 JZ_DMA_REG_DCS, JZ_DMA_DCS_DES8); 490
491 /* Set transfer type. */
492 jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DRT,
493 jzchan->transfer_type);
497 494
498 /* Write descriptor address and initiate descriptor fetch. */ 495 /* Write descriptor address and initiate descriptor fetch. */
499 desc_phys = jzchan->desc->desc_phys + 496 desc_phys = jzchan->desc->desc_phys +
@@ -503,7 +500,7 @@ static void jz4780_dma_begin(struct jz4780_dma_chan *jzchan)
503 500
504 /* Enable the channel. */ 501 /* Enable the channel. */
505 jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 502 jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS,
506 JZ_DMA_DCS_DES8 | JZ_DMA_DCS_CTE); 503 JZ_DMA_DCS_CTE);
507} 504}
508 505
509static void jz4780_dma_issue_pending(struct dma_chan *chan) 506static void jz4780_dma_issue_pending(struct dma_chan *chan)