summaryrefslogtreecommitdiff
path: root/drivers/crypto/ux500/hash/hash_core.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-15 10:51:36 +0100
committerLinus Walleij <linus.walleij@linaro.org>2013-05-23 21:14:07 +0200
commit85c5632d1f7f487d6ac0fb187ee0dacded60abc4 (patch)
treee5737e63db8b33347404f8c370a025ffdb02c72b /drivers/crypto/ux500/hash/hash_core.c
parent58ba67dd36aa393132108ffcaa83873a1f82d70a (diff)
crypto: ux500/hash - Set DMA configuration though dma_slave_config()
The DMA controller currently takes configuration information from information passed though dma_channel_request(), but it shouldn't. Using the API, the DMA channel should only be configured during a dma_slave_config() call. Cc: David S. Miller <davem@davemloft.net> Cc: Andreas Westin <andreas.westin@stericsson.com> Cc: linux-crypto@vger.kernel.org Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/crypto/ux500/hash/hash_core.c')
-rw-r--r--drivers/crypto/ux500/hash/hash_core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 4b024280def1..62695764de1c 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -122,6 +122,13 @@ static void hash_dma_setup_channel(struct hash_device_data *device_data,
struct device *dev)
{
struct hash_platform_data *platform_data = dev->platform_data;
+ struct dma_slave_config conf = {
+ .direction = DMA_MEM_TO_DEV,
+ .dst_addr = device_data->phybase + HASH_DMA_FIFO,
+ .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
+ .dst_maxburst = 16,
+ };
+
dma_cap_zero(device_data->dma.mask);
dma_cap_set(DMA_SLAVE, device_data->dma.mask);
@@ -131,6 +138,8 @@ static void hash_dma_setup_channel(struct hash_device_data *device_data,
platform_data->dma_filter,
device_data->dma.cfg_mem2hash);
+ dmaengine_slave_config(device_data->dma.chan_mem2hash, &conf);
+
init_completion(&device_data->dma.complete);
}
@@ -1699,6 +1708,7 @@ static int ux500_hash_probe(struct platform_device *pdev)
goto out_kfree;
}
+ device_data->phybase = res->start;
device_data->base = ioremap(res->start, resource_size(res));
if (!device_data->base) {
dev_err(dev, "[%s] ioremap() failed!",