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/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_PCM0_RX
,
43 .peri_id
= (u8
)DMACH_PCM0_TX
,
46 .peri_id
= (u8
)DMACH_PCM2_RX
,
49 .peri_id
= (u8
)DMACH_PCM2_TX
,
52 .peri_id
= (u8
)DMACH_MSM_REQ0
,
54 .peri_id
= (u8
)DMACH_MSM_REQ2
,
56 .peri_id
= (u8
)DMACH_SPI0_RX
,
59 .peri_id
= (u8
)DMACH_SPI0_TX
,
62 .peri_id
= (u8
)DMACH_SPI2_RX
,
65 .peri_id
= (u8
)DMACH_SPI2_TX
,
68 .peri_id
= (u8
)DMACH_I2S0S_TX
,
71 .peri_id
= (u8
)DMACH_I2S0_RX
,
74 .peri_id
= (u8
)DMACH_I2S0_TX
,
77 .peri_id
= (u8
)DMACH_UART0_RX
,
80 .peri_id
= (u8
)DMACH_UART0_TX
,
83 .peri_id
= (u8
)DMACH_UART2_RX
,
86 .peri_id
= (u8
)DMACH_UART2_TX
,
89 .peri_id
= (u8
)DMACH_UART4_RX
,
92 .peri_id
= (u8
)DMACH_UART4_TX
,
95 .peri_id
= (u8
)DMACH_SLIMBUS0_RX
,
98 .peri_id
= (u8
)DMACH_SLIMBUS0_TX
,
101 .peri_id
= (u8
)DMACH_SLIMBUS2_RX
,
104 .peri_id
= (u8
)DMACH_SLIMBUS2_TX
,
107 .peri_id
= (u8
)DMACH_SLIMBUS4_RX
,
110 .peri_id
= (u8
)DMACH_SLIMBUS4_TX
,
113 .peri_id
= (u8
)DMACH_AC97_MICIN
,
116 .peri_id
= (u8
)DMACH_AC97_PCMIN
,
119 .peri_id
= (u8
)DMACH_AC97_PCMOUT
,
124 struct dma_pl330_platdata exynos4_pdma0_pdata
= {
125 .nr_valid_peri
= ARRAY_SIZE(pdma0_peri
),
129 struct amba_device exynos4_device_pdma0
= {
131 .init_name
= "dma-pl330.0",
132 .dma_mask
= &dma_dmamask
,
133 .coherent_dma_mask
= DMA_BIT_MASK(32),
134 .platform_data
= &exynos4_pdma0_pdata
,
137 .start
= EXYNOS4_PA_PDMA0
,
138 .end
= EXYNOS4_PA_PDMA0
+ SZ_4K
,
139 .flags
= IORESOURCE_MEM
,
141 .irq
= {IRQ_PDMA0
, NO_IRQ
},
142 .periphid
= 0x00041330,
145 struct dma_pl330_peri pdma1_peri
[25] = {
147 .peri_id
= (u8
)DMACH_PCM0_RX
,
150 .peri_id
= (u8
)DMACH_PCM0_TX
,
153 .peri_id
= (u8
)DMACH_PCM1_RX
,
156 .peri_id
= (u8
)DMACH_PCM1_TX
,
159 .peri_id
= (u8
)DMACH_MSM_REQ1
,
161 .peri_id
= (u8
)DMACH_MSM_REQ3
,
163 .peri_id
= (u8
)DMACH_SPI1_RX
,
166 .peri_id
= (u8
)DMACH_SPI1_TX
,
169 .peri_id
= (u8
)DMACH_I2S0S_TX
,
172 .peri_id
= (u8
)DMACH_I2S0_RX
,
175 .peri_id
= (u8
)DMACH_I2S0_TX
,
178 .peri_id
= (u8
)DMACH_I2S1_RX
,
181 .peri_id
= (u8
)DMACH_I2S1_TX
,
184 .peri_id
= (u8
)DMACH_UART0_RX
,
187 .peri_id
= (u8
)DMACH_UART0_TX
,
190 .peri_id
= (u8
)DMACH_UART1_RX
,
193 .peri_id
= (u8
)DMACH_UART1_TX
,
196 .peri_id
= (u8
)DMACH_UART3_RX
,
199 .peri_id
= (u8
)DMACH_UART3_TX
,
202 .peri_id
= (u8
)DMACH_SLIMBUS1_RX
,
205 .peri_id
= (u8
)DMACH_SLIMBUS1_TX
,
208 .peri_id
= (u8
)DMACH_SLIMBUS3_RX
,
211 .peri_id
= (u8
)DMACH_SLIMBUS3_TX
,
214 .peri_id
= (u8
)DMACH_SLIMBUS5_RX
,
217 .peri_id
= (u8
)DMACH_SLIMBUS5_TX
,
222 struct dma_pl330_platdata exynos4_pdma1_pdata
= {
223 .nr_valid_peri
= ARRAY_SIZE(pdma1_peri
),
227 struct amba_device exynos4_device_pdma1
= {
229 .init_name
= "dma-pl330.1",
230 .dma_mask
= &dma_dmamask
,
231 .coherent_dma_mask
= DMA_BIT_MASK(32),
232 .platform_data
= &exynos4_pdma1_pdata
,
235 .start
= EXYNOS4_PA_PDMA1
,
236 .end
= EXYNOS4_PA_PDMA1
+ SZ_4K
,
237 .flags
= IORESOURCE_MEM
,
239 .irq
= {IRQ_PDMA1
, NO_IRQ
},
240 .periphid
= 0x00041330,
243 static int __init
exynos4_dma_init(void)
245 amba_device_register(&exynos4_device_pdma0
, &iomem_resource
);
246 amba_device_register(&exynos4_device_pdma1
, &iomem_resource
);
250 arch_initcall(exynos4_dma_init
);