1 /* linux/arch/arm/mach-s5p64x0/dma.c
3 * Copyright (c) 2010 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>
28 #include <mach/irqs.h>
29 #include <mach/regs-clock.h>
31 #include <plat/devs.h>
32 #include <plat/s3c-pl330-pdata.h>
34 static u64 dma_dmamask
= DMA_BIT_MASK(32);
36 static struct resource s5p64x0_pdma_resource
[] = {
38 .start
= S5P64X0_PA_PDMA
,
39 .end
= S5P64X0_PA_PDMA
+ SZ_4K
,
40 .flags
= IORESOURCE_MEM
,
45 .flags
= IORESOURCE_IRQ
,
49 static struct s3c_pl330_platdata s5p6440_pdma_pdata
= {
86 static struct s3c_pl330_platdata s5p6450_pdma_pdata
= {
100 [12] = DMACH_I2S0_TX
,
101 [13] = DMACH_I2S0_RX
,
102 [14] = DMACH_SPI0_TX
,
103 [15] = DMACH_SPI0_RX
,
104 [16] = DMACH_PCM1_TX
,
105 [17] = DMACH_PCM1_RX
,
106 [18] = DMACH_PCM2_TX
,
107 [19] = DMACH_PCM2_RX
,
108 [20] = DMACH_SPI1_TX
,
109 [21] = DMACH_SPI1_RX
,
113 [25] = DMACH_I2S1_TX
,
114 [26] = DMACH_I2S1_RX
,
115 [27] = DMACH_I2S2_TX
,
116 [28] = DMACH_I2S2_RX
,
118 [30] = DMACH_UART5_RX
,
119 [31] = DMACH_UART5_TX
,
123 static struct platform_device s5p64x0_device_pdma
= {
126 .num_resources
= ARRAY_SIZE(s5p64x0_pdma_resource
),
127 .resource
= s5p64x0_pdma_resource
,
129 .dma_mask
= &dma_dmamask
,
130 .coherent_dma_mask
= DMA_BIT_MASK(32),
134 static int __init
s5p64x0_dma_init(void)
138 id
= __raw_readl(S5P64X0_SYS_ID
) & 0xFF000;
141 s5p64x0_device_pdma
.dev
.platform_data
= &s5p6450_pdma_pdata
;
143 s5p64x0_device_pdma
.dev
.platform_data
= &s5p6440_pdma_pdata
;
145 platform_device_register(&s5p64x0_device_pdma
);
149 arch_initcall(s5p64x0_dma_init
);