aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/devices
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mxs/devices')
-rw-r--r--arch/arm/mach-mxs/devices/Kconfig3
-rw-r--r--arch/arm/mach-mxs/devices/Makefile2
-rw-r--r--arch/arm/mach-mxs/devices/amba-duart.c40
-rw-r--r--arch/arm/mach-mxs/devices/platform-duart.c48
-rw-r--r--arch/arm/mach-mxs/devices/platform-fec.c2
5 files changed, 44 insertions, 51 deletions
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig
index a35a2dc55395..cf7dc1ae575b 100644
--- a/arch/arm/mach-mxs/devices/Kconfig
+++ b/arch/arm/mach-mxs/devices/Kconfig
@@ -1,5 +1,6 @@
1config MXS_HAVE_PLATFORM_DUART 1config MXS_HAVE_AMBA_DUART
2 bool 2 bool
3 select ARM_AMBA
3 4
4config MXS_HAVE_PLATFORM_FEC 5config MXS_HAVE_PLATFORM_FEC
5 bool 6 bool
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
index 4b5266a3e6d9..d0a09f6934b8 100644
--- a/arch/arm/mach-mxs/devices/Makefile
+++ b/arch/arm/mach-mxs/devices/Makefile
@@ -1,2 +1,2 @@
1obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o 1obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
2obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o 2obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
diff --git a/arch/arm/mach-mxs/devices/amba-duart.c b/arch/arm/mach-mxs/devices/amba-duart.c
new file mode 100644
index 000000000000..a559db09b49c
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/amba-duart.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11#include <asm/irq.h>
12#include <mach/mx23.h>
13#include <mach/mx28.h>
14#include <mach/devices-common.h>
15
16#define MXS_AMBA_DUART_DEVICE(name, soc) \
17const struct amba_device name##_device __initconst = { \
18 .dev = { \
19 .init_name = "duart", \
20 }, \
21 .res = { \
22 .start = soc ## _DUART_BASE_ADDR, \
23 .end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1, \
24 .flags = IORESOURCE_MEM, \
25 }, \
26 .irq = {soc ## _INT_DUART, NO_IRQ}, \
27}
28
29#ifdef CONFIG_SOC_IMX23
30MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);
31#endif
32
33#ifdef CONFIG_SOC_IMX28
34MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
35#endif
36
37int __init mxs_add_duart(const struct amba_device *dev)
38{
39 return mxs_add_amba_device(dev);
40}
diff --git a/arch/arm/mach-mxs/devices/platform-duart.c b/arch/arm/mach-mxs/devices/platform-duart.c
deleted file mode 100644
index 2fe0df5b0aad..000000000000
--- a/arch/arm/mach-mxs/devices/platform-duart.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11#include <mach/mx23.h>
12#include <mach/mx28.h>
13#include <mach/devices-common.h>
14
15#define mxs_duart_data_entry(soc) \
16 { \
17 .iobase = soc ## _DUART_BASE_ADDR, \
18 .irq = soc ## _INT_DUART, \
19 }
20
21#ifdef CONFIG_SOC_IMX23
22const struct mxs_duart_data mx23_duart_data __initconst =
23 mxs_duart_data_entry(MX23);
24#endif
25
26#ifdef CONFIG_SOC_IMX28
27const struct mxs_duart_data mx28_duart_data __initconst =
28 mxs_duart_data_entry(MX28);
29#endif
30
31struct platform_device *__init mxs_add_duart(
32 const struct mxs_duart_data *data)
33{
34 struct resource res[] = {
35 {
36 .start = data->iobase,
37 .end = data->iobase + SZ_8K - 1,
38 .flags = IORESOURCE_MEM,
39 }, {
40 .start = data->irq,
41 .end = data->irq,
42 .flags = IORESOURCE_IRQ,
43 },
44 };
45
46 return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res),
47 NULL, 0);
48}
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
index c08168cf3dec..c42dff72b46c 100644
--- a/arch/arm/mach-mxs/devices/platform-fec.c
+++ b/arch/arm/mach-mxs/devices/platform-fec.c
@@ -45,6 +45,6 @@ struct platform_device *__init mxs_add_fec(
45 }, 45 },
46 }; 46 };
47 47
48 return mxs_add_platform_device("fec", data->id, 48 return mxs_add_platform_device("imx28-fec", data->id,
49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
50} 50}