Commit 361936ef authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Ulf Hansson

mmc: tmio: enable SoC specific DMA buswidth settings

Renesas SDHI which is based on TMIO driver has 2 type SoC. 1st one is
used as SH-Mobile series, and 2nd is R-Car series. R-Car series SoC has
DMA buswidth setting register which enables 32bit access.
This patch adds .dma_buswidth and enables it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 5add2aca
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#ifndef TMIO_MMC_H #ifndef TMIO_MMC_H
#define TMIO_MMC_H #define TMIO_MMC_H
#include <linux/dmaengine.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/mmc/tmio.h> #include <linux/mmc/tmio.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -46,6 +47,7 @@ struct tmio_mmc_dma { ...@@ -46,6 +47,7 @@ struct tmio_mmc_dma {
void *chan_priv_rx; void *chan_priv_rx;
int slave_id_tx; int slave_id_tx;
int slave_id_rx; int slave_id_rx;
enum dma_slave_buswidth dma_buswidth;
bool (*filter)(struct dma_chan *chan, void *arg); bool (*filter)(struct dma_chan *chan, void *arg);
void (*enable)(struct tmio_mmc_host *host, bool enable); void (*enable)(struct tmio_mmc_host *host, bool enable);
}; };
......
...@@ -293,6 +293,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat ...@@ -293,6 +293,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
cfg.slave_id = host->dma->slave_id_tx; cfg.slave_id = host->dma->slave_id_tx;
cfg.direction = DMA_MEM_TO_DEV; cfg.direction = DMA_MEM_TO_DEV;
cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift); cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
cfg.dst_addr_width = host->dma->dma_buswidth;
if (!cfg.dst_addr_width)
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
cfg.src_addr = 0; cfg.src_addr = 0;
ret = dmaengine_slave_config(host->chan_tx, &cfg); ret = dmaengine_slave_config(host->chan_tx, &cfg);
...@@ -312,6 +314,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat ...@@ -312,6 +314,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
cfg.slave_id = host->dma->slave_id_rx; cfg.slave_id = host->dma->slave_id_rx;
cfg.direction = DMA_DEV_TO_MEM; cfg.direction = DMA_DEV_TO_MEM;
cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset; cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset;
cfg.src_addr_width = host->dma->dma_buswidth;
if (!cfg.src_addr_width)
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
cfg.dst_addr = 0; cfg.dst_addr = 0;
ret = dmaengine_slave_config(host->chan_rx, &cfg); ret = dmaengine_slave_config(host->chan_rx, &cfg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment