Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dma.c
Go to the documentation of this file.
1 /* linux/arch/arm/mach-s5pv210/dma.c
2  *
3  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4  * http://www.samsung.com
5  *
6  * Copyright (C) 2010 Samsung Electronics Co. Ltd.
7  * Jaswinder Singh <[email protected]>
8  *
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.
13  *
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.
18  *
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.
22  */
23 
24 #include <linux/dma-mapping.h>
25 #include <linux/amba/bus.h>
26 #include <linux/amba/pl330.h>
27 
28 #include <asm/irq.h>
29 #include <plat/devs.h>
30 #include <plat/irqs.h>
31 
32 #include <mach/map.h>
33 #include <mach/irqs.h>
34 #include <mach/dma.h>
35 
36 static u8 pdma0_peri[] = {
45  DMACH_MAX,
51  DMACH_MAX,
52  DMACH_MAX,
57  DMACH_MAX,
58  DMACH_MAX,
62  DMACH_MAX,
63  DMACH_PWM,
65 };
66 
67 static struct dma_pl330_platdata s5pv210_pdma0_pdata = {
68  .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
69  .peri_id = pdma0_peri,
70 };
71 
72 static AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330,
73  S5PV210_PA_PDMA0, {IRQ_PDMA0}, &s5pv210_pdma0_pdata);
74 
75 static u8 pdma1_peri[] = {
84  DMACH_MAX,
96  DMACH_MAX,
97  DMACH_MAX,
108 };
109 
110 static struct dma_pl330_platdata s5pv210_pdma1_pdata = {
111  .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
112  .peri_id = pdma1_peri,
113 };
114 
115 static AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330,
116  S5PV210_PA_PDMA1, {IRQ_PDMA1}, &s5pv210_pdma1_pdata);
117 
118 static int __init s5pv210_dma_init(void)
119 {
120  dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask);
121  dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask);
122  amba_device_register(&s5pv210_pdma0_device, &iomem_resource);
123 
124  dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask);
125  dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask);
126  amba_device_register(&s5pv210_pdma1_device, &iomem_resource);
127 
128  return 0;
129 }
130 arch_initcall(s5pv210_dma_init);