From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/8] ARM i.MX scb9328: create uart registration helpers and use them
Date: Thu, 28 Jul 2011 10:00:58 +0200 [thread overview]
Message-ID: <1311840062-11446-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1311840062-11446-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/scb9328/scb9328.c | 11 +++--------
arch/arm/mach-imx/include/mach/devices-imx1.h | 11 +++++++++++
2 files changed, 14 insertions(+), 8 deletions(-)
create mode 100644 arch/arm/mach-imx/include/mach/devices-imx1.h
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index d49eaff..cf72ef4 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <dm9000.h>
#include <led.h>
+#include <mach/devices-imx1.h>
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
@@ -120,20 +121,14 @@ static int scb9328_devices_init(void)
device_initcall(scb9328_devices_init);
-static struct device_d scb9328_serial_device = {
- .id = -1,
- .name = "imx_serial",
- .map_base = IMX_UART1_BASE,
- .size = 4096,
-};
-
static int scb9328_console_init(void)
{
/* init gpios for serial port */
imx_gpio_mode(PC11_PF_UART1_TXD);
imx_gpio_mode(PC12_PF_UART1_RXD);
- register_device(&scb9328_serial_device);
+ imx1_add_uart0();
+
return 0;
}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx1.h b/arch/arm/mach-imx/include/mach/devices-imx1.h
new file mode 100644
index 0000000..a45363f
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx1.h
@@ -0,0 +1,11 @@
+#include <mach/devices.h>
+
+static inline struct device_d *imx1_add_uart0(void)
+{
+ return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx1_add_uart1(void)
+{
+ return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-07-28 8:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
2011-07-28 8:00 ` [PATCH 1/8] ARM i.MX: add helper for usb device registration Sascha Hauer
2011-07-28 8:00 ` [PATCH 2/8] ARM i.MX cupid: use device registration helpers Sascha Hauer
2011-07-28 8:00 ` [PATCH 3/8] ARM i.MX pca100: " Sascha Hauer
2011-07-28 8:00 ` Sascha Hauer [this message]
2011-07-28 8:00 ` [PATCH 5/8] ARM i.MX35 3stack: " Sascha Hauer
2011-07-28 8:01 ` [PATCH 6/8] ARM i.MX21ads : " Sascha Hauer
2011-07-28 8:01 ` [PATCH 7/8] ARM i.MX pcm037: " Sascha Hauer
2011-07-28 8:01 ` [PATCH 8/8] add a ns16550 registration helper and use it Sascha Hauer
2011-07-28 8:28 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311840062-11446-5-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox