summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-22 14:50:59 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 09:00:54 +0200
commitd112f4e4e57cbcf81e5f04a0eba77804d14d8640 (patch)
tree97c8001c76e667e87dd1ee98c7c2741f08ff8255 /arch/arm/mach-imx
parent2db6823773760412706168be6378eef30c29808b (diff)
downloadlinux-3.10-d112f4e4e57cbcf81e5f04a0eba77804d14d8640.tar.gz
linux-3.10-d112f4e4e57cbcf81e5f04a0eba77804d14d8640.tar.bz2
linux-3.10-d112f4e4e57cbcf81e5f04a0eba77804d14d8640.zip
ARM: imx: dynamically register imx-uart devices (imx1)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/devices-imx1.h5
-rw-r--r--arch/arm/mach-imx/devices.c31
-rw-r--r--arch/arm/mach-imx/devices.h2
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c17
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c6
6 files changed, 18 insertions, 45 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index c185ec3254c..445ce10b898 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -17,11 +17,13 @@ config ARCH_MX1ADS
bool "MX1ADS platform"
select MACH_MXLADS
select IMX_HAVE_PLATFORM_IMX_I2C
+ select IMX_HAVE_PLATFORM_IMX_UART
help
Say Y here if you are using Motorola MX1ADS/MXLADS boards
config MACH_SCB9328
bool "Synertronixx scb9328"
+ select IMX_HAVE_PLATFORM_IMX_UART
help
Say Y here if you are using a Synertronixx scb9328 board
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index a5cfe046deb..a8d94f07819 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -11,3 +11,8 @@
#define imx1_add_i2c_imx(pdata) \
imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata)
+
+#define imx1_add_imx_uart0(pdata) \
+ imx_add_imx_uart_3irq(0, MX1_UART1_BASE_ADDR, 0xd0, MX1_INT_UART1RX, MX1_INT_UART1TX, MX1_INT_UART1RTS, pdata)
+#define imx1_add_imx_uart1(pdata) \
+ imx_add_imx_uart_3irq(0, MX1_UART2_BASE_ADDR, 0xd0, MX1_INT_UART2RX, MX1_INT_UART2TX, MX1_INT_UART2RTS, pdata)
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index 84e6da6b8c0..b4bf8fc8021 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -70,37 +70,6 @@ struct platform_device imx1_camera_device = {
.num_resources = ARRAY_SIZE(imx1_camera_resources),
};
-#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \
- static struct resource imx1_uart_resources ## n[] = { \
- { \
- .start = baseaddr, \
- .end = baseaddr + 0xd0, \
- .flags = IORESOURCE_MEM, \
- }, { \
- .start = irqrx, \
- .end = irqrx, \
- .flags = IORESOURCE_IRQ, \
- }, { \
- .start = irqtx, \
- .end = irqtx, \
- .flags = IORESOURCE_IRQ, \
- }, { \
- .start = irqrts, \
- .end = irqrts, \
- .flags = IORESOURCE_IRQ, \
- }, \
- }; \
- \
- struct platform_device imx1_uart_device ## n = { \
- .name = "imx-uart", \
- .id = n, \
- .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \
- .resource = imx1_uart_resources ## n, \
- }
-
-DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
-DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
-
static struct resource imx_rtc_resources[] = {
{
.start = 0x00204000,
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index db995b156ee..e56efbcb75d 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -1,7 +1,5 @@
#ifdef CONFIG_ARCH_MX1
extern struct platform_device imx1_camera_device;
-extern struct platform_device imx1_uart_device0;
-extern struct platform_device imx1_uart_device1;
extern struct platform_device imx_rtc_device;
extern struct platform_device imx_wdt_device;
extern struct platform_device imx_usb_device;
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 339d41ad19d..77a760cfadc 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -26,7 +26,6 @@
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/i2c.h>
-#include <mach/imx-uart.h>
#include <mach/iomux-mx1.h>
#include <mach/irqs.h>
@@ -59,12 +58,12 @@ static int mx1ads_pins[] = {
* UARTs platform data
*/
-static struct imxuart_platform_data uart_pdata[] = {
- {
- .flags = IMXUART_HAVE_RTSCTS,
- }, {
- .flags = IMXUART_HAVE_RTSCTS,
- },
+static const struct imxuart_platform_data uart0_pdata __initconst = {
+ .flags = IMXUART_HAVE_RTSCTS,
+};
+
+static const struct imxuart_platform_data uart1_pdata __initconst = {
+ .flags = IMXUART_HAVE_RTSCTS,
};
/*
@@ -122,8 +121,8 @@ static void __init mx1ads_init(void)
ARRAY_SIZE(mx1ads_pins), "mx1ads");
/* UART */
- mxc_register_device(&imx1_uart_device0, &uart_pdata[0]);
- mxc_register_device(&imx1_uart_device1, &uart_pdata[1]);
+ imx1_add_imx_uart0(&uart0_pdata);
+ imx1_add_imx_uart1(&uart1_pdata);
/* Physmap flash */
mxc_register_device(&flash_device, &mx1ads_flash_data);
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index 482b24df462..88bf0d1e26e 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -22,9 +22,9 @@
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
-#include <mach/imx-uart.h>
#include <mach/iomux-mx1.h>
+#include "devices-imx1.h"
#include "devices.h"
/*
@@ -114,7 +114,7 @@ static void uart1_mxc_exit(struct platform_device *pdev)
ARRAY_SIZE(mxc_uart1_pins));
}
-static struct imxuart_platform_data uart_pdata = {
+static const struct imxuart_platform_data uart_pdata __initconst = {
.init = uart1_mxc_init,
.exit = uart1_mxc_exit,
.flags = IMXUART_HAVE_RTSCTS,
@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = {
*/
static void __init scb9328_init(void)
{
- mxc_register_device(&imx1_uart_device0, &uart_pdata);
+ imx1_add_imx_uart0(&uart_pdata);
printk(KERN_INFO"Scb9328: Adding devices\n");
platform_add_devices(devices, ARRAY_SIZE(devices));