aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2011-02-22 08:36:27 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-03-07 13:29:53 -0500
commit3baa4feeadf22ae72dad217f31ea739d881fc149 (patch)
tree5e7db774c15c1ec2d92300933aaa9efe1e7ffc90 /arch/arm/mach-mxs
parent4ca94366b314c22fda49cbe2c51ceb7bb3e16932 (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')
-rw-r--r--arch/arm/mach-mxs/clock-mx23.c3
-rw-r--r--arch/arm/mach-mxs/clock-mx28.c4
-rw-r--r--arch/arm/mach-mxs/devices/Makefile1
-rw-r--r--arch/arm/mach-mxs/devices/platform-dma.c49
4 files changed, 54 insertions, 3 deletions
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index 2415b33d79c0..d133c7f30940 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -444,7 +444,8 @@ static struct clk_lookup lookups[] = {
444 _REGISTER_CLOCK("duart", NULL, uart_clk) 444 _REGISTER_CLOCK("duart", NULL, uart_clk)
445 _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) 445 _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
446 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 446 _REGISTER_CLOCK("rtc", NULL, rtc_clk)
447 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 447 _REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
448 _REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
448 _REGISTER_CLOCK(NULL, "usb", usb_clk) 449 _REGISTER_CLOCK(NULL, "usb", usb_clk)
449 _REGISTER_CLOCK(NULL, "audio", audio_clk) 450 _REGISTER_CLOCK(NULL, "audio", audio_clk)
450 _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk) 451 _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 82770568845e..a350f9576019 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -616,8 +616,8 @@ static struct clk_lookup lookups[] = {
616 _REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk) 616 _REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
617 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 617 _REGISTER_CLOCK("rtc", NULL, rtc_clk)
618 _REGISTER_CLOCK("pll2", NULL, pll2_clk) 618 _REGISTER_CLOCK("pll2", NULL, pll2_clk)
619 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 619 _REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
620 _REGISTER_CLOCK(NULL, "xclk", xbus_clk) 620 _REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
621 _REGISTER_CLOCK("flexcan.0", NULL, can0_clk) 621 _REGISTER_CLOCK("flexcan.0", NULL, can0_clk)
622 _REGISTER_CLOCK("flexcan.1", NULL, can1_clk) 622 _REGISTER_CLOCK("flexcan.1", NULL, can1_clk)
623 _REGISTER_CLOCK(NULL, "usb0", usb0_clk) 623 _REGISTER_CLOCK(NULL, "usb0", usb0_clk)
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
index 39bd77348a42..0d9bea30b0a2 100644
--- a/arch/arm/mach-mxs/devices/Makefile
+++ b/arch/arm/mach-mxs/devices/Makefile
@@ -1,5 +1,6 @@
1obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o 1obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
2obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o 2obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o
3obj-y += platform-dma.o
3obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o 4obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
4obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o 5obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
5obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o 6obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o
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
16static 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
32static 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}
49arch_initcall(mxs_add_mxs_dma);