diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-22 11:59:58 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-30 03:00:55 -0400 |
commit | 3c5227fd40b1250490c34b50298973f32b7dcf96 (patch) | |
tree | d9865e8c1532ba7495c182024e3291cb33cb7b7f | |
parent | d112f4e4e57cbcf81e5f04a0eba77804d14d8640 (diff) |
ARM: imx: dynamically register imx-uart devices (imx21)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx21.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx21ads.c | 12 |
5 files changed, 17 insertions, 10 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 445ce10b8985..0fa8acc94271 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -71,6 +71,7 @@ comment "MX21 platforms:" | |||
71 | 71 | ||
72 | config MACH_MX21ADS | 72 | config MACH_MX21ADS |
73 | bool "MX21ADS platform" | 73 | bool "MX21ADS platform" |
74 | select IMX_HAVE_PLATFORM_IMX_UART | ||
74 | select IMX_HAVE_PLATFORM_MXC_NAND | 75 | select IMX_HAVE_PLATFORM_MXC_NAND |
75 | help | 76 | help |
76 | Include support for MX21ADS platform. This includes specific | 77 | Include support for MX21ADS platform. This includes specific |
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h index de80ccd6f744..42788e99d127 100644 --- a/arch/arm/mach-imx/devices-imx21.h +++ b/arch/arm/mach-imx/devices-imx21.h | |||
@@ -12,6 +12,15 @@ | |||
12 | #define imx21_add_i2c_imx(pdata) \ | 12 | #define imx21_add_i2c_imx(pdata) \ |
13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) | 13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) |
14 | 14 | ||
15 | #define imx21_add_imx_uart0(pdata) \ | ||
16 | imx_add_imx_uart_1irq(0, MX21_UART1_BASE_ADDR, SZ_4K, MX21_INT_UART1, pdata) | ||
17 | #define imx21_add_imx_uart1(pdata) \ | ||
18 | imx_add_imx_uart_1irq(1, MX21_UART2_BASE_ADDR, SZ_4K, MX21_INT_UART2, pdata) | ||
19 | #define imx21_add_imx_uart2(pdata) \ | ||
20 | imx_add_imx_uart_1irq(2, MX21_UART3_BASE_ADDR, SZ_4K, MX21_INT_UART3, pdata) | ||
21 | #define imx21_add_imx_uart3(pdata) \ | ||
22 | imx_add_imx_uart_1irq(3, MX21_UART4_BASE_ADDR, SZ_4K, MX21_INT_UART4, pdata) | ||
23 | |||
15 | #define imx21_add_mxc_nand(pdata) \ | 24 | #define imx21_add_mxc_nand(pdata) \ |
16 | imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata) | 25 | imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata) |
17 | 26 | ||
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index b4bf8fc80216..9ea2ef1b2387 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c | |||
@@ -483,6 +483,7 @@ struct platform_device mxc_usbh2 = { | |||
483 | DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | 483 | DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); |
484 | DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | 484 | DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); |
485 | 485 | ||
486 | #ifdef CONFIG_MACH_MX27 | ||
486 | #define DEFINE_IMX2x_UART_DEVICE(n, baseaddr, irq) \ | 487 | #define DEFINE_IMX2x_UART_DEVICE(n, baseaddr, irq) \ |
487 | static struct resource imx2x_uart_resources ## n[] = { \ | 488 | static struct resource imx2x_uart_resources ## n[] = { \ |
488 | { \ | 489 | { \ |
@@ -507,8 +508,6 @@ DEFINE_IMX2x_UART_DEVICE(0, MX2x_UART1_BASE_ADDR, MX2x_INT_UART1); | |||
507 | DEFINE_IMX2x_UART_DEVICE(1, MX2x_UART2_BASE_ADDR, MX2x_INT_UART2); | 508 | DEFINE_IMX2x_UART_DEVICE(1, MX2x_UART2_BASE_ADDR, MX2x_INT_UART2); |
508 | DEFINE_IMX2x_UART_DEVICE(2, MX2x_UART3_BASE_ADDR, MX2x_INT_UART3); | 509 | DEFINE_IMX2x_UART_DEVICE(2, MX2x_UART3_BASE_ADDR, MX2x_INT_UART3); |
509 | DEFINE_IMX2x_UART_DEVICE(3, MX2x_UART4_BASE_ADDR, MX2x_INT_UART4); | 510 | DEFINE_IMX2x_UART_DEVICE(3, MX2x_UART4_BASE_ADDR, MX2x_INT_UART4); |
510 | |||
511 | #ifdef CONFIG_MACH_MX27 | ||
512 | DEFINE_IMX2x_UART_DEVICE(4, MX27_UART5_BASE_ADDR, MX27_INT_UART5); | 511 | DEFINE_IMX2x_UART_DEVICE(4, MX27_UART5_BASE_ADDR, MX27_INT_UART5); |
513 | DEFINE_IMX2x_UART_DEVICE(5, MX27_UART6_BASE_ADDR, MX27_INT_UART6); | 512 | DEFINE_IMX2x_UART_DEVICE(5, MX27_UART6_BASE_ADDR, MX27_INT_UART6); |
514 | #endif | 513 | #endif |
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h index e56efbcb75d6..13790fbb456d 100644 --- a/arch/arm/mach-imx/devices.h +++ b/arch/arm/mach-imx/devices.h | |||
@@ -14,11 +14,11 @@ extern struct platform_device mxc_gpt4; | |||
14 | extern struct platform_device mxc_gpt5; | 14 | extern struct platform_device mxc_gpt5; |
15 | #endif | 15 | #endif |
16 | extern struct platform_device mxc_wdt; | 16 | extern struct platform_device mxc_wdt; |
17 | #ifdef CONFIG_MACH_MX27 | ||
17 | extern struct platform_device imx2x_uart_device0; | 18 | extern struct platform_device imx2x_uart_device0; |
18 | extern struct platform_device imx2x_uart_device1; | 19 | extern struct platform_device imx2x_uart_device1; |
19 | extern struct platform_device imx2x_uart_device2; | 20 | extern struct platform_device imx2x_uart_device2; |
20 | extern struct platform_device imx2x_uart_device3; | 21 | extern struct platform_device imx2x_uart_device3; |
21 | #ifdef CONFIG_MACH_MX27 | ||
22 | extern struct platform_device imx2x_uart_device4; | 22 | extern struct platform_device imx2x_uart_device4; |
23 | extern struct platform_device imx2x_uart_device5; | 23 | extern struct platform_device imx2x_uart_device5; |
24 | #endif | 24 | #endif |
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index fde2a5770bfe..96d7f8189f32 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/time.h> | 25 | #include <asm/mach/time.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <mach/imx-uart.h> | ||
28 | #include <mach/imxfb.h> | 27 | #include <mach/imxfb.h> |
29 | #include <mach/iomux-mx21.h> | 28 | #include <mach/iomux-mx21.h> |
30 | #include <mach/mxc_nand.h> | 29 | #include <mach/mxc_nand.h> |
@@ -164,14 +163,13 @@ static struct platform_device mx21ads_nor_mtd_device = { | |||
164 | .resource = &mx21ads_flash_resource, | 163 | .resource = &mx21ads_flash_resource, |
165 | }; | 164 | }; |
166 | 165 | ||
167 | static struct imxuart_platform_data uart_pdata = { | 166 | static const struct imxuart_platform_data uart_pdata_rts __initconst = { |
168 | .flags = IMXUART_HAVE_RTSCTS, | 167 | .flags = IMXUART_HAVE_RTSCTS, |
169 | }; | 168 | }; |
170 | 169 | ||
171 | static struct imxuart_platform_data uart_norts_pdata = { | 170 | static const struct imxuart_platform_data uart_pdata_norts __initconst = { |
172 | }; | 171 | }; |
173 | 172 | ||
174 | |||
175 | static int mx21ads_fb_init(struct platform_device *pdev) | 173 | static int mx21ads_fb_init(struct platform_device *pdev) |
176 | { | 174 | { |
177 | u16 tmp; | 175 | u16 tmp; |
@@ -295,9 +293,9 @@ static void __init mx21ads_board_init(void) | |||
295 | mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins), | 293 | mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins), |
296 | "mx21ads"); | 294 | "mx21ads"); |
297 | 295 | ||
298 | mxc_register_device(&imx2x_uart_device0, &uart_pdata); | 296 | imx21_add_imx_uart0(&uart_pdata_rts); |
299 | mxc_register_device(&imx2x_uart_device2, &uart_norts_pdata); | 297 | imx21_add_imx_uart2(&uart_pdata_norts); |
300 | mxc_register_device(&imx2x_uart_device3, &uart_pdata); | 298 | imx21_add_imx_uart3(&uart_pdata_rts); |
301 | mxc_register_device(&mxc_fb_device, &mx21ads_fb_data); | 299 | mxc_register_device(&mxc_fb_device, &mx21ads_fb_data); |
302 | mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); | 300 | mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); |
303 | imx21_add_mxc_nand(&mx21ads_nand_board_info); | 301 | imx21_add_mxc_nand(&mx21ads_nand_board_info); |