aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-r8a7790.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7790.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 6ab37aa1e919..c4616f0698c6 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -24,12 +24,100 @@
24#include <linux/platform_data/gpio-rcar.h> 24#include <linux/platform_data/gpio-rcar.h>
25#include <linux/platform_data/irq-renesas-irqc.h> 25#include <linux/platform_data/irq-renesas-irqc.h>
26#include <linux/serial_sci.h> 26#include <linux/serial_sci.h>
27#include <linux/sh_dma.h>
27#include <linux/sh_timer.h> 28#include <linux/sh_timer.h>
28#include <mach/common.h> 29#include <mach/common.h>
30#include <mach/dma-register.h>
29#include <mach/irqs.h> 31#include <mach/irqs.h>
30#include <mach/r8a7790.h> 32#include <mach/r8a7790.h>
31#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
32 34
35/* Audio-DMAC */
36#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \
37{ \
38 .slave_id = AUDIO_DMAC_SLAVE_## _id ##_TX, \
39 .addr = _addr + 0x8, \
40 .chcr = CHCR_TX(XMIT_SZ_32BIT), \
41 .mid_rid = t, \
42}, { \
43 .slave_id = AUDIO_DMAC_SLAVE_## _id ##_RX, \
44 .addr = _addr + 0xc, \
45 .chcr = CHCR_RX(XMIT_SZ_32BIT), \
46 .mid_rid = r, \
47}
48
49static const struct sh_dmae_slave_config r8a7790_audio_dmac_slaves[] = {
50 AUDIO_DMAC_SLAVE(SSI0, 0xec241000, 0x01, 0x02),
51 AUDIO_DMAC_SLAVE(SSI1, 0xec241040, 0x03, 0x04),
52 AUDIO_DMAC_SLAVE(SSI2, 0xec241080, 0x05, 0x06),
53 AUDIO_DMAC_SLAVE(SSI3, 0xec2410c0, 0x07, 0x08),
54 AUDIO_DMAC_SLAVE(SSI4, 0xec241100, 0x09, 0x0a),
55 AUDIO_DMAC_SLAVE(SSI5, 0xec241140, 0x0b, 0x0c),
56 AUDIO_DMAC_SLAVE(SSI6, 0xec241180, 0x0d, 0x0e),
57 AUDIO_DMAC_SLAVE(SSI7, 0xec2411c0, 0x0f, 0x10),
58 AUDIO_DMAC_SLAVE(SSI8, 0xec241200, 0x11, 0x12),
59 AUDIO_DMAC_SLAVE(SSI9, 0xec241240, 0x13, 0x14),
60};
61
62#define DMAE_CHANNEL(a, b) \
63{ \
64 .offset = (a) - 0x20, \
65 .dmars = (a) - 0x20 + 0x40, \
66 .chclr_bit = (b), \
67 .chclr_offset = 0x80 - 0x20, \
68}
69
70static const struct sh_dmae_channel r8a7790_audio_dmac_channels[] = {
71 DMAE_CHANNEL(0x8000, 0),
72 DMAE_CHANNEL(0x8080, 1),
73 DMAE_CHANNEL(0x8100, 2),
74 DMAE_CHANNEL(0x8180, 3),
75 DMAE_CHANNEL(0x8200, 4),
76 DMAE_CHANNEL(0x8280, 5),
77 DMAE_CHANNEL(0x8300, 6),
78 DMAE_CHANNEL(0x8380, 7),
79 DMAE_CHANNEL(0x8400, 8),
80 DMAE_CHANNEL(0x8480, 9),
81 DMAE_CHANNEL(0x8500, 10),
82 DMAE_CHANNEL(0x8580, 11),
83 DMAE_CHANNEL(0x8600, 12),
84};
85
86static struct sh_dmae_pdata r8a7790_audio_dmac_platform_data = {
87 .slave = r8a7790_audio_dmac_slaves,
88 .slave_num = ARRAY_SIZE(r8a7790_audio_dmac_slaves),
89 .channel = r8a7790_audio_dmac_channels,
90 .channel_num = ARRAY_SIZE(r8a7790_audio_dmac_channels),
91 .ts_low_shift = TS_LOW_SHIFT,
92 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
93 .ts_high_shift = TS_HI_SHIFT,
94 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
95 .ts_shift = dma_ts_shift,
96 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
97 .dmaor_init = DMAOR_DME,
98 .chclr_present = 1,
99 .chclr_bitwise = 1,
100};
101
102static struct resource r8a7790_audio_dmac_resources[] = {
103 /* Channel registers and DMAOR for low */
104 DEFINE_RES_MEM(0xec700020, 0x8663 - 0x20),
105 DEFINE_RES_IRQ(gic_spi(346)),
106 DEFINE_RES_NAMED(gic_spi(320), 13, NULL, IORESOURCE_IRQ),
107
108 /* Channel registers and DMAOR for hi */
109 DEFINE_RES_MEM(0xec720020, 0x8663 - 0x20), /* hi */
110 DEFINE_RES_IRQ(gic_spi(347)),
111 DEFINE_RES_NAMED(gic_spi(333), 13, NULL, IORESOURCE_IRQ),
112};
113
114#define r8a7790_register_audio_dmac(id) \
115 platform_device_register_resndata( \
116 &platform_bus, "sh-dma-engine", id, \
117 &r8a7790_audio_dmac_resources[id * 3], 3, \
118 &r8a7790_audio_dmac_platform_data, \
119 sizeof(r8a7790_audio_dmac_platform_data))
120
33static const struct resource pfc_resources[] __initconst = { 121static const struct resource pfc_resources[] __initconst = {
34 DEFINE_RES_MEM(0xe6060000, 0x250), 122 DEFINE_RES_MEM(0xe6060000, 0x250),
35}; 123};
@@ -101,6 +189,8 @@ void __init r8a7790_pinmux_init(void)
101 r8a7790_register_i2c(1); 189 r8a7790_register_i2c(1);
102 r8a7790_register_i2c(2); 190 r8a7790_register_i2c(2);
103 r8a7790_register_i2c(3); 191 r8a7790_register_i2c(3);
192 r8a7790_register_audio_dmac(0);
193 r8a7790_register_audio_dmac(1);
104} 194}
105 195
106#define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \ 196#define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \