1 /* linux/arch/arm/mach-exynos4/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/platform_device.h>
25 #include <linux/dma-mapping.h>
27 #include <plat/devs.h>
28 #include <plat/irqs.h>
31 #include <mach/irqs.h>
33 #include <plat/s3c-pl330-pdata.h>
35 static u64 dma_dmamask
= DMA_BIT_MASK(32);
37 static struct resource exynos4_pdma0_resource
[] = {
39 .start
= EXYNOS4_PA_PDMA0
,
40 .end
= EXYNOS4_PA_PDMA0
+ SZ_4K
,
41 .flags
= IORESOURCE_MEM
,
46 .flags
= IORESOURCE_IRQ
,
50 static struct s3c_pl330_platdata exynos4_pdma0_pdata
= {
62 [10] = DMACH_I2S0S_TX
,
67 [15] = DMACH_UART0_RX
,
68 [16] = DMACH_UART0_TX
,
69 [17] = DMACH_UART2_RX
,
70 [18] = DMACH_UART2_TX
,
71 [19] = DMACH_UART4_RX
,
72 [20] = DMACH_UART4_TX
,
73 [21] = DMACH_SLIMBUS0_RX
,
74 [22] = DMACH_SLIMBUS0_TX
,
75 [23] = DMACH_SLIMBUS2_RX
,
76 [24] = DMACH_SLIMBUS2_TX
,
77 [25] = DMACH_SLIMBUS4_RX
,
78 [26] = DMACH_SLIMBUS4_TX
,
79 [27] = DMACH_AC97_MICIN
,
80 [28] = DMACH_AC97_PCMIN
,
81 [29] = DMACH_AC97_PCMOUT
,
87 static struct platform_device exynos4_device_pdma0
= {
90 .num_resources
= ARRAY_SIZE(exynos4_pdma0_resource
),
91 .resource
= exynos4_pdma0_resource
,
93 .dma_mask
= &dma_dmamask
,
94 .coherent_dma_mask
= DMA_BIT_MASK(32),
95 .platform_data
= &exynos4_pdma0_pdata
,
99 static struct resource exynos4_pdma1_resource
[] = {
101 .start
= EXYNOS4_PA_PDMA1
,
102 .end
= EXYNOS4_PA_PDMA1
+ SZ_4K
,
103 .flags
= IORESOURCE_MEM
,
108 .flags
= IORESOURCE_IRQ
,
112 static struct s3c_pl330_platdata exynos4_pdma1_pdata
= {
118 [4] = DMACH_MSM_REQ1
,
119 [5] = DMACH_MSM_REQ3
,
122 [8] = DMACH_I2S0S_TX
,
124 [10] = DMACH_I2S0_TX
,
125 [11] = DMACH_I2S1_RX
,
126 [12] = DMACH_I2S1_TX
,
127 [13] = DMACH_UART0_RX
,
128 [14] = DMACH_UART0_TX
,
129 [15] = DMACH_UART1_RX
,
130 [16] = DMACH_UART1_TX
,
131 [17] = DMACH_UART3_RX
,
132 [18] = DMACH_UART3_TX
,
133 [19] = DMACH_SLIMBUS1_RX
,
134 [20] = DMACH_SLIMBUS1_TX
,
135 [21] = DMACH_SLIMBUS3_RX
,
136 [22] = DMACH_SLIMBUS3_TX
,
137 [23] = DMACH_SLIMBUS5_RX
,
138 [24] = DMACH_SLIMBUS5_TX
,
139 [25] = DMACH_SLIMBUS0AUX_RX
,
140 [26] = DMACH_SLIMBUS0AUX_TX
,
149 static struct platform_device exynos4_device_pdma1
= {
152 .num_resources
= ARRAY_SIZE(exynos4_pdma1_resource
),
153 .resource
= exynos4_pdma1_resource
,
155 .dma_mask
= &dma_dmamask
,
156 .coherent_dma_mask
= DMA_BIT_MASK(32),
157 .platform_data
= &exynos4_pdma1_pdata
,
161 static struct platform_device
*exynos4_dmacs
[] __initdata
= {
162 &exynos4_device_pdma0
,
163 &exynos4_device_pdma1
,
166 static int __init
exynos4_dma_init(void)
168 platform_add_devices(exynos4_dmacs
, ARRAY_SIZE(exynos4_dmacs
));
172 arch_initcall(exynos4_dma_init
);