]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00143126-2 ARM: add DMA device for mx50
authorHuang Shijie <b32955@freescale.com>
Wed, 27 Apr 2011 02:29:31 +0000 (10:29 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:09:04 +0000 (14:09 +0200)
add dma device for mx50.

Signed-off-by: Huang Shijie <b32955@freescale.com>
arch/arm/mach-mx5/board-mx50_rdp.c
arch/arm/mach-mx5/clock_mx50.c
arch/arm/mach-mx5/devices-imx50.h
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/platform-dma.c [new file with mode: 0644]
arch/arm/plat-mxc/include/mach/devices-common.h

index bbaeef79029d7988b0e915f38e91138ad0ba44e5..759b128dcd45a157aa5f895d6cf28f09c5a4be7e 100755 (executable)
@@ -259,6 +259,7 @@ static void __init mx50_rdp_board_init(void)
 
        imx50_add_cspi(3, &mx50_rdp_spi_pdata);
 
+       imx50_add_dma();
        imx50_add_imx_uart(0, NULL);
        imx50_add_imx_uart(1, NULL);
        imx50_add_srtc();
index 48f9de5520790846fd8e0f92431f7463b5d996cd..ff3b0eb0f7717fdeb1d58f6cc9fb24a0d32c18bd 100755 (executable)
@@ -3332,7 +3332,7 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK(NULL, "dcp_clk", dcp_clk),
        _REGISTER_CLOCK(NULL, "ocotp_ctrl_apb", ocotp_clk),
        _REGISTER_CLOCK(NULL, "ocram_clk", ocram_clk),
-       _REGISTER_CLOCK(NULL, "apbh_dma_clk", apbh_dma_clk),
+       _REGISTER_CLOCK("mxs-dma-apbh", NULL, apbh_dma_clk),
        _REGISTER_CLOCK(NULL, "sys_clk", sys_clk),
        _REGISTER_CLOCK(NULL, "elcdif_pix", elcdif_pix_clk),
        _REGISTER_CLOCK(NULL, "display_axi", display_axi_clk),
index 18c9609e5789ecf734e495778929819ea68d3f80..cf8af0eefd6e18e955ea001a8f060225030a66e5 100755 (executable)
@@ -29,6 +29,9 @@ extern const struct imx_srtc_data imx50_imx_srtc_data __initconst;
 #define imx50_add_srtc()       \
        imx_add_srtc(&imx50_imx_srtc_data)
 
+extern const struct imx_dma_data imx50_dma_data __initconst;
+#define imx50_add_dma()        imx_add_dma(&imx50_dma_data);
+
 extern const struct imx_fec_data imx50_fec_data;
 #define imx50_add_fec(pdata)   \
        imx_add_fec(&imx50_fec_data, pdata)
index d3b1350037f4074770d09a168a22024fdcff0a35..b146fc1617be9182e68c7a62f945136067086ed1 100755 (executable)
@@ -1,3 +1,6 @@
+config IMX_HAVE_PLATFORM_DMA
+       bool
+
 config IMX_HAVE_PLATFORM_FEC
        bool
        default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
index e3dd8d8b75da6f40f9b08475319fde7c48b17020..149b6734b35030ffa2e0192f38a4367fea9e9122 100755 (executable)
@@ -1,3 +1,4 @@
+obj-$(CONFIG_IMX_HAVE_PLATFORM_DMA) += platform-dma.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
diff --git a/arch/arm/plat-mxc/devices/platform-dma.c b/arch/arm/plat-mxc/devices/platform-dma.c
new file mode 100644 (file)
index 0000000..7a73c23
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <linux/compiler.h>
+#include <linux/err.h>
+#include <linux/init.h>
+
+#include <mach/mx50.h>
+#include <mach/devices-common.h>
+
+#ifdef CONFIG_SOC_IMX50
+const struct imx_dma_data imx50_dma_data __initconst = {
+       .iobase = MX50_APBHDMA_BASE_ADDR,
+};
+#endif
+
+struct platform_device *__init imx_add_dma(
+                       const struct imx_dma_data *data)
+{
+       struct resource res[] = {
+               {
+                       .start = data->iobase,
+                       .end = data->iobase + SZ_8K - 1,
+                       .flags = IORESOURCE_MEM,
+               },
+       };
+
+       return imx_add_platform_device_dmamask("mxs-dma-apbh", -1,
+                               res, ARRAY_SIZE(res), NULL, 0,
+                               DMA_BIT_MASK(32));
+}
index 56f26ac3a45c66bc4579ecbe4a8b1aae42ab39a2..c62f7b763e7e8fb102a18b24801efdee245dcf4d 100755 (executable)
@@ -24,6 +24,11 @@ static inline struct platform_device *imx_add_platform_device(
                        name, id, res, num_resources, data, size_data, 0);
 }
 
+struct imx_dma_data {
+       resource_size_t iobase;
+};
+struct platform_device *__init imx_add_dma(const struct imx_dma_data *data);
+
 #include <linux/fec.h>
 struct imx_fec_data {
        resource_size_t iobase;