diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2011-02-22 08:36:27 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-03-07 13:29:53 -0500 |
commit | 3baa4feeadf22ae72dad217f31ea739d881fc149 (patch) | |
tree | 5e7db774c15c1ec2d92300933aaa9efe1e7ffc90 /arch/arm/mach-mxs/devices/platform-dma.c | |
parent | 4ca94366b314c22fda49cbe2c51ceb7bb3e16932 (diff) |
ARM: mxs: add dma device
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs/devices/platform-dma.c')
-rw-r--r-- | arch/arm/mach-mxs/devices/platform-dma.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c new file mode 100644 index 000000000000..295c4424d5d9 --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-dma.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | #include <linux/compiler.h> | ||
9 | #include <linux/err.h> | ||
10 | #include <linux/init.h> | ||
11 | |||
12 | #include <mach/mx23.h> | ||
13 | #include <mach/mx28.h> | ||
14 | #include <mach/devices-common.h> | ||
15 | |||
16 | static struct platform_device *__init mxs_add_dma(const char *devid, | ||
17 | resource_size_t base) | ||
18 | { | ||
19 | struct resource res[] = { | ||
20 | { | ||
21 | .start = base, | ||
22 | .end = base + SZ_8K - 1, | ||
23 | .flags = IORESOURCE_MEM, | ||
24 | } | ||
25 | }; | ||
26 | |||
27 | return mxs_add_platform_device_dmamask(devid, -1, | ||
28 | res, ARRAY_SIZE(res), NULL, 0, | ||
29 | DMA_BIT_MASK(32)); | ||
30 | } | ||
31 | |||
32 | static int __init mxs_add_mxs_dma(void) | ||
33 | { | ||
34 | char *apbh = "mxs-dma-apbh"; | ||
35 | char *apbx = "mxs-dma-apbx"; | ||
36 | |||
37 | if (cpu_is_mx23()) { | ||
38 | mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR); | ||
39 | mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR); | ||
40 | } | ||
41 | |||
42 | if (cpu_is_mx28()) { | ||
43 | mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR); | ||
44 | mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR); | ||
45 | } | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | arch_initcall(mxs_add_mxs_dma); | ||