1 /* linux/arch/arm/mach-s5pv210/dma.c
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
7 * Jaswinder Singh <jassi.brar@samsung.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/dma-mapping.h>
25 #include <linux/amba/bus.h>
26 #include <linux/amba/pl330.h>
29 #include <plat/devs.h>
30 #include <plat/irqs.h>
33 #include <mach/irqs.h>
36 static u64 dma_dmamask = DMA_BIT_MASK(32);
38 struct dma_pl330_peri pdma0_peri[28] = {
40 .peri_id = (u8)DMACH_UART0_RX,
43 .peri_id = (u8)DMACH_UART0_TX,
46 .peri_id = (u8)DMACH_UART1_RX,
49 .peri_id = (u8)DMACH_UART1_TX,
52 .peri_id = (u8)DMACH_UART2_RX,
55 .peri_id = (u8)DMACH_UART2_TX,
58 .peri_id = (u8)DMACH_UART3_RX,
61 .peri_id = (u8)DMACH_UART3_TX,
66 .peri_id = (u8)DMACH_I2S0_RX,
69 .peri_id = (u8)DMACH_I2S0_TX,
72 .peri_id = (u8)DMACH_I2S0S_TX,
75 .peri_id = (u8)DMACH_I2S1_RX,
78 .peri_id = (u8)DMACH_I2S1_TX,
81 .peri_id = (u8)DMACH_MAX,
83 .peri_id = (u8)DMACH_MAX,
85 .peri_id = (u8)DMACH_SPI0_RX,
88 .peri_id = (u8)DMACH_SPI0_TX,
91 .peri_id = (u8)DMACH_SPI1_RX,
94 .peri_id = (u8)DMACH_SPI1_TX,
97 .peri_id = (u8)DMACH_MAX,
99 .peri_id = (u8)DMACH_MAX,
101 .peri_id = (u8)DMACH_AC97_MICIN,
104 .peri_id = (u8)DMACH_AC97_PCMIN,
107 .peri_id = (u8)DMACH_AC97_PCMOUT,
110 .peri_id = (u8)DMACH_MAX,
112 .peri_id = (u8)DMACH_PWM,
114 .peri_id = (u8)DMACH_SPDIF,
119 struct dma_pl330_platdata s5pv210_pdma0_pdata = {
120 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
124 struct amba_device s5pv210_device_pdma0 = {
126 .init_name = "dma-pl330.0",
127 .dma_mask = &dma_dmamask,
128 .coherent_dma_mask = DMA_BIT_MASK(32),
129 .platform_data = &s5pv210_pdma0_pdata,
132 .start = S5PV210_PA_PDMA0,
133 .end = S5PV210_PA_PDMA0 + SZ_4K,
134 .flags = IORESOURCE_MEM,
136 .irq = {IRQ_PDMA0, NO_IRQ},
137 .periphid = 0x00041330,
140 struct dma_pl330_peri pdma1_peri[32] = {
142 .peri_id = (u8)DMACH_UART0_RX,
145 .peri_id = (u8)DMACH_UART0_TX,
148 .peri_id = (u8)DMACH_UART1_RX,
151 .peri_id = (u8)DMACH_UART1_TX,
154 .peri_id = (u8)DMACH_UART2_RX,
157 .peri_id = (u8)DMACH_UART2_TX,
160 .peri_id = (u8)DMACH_UART3_RX,
163 .peri_id = (u8)DMACH_UART3_TX,
166 .peri_id = DMACH_MAX,
168 .peri_id = (u8)DMACH_I2S0_RX,
171 .peri_id = (u8)DMACH_I2S0_TX,
174 .peri_id = (u8)DMACH_I2S0S_TX,
177 .peri_id = (u8)DMACH_I2S1_RX,
180 .peri_id = (u8)DMACH_I2S1_TX,
183 .peri_id = (u8)DMACH_I2S2_RX,
186 .peri_id = (u8)DMACH_I2S2_TX,
189 .peri_id = (u8)DMACH_SPI0_RX,
192 .peri_id = (u8)DMACH_SPI0_TX,
195 .peri_id = (u8)DMACH_SPI1_RX,
198 .peri_id = (u8)DMACH_SPI1_TX,
201 .peri_id = (u8)DMACH_MAX,
203 .peri_id = (u8)DMACH_MAX,
205 .peri_id = (u8)DMACH_PCM0_RX,
208 .peri_id = (u8)DMACH_PCM0_TX,
211 .peri_id = (u8)DMACH_PCM1_RX,
214 .peri_id = (u8)DMACH_PCM1_TX,
217 .peri_id = (u8)DMACH_MSM_REQ0,
219 .peri_id = (u8)DMACH_MSM_REQ1,
221 .peri_id = (u8)DMACH_MSM_REQ2,
223 .peri_id = (u8)DMACH_MSM_REQ3,
225 .peri_id = (u8)DMACH_PCM2_RX,
228 .peri_id = (u8)DMACH_PCM2_TX,
233 struct dma_pl330_platdata s5pv210_pdma1_pdata = {
234 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
238 struct amba_device s5pv210_device_pdma1 = {
240 .init_name = "dma-pl330.1",
241 .dma_mask = &dma_dmamask,
242 .coherent_dma_mask = DMA_BIT_MASK(32),
243 .platform_data = &s5pv210_pdma1_pdata,
246 .start = S5PV210_PA_PDMA1,
247 .end = S5PV210_PA_PDMA1 + SZ_4K,
248 .flags = IORESOURCE_MEM,
250 .irq = {IRQ_PDMA1, NO_IRQ},
251 .periphid = 0x00041330,
254 static int __init s5pv210_dma_init(void)
256 amba_device_register(&s5pv210_device_pdma0, &iomem_resource);
257 amba_device_register(&s5pv210_device_pdma1, &iomem_resource);
261 arch_initcall(s5pv210_dma_init);