summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/devices/amba-duart.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2011-01-04 14:20:52 +0800
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-12 14:47:15 +0100
commitdbc4245bb520580fc1b01105727fde7d7cbe452d (patch)
tree993aa43d0831ddb9a981640a9bf48bb92e8e78bf /arch/arm/mach-mxs/devices/amba-duart.c
parent48f76ed1cc034c682666c43815fd0ef27c2a7215 (diff)
downloadop-kernel-dev-dbc4245bb520580fc1b01105727fde7d7cbe452d.zip
op-kernel-dev-dbc4245bb520580fc1b01105727fde7d7cbe452d.tar.gz
ARM: mxs: Change duart device to use amba-pl011
The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs. Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs/devices/amba-duart.c')
-rw-r--r--arch/arm/mach-mxs/devices/amba-duart.c40
1 files changed, 40 insertions, 0 deletions
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 0000000..a559db0
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/amba-duart.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010 Pengutronix
+ * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
+ *
+ * Copyright 2010 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 <asm/irq.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+#define MXS_AMBA_DUART_DEVICE(name, soc) \
+const struct amba_device name##_device __initconst = { \
+ .dev = { \
+ .init_name = "duart", \
+ }, \
+ .res = { \
+ .start = soc ## _DUART_BASE_ADDR, \
+ .end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1, \
+ .flags = IORESOURCE_MEM, \
+ }, \
+ .irq = {soc ## _INT_DUART, NO_IRQ}, \
+}
+
+#ifdef CONFIG_SOC_IMX23
+MXS_AMBA_DUART_DEVICE(mx23_duart, MX23);
+#endif
+
+#ifdef CONFIG_SOC_IMX28
+MXS_AMBA_DUART_DEVICE(mx28_duart, MX28);
+#endif
+
+int __init mxs_add_duart(const struct amba_device *dev)
+{
+ return mxs_add_amba_device(dev);
+}
OpenPOWER on IntegriCloud