]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00142005-2 ARM: imx: Add LDB device
authorLily Zhang <r58066@freescale.com>
Thu, 14 Apr 2011 06:18:43 +0000 (14:18 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:32:46 +0000 (08:32 +0200)
Add LDB device into i.MX platform

Signed-off-by: Lily Zhang <r58066@freescale.com>
arch/arm/mach-mx5/Kconfig
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/platform-imx_ldb.c [new file with mode: 0644]
arch/arm/plat-mxc/include/mach/devices-common.h

index 1a1713c7ff5cbc85773374dac6b8fd48a3a402a1..af268be483ab31b3d9685585e5a4d616d9468e45 100755 (executable)
@@ -58,6 +58,7 @@ config        SOC_IMX53
        select IMX_HAVE_PLATFORM_IMX_DVFS
        select IMX_HAVE_PLATFORM_IMX_SSI
        select IMX_HAVE_PLATFORM_IMX_IIM
+       select IMX_HAVE_PLATFORM_LDB
 
 if ARCH_MX50_SUPPORTED
 #comment "i.MX50 machines:"
index e7149db9bf9a6b19ee1de1a2f1918ee7f4b160ad..f2ee8a5be730ed61a57a63c10eb2be4c18e01332 100755 (executable)
@@ -112,3 +112,6 @@ config IMX_HAVE_PLATFORM_RANDOM_RNGC
 
 config IMX_HAVE_PLATFORM_PERFMON
        bool
+
+config IMX_HAVE_PLATFORM_LDB
+       bool
index f7a3680a7aee36dd0c60c59795adcfca20954ca7..f18fd96618af35d225fe47c976f9f8ac698bbd24 100755 (executable)
@@ -36,4 +36,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_OCOTP) += platform-imx-ocotp.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_DCP) += platform-imx-dcp.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_RANDOM_RNGC) += platform-imx-rngb.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_PERFMON) += platform-imx-perfmon.o
-
+obj-$(CONFIG_IMX_HAVE_PLATFORM_LDB) += platform-imx_ldb.o
diff --git a/arch/arm/plat-mxc/devices/platform-imx_ldb.c b/arch/arm/plat-mxc/devices/platform-imx_ldb.c
new file mode 100644 (file)
index 0000000..93de74d
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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 as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <mach/hardware.h>
+#include <mach/devices-common.h>
+#include <linux/clk.h>
+
+#define imx_ldb_data_entry_single(soc, size)   \
+       {                                                               \
+               .iobase = soc ## _IOMUXC_BASE_ADDR,                     \
+               .iosize = size,                                         \
+       }
+
+#ifdef CONFIG_SOC_IMX53
+const struct imx_ldb_data imx53_ldb_data __initconst =
+                       imx_ldb_data_entry_single(MX53, SZ_4K);
+#endif
+
+struct platform_device *__init imx_add_ldb(
+               const struct imx_ldb_data *data,
+               struct fsl_mxc_ldb_platform_data *pdata)
+{
+       struct resource res[] = {
+               {
+                       .start = data->iobase,
+                       .end = data->iobase + data->iosize - 1,
+                       .flags = IORESOURCE_MEM,
+               },
+       };
+
+       return imx_add_platform_device("mxc_ldb", -1,
+                       res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
+}
+
index 24c91875e121e40d465d0f57192a40eb5bdbf16c..a5ee1dbc17559637a7b11b781ce40471ab36900f 100755 (executable)
@@ -378,6 +378,15 @@ struct imx_perfmon_data {
 
 struct platform_device *__init imx_add_perfmon(
                const struct imx_perfmon_data *data);
+
+struct imx_ldb_data {
+       resource_size_t iobase;
+       resource_size_t iosize;
+};
+
+struct platform_device *__init imx_add_ldb(
+       const struct imx_ldb_data *data,
+       struct fsl_mxc_ldb_platform_data *pdata);
 struct imx_perfmon_data {
        resource_size_t iobase;
        struct mxs_platform_perfmon_data *pdata;