diff options
author | Jassi Brar <jassi.brar@samsung.com> | 2010-11-18 18:49:43 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-11-18 18:49:43 -0500 |
commit | 8b0ae0b719d4ea9aee4ed3a7a09d5ff76557fadf (patch) | |
tree | d32eef922eb5dd3b7b519ac427eeecc6aac2d7c6 /arch/arm/mach-s5pv310 | |
parent | e53beacd23d9cb47590da6a7a7f6d417b941a994 (diff) |
ARM: S5PV310: Add platform devices for PL330 DMACs
Samsung's Soc S5PV310 has three PL330 DMACs. First is dedicated for
Memory->Memory data transfer while the other two meant for data
transfer with peripherals.
Define and add latter two PL330 DMACs as platform devices on the
S5PV310 platform.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv310')
-rw-r--r-- | arch/arm/mach-s5pv310/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pv310/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pv310/dma.c | 168 | ||||
-rw-r--r-- | arch/arm/mach-s5pv310/include/mach/dma.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-s5pv310/include/mach/irqs.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5pv310/include/mach/map.h | 5 |
6 files changed, 204 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig index 1150b360f38c..d64efe0d4c97 100644 --- a/arch/arm/mach-s5pv310/Kconfig +++ b/arch/arm/mach-s5pv310/Kconfig | |||
@@ -11,6 +11,7 @@ if ARCH_S5PV310 | |||
11 | 11 | ||
12 | config CPU_S5PV310 | 12 | config CPU_S5PV310 |
13 | bool | 13 | bool |
14 | select S3C_PL330_DMA | ||
14 | help | 15 | help |
15 | Enable S5PV310 CPU support | 16 | Enable S5PV310 CPU support |
16 | 17 | ||
diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-s5pv310/Makefile index 84afc64e7c01..d265adb178e6 100644 --- a/arch/arm/mach-s5pv310/Makefile +++ b/arch/arm/mach-s5pv310/Makefile | |||
@@ -13,7 +13,7 @@ obj- := | |||
13 | # Core support for S5PV310 system | 13 | # Core support for S5PV310 system |
14 | 14 | ||
15 | obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o | 15 | obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o |
16 | obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o | 16 | obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o |
17 | 17 | ||
18 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 18 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
19 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | 19 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o |
diff --git a/arch/arm/mach-s5pv310/dma.c b/arch/arm/mach-s5pv310/dma.c new file mode 100644 index 000000000000..20066c7c9e56 --- /dev/null +++ b/arch/arm/mach-s5pv310/dma.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/dma-mapping.h> | ||
22 | |||
23 | #include <plat/devs.h> | ||
24 | #include <plat/irqs.h> | ||
25 | |||
26 | #include <mach/map.h> | ||
27 | #include <mach/irqs.h> | ||
28 | |||
29 | #include <plat/s3c-pl330-pdata.h> | ||
30 | |||
31 | static u64 dma_dmamask = DMA_BIT_MASK(32); | ||
32 | |||
33 | static struct resource s5pv310_pdma0_resource[] = { | ||
34 | [0] = { | ||
35 | .start = S5PV310_PA_PDMA0, | ||
36 | .end = S5PV310_PA_PDMA0 + SZ_4K, | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }, | ||
39 | [1] = { | ||
40 | .start = IRQ_PDMA0, | ||
41 | .end = IRQ_PDMA0, | ||
42 | .flags = IORESOURCE_IRQ, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | static struct s3c_pl330_platdata s5pv310_pdma0_pdata = { | ||
47 | .peri = { | ||
48 | [0] = DMACH_PCM0_RX, | ||
49 | [1] = DMACH_PCM0_TX, | ||
50 | [2] = DMACH_PCM2_RX, | ||
51 | [3] = DMACH_PCM2_TX, | ||
52 | [4] = DMACH_MSM_REQ0, | ||
53 | [5] = DMACH_MSM_REQ2, | ||
54 | [6] = DMACH_SPI0_RX, | ||
55 | [7] = DMACH_SPI0_TX, | ||
56 | [8] = DMACH_SPI2_RX, | ||
57 | [9] = DMACH_SPI2_TX, | ||
58 | [10] = DMACH_I2S0S_TX, | ||
59 | [11] = DMACH_I2S0_RX, | ||
60 | [12] = DMACH_I2S0_TX, | ||
61 | [13] = DMACH_I2S2_RX, | ||
62 | [14] = DMACH_I2S2_TX, | ||
63 | [15] = DMACH_UART0_RX, | ||
64 | [16] = DMACH_UART0_TX, | ||
65 | [17] = DMACH_UART2_RX, | ||
66 | [18] = DMACH_UART2_TX, | ||
67 | [19] = DMACH_UART4_RX, | ||
68 | [20] = DMACH_UART4_TX, | ||
69 | [21] = DMACH_SLIMBUS0_RX, | ||
70 | [22] = DMACH_SLIMBUS0_TX, | ||
71 | [23] = DMACH_SLIMBUS2_RX, | ||
72 | [24] = DMACH_SLIMBUS2_TX, | ||
73 | [25] = DMACH_SLIMBUS4_RX, | ||
74 | [26] = DMACH_SLIMBUS4_TX, | ||
75 | [27] = DMACH_AC97_MICIN, | ||
76 | [28] = DMACH_AC97_PCMIN, | ||
77 | [29] = DMACH_AC97_PCMOUT, | ||
78 | [30] = DMACH_MAX, | ||
79 | [31] = DMACH_MAX, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | static struct platform_device s5pv310_device_pdma0 = { | ||
84 | .name = "s3c-pl330", | ||
85 | .id = 0, | ||
86 | .num_resources = ARRAY_SIZE(s5pv310_pdma0_resource), | ||
87 | .resource = s5pv310_pdma0_resource, | ||
88 | .dev = { | ||
89 | .dma_mask = &dma_dmamask, | ||
90 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
91 | .platform_data = &s5pv310_pdma0_pdata, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | static struct resource s5pv310_pdma1_resource[] = { | ||
96 | [0] = { | ||
97 | .start = S5PV310_PA_PDMA1, | ||
98 | .end = S5PV310_PA_PDMA1 + SZ_4K, | ||
99 | .flags = IORESOURCE_MEM, | ||
100 | }, | ||
101 | [1] = { | ||
102 | .start = IRQ_PDMA1, | ||
103 | .end = IRQ_PDMA1, | ||
104 | .flags = IORESOURCE_IRQ, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | static struct s3c_pl330_platdata s5pv310_pdma1_pdata = { | ||
109 | .peri = { | ||
110 | [0] = DMACH_PCM0_RX, | ||
111 | [1] = DMACH_PCM0_TX, | ||
112 | [2] = DMACH_PCM1_RX, | ||
113 | [3] = DMACH_PCM1_TX, | ||
114 | [4] = DMACH_MSM_REQ1, | ||
115 | [5] = DMACH_MSM_REQ3, | ||
116 | [6] = DMACH_SPI1_RX, | ||
117 | [7] = DMACH_SPI1_TX, | ||
118 | [8] = DMACH_I2S0S_TX, | ||
119 | [9] = DMACH_I2S0_RX, | ||
120 | [10] = DMACH_I2S0_TX, | ||
121 | [11] = DMACH_I2S1_RX, | ||
122 | [12] = DMACH_I2S1_TX, | ||
123 | [13] = DMACH_UART0_RX, | ||
124 | [14] = DMACH_UART0_TX, | ||
125 | [15] = DMACH_UART1_RX, | ||
126 | [16] = DMACH_UART1_TX, | ||
127 | [17] = DMACH_UART3_RX, | ||
128 | [18] = DMACH_UART3_TX, | ||
129 | [19] = DMACH_SLIMBUS1_RX, | ||
130 | [20] = DMACH_SLIMBUS1_TX, | ||
131 | [21] = DMACH_SLIMBUS3_RX, | ||
132 | [22] = DMACH_SLIMBUS3_TX, | ||
133 | [23] = DMACH_SLIMBUS5_RX, | ||
134 | [24] = DMACH_SLIMBUS5_TX, | ||
135 | [25] = DMACH_SLIMBUS0AUX_RX, | ||
136 | [26] = DMACH_SLIMBUS0AUX_TX, | ||
137 | [27] = DMACH_SPDIF, | ||
138 | [28] = DMACH_MAX, | ||
139 | [29] = DMACH_MAX, | ||
140 | [30] = DMACH_MAX, | ||
141 | [31] = DMACH_MAX, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | static struct platform_device s5pv310_device_pdma1 = { | ||
146 | .name = "s3c-pl330", | ||
147 | .id = 1, | ||
148 | .num_resources = ARRAY_SIZE(s5pv310_pdma1_resource), | ||
149 | .resource = s5pv310_pdma1_resource, | ||
150 | .dev = { | ||
151 | .dma_mask = &dma_dmamask, | ||
152 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
153 | .platform_data = &s5pv310_pdma1_pdata, | ||
154 | }, | ||
155 | }; | ||
156 | |||
157 | static struct platform_device *s5pv310_dmacs[] __initdata = { | ||
158 | &s5pv310_device_pdma0, | ||
159 | &s5pv310_device_pdma1, | ||
160 | }; | ||
161 | |||
162 | static int __init s5pv310_dma_init(void) | ||
163 | { | ||
164 | platform_add_devices(s5pv310_dmacs, ARRAY_SIZE(s5pv310_dmacs)); | ||
165 | |||
166 | return 0; | ||
167 | } | ||
168 | arch_initcall(s5pv310_dma_init); | ||
diff --git a/arch/arm/mach-s5pv310/include/mach/dma.h b/arch/arm/mach-s5pv310/include/mach/dma.h new file mode 100644 index 000000000000..81209eb1409b --- /dev/null +++ b/arch/arm/mach-s5pv310/include/mach/dma.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MACH_DMA_H | ||
21 | #define __MACH_DMA_H | ||
22 | |||
23 | /* This platform uses the common S3C DMA API driver for PL330 */ | ||
24 | #include <plat/s3c-dma-pl330.h> | ||
25 | |||
26 | #endif /* __MACH_DMA_H */ | ||
diff --git a/arch/arm/mach-s5pv310/include/mach/irqs.h b/arch/arm/mach-s5pv310/include/mach/irqs.h index 99e7dad8a85a..3c05c58b5392 100644 --- a/arch/arm/mach-s5pv310/include/mach/irqs.h +++ b/arch/arm/mach-s5pv310/include/mach/irqs.h | |||
@@ -54,6 +54,9 @@ | |||
54 | #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) | 54 | #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) |
55 | #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) | 55 | #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) |
56 | 56 | ||
57 | #define IRQ_PDMA0 COMBINER_IRQ(21, 0) | ||
58 | #define IRQ_PDMA1 COMBINER_IRQ(21, 1) | ||
59 | |||
57 | #define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0) | 60 | #define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0) |
58 | #define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1) | 61 | #define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1) |
59 | #define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2) | 62 | #define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2) |
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h index 7acf4e77e92e..169fac2899f0 100644 --- a/arch/arm/mach-s5pv310/include/mach/map.h +++ b/arch/arm/mach-s5pv310/include/mach/map.h | |||
@@ -52,6 +52,11 @@ | |||
52 | #define S5PV310_PA_GIC_DIST (0x10501000) | 52 | #define S5PV310_PA_GIC_DIST (0x10501000) |
53 | #define S5PV310_PA_L2CC (0x10502000) | 53 | #define S5PV310_PA_L2CC (0x10502000) |
54 | 54 | ||
55 | /* DMA */ | ||
56 | #define S5PV310_PA_MDMA 0x10810000 | ||
57 | #define S5PV310_PA_PDMA0 0x12680000 | ||
58 | #define S5PV310_PA_PDMA1 0x12690000 | ||
59 | |||
55 | #define S5PV310_PA_GPIO1 (0x11400000) | 60 | #define S5PV310_PA_GPIO1 (0x11400000) |
56 | #define S5PV310_PA_GPIO2 (0x11000000) | 61 | #define S5PV310_PA_GPIO2 (0x11000000) |
57 | #define S5PV310_PA_GPIO3 (0x03860000) | 62 | #define S5PV310_PA_GPIO3 (0x03860000) |