diff options
author | Jassi Brar <jassi.brar@samsung.com> | 2010-05-17 22:59:13 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-23 11:26:56 -0400 |
commit | c5e2caca6a0732108bec146844551767cfbc115c (patch) | |
tree | 36f2a71cd9fdccbd179b3957992e748a167ee608 /arch/arm/mach-s5pc100 | |
parent | b69a596afe1d46f24f97fe69f67370cdfa9d5329 (diff) |
ARM: S5PC100: DMA: Add platform devices for PL330 DMACs
Samsung's Soc S5PC100 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
S5PC100 platform.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s5pc100')
-rw-r--r-- | arch/arm/mach-s5pc100/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/dma.c | 167 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/include/mach/dma.h | 26 |
4 files changed, 195 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index 2eb949771dbc..b2a11dfa3399 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig | |||
@@ -11,6 +11,7 @@ config CPU_S5PC100 | |||
11 | bool | 11 | bool |
12 | select PLAT_S5P | 12 | select PLAT_S5P |
13 | select S5P_EXT_INT | 13 | select S5P_EXT_INT |
14 | select S3C_PL330_DMA | ||
14 | help | 15 | help |
15 | Enable S5PC100 CPU support | 16 | Enable S5PC100 CPU support |
16 | 17 | ||
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile index e1081a9b19c8..543f3de5131e 100644 --- a/arch/arm/mach-s5pc100/Makefile +++ b/arch/arm/mach-s5pc100/Makefile | |||
@@ -13,6 +13,7 @@ obj- := | |||
13 | 13 | ||
14 | obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o gpiolib.o irq-gpio.o | 14 | obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o gpiolib.o irq-gpio.o |
15 | obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o | 15 | obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o |
16 | obj-$(CONFIG_CPU_S5PC100) += dma.o | ||
16 | 17 | ||
17 | # Helper and device support | 18 | # Helper and device support |
18 | 19 | ||
diff --git a/arch/arm/mach-s5pc100/dma.c b/arch/arm/mach-s5pc100/dma.c new file mode 100644 index 000000000000..8e7af46bba09 --- /dev/null +++ b/arch/arm/mach-s5pc100/dma.c | |||
@@ -0,0 +1,167 @@ | |||
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 | |||
28 | #include <plat/s3c-pl330-pdata.h> | ||
29 | |||
30 | static u64 dma_dmamask = DMA_BIT_MASK(32); | ||
31 | |||
32 | static struct resource s5pc100_pdma0_resource[] = { | ||
33 | [0] = { | ||
34 | .start = S5PC100_PA_PDMA0, | ||
35 | .end = S5PC100_PA_PDMA0 + SZ_4K, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, | ||
38 | [1] = { | ||
39 | .start = IRQ_PDMA0, | ||
40 | .end = IRQ_PDMA0, | ||
41 | .flags = IORESOURCE_IRQ, | ||
42 | }, | ||
43 | }; | ||
44 | |||
45 | static struct s3c_pl330_platdata s5pc100_pdma0_pdata = { | ||
46 | .peri = { | ||
47 | [0] = DMACH_UART0_RX, | ||
48 | [1] = DMACH_UART0_TX, | ||
49 | [2] = DMACH_UART1_RX, | ||
50 | [3] = DMACH_UART1_TX, | ||
51 | [4] = DMACH_UART2_RX, | ||
52 | [5] = DMACH_UART2_TX, | ||
53 | [6] = DMACH_UART3_RX, | ||
54 | [7] = DMACH_UART3_TX, | ||
55 | [8] = DMACH_IRDA, | ||
56 | [9] = DMACH_I2S0_RX, | ||
57 | [10] = DMACH_I2S0_TX, | ||
58 | [11] = DMACH_I2S0S_TX, | ||
59 | [12] = DMACH_I2S1_RX, | ||
60 | [13] = DMACH_I2S1_TX, | ||
61 | [14] = DMACH_I2S2_RX, | ||
62 | [15] = DMACH_I2S2_TX, | ||
63 | [16] = DMACH_SPI0_RX, | ||
64 | [17] = DMACH_SPI0_TX, | ||
65 | [18] = DMACH_SPI1_RX, | ||
66 | [19] = DMACH_SPI1_TX, | ||
67 | [20] = DMACH_SPI2_RX, | ||
68 | [21] = DMACH_SPI2_TX, | ||
69 | [22] = DMACH_AC97_MICIN, | ||
70 | [23] = DMACH_AC97_PCMIN, | ||
71 | [24] = DMACH_AC97_PCMOUT, | ||
72 | [25] = DMACH_EXTERNAL, | ||
73 | [26] = DMACH_PWM, | ||
74 | [27] = DMACH_SPDIF, | ||
75 | [28] = DMACH_HSI_RX, | ||
76 | [29] = DMACH_HSI_TX, | ||
77 | [30] = DMACH_MAX, | ||
78 | [31] = DMACH_MAX, | ||
79 | }, | ||
80 | }; | ||
81 | |||
82 | static struct platform_device s5pc100_device_pdma0 = { | ||
83 | .name = "s3c-pl330", | ||
84 | .id = 1, | ||
85 | .num_resources = ARRAY_SIZE(s5pc100_pdma0_resource), | ||
86 | .resource = s5pc100_pdma0_resource, | ||
87 | .dev = { | ||
88 | .dma_mask = &dma_dmamask, | ||
89 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
90 | .platform_data = &s5pc100_pdma0_pdata, | ||
91 | }, | ||
92 | }; | ||
93 | |||
94 | static struct resource s5pc100_pdma1_resource[] = { | ||
95 | [0] = { | ||
96 | .start = S5PC100_PA_PDMA1, | ||
97 | .end = S5PC100_PA_PDMA1 + SZ_4K, | ||
98 | .flags = IORESOURCE_MEM, | ||
99 | }, | ||
100 | [1] = { | ||
101 | .start = IRQ_PDMA1, | ||
102 | .end = IRQ_PDMA1, | ||
103 | .flags = IORESOURCE_IRQ, | ||
104 | }, | ||
105 | }; | ||
106 | |||
107 | static struct s3c_pl330_platdata s5pc100_pdma1_pdata = { | ||
108 | .peri = { | ||
109 | [0] = DMACH_UART0_RX, | ||
110 | [1] = DMACH_UART0_TX, | ||
111 | [2] = DMACH_UART1_RX, | ||
112 | [3] = DMACH_UART1_TX, | ||
113 | [4] = DMACH_UART2_RX, | ||
114 | [5] = DMACH_UART2_TX, | ||
115 | [6] = DMACH_UART3_RX, | ||
116 | [7] = DMACH_UART3_TX, | ||
117 | [8] = DMACH_IRDA, | ||
118 | [9] = DMACH_I2S0_RX, | ||
119 | [10] = DMACH_I2S0_TX, | ||
120 | [11] = DMACH_I2S0S_TX, | ||
121 | [12] = DMACH_I2S1_RX, | ||
122 | [13] = DMACH_I2S1_TX, | ||
123 | [14] = DMACH_I2S2_RX, | ||
124 | [15] = DMACH_I2S2_TX, | ||
125 | [16] = DMACH_SPI0_RX, | ||
126 | [17] = DMACH_SPI0_TX, | ||
127 | [18] = DMACH_SPI1_RX, | ||
128 | [19] = DMACH_SPI1_TX, | ||
129 | [20] = DMACH_SPI2_RX, | ||
130 | [21] = DMACH_SPI2_TX, | ||
131 | [22] = DMACH_PCM0_RX, | ||
132 | [23] = DMACH_PCM0_TX, | ||
133 | [24] = DMACH_PCM1_RX, | ||
134 | [25] = DMACH_PCM1_TX, | ||
135 | [26] = DMACH_MSM_REQ0, | ||
136 | [27] = DMACH_MSM_REQ1, | ||
137 | [28] = DMACH_MSM_REQ2, | ||
138 | [29] = DMACH_MSM_REQ3, | ||
139 | [30] = DMACH_MAX, | ||
140 | [31] = DMACH_MAX, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | static struct platform_device s5pc100_device_pdma1 = { | ||
145 | .name = "s3c-pl330", | ||
146 | .id = 2, | ||
147 | .num_resources = ARRAY_SIZE(s5pc100_pdma1_resource), | ||
148 | .resource = s5pc100_pdma1_resource, | ||
149 | .dev = { | ||
150 | .dma_mask = &dma_dmamask, | ||
151 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
152 | .platform_data = &s5pc100_pdma1_pdata, | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | static struct platform_device *s5pc100_dmacs[] __initdata = { | ||
157 | &s5pc100_device_pdma0, | ||
158 | &s5pc100_device_pdma1, | ||
159 | }; | ||
160 | |||
161 | static int __init s5pc100_dma_init(void) | ||
162 | { | ||
163 | platform_add_devices(s5pc100_dmacs, ARRAY_SIZE(s5pc100_dmacs)); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | arch_initcall(s5pc100_dma_init); | ||
diff --git a/arch/arm/mach-s5pc100/include/mach/dma.h b/arch/arm/mach-s5pc100/include/mach/dma.h new file mode 100644 index 000000000000..81209eb1409b --- /dev/null +++ b/arch/arm/mach-s5pc100/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 */ | ||