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>
30 #include <plat/devs.h>
31 #include <plat/irqs.h>
34 #include <mach/irqs.h>
37 static u64 dma_dmamask = DMA_BIT_MASK(32);
72 struct dma_pl330_platdata exynos4_pdma0_pdata = {
73 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
74 .peri_id = pdma0_peri,
77 struct amba_device exynos4_device_pdma0 = {
79 .init_name = "dma-pl330.0",
80 .dma_mask = &dma_dmamask,
81 .coherent_dma_mask = DMA_BIT_MASK(32),
82 .platform_data = &exynos4_pdma0_pdata,
85 .start = EXYNOS4_PA_PDMA0,
86 .end = EXYNOS4_PA_PDMA0 + SZ_4K,
87 .flags = IORESOURCE_MEM,
89 .irq = {IRQ_PDMA0, NO_IRQ},
90 .periphid = 0x00041330,
121 struct dma_pl330_platdata exynos4_pdma1_pdata = {
122 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
123 .peri_id = pdma1_peri,
126 struct amba_device exynos4_device_pdma1 = {
128 .init_name = "dma-pl330.1",
129 .dma_mask = &dma_dmamask,
130 .coherent_dma_mask = DMA_BIT_MASK(32),
131 .platform_data = &exynos4_pdma1_pdata,
134 .start = EXYNOS4_PA_PDMA1,
135 .end = EXYNOS4_PA_PDMA1 + SZ_4K,
136 .flags = IORESOURCE_MEM,
138 .irq = {IRQ_PDMA1, NO_IRQ},
139 .periphid = 0x00041330,
142 static int __init exynos4_dma_init(void)
144 if (of_have_populated_dt())
147 dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask);
148 dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask);
149 amba_device_register(&exynos4_device_pdma0, &iomem_resource);
151 dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask);
152 dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask);
153 amba_device_register(&exynos4_device_pdma1, &iomem_resource);
157 arch_initcall(exynos4_dma_init);