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-s5p64x0/dma.c
2  *
3  * Copyright (c) 2010 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 
30 #include <mach/map.h>
31 #include <mach/irqs.h>
32 #include <mach/regs-clock.h>
33 #include <mach/dma.h>
34 
35 #include <plat/cpu.h>
36 #include <plat/devs.h>
37 #include <plat/irqs.h>
38 
39 static u8 s5p6440_pdma_peri[] = {
48  DMACH_MAX,
49  DMACH_MAX,
56  DMACH_MAX,
57  DMACH_MAX,
58  DMACH_MAX,
59  DMACH_MAX,
62 };
63 
64 static struct dma_pl330_platdata s5p6440_pdma_pdata = {
65  .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri),
66  .peri_id = s5p6440_pdma_peri,
67 };
68 
69 static u8 s5p6450_pdma_peri[] = {
94  DMACH_MAX,
99  DMACH_PWM,
102 };
103 
104 static struct dma_pl330_platdata s5p6450_pdma_pdata = {
105  .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri),
106  .peri_id = s5p6450_pdma_peri,
107 };
108 
109 static AMBA_AHB_DEVICE(s5p64x0_pdma, "dma-pl330", 0x00041330,
111 
112 static int __init s5p64x0_dma_init(void)
113 {
114  if (soc_is_s5p6450()) {
115  dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask);
116  dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask);
117  s5p64x0_pdma_device.dev.platform_data = &s5p6450_pdma_pdata;
118  } else {
119  dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask);
120  dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask);
121  s5p64x0_pdma_device.dev.platform_data = &s5p6440_pdma_pdata;
122  }
123 
124  amba_device_register(&s5p64x0_pdma_device, &iomem_resource);
125 
126  return 0;
127 }
128 arch_initcall(s5p64x0_dma_init);