aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-22 08:50:59 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 03:00:54 -0400
commitd112f4e4e57cbcf81e5f04a0eba77804d14d8640 (patch)
tree97c8001c76e667e87dd1ee98c7c2741f08ff8255 /arch
parent2db6823773760412706168be6378eef30c29808b (diff)
ARM: imx: dynamically register imx-uart devices (imx1)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-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
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h24
7 files changed, 30 insertions, 57 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index c185ec3254ca..445ce10b8985 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -17,11 +17,13 @@ config ARCH_MX1ADS
17 bool "MX1ADS platform" 17 bool "MX1ADS platform"
18 select MACH_MXLADS 18 select MACH_MXLADS
19 select IMX_HAVE_PLATFORM_IMX_I2C 19 select IMX_HAVE_PLATFORM_IMX_I2C
20 select IMX_HAVE_PLATFORM_IMX_UART
20 help 21 help
21 Say Y here if you are using Motorola MX1ADS/MXLADS boards 22 Say Y here if you are using Motorola MX1ADS/MXLADS boards
22 23
23config MACH_SCB9328 24config MACH_SCB9328
24 bool "Synertronixx scb9328" 25 bool "Synertronixx scb9328"
26 select IMX_HAVE_PLATFORM_IMX_UART
25 help 27 help
26 Say Y here if you are using a Synertronixx scb9328 board 28 Say Y here if you are using a Synertronixx scb9328 board
27 29
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index a5cfe046deb4..a8d94f078196 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -11,3 +11,8 @@
11 11
12#define imx1_add_i2c_imx(pdata) \ 12#define imx1_add_i2c_imx(pdata) \
13 imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata) 13 imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata)
14
15#define imx1_add_imx_uart0(pdata) \
16 imx_add_imx_uart_3irq(0, MX1_UART1_BASE_ADDR, 0xd0, MX1_INT_UART1RX, MX1_INT_UART1TX, MX1_INT_UART1RTS, pdata)
17#define imx1_add_imx_uart1(pdata) \
18 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 84e6da6b8c0c..b4bf8fc80216 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 = {
70 .num_resources = ARRAY_SIZE(imx1_camera_resources), 70 .num_resources = ARRAY_SIZE(imx1_camera_resources),
71}; 71};
72 72
73#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \
74 static struct resource imx1_uart_resources ## n[] = { \
75 { \
76 .start = baseaddr, \
77 .end = baseaddr + 0xd0, \
78 .flags = IORESOURCE_MEM, \
79 }, { \
80 .start = irqrx, \
81 .end = irqrx, \
82 .flags = IORESOURCE_IRQ, \
83 }, { \
84 .start = irqtx, \
85 .end = irqtx, \
86 .flags = IORESOURCE_IRQ, \
87 }, { \
88 .start = irqrts, \
89 .end = irqrts, \
90 .flags = IORESOURCE_IRQ, \
91 }, \
92 }; \
93 \
94 struct platform_device imx1_uart_device ## n = { \
95 .name = "imx-uart", \
96 .id = n, \
97 .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \
98 .resource = imx1_uart_resources ## n, \
99 }
100
101DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
102DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
103
104static struct resource imx_rtc_resources[] = { 73static struct resource imx_rtc_resources[] = {
105 { 74 {
106 .start = 0x00204000, 75 .start = 0x00204000,
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index db995b156ee6..e56efbcb75d6 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -1,7 +1,5 @@
1#ifdef CONFIG_ARCH_MX1 1#ifdef CONFIG_ARCH_MX1
2extern struct platform_device imx1_camera_device; 2extern struct platform_device imx1_camera_device;
3extern struct platform_device imx1_uart_device0;
4extern struct platform_device imx1_uart_device1;
5extern struct platform_device imx_rtc_device; 3extern struct platform_device imx_rtc_device;
6extern struct platform_device imx_wdt_device; 4extern struct platform_device imx_wdt_device;
7extern struct platform_device imx_usb_device; 5extern 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 339d41ad19d5..77a760cfadc0 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -26,7 +26,6 @@
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/i2c.h> 28#include <mach/i2c.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux-mx1.h> 29#include <mach/iomux-mx1.h>
31#include <mach/irqs.h> 30#include <mach/irqs.h>
32 31
@@ -59,12 +58,12 @@ static int mx1ads_pins[] = {
59 * UARTs platform data 58 * UARTs platform data
60 */ 59 */
61 60
62static struct imxuart_platform_data uart_pdata[] = { 61static const struct imxuart_platform_data uart0_pdata __initconst = {
63 { 62 .flags = IMXUART_HAVE_RTSCTS,
64 .flags = IMXUART_HAVE_RTSCTS, 63};
65 }, { 64
66 .flags = IMXUART_HAVE_RTSCTS, 65static const struct imxuart_platform_data uart1_pdata __initconst = {
67 }, 66 .flags = IMXUART_HAVE_RTSCTS,
68}; 67};
69 68
70/* 69/*
@@ -122,8 +121,8 @@ static void __init mx1ads_init(void)
122 ARRAY_SIZE(mx1ads_pins), "mx1ads"); 121 ARRAY_SIZE(mx1ads_pins), "mx1ads");
123 122
124 /* UART */ 123 /* UART */
125 mxc_register_device(&imx1_uart_device0, &uart_pdata[0]); 124 imx1_add_imx_uart0(&uart0_pdata);
126 mxc_register_device(&imx1_uart_device1, &uart_pdata[1]); 125 imx1_add_imx_uart1(&uart1_pdata);
127 126
128 /* Physmap flash */ 127 /* Physmap flash */
129 mxc_register_device(&flash_device, &mx1ads_flash_data); 128 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 482b24df4624..88bf0d1e26e6 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -22,9 +22,9 @@
22#include <mach/common.h> 22#include <mach/common.h>
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/irqs.h> 24#include <mach/irqs.h>
25#include <mach/imx-uart.h>
26#include <mach/iomux-mx1.h> 25#include <mach/iomux-mx1.h>
27 26
27#include "devices-imx1.h"
28#include "devices.h" 28#include "devices.h"
29 29
30/* 30/*
@@ -114,7 +114,7 @@ static void uart1_mxc_exit(struct platform_device *pdev)
114 ARRAY_SIZE(mxc_uart1_pins)); 114 ARRAY_SIZE(mxc_uart1_pins));
115} 115}
116 116
117static struct imxuart_platform_data uart_pdata = { 117static const struct imxuart_platform_data uart_pdata __initconst = {
118 .init = uart1_mxc_init, 118 .init = uart1_mxc_init,
119 .exit = uart1_mxc_exit, 119 .exit = uart1_mxc_exit,
120 .flags = IMXUART_HAVE_RTSCTS, 120 .flags = IMXUART_HAVE_RTSCTS,
@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = {
130 */ 130 */
131static void __init scb9328_init(void) 131static void __init scb9328_init(void)
132{ 132{
133 mxc_register_device(&imx1_uart_device0, &uart_pdata); 133 imx1_add_imx_uart0(&uart_pdata);
134 134
135 printk(KERN_INFO"Scb9328: Adding devices\n"); 135 printk(KERN_INFO"Scb9328: Adding devices\n");
136 platform_add_devices(devices, ARRAY_SIZE(devices)); 136 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index e99c0b21e092..641b24618239 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -91,18 +91,18 @@
91#define MX1_SIM_DATA_INT 16 91#define MX1_SIM_DATA_INT 16
92#define MX1_RTC_INT 17 92#define MX1_RTC_INT 17
93#define MX1_RTC_SAMINT 18 93#define MX1_RTC_SAMINT 18
94#define MX1_UART2_MINT_PFERR 19 94#define MX1_INT_UART2PFERR 19
95#define MX1_UART2_MINT_RTS 20 95#define MX1_INT_UART2RTS 20
96#define MX1_UART2_MINT_DTR 21 96#define MX1_INT_UART2DTR 21
97#define MX1_UART2_MINT_UARTC 22 97#define MX1_INT_UART2UARTC 22
98#define MX1_UART2_MINT_TX 23 98#define MX1_INT_UART2TX 23
99#define MX1_UART2_MINT_RX 24 99#define MX1_INT_UART2RX 24
100#define MX1_UART1_MINT_PFERR 25 100#define MX1_INT_UART1PFERR 25
101#define MX1_UART1_MINT_RTS 26 101#define MX1_INT_UART1RTS 26
102#define MX1_UART1_MINT_DTR 27 102#define MX1_INT_UART1DTR 27
103#define MX1_UART1_MINT_UARTC 28 103#define MX1_INT_UART1UARTC 28
104#define MX1_UART1_MINT_TX 29 104#define MX1_INT_UART1TX 29
105#define MX1_UART1_MINT_RX 30 105#define MX1_INT_UART1RX 30
106#define MX1_VOICE_DAC_INT 31 106#define MX1_VOICE_DAC_INT 31
107#define MX1_VOICE_ADC_INT 32 107#define MX1_VOICE_ADC_INT 32
108#define MX1_PEN_DATA_INT 33 108#define MX1_PEN_DATA_INT 33