aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-08-02 10:50:39 -0400
committerVinod Koul <vinod.koul@intel.com>2013-08-27 04:56:21 -0400
commit1e69653d40f1a280dbfef48b0c62473ac415dd57 (patch)
treede6a43d2dbe37ac5475716377679051f8f389bc9
parent8eb742a0914cd79053d092a14bfac5315993dd61 (diff)
DMA: shdma: add r8a73a4 DMAC data to the device ID table
This configuration data will be used, when DMAC DT support is added to r8a73a4. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/sh/Kconfig4
-rw-r--r--drivers/dma/sh/Makefile3
-rw-r--r--drivers/dma/sh/shdma-r8a73a4.c77
-rw-r--r--drivers/dma/sh/shdma.h7
-rw-r--r--drivers/dma/sh/shdmac.c1
5 files changed, 92 insertions, 0 deletions
diff --git a/drivers/dma/sh/Kconfig b/drivers/dma/sh/Kconfig
index 5c1dee20c13e..d0924b6948e0 100644
--- a/drivers/dma/sh/Kconfig
+++ b/drivers/dma/sh/Kconfig
@@ -22,3 +22,7 @@ config SUDMAC
22 depends on SH_DMAE_BASE 22 depends on SH_DMAE_BASE
23 help 23 help
24 Enable support for the Renesas SUDMAC controllers. 24 Enable support for the Renesas SUDMAC controllers.
25
26config SHDMA_R8A73A4
27 def_bool y
28 depends on ARCH_R8A73A4 && SH_DMAE != n
diff --git a/drivers/dma/sh/Makefile b/drivers/dma/sh/Makefile
index 893ee095f93c..05a31d447bd4 100644
--- a/drivers/dma/sh/Makefile
+++ b/drivers/dma/sh/Makefile
@@ -1,5 +1,8 @@
1obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o shdma-of.o 1obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o shdma-of.o
2obj-$(CONFIG_SH_DMAE) += shdma.o 2obj-$(CONFIG_SH_DMAE) += shdma.o
3shdma-y := shdmac.o 3shdma-y := shdmac.o
4ifeq ($(CONFIG_OF),y)
5shdma-$(CONFIG_SHDMA_R8A73A4) += shdma-r8a73a4.o
6endif
4shdma-objs := $(shdma-y) 7shdma-objs := $(shdma-y)
5obj-$(CONFIG_SUDMAC) += sudmac.o 8obj-$(CONFIG_SUDMAC) += sudmac.o
diff --git a/drivers/dma/sh/shdma-r8a73a4.c b/drivers/dma/sh/shdma-r8a73a4.c
new file mode 100644
index 000000000000..4fb99970a3ea
--- /dev/null
+++ b/drivers/dma/sh/shdma-r8a73a4.c
@@ -0,0 +1,77 @@
1/*
2 * Renesas SuperH DMA Engine support for r8a73a4 (APE6) SoCs
3 *
4 * Copyright (C) 2013 Renesas Electronics, Inc.
5 *
6 * This is free software; you can redistribute it and/or modify it under the
7 * terms of version 2 the GNU General Public License as published by the Free
8 * Software Foundation.
9 */
10#include <linux/sh_dma.h>
11
12#include "shdma-arm.h"
13
14const unsigned int dma_ts_shift[] = SH_DMAE_TS_SHIFT;
15
16static const struct sh_dmae_slave_config dma_slaves[] = {
17 {
18 .chcr = CHCR_TX(XMIT_SZ_32BIT),
19 .mid_rid = 0xd1, /* MMC0 Tx */
20 }, {
21 .chcr = CHCR_RX(XMIT_SZ_32BIT),
22 .mid_rid = 0xd2, /* MMC0 Rx */
23 }, {
24 .chcr = CHCR_TX(XMIT_SZ_32BIT),
25 .mid_rid = 0xe1, /* MMC1 Tx */
26 }, {
27 .chcr = CHCR_RX(XMIT_SZ_32BIT),
28 .mid_rid = 0xe2, /* MMC1 Rx */
29 },
30};
31
32#define DMAE_CHANNEL(a, b) \
33 { \
34 .offset = (a) - 0x20, \
35 .dmars = (a) - 0x20 + 0x40, \
36 .chclr_bit = (b), \
37 .chclr_offset = 0x80 - 0x20, \
38 }
39
40static const struct sh_dmae_channel dma_channels[] = {
41 DMAE_CHANNEL(0x8000, 0),
42 DMAE_CHANNEL(0x8080, 1),
43 DMAE_CHANNEL(0x8100, 2),
44 DMAE_CHANNEL(0x8180, 3),
45 DMAE_CHANNEL(0x8200, 4),
46 DMAE_CHANNEL(0x8280, 5),
47 DMAE_CHANNEL(0x8300, 6),
48 DMAE_CHANNEL(0x8380, 7),
49 DMAE_CHANNEL(0x8400, 8),
50 DMAE_CHANNEL(0x8480, 9),
51 DMAE_CHANNEL(0x8500, 10),
52 DMAE_CHANNEL(0x8580, 11),
53 DMAE_CHANNEL(0x8600, 12),
54 DMAE_CHANNEL(0x8680, 13),
55 DMAE_CHANNEL(0x8700, 14),
56 DMAE_CHANNEL(0x8780, 15),
57 DMAE_CHANNEL(0x8800, 16),
58 DMAE_CHANNEL(0x8880, 17),
59 DMAE_CHANNEL(0x8900, 18),
60 DMAE_CHANNEL(0x8980, 19),
61};
62
63const struct sh_dmae_pdata r8a73a4_dma_pdata = {
64 .slave = dma_slaves,
65 .slave_num = ARRAY_SIZE(dma_slaves),
66 .channel = dma_channels,
67 .channel_num = ARRAY_SIZE(dma_channels),
68 .ts_low_shift = TS_LOW_SHIFT,
69 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
70 .ts_high_shift = TS_HI_SHIFT,
71 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
72 .ts_shift = dma_ts_shift,
73 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
74 .dmaor_init = DMAOR_DME,
75 .chclr_present = 1,
76 .chclr_bitwise = 1,
77};
diff --git a/drivers/dma/sh/shdma.h b/drivers/dma/sh/shdma.h
index ff2f93b612ca..758a57b51875 100644
--- a/drivers/dma/sh/shdma.h
+++ b/drivers/dma/sh/shdma.h
@@ -62,4 +62,11 @@ struct sh_dmae_desc {
62#define to_sh_dev(chan) container_of(chan->shdma_chan.dma_chan.device,\ 62#define to_sh_dev(chan) container_of(chan->shdma_chan.dma_chan.device,\
63 struct sh_dmae_device, shdma_dev.dma_dev) 63 struct sh_dmae_device, shdma_dev.dma_dev)
64 64
65#ifdef CONFIG_SHDMA_R8A73A4
66extern const struct sh_dmae_pdata r8a73a4_dma_pdata;
67#define r8a73a4_shdma_devid (&r8a73a4_dma_pdata)
68#else
69#define r8a73a4_shdma_devid NULL
70#endif
71
65#endif /* __DMA_SHDMA_H */ 72#endif /* __DMA_SHDMA_H */
diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
index 03efd4ad0f0b..77de5e4375f2 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -677,6 +677,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = {
677}; 677};
678 678
679static const struct of_device_id sh_dmae_of_match[] = { 679static const struct of_device_id sh_dmae_of_match[] = {
680 {.compatible = "renesas,shdma-r8a73a4", .data = r8a73a4_shdma_devid,},
680 {} 681 {}
681}; 682};
682MODULE_DEVICE_TABLE(of, sh_dmae_of_match); 683MODULE_DEVICE_TABLE(of, sh_dmae_of_match);