aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-13 13:09:19 -0400
committerVinod Koul <vinod.koul@intel.com>2015-10-30 22:02:43 -0400
commitdf5c7386f62d2db95ca48005087195e9a15e2b1f (patch)
treecd017e1d7050b7fd44ee4db9e728e193afc83b99
parent175267b389f781748e2bbb6c737e76b5c9bc4c88 (diff)
dmaengine: dw: some Intel devices has no memcpy support
Provide a flag to choose if the device does support memory-to-memory transfers. At least this is not true for iDMA32 controller that might be supported in the future. Besides that Intel BayTrail and Braswell users should not try this feature due to HW specific behaviour. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/dw/core.c6
-rw-r--r--include/linux/platform_data/dma-dw.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index f16d1ed99ba9..41e9554b884d 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1541,6 +1541,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
1541 1541
1542 /* Fill platform data with the default values */ 1542 /* Fill platform data with the default values */
1543 pdata->is_private = true; 1543 pdata->is_private = true;
1544 pdata->is_memcpy = true;
1544 pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING; 1545 pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING;
1545 pdata->chan_priority = CHAN_PRIORITY_ASCENDING; 1546 pdata->chan_priority = CHAN_PRIORITY_ASCENDING;
1546 } else if (pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) { 1547 } else if (pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) {
@@ -1653,10 +1654,13 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
1653 dma_writel(dw, CLEAR.DST_TRAN, dw->all_chan_mask); 1654 dma_writel(dw, CLEAR.DST_TRAN, dw->all_chan_mask);
1654 dma_writel(dw, CLEAR.ERROR, dw->all_chan_mask); 1655 dma_writel(dw, CLEAR.ERROR, dw->all_chan_mask);
1655 1656
1656 dma_cap_set(DMA_MEMCPY, dw->dma.cap_mask); 1657 /* Set capabilities */
1657 dma_cap_set(DMA_SLAVE, dw->dma.cap_mask); 1658 dma_cap_set(DMA_SLAVE, dw->dma.cap_mask);
1658 if (pdata->is_private) 1659 if (pdata->is_private)
1659 dma_cap_set(DMA_PRIVATE, dw->dma.cap_mask); 1660 dma_cap_set(DMA_PRIVATE, dw->dma.cap_mask);
1661 if (pdata->is_memcpy)
1662 dma_cap_set(DMA_MEMCPY, dw->dma.cap_mask);
1663
1660 dw->dma.dev = chip->dev; 1664 dw->dma.dev = chip->dev;
1661 dw->dma.device_alloc_chan_resources = dwc_alloc_chan_resources; 1665 dw->dma.device_alloc_chan_resources = dwc_alloc_chan_resources;
1662 dw->dma.device_free_chan_resources = dwc_free_chan_resources; 1666 dw->dma.device_free_chan_resources = dwc_free_chan_resources;
diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h
index 87ac14c584f2..03b6095d3b18 100644
--- a/include/linux/platform_data/dma-dw.h
+++ b/include/linux/platform_data/dma-dw.h
@@ -37,6 +37,7 @@ struct dw_dma_slave {
37 * @nr_channels: Number of channels supported by hardware (max 8) 37 * @nr_channels: Number of channels supported by hardware (max 8)
38 * @is_private: The device channels should be marked as private and not for 38 * @is_private: The device channels should be marked as private and not for
39 * by the general purpose DMA channel allocator. 39 * by the general purpose DMA channel allocator.
40 * @is_memcpy: The device channels do support memory-to-memory transfers.
40 * @chan_allocation_order: Allocate channels starting from 0 or 7 41 * @chan_allocation_order: Allocate channels starting from 0 or 7
41 * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0. 42 * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0.
42 * @block_size: Maximum block size supported by the controller 43 * @block_size: Maximum block size supported by the controller
@@ -47,6 +48,7 @@ struct dw_dma_slave {
47struct dw_dma_platform_data { 48struct dw_dma_platform_data {
48 unsigned int nr_channels; 49 unsigned int nr_channels;
49 bool is_private; 50 bool is_private;
51 bool is_memcpy;
50#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */ 52#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
51#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */ 53#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
52 unsigned char chan_allocation_order; 54 unsigned char chan_allocation_order;