aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-25 09:43:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-25 09:43:18 -0400
commita41efc2a0f68cea26665ab9e6d991c9bf33b3f59 (patch)
tree4fb79cbd5ada8f501ba49234f0c84964de943112 /include
parent36168d7123311d52e085c116f6c66e16f0b84615 (diff)
parent71f021cf6de822ac49a790509683fbb4a06ce4bf (diff)
Merge tag 'dmaengine-4.20-rc1' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine updates from Vinod Koul: - Support for ColdFire mcf5441x edma controller - Support for link list mode in sprd dma - More users of managed dmaenginem_async_device_register API - Cyclic mode support in owl dma driver - DT updates for renesas drivers, dma-jz4780 updates and support for JZ4770, JZ4740 and JZ4725B controllers - Removal of deprecated dma_slave_config direction in dmaengine drivers, few more users will be removed in next cycle and eventually removed. - Minor updates to idma64, ioat, pxa, ppc drivers * tag 'dmaengine-4.20-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (66 commits) dmaengine: ppc4xx: fix off-by-one build failure dmaengine: owl: Fix warnings generated during build dmaengine: fsl-edma: remove dma_slave_config direction usage dmaengine: rcar-dmac: set scatter/gather max segment size dmaengine: mmp_tdma: remove dma_slave_config direction usage dmaengine: ep93xx_dma: remove dma_slave_config direction usage dmaengine: k3dma: remove dma_slave_config direction usage dmaengine: k3dma: dont use direction for memcpy dmaengine: imx-dma: remove dma_slave_config direction usage dmaengine: idma: remove dma_slave_config direction usage dmaengine: hsu: remove dma_slave_config direction usage dmaengine: dw: remove dma_slave_config direction usage dmaengine: jz4740: remove dma_slave_config direction usage dmaengine: coh901318: remove dma_slave_config direction usage dmaengine: bcm2835: remove dma_slave_config direction usage dmaengine: at_hdmac: remove dma_slave_config direction usage dmaengine: owl: Add Slave and Cyclic mode support for Actions Semi Owl S900 SoC dmaengine: ioat: fix prototype of ioat_enumerate_channels dmaengine: stm32-dma: check whether length is aligned on FIFO threshold dt-bindings: dmaengine: usb-dmac: Add binding for r8a7744 ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/dma/sprd-dma.h69
-rw-r--r--include/linux/platform_data/dma-ep93xx.h2
-rw-r--r--include/linux/platform_data/dma-mcf-edma.h38
3 files changed, 108 insertions, 1 deletions
diff --git a/include/linux/dma/sprd-dma.h b/include/linux/dma/sprd-dma.h
index b0115e340fbc..b42b80e52cc2 100644
--- a/include/linux/dma/sprd-dma.h
+++ b/include/linux/dma/sprd-dma.h
@@ -58,4 +58,73 @@ enum sprd_dma_int_type {
58 SPRD_DMA_CFGERR_INT, 58 SPRD_DMA_CFGERR_INT,
59}; 59};
60 60
61/*
62 * struct sprd_dma_linklist - DMA link-list address structure
63 * @virt_addr: link-list virtual address to configure link-list node
64 * @phy_addr: link-list physical address to link DMA transfer
65 *
66 * The Spreadtrum DMA controller supports the link-list mode, that means slaves
67 * can supply several groups configurations (each configuration represents one
68 * DMA transfer) saved in memory, and DMA controller will link these groups
69 * configurations by writing the physical address of each configuration into the
70 * link-list register.
71 *
72 * Just as shown below, the link-list pointer register will be pointed to the
73 * physical address of 'configuration 1', and the 'configuration 1' link-list
74 * pointer will be pointed to 'configuration 2', and so on.
75 * Once trigger the DMA transfer, the DMA controller will load 'configuration
76 * 1' to its registers automatically, after 'configuration 1' transaction is
77 * done, DMA controller will load 'configuration 2' automatically, until all
78 * DMA transactions are done.
79 *
80 * Note: The last link-list pointer should point to the physical address
81 * of 'configuration 1', which can avoid DMA controller loads incorrect
82 * configuration when the last configuration transaction is done.
83 *
84 * DMA controller linklist memory
85 * ====================== -----------------------
86 *| | | configuration 1 |<---
87 *| DMA controller | ------->| | |
88 *| | | | | |
89 *| | | | | |
90 *| | | | | |
91 *| linklist pointer reg |---- ----| linklist pointer | |
92 * ====================== | ----------------------- |
93 * | |
94 * | ----------------------- |
95 * | | configuration 2 | |
96 * --->| | |
97 * | | |
98 * | | |
99 * | | |
100 * ----| linklist pointer | |
101 * | ----------------------- |
102 * | |
103 * | ----------------------- |
104 * | | configuration 3 | |
105 * --->| | |
106 * | | |
107 * | . | |
108 * . |
109 * . |
110 * . |
111 * | . |
112 * | ----------------------- |
113 * | | configuration n | |
114 * --->| | |
115 * | | |
116 * | | |
117 * | | |
118 * | linklist pointer |----
119 * -----------------------
120 *
121 * To support the link-list mode, DMA slaves should allocate one segment memory
122 * from always-on IRAM or dma coherent memory to store these groups of DMA
123 * configuration, and pass the virtual and physical address to DMA controller.
124 */
125struct sprd_dma_linklist {
126 unsigned long virt_addr;
127 phys_addr_t phy_addr;
128};
129
61#endif 130#endif
diff --git a/include/linux/platform_data/dma-ep93xx.h b/include/linux/platform_data/dma-ep93xx.h
index f8f1f6b952a6..eb9805bb3fe8 100644
--- a/include/linux/platform_data/dma-ep93xx.h
+++ b/include/linux/platform_data/dma-ep93xx.h
@@ -85,7 +85,7 @@ static inline enum dma_transfer_direction
85ep93xx_dma_chan_direction(struct dma_chan *chan) 85ep93xx_dma_chan_direction(struct dma_chan *chan)
86{ 86{
87 if (!ep93xx_dma_chan_is_m2p(chan)) 87 if (!ep93xx_dma_chan_is_m2p(chan))
88 return DMA_NONE; 88 return DMA_TRANS_NONE;
89 89
90 /* even channels are for TX, odd for RX */ 90 /* even channels are for TX, odd for RX */
91 return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; 91 return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
diff --git a/include/linux/platform_data/dma-mcf-edma.h b/include/linux/platform_data/dma-mcf-edma.h
new file mode 100644
index 000000000000..d718ccfa3421
--- /dev/null
+++ b/include/linux/platform_data/dma-mcf-edma.h
@@ -0,0 +1,38 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Freescale eDMA platform data, ColdFire SoC's family.
4 *
5 * Copyright (c) 2017 Angelo Dureghello <angelo@sysam.it>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_PLATFORM_DATA_MCF_EDMA_H__
18#define __LINUX_PLATFORM_DATA_MCF_EDMA_H__
19
20struct dma_slave_map;
21
22bool mcf_edma_filter_fn(struct dma_chan *chan, void *param);
23
24#define MCF_EDMA_FILTER_PARAM(ch) ((void *)ch)
25
26/**
27 * struct mcf_edma_platform_data - platform specific data for eDMA engine
28 *
29 * @ver The eDMA module version.
30 * @dma_channels The number of eDMA channels.
31 */
32struct mcf_edma_platform_data {
33 int dma_channels;
34 const struct dma_slave_map *slave_map;
35 int slavecnt;
36};
37
38#endif /* __LINUX_PLATFORM_DATA_MCF_EDMA_H__ */