diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-16 06:34:56 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-30 03:00:32 -0400 |
commit | b0c4845c47bce6fefe5e08b1e0cbd100d62ec36b (patch) | |
tree | 409483c88a00e0ca311efb6e6b83f17461b0fed5 /arch/arm | |
parent | 1f8d721cd3dd1a2ee37152ce228f035212074984 (diff) |
ARM: imx: Change the way nand devices are registered (imx25)
Make use of new mechanism to register a nand device.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mx25/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices-imx25.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx25/mach-mx25_3ds.c | 10 |
5 files changed, 20 insertions, 25 deletions
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig index 54d217314ee9..3c4f1eeb88e5 100644 --- a/arch/arm/mach-mx25/Kconfig +++ b/arch/arm/mach-mx25/Kconfig | |||
@@ -4,5 +4,6 @@ comment "MX25 platforms:" | |||
4 | 4 | ||
5 | config MACH_MX25_3DS | 5 | config MACH_MX25_3DS |
6 | bool "Support MX25PDK (3DS) Platform" | 6 | bool "Support MX25PDK (3DS) Platform" |
7 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
7 | 8 | ||
8 | endif | 9 | endif |
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h new file mode 100644 index 000000000000..f8d4ee0b1eb6 --- /dev/null +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/mx25.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx25_add_mxc_nand(pdata) \ | ||
13 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) | ||
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index 80f313180713..e1c3cd14078c 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -439,26 +439,6 @@ struct platform_device mx25_fec_device = { | |||
439 | .resource = mx25_fec_resources, | 439 | .resource = mx25_fec_resources, |
440 | }; | 440 | }; |
441 | 441 | ||
442 | static struct resource mxc_nand_resources[] = { | ||
443 | { | ||
444 | .start = MX25_NFC_BASE_ADDR, | ||
445 | .end = MX25_NFC_BASE_ADDR + 0x1fff, | ||
446 | .flags = IORESOURCE_MEM, | ||
447 | }, | ||
448 | { | ||
449 | .start = MX25_INT_NANDFC, | ||
450 | .end = MX25_INT_NANDFC, | ||
451 | .flags = IORESOURCE_IRQ, | ||
452 | }, | ||
453 | }; | ||
454 | |||
455 | struct platform_device mxc_nand_device = { | ||
456 | .name = "mxc_nand", | ||
457 | .id = 0, | ||
458 | .num_resources = ARRAY_SIZE(mxc_nand_resources), | ||
459 | .resource = mxc_nand_resources, | ||
460 | }; | ||
461 | |||
462 | static struct resource mx25_rtc_resources[] = { | 442 | static struct resource mx25_rtc_resources[] = { |
463 | { | 443 | { |
464 | .start = MX25_DRYICE_BASE_ADDR, | 444 | .start = MX25_DRYICE_BASE_ADDR, |
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index cee12c0a0be6..f212c93648c9 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -18,7 +18,6 @@ extern struct platform_device mxc_i2c_device0; | |||
18 | extern struct platform_device mxc_i2c_device1; | 18 | extern struct platform_device mxc_i2c_device1; |
19 | extern struct platform_device mxc_i2c_device2; | 19 | extern struct platform_device mxc_i2c_device2; |
20 | extern struct platform_device mx25_fec_device; | 20 | extern struct platform_device mx25_fec_device; |
21 | extern struct platform_device mxc_nand_device; | ||
22 | extern struct platform_device mx25_rtc_device; | 21 | extern struct platform_device mx25_rtc_device; |
23 | extern struct platform_device mx25_fb_device; | 22 | extern struct platform_device mx25_fb_device; |
24 | extern struct platform_device mxc_wdt; | 23 | extern struct platform_device mxc_wdt; |
diff --git a/arch/arm/mach-mx25/mach-mx25_3ds.c b/arch/arm/mach-mx25/mach-mx25_3ds.c index 26ba246c57ee..e1e98864c8e7 100644 --- a/arch/arm/mach-mx25/mach-mx25_3ds.c +++ b/arch/arm/mach-mx25/mach-mx25_3ds.c | |||
@@ -40,11 +40,12 @@ | |||
40 | #include <mach/common.h> | 40 | #include <mach/common.h> |
41 | #include <mach/imx-uart.h> | 41 | #include <mach/imx-uart.h> |
42 | #include <mach/mx25.h> | 42 | #include <mach/mx25.h> |
43 | #include <mach/mxc_nand.h> | ||
44 | #include <mach/imxfb.h> | 43 | #include <mach/imxfb.h> |
45 | #include "devices.h" | ||
46 | #include <mach/iomux-mx25.h> | 44 | #include <mach/iomux-mx25.h> |
47 | 45 | ||
46 | #include "devices-imx25.h" | ||
47 | #include "devices.h" | ||
48 | |||
48 | static struct imxuart_platform_data uart_pdata = { | 49 | static struct imxuart_platform_data uart_pdata = { |
49 | .flags = IMXUART_HAVE_RTSCTS, | 50 | .flags = IMXUART_HAVE_RTSCTS, |
50 | }; | 51 | }; |
@@ -109,7 +110,8 @@ static void __init mx25pdk_fec_reset(void) | |||
109 | gpio_set_value(FEC_RESET_B_GPIO, 1); | 110 | gpio_set_value(FEC_RESET_B_GPIO, 1); |
110 | } | 111 | } |
111 | 112 | ||
112 | static struct mxc_nand_platform_data mx25pdk_nand_board_info = { | 113 | static const struct mxc_nand_platform_data |
114 | mx25pdk_nand_board_info __initconst = { | ||
113 | .width = 1, | 115 | .width = 1, |
114 | .hw_ecc = 1, | 116 | .hw_ecc = 1, |
115 | .flash_bbt = 1, | 117 | .flash_bbt = 1, |
@@ -150,7 +152,7 @@ static void __init mx25pdk_init(void) | |||
150 | 152 | ||
151 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 153 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
152 | mxc_register_device(&mxc_usbh2, NULL); | 154 | mxc_register_device(&mxc_usbh2, NULL); |
153 | mxc_register_device(&mxc_nand_device, &mx25pdk_nand_board_info); | 155 | imx25_add_mxc_nand(&mx25pdk_nand_board_info); |
154 | mxc_register_device(&mx25_rtc_device, NULL); | 156 | mxc_register_device(&mx25_rtc_device, NULL); |
155 | mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata); | 157 | mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata); |
156 | 158 | ||