Commit 64fa8f4c2ef9df866d693194e7c85f42e5340c44

Authored by Peter Ujfalusi
Committed by Tero Kristo
1 parent b1c8255161

dmaengine: edma: Remove alignment constraint for memcpy

Despite the claim by the original commit adding the memcpy support, eDMA
does not have constraint on the alignment of src, dst or length in increment
mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Vignesh R <vigneshr@ti.com>

Showing 1 changed file with 6 additions and 7 deletions Side-by-side Diff

... ... @@ -545,6 +545,7 @@
545 545 struct edma_desc *edesc;
546 546 struct device *dev = chan->device->dev;
547 547 struct edma_chan *echan = to_edma_chan(chan);
  548 + unsigned int width;
548 549  
549 550 if (unlikely(!echan || !len))
550 551 return NULL;
551 552  
... ... @@ -557,8 +558,12 @@
557 558  
558 559 edesc->pset_nr = 1;
559 560  
  561 + width = 1 << __ffs((src | dest | len));
  562 + if (width > DMA_SLAVE_BUSWIDTH_64_BYTES)
  563 + width = DMA_SLAVE_BUSWIDTH_64_BYTES;
  564 +
560 565 ret = edma_config_pset(chan, &edesc->pset[0], src, dest, 1,
561   - DMA_SLAVE_BUSWIDTH_4_BYTES, len, DMA_MEM_TO_MEM);
  566 + width, len, DMA_MEM_TO_MEM);
562 567 if (ret < 0)
563 568 return NULL;
564 569  
... ... @@ -996,12 +1001,6 @@
996 1001 dma->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
997 1002  
998 1003 dma->dev = dev;
999   -
1000   - /*
1001   - * code using dma memcpy must make sure alignment of
1002   - * length is at dma->copy_align boundary.
1003   - */
1004   - dma->copy_align = DMA_SLAVE_BUSWIDTH_4_BYTES;
1005 1004  
1006 1005 INIT_LIST_HEAD(&dma->channels);
1007 1006 }