aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2015-09-16 02:41:23 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-10-26 11:00:16 -0400
commit3fc7eaef44dbcbcd602b6bcd0ac6efba7a30b108 (patch)
treea3e33791bb0ed5bd2fd328f7e5204584cbb47eaf /include/linux/mmc
parent9e4703df3aa9829a84d6ccf19c6062ba19a8de71 (diff)
mmc: dw_mmc: Add external dma interface support
DesignWare MMC Controller can supports two types of DMA mode: external dma and internal dma. We get a RK312x platform integrated dw_mmc and ARM pl330 dma controller. This patch add edmac ops to support these platforms. I've tested it on RK31xx platform with edmac mode and RK3288 platform with idmac mode. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/dw_mmc.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 134c57422740..f67b2ec18e6d 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -16,6 +16,7 @@
16 16
17#include <linux/scatterlist.h> 17#include <linux/scatterlist.h>
18#include <linux/mmc/core.h> 18#include <linux/mmc/core.h>
19#include <linux/dmaengine.h>
19 20
20#define MAX_MCI_SLOTS 2 21#define MAX_MCI_SLOTS 2
21 22
@@ -40,6 +41,17 @@ enum {
40 41
41struct mmc_data; 42struct mmc_data;
42 43
44enum {
45 TRANS_MODE_PIO = 0,
46 TRANS_MODE_IDMAC,
47 TRANS_MODE_EDMAC
48};
49
50struct dw_mci_dma_slave {
51 struct dma_chan *ch;
52 enum dma_transfer_direction direction;
53};
54
43/** 55/**
44 * struct dw_mci - MMC controller state shared between all slots 56 * struct dw_mci - MMC controller state shared between all slots
45 * @lock: Spinlock protecting the queue and associated data. 57 * @lock: Spinlock protecting the queue and associated data.
@@ -154,7 +166,14 @@ struct dw_mci {
154 dma_addr_t sg_dma; 166 dma_addr_t sg_dma;
155 void *sg_cpu; 167 void *sg_cpu;
156 const struct dw_mci_dma_ops *dma_ops; 168 const struct dw_mci_dma_ops *dma_ops;
169 /* For idmac */
157 unsigned int ring_size; 170 unsigned int ring_size;
171
172 /* For edmac */
173 struct dw_mci_dma_slave *dms;
174 /* Registers's physical base address */
175 void *phy_regs;
176
158 u32 cmd_status; 177 u32 cmd_status;
159 u32 data_status; 178 u32 data_status;
160 u32 stop_cmdr; 179 u32 stop_cmdr;
@@ -208,8 +227,8 @@ struct dw_mci {
208struct dw_mci_dma_ops { 227struct dw_mci_dma_ops {
209 /* DMA Ops */ 228 /* DMA Ops */
210 int (*init)(struct dw_mci *host); 229 int (*init)(struct dw_mci *host);
211 void (*start)(struct dw_mci *host, unsigned int sg_len); 230 int (*start)(struct dw_mci *host, unsigned int sg_len);
212 void (*complete)(struct dw_mci *host); 231 void (*complete)(void *host);
213 void (*stop)(struct dw_mci *host); 232 void (*stop)(struct dw_mci *host);
214 void (*cleanup)(struct dw_mci *host); 233 void (*cleanup)(struct dw_mci *host);
215 void (*exit)(struct dw_mci *host); 234 void (*exit)(struct dw_mci *host);