diff options
author | Jingchang Lu <jingchang.lu@freescale.com> | 2014-07-10 02:11:29 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:35:41 (GMT) |
commit | 12296039029b255945406aec91e99e50cf6dda4e (patch) | |
tree | 75e56fda0f0d71229bae7dd5f7563753973c10cc /drivers | |
parent | 0fa22197b06b301ca0b6bd6ed8c476efa2915f9e (diff) | |
download | linux-fsl-qoriq-12296039029b255945406aec91e99e50cf6dda4e.tar.xz |
dmaengine: fsl-edma: add dma memcpy support
The eDMA channel support the mem2mem copy with the
always on slot number 63.
Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/fsl-edma.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index 8040f25..9159831 100644 --- a/drivers/dma/fsl-edma.c +++ b/drivers/dma/fsl-edma.c @@ -638,6 +638,27 @@ static struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } +static struct dma_async_tx_descriptor * +fsl_edma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, + dma_addr_t src, size_t len, unsigned long tx_flags) +{ + struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); + struct fsl_edma_desc *fsl_desc; + + fsl_desc = fsl_edma_alloc_desc(fsl_chan, 1); + if (!fsl_desc) + return NULL; + fsl_desc->iscyclic = false; + + fill_tcd_params(fsl_chan->edma, fsl_desc->tcd[0].vtcd, src, dst, + EDMA_TCD_ATTR_SSIZE_32BIT | EDMA_TCD_ATTR_DSIZE_32BIT, + 0x4, len, 0, 1, 1, 0x4, 0, + true, true, false); + + return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, tx_flags); + +} + static void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) { struct fsl_edma_hw_tcd *tcd; @@ -920,6 +941,7 @@ static int fsl_edma_probe(struct platform_device *pdev) dma_cap_set(DMA_PRIVATE, fsl_edma->dma_dev.cap_mask); dma_cap_set(DMA_SLAVE, fsl_edma->dma_dev.cap_mask); dma_cap_set(DMA_CYCLIC, fsl_edma->dma_dev.cap_mask); + dma_cap_set(DMA_MEMCPY, fsl_edma->dma_dev.cap_mask); fsl_edma->dma_dev.dev = &pdev->dev; fsl_edma->dma_dev.device_alloc_chan_resources @@ -932,6 +954,7 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma->dma_dev.device_control = fsl_edma_control; fsl_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; fsl_edma->dma_dev.device_slave_caps = fsl_dma_device_slave_caps; + fsl_edma->dma_dev.device_prep_dma_memcpy = fsl_edma_prep_memcpy; platform_set_drvdata(pdev, fsl_edma); |