2 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
3 * Jaswinder Singh <jassi.brar@samsung.com>
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.
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.
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.
20 #include <linux/platform_device.h>
21 #include <linux/dma-mapping.h>
23 #include <plat/devs.h>
24 #include <plat/irqs.h>
27 #include <mach/irqs.h>
29 #include <plat/s3c-pl330-pdata.h>
31 static u64 dma_dmamask
= DMA_BIT_MASK(32);
33 static struct resource s5pv210_pdma0_resource
[] = {
35 .start
= S5PV210_PA_PDMA0
,
36 .end
= S5PV210_PA_PDMA0
+ SZ_4K
,
37 .flags
= IORESOURCE_MEM
,
42 .flags
= IORESOURCE_IRQ
,
46 static struct s3c_pl330_platdata s5pv210_pdma0_pdata
= {
59 [11] = DMACH_I2S0S_TX
,
70 [22] = DMACH_AC97_MICIN
,
71 [23] = DMACH_AC97_PCMIN
,
72 [24] = DMACH_AC97_PCMOUT
,
83 static struct platform_device s5pv210_device_pdma0
= {
86 .num_resources
= ARRAY_SIZE(s5pv210_pdma0_resource
),
87 .resource
= s5pv210_pdma0_resource
,
89 .dma_mask
= &dma_dmamask
,
90 .coherent_dma_mask
= DMA_BIT_MASK(32),
91 .platform_data
= &s5pv210_pdma0_pdata
,
95 static struct resource s5pv210_pdma1_resource
[] = {
97 .start
= S5PV210_PA_PDMA1
,
98 .end
= S5PV210_PA_PDMA1
+ SZ_4K
,
99 .flags
= IORESOURCE_MEM
,
104 .flags
= IORESOURCE_IRQ
,
108 static struct s3c_pl330_platdata s5pv210_pdma1_pdata
= {
110 [0] = DMACH_UART0_RX
,
111 [1] = DMACH_UART0_TX
,
112 [2] = DMACH_UART1_RX
,
113 [3] = DMACH_UART1_TX
,
114 [4] = DMACH_UART2_RX
,
115 [5] = DMACH_UART2_TX
,
116 [6] = DMACH_UART3_RX
,
117 [7] = DMACH_UART3_TX
,
120 [10] = DMACH_I2S0_TX
,
121 [11] = DMACH_I2S0S_TX
,
122 [12] = DMACH_I2S1_RX
,
123 [13] = DMACH_I2S1_TX
,
124 [14] = DMACH_I2S2_RX
,
125 [15] = DMACH_I2S2_TX
,
126 [16] = DMACH_SPI0_RX
,
127 [17] = DMACH_SPI0_TX
,
128 [18] = DMACH_SPI1_RX
,
129 [19] = DMACH_SPI1_TX
,
132 [22] = DMACH_PCM0_RX
,
133 [23] = DMACH_PCM0_TX
,
134 [24] = DMACH_PCM1_RX
,
135 [25] = DMACH_PCM1_TX
,
136 [26] = DMACH_MSM_REQ0
,
137 [27] = DMACH_MSM_REQ1
,
138 [28] = DMACH_MSM_REQ2
,
139 [29] = DMACH_MSM_REQ3
,
140 [30] = DMACH_PCM2_RX
,
141 [31] = DMACH_PCM2_TX
,
145 static struct platform_device s5pv210_device_pdma1
= {
148 .num_resources
= ARRAY_SIZE(s5pv210_pdma1_resource
),
149 .resource
= s5pv210_pdma1_resource
,
151 .dma_mask
= &dma_dmamask
,
152 .coherent_dma_mask
= DMA_BIT_MASK(32),
153 .platform_data
= &s5pv210_pdma1_pdata
,
157 static struct platform_device
*s5pv210_dmacs
[] __initdata
= {
158 &s5pv210_device_pdma0
,
159 &s5pv210_device_pdma1
,
162 static int __init
s5pv210_dma_init(void)
164 platform_add_devices(s5pv210_dmacs
, ARRAY_SIZE(s5pv210_dmacs
));
168 arch_initcall(s5pv210_dma_init
);