aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-23 05:46:16 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 03:00:58 -0400
commit16cf5c41514fd94ff1e8b6be091e4b4732688fa6 (patch)
treeb6c14199c6bac7a174c22a3d05eb48689a81df47 /arch/arm
parentd5dac4a69fe571ec12d999174e0425f2641325d4 (diff)
ARM: imx: dynamically register imx-uart devices (imx31)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx3/Kconfig9
-rw-r--r--arch/arm/mach-mx3/devices-imx31.h11
-rw-r--r--arch/arm/mach-mx3/devices.c43
-rw-r--r--arch/arm/mach-mx3/devices.h5
-rw-r--r--arch/arm/mach-mx3/mach-armadillo5x0.c7
-rw-r--r--arch/arm/mach-mx3/mach-kzm_arm11_01.c9
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c5
-rw-r--r--arch/arm/mach-mx3/mach-mx31ads.c5
-rw-r--r--arch/arm/mach-mx3/mach-mx31lite.c1
-rw-r--r--arch/arm/mach-mx3/mach-mx31moboard.c10
-rw-r--r--arch/arm/mach-mx3/mach-pcm037.c10
-rw-r--r--arch/arm/mach-mx3/mach-qong.c9
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c10
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c5
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c6
-rw-r--r--arch/arm/mach-mx3/mx31moboard-smartbot.c7
16 files changed, 62 insertions, 90 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index a8018e8edb01..7f2d5a6a8e20 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -16,6 +16,7 @@ config MACH_MX31ADS
16 bool "Support MX31ADS platforms" 16 bool "Support MX31ADS platforms"
17 select ARCH_MX31 17 select ARCH_MX31
18 select IMX_HAVE_PLATFORM_IMX_I2C 18 select IMX_HAVE_PLATFORM_IMX_I2C
19 select IMX_HAVE_PLATFORM_IMX_UART
19 default y 20 default y
20 help 21 help
21 Include support for MX31ADS platform. This includes specific 22 Include support for MX31ADS platform. This includes specific
@@ -36,6 +37,7 @@ config MACH_PCM037
36 bool "Support Phytec pcm037 (i.MX31) platforms" 37 bool "Support Phytec pcm037 (i.MX31) platforms"
37 select ARCH_MX31 38 select ARCH_MX31
38 select IMX_HAVE_PLATFORM_IMX_I2C 39 select IMX_HAVE_PLATFORM_IMX_I2C
40 select IMX_HAVE_PLATFORM_IMX_UART
39 select IMX_HAVE_PLATFORM_MXC_NAND 41 select IMX_HAVE_PLATFORM_MXC_NAND
40 select MXC_ULPI if USB_ULPI 42 select MXC_ULPI if USB_ULPI
41 help 43 help
@@ -55,6 +57,7 @@ config MACH_MX31LITE
55 bool "Support MX31 LITEKIT (LogicPD)" 57 bool "Support MX31 LITEKIT (LogicPD)"
56 select ARCH_MX31 58 select ARCH_MX31
57 select MXC_ULPI if USB_ULPI 59 select MXC_ULPI if USB_ULPI
60 select IMX_HAVE_PLATFORM_IMX_UART
58 select IMX_HAVE_PLATFORM_MXC_NAND 61 select IMX_HAVE_PLATFORM_MXC_NAND
59 select IMX_HAVE_PLATFORM_SPI_IMX 62 select IMX_HAVE_PLATFORM_SPI_IMX
60 help 63 help
@@ -64,6 +67,7 @@ config MACH_MX31LITE
64config MACH_MX31_3DS 67config MACH_MX31_3DS
65 bool "Support MX31PDK (3DS)" 68 bool "Support MX31PDK (3DS)"
66 select ARCH_MX31 69 select ARCH_MX31
70 select IMX_HAVE_PLATFORM_IMX_UART
67 select IMX_HAVE_PLATFORM_MXC_NAND 71 select IMX_HAVE_PLATFORM_MXC_NAND
68 select IMX_HAVE_PLATFORM_SPI_IMX 72 select IMX_HAVE_PLATFORM_SPI_IMX
69 help 73 help
@@ -83,6 +87,7 @@ config MACH_MX31MOBOARD
83 bool "Support mx31moboard platforms (EPFL Mobots group)" 87 bool "Support mx31moboard platforms (EPFL Mobots group)"
84 select ARCH_MX31 88 select ARCH_MX31
85 select IMX_HAVE_PLATFORM_IMX_I2C 89 select IMX_HAVE_PLATFORM_IMX_I2C
90 select IMX_HAVE_PLATFORM_IMX_UART
86 select IMX_HAVE_PLATFORM_SPI_IMX 91 select IMX_HAVE_PLATFORM_SPI_IMX
87 select MXC_ULPI if USB_ULPI 92 select MXC_ULPI if USB_ULPI
88 help 93 help
@@ -92,6 +97,7 @@ config MACH_MX31MOBOARD
92config MACH_MX31LILLY 97config MACH_MX31LILLY
93 bool "Support MX31 LILLY-1131 platforms (INCO startec)" 98 bool "Support MX31 LILLY-1131 platforms (INCO startec)"
94 select ARCH_MX31 99 select ARCH_MX31
100 select IMX_HAVE_PLATFORM_IMX_UART
95 select IMX_HAVE_PLATFORM_SPI_IMX 101 select IMX_HAVE_PLATFORM_SPI_IMX
96 select MXC_ULPI if USB_ULPI 102 select MXC_ULPI if USB_ULPI
97 help 103 help
@@ -101,6 +107,7 @@ config MACH_MX31LILLY
101config MACH_QONG 107config MACH_QONG
102 bool "Support Dave/DENX QongEVB-LITE platform" 108 bool "Support Dave/DENX QongEVB-LITE platform"
103 select ARCH_MX31 109 select ARCH_MX31
110 select IMX_HAVE_PLATFORM_IMX_UART
104 help 111 help
105 Include support for Dave/DENX QongEVB-LITE platform. This includes 112 Include support for Dave/DENX QongEVB-LITE platform. This includes
106 specific configurations for the board and its peripherals. 113 specific configurations for the board and its peripherals.
@@ -119,6 +126,7 @@ config MACH_ARMADILLO5X0
119 bool "Support Atmark Armadillo-500 Development Base Board" 126 bool "Support Atmark Armadillo-500 Development Base Board"
120 select ARCH_MX31 127 select ARCH_MX31
121 select IMX_HAVE_PLATFORM_IMX_I2C 128 select IMX_HAVE_PLATFORM_IMX_I2C
129 select IMX_HAVE_PLATFORM_IMX_UART
122 select IMX_HAVE_PLATFORM_MXC_NAND 130 select IMX_HAVE_PLATFORM_MXC_NAND
123 select MXC_ULPI if USB_ULPI 131 select MXC_ULPI if USB_ULPI
124 help 132 help
@@ -136,6 +144,7 @@ config MACH_MX35_3DS
136config MACH_KZM_ARM11_01 144config MACH_KZM_ARM11_01
137 bool "Support KZM-ARM11-01(Kyoto Microcomputer)" 145 bool "Support KZM-ARM11-01(Kyoto Microcomputer)"
138 select ARCH_MX31 146 select ARCH_MX31
147 select IMX_HAVE_PLATFORM_IMX_UART
139 help 148 help
140 Include support for KZM-ARM11-01. This includes specific 149 Include support for KZM-ARM11-01. This includes specific
141 configurations for the board and its peripherals. 150 configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h
index 1cf96caf8265..3b1a44a20585 100644
--- a/arch/arm/mach-mx3/devices-imx31.h
+++ b/arch/arm/mach-mx3/devices-imx31.h
@@ -16,6 +16,17 @@
16#define imx31_add_imx_i2c2(pdata) \ 16#define imx31_add_imx_i2c2(pdata) \
17 imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata) 17 imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata)
18 18
19#define imx31_add_imx_uart0(pdata) \
20 imx_add_imx_uart_1irq(0, MX31_UART1_BASE_ADDR, SZ_16K, MX31_INT_UART1, pdata)
21#define imx31_add_imx_uart1(pdata) \
22 imx_add_imx_uart_1irq(1, MX31_UART2_BASE_ADDR, SZ_16K, MX31_INT_UART2, pdata)
23#define imx31_add_imx_uart2(pdata) \
24 imx_add_imx_uart_1irq(2, MX31_UART3_BASE_ADDR, SZ_16K, MX31_INT_UART3, pdata)
25#define imx31_add_imx_uart3(pdata) \
26 imx_add_imx_uart_1irq(3, MX31_UART4_BASE_ADDR, SZ_16K, MX31_INT_UART4, pdata)
27#define imx31_add_imx_uart4(pdata) \
28 imx_add_imx_uart_1irq(4, MX31_UART5_BASE_ADDR, SZ_16K, MX31_INT_UART5, pdata)
29
19#define imx31_add_mxc_nand(pdata) \ 30#define imx31_add_mxc_nand(pdata) \
20 imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata) 31 imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata)
21 32
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index dd90ee9a0d63..5b428626c05a 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -25,11 +25,11 @@
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/irqs.h> 26#include <mach/irqs.h>
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/imx-uart.h>
29#include <mach/mx3_camera.h> 28#include <mach/mx3_camera.h>
30 29
31#include "devices.h" 30#include "devices.h"
32 31
32#if defined(CONFIG_ARCH_MX35)
33static struct resource uart0[] = { 33static struct resource uart0[] = {
34 { 34 {
35 .start = UART1_BASE_ADDR, 35 .start = UART1_BASE_ADDR,
@@ -86,46 +86,7 @@ struct platform_device mxc_uart_device2 = {
86 .resource = uart2, 86 .resource = uart2,
87 .num_resources = ARRAY_SIZE(uart2), 87 .num_resources = ARRAY_SIZE(uart2),
88}; 88};
89 89#endif
90#ifdef CONFIG_ARCH_MX31
91static struct resource uart3[] = {
92 {
93 .start = UART4_BASE_ADDR,
94 .end = UART4_BASE_ADDR + 0x0B5,
95 .flags = IORESOURCE_MEM,
96 }, {
97 .start = MXC_INT_UART4,
98 .end = MXC_INT_UART4,
99 .flags = IORESOURCE_IRQ,
100 },
101};
102
103struct platform_device mxc_uart_device3 = {
104 .name = "imx-uart",
105 .id = 3,
106 .resource = uart3,
107 .num_resources = ARRAY_SIZE(uart3),
108};
109
110static struct resource uart4[] = {
111 {
112 .start = UART5_BASE_ADDR,
113 .end = UART5_BASE_ADDR + 0x0B5,
114 .flags = IORESOURCE_MEM,
115 }, {
116 .start = MXC_INT_UART5,
117 .end = MXC_INT_UART5,
118 .flags = IORESOURCE_IRQ,
119 },
120};
121
122struct platform_device mxc_uart_device4 = {
123 .name = "imx-uart",
124 .id = 4,
125 .resource = uart4,
126 .num_resources = ARRAY_SIZE(uart4),
127};
128#endif /* CONFIG_ARCH_MX31 */
129 90
130/* GPIO port description */ 91/* GPIO port description */
131static struct mxc_gpio_port imx_gpio_ports[] = { 92static struct mxc_gpio_port imx_gpio_ports[] = {
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 9380cd998278..5a156f1d3282 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -1,9 +1,8 @@
1 1#if defined(CONFIG_ARCH_MX35)
2extern struct platform_device mxc_uart_device0; 2extern struct platform_device mxc_uart_device0;
3extern struct platform_device mxc_uart_device1; 3extern struct platform_device mxc_uart_device1;
4extern struct platform_device mxc_uart_device2; 4extern struct platform_device mxc_uart_device2;
5extern struct platform_device mxc_uart_device3; 5#endif
6extern struct platform_device mxc_uart_device4;
7extern struct platform_device mxc_w1_master_device; 6extern struct platform_device mxc_w1_master_device;
8extern struct platform_device mx3_ipu; 7extern struct platform_device mx3_ipu;
9extern struct platform_device mx3_fb; 8extern struct platform_device mx3_fb;
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c
index 423ffe774ead..96aadcadb4ff 100644
--- a/arch/arm/mach-mx3/mach-armadillo5x0.c
+++ b/arch/arm/mach-mx3/mach-armadillo5x0.c
@@ -48,7 +48,6 @@
48#include <asm/mach/map.h> 48#include <asm/mach/map.h>
49 49
50#include <mach/common.h> 50#include <mach/common.h>
51#include <mach/imx-uart.h>
52#include <mach/iomux-mx3.h> 51#include <mach/iomux-mx3.h>
53#include <mach/mmc.h> 52#include <mach/mmc.h>
54#include <mach/ipu.h> 53#include <mach/ipu.h>
@@ -493,7 +492,7 @@ static struct platform_device armadillo5x0_smc911x_device = {
493}; 492};
494 493
495/* UART device data */ 494/* UART device data */
496static struct imxuart_platform_data uart_pdata = { 495static const struct imxuart_platform_data uart_pdata __initconst = {
497 .flags = IMXUART_HAVE_RTSCTS, 496 .flags = IMXUART_HAVE_RTSCTS,
498}; 497};
499 498
@@ -514,8 +513,8 @@ static void __init armadillo5x0_init(void)
514 imx31_add_imx_i2c1(NULL); 513 imx31_add_imx_i2c1(NULL);
515 514
516 /* Register UART */ 515 /* Register UART */
517 mxc_register_device(&mxc_uart_device0, &uart_pdata); 516 imx31_add_imx_uart0(&uart_pdata);
518 mxc_register_device(&mxc_uart_device1, &uart_pdata); 517 imx31_add_imx_uart1(&uart_pdata);
519 518
520 /* SMSC9118 IRQ pin */ 519 /* SMSC9118 IRQ pin */
521 gpio_direction_input(MX31_PIN_GPIO1_0); 520 gpio_direction_input(MX31_PIN_GPIO1_0);
diff --git a/arch/arm/mach-mx3/mach-kzm_arm11_01.c b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
index 11291400ee58..5b23e416d6c7 100644
--- a/arch/arm/mach-mx3/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
@@ -35,10 +35,10 @@
35 35
36#include <mach/clock.h> 36#include <mach/clock.h>
37#include <mach/common.h> 37#include <mach/common.h>
38#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 38#include <mach/iomux-mx3.h>
40#include <mach/memory.h> 39#include <mach/memory.h>
41 40
41#include "devices-imx31.h"
42#include "devices.h" 42#include "devices.h"
43 43
44#define KZM_ARM11_IO_ADDRESS(x) ( \ 44#define KZM_ARM11_IO_ADDRESS(x) ( \
@@ -185,15 +185,14 @@ static inline int kzm_init_smsc9118(void)
185#endif 185#endif
186 186
187#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) 187#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
188static struct imxuart_platform_data uart_pdata = { 188static const struct imxuart_platform_data uart_pdata __initconst = {
189 .flags = IMXUART_HAVE_RTSCTS, 189 .flags = IMXUART_HAVE_RTSCTS,
190}; 190};
191 191
192static void __init kzm_init_imx_uart(void) 192static void __init kzm_init_imx_uart(void)
193{ 193{
194 mxc_register_device(&mxc_uart_device0, &uart_pdata); 194 imx31_add_imx_uart0(&uart_pdata);
195 195 imx31_add_imx_uart1(&uart_pdata);
196 mxc_register_device(&mxc_uart_device1, &uart_pdata);
197} 196}
198#else 197#else
199static inline void kzm_init_imx_uart(void) 198static inline void kzm_init_imx_uart(void)
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 2aa3e581e840..4c021c590306 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -33,7 +33,6 @@
33#include <asm/memory.h> 33#include <asm/memory.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/imx-uart.h>
37#include <mach/iomux-mx3.h> 36#include <mach/iomux-mx3.h>
38 37
39#include "devices-imx31.h" 38#include "devices-imx31.h"
@@ -233,7 +232,7 @@ static struct fsl_usb2_platform_data usbotg_pdata = {
233 .phy_mode = FSL_USB2_PHY_ULPI, 232 .phy_mode = FSL_USB2_PHY_ULPI,
234}; 233};
235 234
236static struct imxuart_platform_data uart_pdata = { 235static const struct imxuart_platform_data uart_pdata __initconst = {
237 .flags = IMXUART_HAVE_RTSCTS, 236 .flags = IMXUART_HAVE_RTSCTS,
238}; 237};
239 238
@@ -415,7 +414,7 @@ static void __init mxc_board_init(void)
415 mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins), 414 mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins),
416 "mx31_3ds"); 415 "mx31_3ds");
417 416
418 mxc_register_device(&mxc_uart_device0, &uart_pdata); 417 imx31_add_imx_uart0(&uart_pdata);
419 imx31_add_mxc_nand(&mx31_3ds_nand_board_info); 418 imx31_add_mxc_nand(&mx31_3ds_nand_board_info);
420 419
421 imx31_add_spi_imx0(&spi1_pdata); 420 imx31_add_spi_imx0(&spi1_pdata);
diff --git a/arch/arm/mach-mx3/mach-mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c
index b6dc6c848b51..94b3e7c42404 100644
--- a/arch/arm/mach-mx3/mach-mx31ads.c
+++ b/arch/arm/mach-mx3/mach-mx31ads.c
@@ -29,7 +29,6 @@
29#include <asm/memory.h> 29#include <asm/memory.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <mach/common.h> 31#include <mach/common.h>
32#include <mach/imx-uart.h>
33#include <mach/iomux-mx3.h> 32#include <mach/iomux-mx3.h>
34 33
35#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 34#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
@@ -124,7 +123,7 @@ static inline int mxc_init_extuart(void)
124#endif 123#endif
125 124
126#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) 125#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
127static struct imxuart_platform_data uart_pdata = { 126static const struct imxuart_platform_data uart_pdata __initconst = {
128 .flags = IMXUART_HAVE_RTSCTS, 127 .flags = IMXUART_HAVE_RTSCTS,
129}; 128};
130 129
@@ -138,7 +137,7 @@ static unsigned int uart_pins[] = {
138static inline void mxc_init_imx_uart(void) 137static inline void mxc_init_imx_uart(void)
139{ 138{
140 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); 139 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0");
141 mxc_register_device(&mxc_uart_device0, &uart_pdata); 140 imx31_add_imx_uart0(&uart_pdata);
142} 141}
143#else /* !SERIAL_IMX */ 142#else /* !SERIAL_IMX */
144static inline void mxc_init_imx_uart(void) 143static inline void mxc_init_imx_uart(void)
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c
index 634b8559c81b..da236c497d2a 100644
--- a/arch/arm/mach-mx3/mach-mx31lite.c
+++ b/arch/arm/mach-mx3/mach-mx31lite.c
@@ -38,7 +38,6 @@
38#include <mach/hardware.h> 38#include <mach/hardware.h>
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/board-mx31lite.h> 40#include <mach/board-mx31lite.h>
41#include <mach/imx-uart.h>
42#include <mach/iomux-mx3.h> 41#include <mach/iomux-mx3.h>
43#include <mach/irqs.h> 42#include <mach/irqs.h>
44#include <mach/mxc_ehci.h> 43#include <mach/mxc_ehci.h>
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index 689b0681a409..95633bb063bf 100644
--- a/arch/arm/mach-mx3/mach-mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -38,7 +38,6 @@
38#include <mach/board-mx31moboard.h> 38#include <mach/board-mx31moboard.h>
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/hardware.h> 40#include <mach/hardware.h>
41#include <mach/imx-uart.h>
42#include <mach/iomux-mx3.h> 41#include <mach/iomux-mx3.h>
43#include <mach/ipu.h> 42#include <mach/ipu.h>
44#include <mach/mmc.h> 43#include <mach/mmc.h>
@@ -131,11 +130,11 @@ static int moboard_uart0_init(struct platform_device *pdev)
131 return 0; 130 return 0;
132} 131}
133 132
134static struct imxuart_platform_data uart0_pdata = { 133static const struct imxuart_platform_data uart0_pdata __initconst = {
135 .init = moboard_uart0_init, 134 .init = moboard_uart0_init,
136}; 135};
137 136
138static struct imxuart_platform_data uart4_pdata = { 137static const struct imxuart_platform_data uart4_pdata __initconst = {
139 .flags = IMXUART_HAVE_RTSCTS, 138 .flags = IMXUART_HAVE_RTSCTS,
140}; 139};
141 140
@@ -495,9 +494,8 @@ static void __init mxc_board_init(void)
495 494
496 platform_add_devices(devices, ARRAY_SIZE(devices)); 495 platform_add_devices(devices, ARRAY_SIZE(devices));
497 496
498 mxc_register_device(&mxc_uart_device0, &uart0_pdata); 497 imx31_add_imx_uart0(&uart0_pdata);
499 498 imx31_add_imx_uart4(&uart4_pdata);
500 mxc_register_device(&mxc_uart_device4, &uart4_pdata);
501 499
502 imx31_add_imx_i2c0(&moboard_i2c0_data); 500 imx31_add_imx_i2c0(&moboard_i2c0_data);
503 imx31_add_imx_i2c1(&moboard_i2c1_data); 501 imx31_add_imx_i2c1(&moboard_i2c1_data);
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index 7e3fc470d55d..e71e3904cff9 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -41,7 +41,6 @@
41#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <mach/common.h> 42#include <mach/common.h>
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44#include <mach/imx-uart.h>
45#include <mach/iomux-mx3.h> 44#include <mach/iomux-mx3.h>
46#include <mach/ipu.h> 45#include <mach/ipu.h>
47#include <mach/mmc.h> 46#include <mach/mmc.h>
@@ -219,7 +218,7 @@ static struct platform_device pcm037_flash = {
219 .num_resources = 1, 218 .num_resources = 1,
220}; 219};
221 220
222static struct imxuart_platform_data uart_pdata = { 221static const struct imxuart_platform_data uart_pdata __initconst = {
223 .flags = IMXUART_HAVE_RTSCTS, 222 .flags = IMXUART_HAVE_RTSCTS,
224}; 223};
225 224
@@ -609,9 +608,10 @@ static void __init mxc_board_init(void)
609 608
610 platform_add_devices(devices, ARRAY_SIZE(devices)); 609 platform_add_devices(devices, ARRAY_SIZE(devices));
611 610
612 mxc_register_device(&mxc_uart_device0, &uart_pdata); 611 imx31_add_imx_uart0(&uart_pdata);
613 mxc_register_device(&mxc_uart_device1, &uart_pdata); 612 /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */
614 mxc_register_device(&mxc_uart_device2, &uart_pdata); 613 imx31_add_imx_uart1(&uart_pdata);
614 imx31_add_imx_uart2(&uart_pdata);
615 615
616 mxc_register_device(&mxc_w1_master_device, NULL); 616 mxc_register_device(&mxc_w1_master_device, NULL);
617 617
diff --git a/arch/arm/mach-mx3/mach-qong.c b/arch/arm/mach-mx3/mach-qong.c
index 335b0bf93eb5..d44ac70222a5 100644
--- a/arch/arm/mach-mx3/mach-qong.c
+++ b/arch/arm/mach-mx3/mach-qong.c
@@ -30,8 +30,9 @@
30#include <mach/common.h> 30#include <mach/common.h>
31#include <asm/page.h> 31#include <asm/page.h>
32#include <asm/setup.h> 32#include <asm/setup.h>
33#include <mach/imx-uart.h>
34#include <mach/iomux-mx3.h> 33#include <mach/iomux-mx3.h>
34
35#include "devices-imx31.h"
35#include "devices.h" 36#include "devices.h"
36 37
37/* FPGA defines */ 38/* FPGA defines */
@@ -57,7 +58,7 @@
57 * This file contains the board-specific initialization routines. 58 * This file contains the board-specific initialization routines.
58 */ 59 */
59 60
60static struct imxuart_platform_data uart_pdata = { 61static const struct imxuart_platform_data uart_pdata __initconst = {
61 .flags = IMXUART_HAVE_RTSCTS, 62 .flags = IMXUART_HAVE_RTSCTS,
62}; 63};
63 64
@@ -68,11 +69,11 @@ static int uart_pins[] = {
68 MX31_PIN_RXD1__RXD1 69 MX31_PIN_RXD1__RXD1
69}; 70};
70 71
71static inline void mxc_init_imx_uart(void) 72static inline void __init mxc_init_imx_uart(void)
72{ 73{
73 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), 74 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins),
74 "uart-0"); 75 "uart-0");
75 mxc_register_device(&mxc_uart_device0, &uart_pdata); 76 imx31_add_imx_uart0(&uart_pdata);
76} 77}
77 78
78static struct resource dnet_resources[] = { 79static struct resource dnet_resources[] = {
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
index 2e50951d7319..827fd3c80201 100644
--- a/arch/arm/mach-mx3/mx31lilly-db.c
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -32,13 +32,13 @@
32 32
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <mach/common.h> 34#include <mach/common.h>
35#include <mach/imx-uart.h>
36#include <mach/iomux-mx3.h> 35#include <mach/iomux-mx3.h>
37#include <mach/board-mx31lilly.h> 36#include <mach/board-mx31lilly.h>
38#include <mach/mmc.h> 37#include <mach/mmc.h>
39#include <mach/mx3fb.h> 38#include <mach/mx3fb.h>
40#include <mach/ipu.h> 39#include <mach/ipu.h>
41 40
41#include "devices-imx31.h"
42#include "devices.h" 42#include "devices.h"
43 43
44/* 44/*
@@ -92,7 +92,7 @@ static unsigned int lilly_db_board_pins[] __initdata = {
92}; 92};
93 93
94/* UART */ 94/* UART */
95static struct imxuart_platform_data uart_pdata __initdata = { 95static const struct imxuart_platform_data uart_pdata __initconst = {
96 .flags = IMXUART_HAVE_RTSCTS, 96 .flags = IMXUART_HAVE_RTSCTS,
97}; 97};
98 98
@@ -213,9 +213,9 @@ void __init mx31lilly_db_init(void)
213 mxc_iomux_setup_multiple_pins(lilly_db_board_pins, 213 mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
214 ARRAY_SIZE(lilly_db_board_pins), 214 ARRAY_SIZE(lilly_db_board_pins),
215 "development board pins"); 215 "development board pins");
216 mxc_register_device(&mxc_uart_device0, &uart_pdata); 216 imx31_add_imx_uart0(&uart_pdata);
217 mxc_register_device(&mxc_uart_device1, &uart_pdata); 217 imx31_add_imx_uart1(&uart_pdata);
218 mxc_register_device(&mxc_uart_device2, &uart_pdata); 218 imx31_add_imx_uart2(&uart_pdata);
219 mxc_register_device(&mxcsdhc_device0, &mmc_pdata); 219 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
220 mx31lilly_init_fb(); 220 mx31lilly_init_fb();
221} 221}
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index 3786e29752f5..7b0e74e275ba 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -33,7 +33,6 @@
33 33
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/imx-uart.h>
37#include <mach/iomux-mx3.h> 36#include <mach/iomux-mx3.h>
38#include <mach/board-mx31lite.h> 37#include <mach/board-mx31lite.h>
39#include <mach/mmc.h> 38#include <mach/mmc.h>
@@ -72,7 +71,7 @@ static unsigned int litekit_db_board_pins[] __initdata = {
72}; 71};
73 72
74/* UART */ 73/* UART */
75static struct imxuart_platform_data uart_pdata __initdata = { 74static const struct imxuart_platform_data uart_pdata __initconst = {
76 .flags = IMXUART_HAVE_RTSCTS, 75 .flags = IMXUART_HAVE_RTSCTS,
77}; 76};
78 77
@@ -197,7 +196,7 @@ void __init mx31lite_db_init(void)
197 mxc_iomux_setup_multiple_pins(litekit_db_board_pins, 196 mxc_iomux_setup_multiple_pins(litekit_db_board_pins,
198 ARRAY_SIZE(litekit_db_board_pins), 197 ARRAY_SIZE(litekit_db_board_pins),
199 "development board pins"); 198 "development board pins");
200 mxc_register_device(&mxc_uart_device0, &uart_pdata); 199 imx31_add_imx_uart0(&uart_pdata);
201 mxc_register_device(&mxcsdhc_device0, &mmc_pdata); 200 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
202 imx31_add_spi_imx0(&spi0_pdata); 201 imx31_add_spi_imx0(&spi0_pdata);
203 platform_device_register(&litekit_led_device); 202 platform_device_register(&litekit_led_device);
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 44473b16e62f..fc395a7a8599 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -23,13 +23,13 @@
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24 24
25#include <mach/common.h> 25#include <mach/common.h>
26#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h> 26#include <mach/iomux-mx3.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29#include <mach/mmc.h> 28#include <mach/mmc.h>
30#include <mach/mxc_ehci.h> 29#include <mach/mxc_ehci.h>
31#include <mach/ulpi.h> 30#include <mach/ulpi.h>
32 31
32#include "devices-imx31.h"
33#include "devices.h" 33#include "devices.h"
34 34
35static unsigned int devboard_pins[] = { 35static unsigned int devboard_pins[] = {
@@ -52,7 +52,7 @@ static unsigned int devboard_pins[] = {
52 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, 52 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
53}; 53};
54 54
55static struct imxuart_platform_data uart_pdata = { 55static const struct imxuart_platform_data uart_pdata __initconst = {
56 .flags = IMXUART_HAVE_RTSCTS, 56 .flags = IMXUART_HAVE_RTSCTS,
57}; 57};
58 58
@@ -226,7 +226,7 @@ void __init mx31moboard_devboard_init(void)
226 mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins), 226 mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins),
227 "devboard"); 227 "devboard");
228 228
229 mxc_register_device(&mxc_uart_device1, &uart_pdata); 229 imx31_add_imx_uart1(&uart_pdata);
230 230
231 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 231 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
232 232
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
index f45a500a4816..40c3e7564cb6 100644
--- a/arch/arm/mach-mx3/mx31moboard-smartbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -26,7 +26,6 @@
26 26
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux-mx3.h> 29#include <mach/iomux-mx3.h>
31#include <mach/board-mx31moboard.h> 30#include <mach/board-mx31moboard.h>
32#include <mach/mxc_ehci.h> 31#include <mach/mxc_ehci.h>
@@ -34,6 +33,7 @@
34 33
35#include <media/soc_camera.h> 34#include <media/soc_camera.h>
36 35
36#include "devices-imx31.h"
37#include "devices.h" 37#include "devices.h"
38 38
39static unsigned int smartbot_pins[] = { 39static unsigned int smartbot_pins[] = {
@@ -55,7 +55,7 @@ static unsigned int smartbot_pins[] = {
55 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, 55 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
56}; 56};
57 57
58static struct imxuart_platform_data uart_pdata = { 58static const struct imxuart_platform_data uart_pdata __initconst = {
59 .flags = IMXUART_HAVE_RTSCTS, 59 .flags = IMXUART_HAVE_RTSCTS,
60}; 60};
61 61
@@ -179,8 +179,7 @@ void __init mx31moboard_smartbot_init(int board)
179 mxc_iomux_setup_multiple_pins(smartbot_pins, ARRAY_SIZE(smartbot_pins), 179 mxc_iomux_setup_multiple_pins(smartbot_pins, ARRAY_SIZE(smartbot_pins),
180 "smartbot"); 180 "smartbot");
181 181
182 mxc_register_device(&mxc_uart_device1, &uart_pdata); 182 imx31_add_imx_uart1(&uart_pdata);
183
184 183
185 switch (board) { 184 switch (board) {
186 case MX31SMARTBOT: 185 case MX31SMARTBOT: