aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-16 06:23:11 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 03:00:34 -0400
commita2ceeef59f8fc9303dd23ebe09e9daca70799ff5 (patch)
treec25571df25c4693880cfb5548a86c2f706766939
parent0e7a29a8d97c4ea86b9975e65f554c0398a8fdbf (diff)
ARM: imx: Change the way nand devices are registered (imx31)
Make use of new mechanism to register a nand device. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/Kconfig4
-rw-r--r--arch/arm/mach-mx3/devices-imx31.h13
-rw-r--r--arch/arm/mach-mx3/devices.c8
-rw-r--r--arch/arm/mach-mx3/devices.h2
-rw-r--r--arch/arm/mach-mx3/mach-armadillo5x0.c7
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c8
-rw-r--r--arch/arm/mach-mx3/mach-mx31lite.c7
-rw-r--r--arch/arm/mach-mx3/mach-pcm037.c7
8 files changed, 42 insertions, 14 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 344753fdf25e..cb9368f71596 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -34,6 +34,7 @@ config MACH_MX31ADS_WM1133_EV1
34config MACH_PCM037 34config MACH_PCM037
35 bool "Support Phytec pcm037 (i.MX31) platforms" 35 bool "Support Phytec pcm037 (i.MX31) platforms"
36 select ARCH_MX31 36 select ARCH_MX31
37 select IMX_HAVE_PLATFORM_MXC_NAND
37 select MXC_ULPI if USB_ULPI 38 select MXC_ULPI if USB_ULPI
38 help 39 help
39 Include support for Phytec pcm037 platform. This includes 40 Include support for Phytec pcm037 platform. This includes
@@ -51,6 +52,7 @@ config MACH_MX31LITE
51 bool "Support MX31 LITEKIT (LogicPD)" 52 bool "Support MX31 LITEKIT (LogicPD)"
52 select ARCH_MX31 53 select ARCH_MX31
53 select MXC_ULPI if USB_ULPI 54 select MXC_ULPI if USB_ULPI
55 select IMX_HAVE_PLATFORM_MXC_NAND
54 help 56 help
55 Include support for MX31 LITEKIT platform. This includes specific 57 Include support for MX31 LITEKIT platform. This includes specific
56 configurations for the board and its peripherals. 58 configurations for the board and its peripherals.
@@ -58,6 +60,7 @@ config MACH_MX31LITE
58config MACH_MX31_3DS 60config MACH_MX31_3DS
59 bool "Support MX31PDK (3DS)" 61 bool "Support MX31PDK (3DS)"
60 select ARCH_MX31 62 select ARCH_MX31
63 select IMX_HAVE_PLATFORM_MXC_NAND
61 help 64 help
62 Include support for MX31PDK (3DS) platform. This includes specific 65 Include support for MX31PDK (3DS) platform. This includes specific
63 configurations for the board and its peripherals. 66 configurations for the board and its peripherals.
@@ -105,6 +108,7 @@ config MACH_PCM043
105config MACH_ARMADILLO5X0 108config MACH_ARMADILLO5X0
106 bool "Support Atmark Armadillo-500 Development Base Board" 109 bool "Support Atmark Armadillo-500 Development Base Board"
107 select ARCH_MX31 110 select ARCH_MX31
111 select IMX_HAVE_PLATFORM_MXC_NAND
108 select MXC_ULPI if USB_ULPI 112 select MXC_ULPI if USB_ULPI
109 help 113 help
110 Include support for Atmark Armadillo-500 platform. This includes 114 Include support for Atmark Armadillo-500 platform. This includes
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h
new file mode 100644
index 000000000000..8bd8b3808cae
--- /dev/null
+++ b/arch/arm/mach-mx3/devices-imx31.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/mx31.h>
10#include <mach/devices-common.h>
11
12#define imx31_add_mxc_nand(pdata) \
13 imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index f6da0ffbe719..baa4bd117b33 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -167,6 +167,7 @@ struct platform_device mxc_w1_master_device = {
167 .resource = mxc_w1_master_resources, 167 .resource = mxc_w1_master_resources,
168}; 168};
169 169
170#if defined(CONFIG_ARCH_MX35)
170static struct resource mxc_nand_resources[] = { 171static struct resource mxc_nand_resources[] = {
171 { 172 {
172 .start = 0, /* runtime dependent */ 173 .start = 0, /* runtime dependent */
@@ -185,6 +186,7 @@ struct platform_device mxc_nand_device = {
185 .num_resources = ARRAY_SIZE(mxc_nand_resources), 186 .num_resources = ARRAY_SIZE(mxc_nand_resources),
186 .resource = mxc_nand_resources, 187 .resource = mxc_nand_resources,
187}; 188};
189#endif
188 190
189static struct resource mxc_i2c0_resources[] = { 191static struct resource mxc_i2c0_resources[] = {
190 { 192 {
@@ -628,13 +630,14 @@ struct platform_device imx_kpp_device = {
628 630
629static int __init mx3_devices_init(void) 631static int __init mx3_devices_init(void)
630{ 632{
633#if defined(CONFIG_ARCH_MX31)
631 if (cpu_is_mx31()) { 634 if (cpu_is_mx31()) {
632 mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR;
633 mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff;
634 imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR; 635 imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR;
635 imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff; 636 imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff;
636 mxc_register_device(&mxc_rnga_device, NULL); 637 mxc_register_device(&mxc_rnga_device, NULL);
637 } 638 }
639#endif
640#if defined(CONFIG_ARCH_MX35)
638 if (cpu_is_mx35()) { 641 if (cpu_is_mx35()) {
639 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; 642 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
640 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff; 643 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff;
@@ -653,6 +656,7 @@ static int __init mx3_devices_init(void)
653 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; 656 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR;
654 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; 657 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff;
655 } 658 }
659#endif
656 660
657 return 0; 661 return 0;
658} 662}
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 2c3c8646a29e..6bb71d334c65 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -5,7 +5,9 @@ extern struct platform_device mxc_uart_device2;
5extern struct platform_device mxc_uart_device3; 5extern struct platform_device mxc_uart_device3;
6extern struct platform_device mxc_uart_device4; 6extern struct platform_device mxc_uart_device4;
7extern struct platform_device mxc_w1_master_device; 7extern struct platform_device mxc_w1_master_device;
8#if defined(CONFIG_ARCH_MX35)
8extern struct platform_device mxc_nand_device; 9extern struct platform_device mxc_nand_device;
10#endif
9extern struct platform_device mxc_i2c_device0; 11extern struct platform_device mxc_i2c_device0;
10extern struct platform_device mxc_i2c_device1; 12extern struct platform_device mxc_i2c_device1;
11extern struct platform_device mxc_i2c_device2; 13extern struct platform_device mxc_i2c_device2;
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c
index 2a8de89e0b68..633107a69acd 100644
--- a/arch/arm/mach-mx3/mach-armadillo5x0.c
+++ b/arch/arm/mach-mx3/mach-armadillo5x0.c
@@ -53,10 +53,10 @@
53#include <mach/mmc.h> 53#include <mach/mmc.h>
54#include <mach/ipu.h> 54#include <mach/ipu.h>
55#include <mach/mx3fb.h> 55#include <mach/mx3fb.h>
56#include <mach/mxc_nand.h>
57#include <mach/mxc_ehci.h> 56#include <mach/mxc_ehci.h>
58#include <mach/ulpi.h> 57#include <mach/ulpi.h>
59 58
59#include "devices-imx31.h"
60#include "devices.h" 60#include "devices.h"
61#include "crm_regs.h" 61#include "crm_regs.h"
62 62
@@ -300,7 +300,8 @@ static struct platform_device armadillo5x0_button_device = {
300/* 300/*
301 * NAND Flash 301 * NAND Flash
302 */ 302 */
303static struct mxc_nand_platform_data armadillo5x0_nand_flash_pdata = { 303static const struct mxc_nand_platform_data
304armadillo5x0_nand_board_info __initconst = {
304 .width = 1, 305 .width = 1,
305 .hw_ecc = 1, 306 .hw_ecc = 1,
306}; 307};
@@ -531,7 +532,7 @@ static void __init armadillo5x0_init(void)
531 &armadillo5x0_nor_flash_pdata); 532 &armadillo5x0_nor_flash_pdata);
532 533
533 /* Register NAND Flash */ 534 /* Register NAND Flash */
534 mxc_register_device(&mxc_nand_device, &armadillo5x0_nand_flash_pdata); 535 imx31_add_mxc_nand(&armadillo5x0_nand_board_info);
535 536
536 /* set NAND page size to 2k if not configured via boot mode pins */ 537 /* set NAND page size to 2k if not configured via boot mode pins */
537 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); 538 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 33f2554fe31c..c730c090208a 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -35,8 +35,9 @@
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/imx-uart.h> 36#include <mach/imx-uart.h>
37#include <mach/iomux-mx3.h> 37#include <mach/iomux-mx3.h>
38#include <mach/mxc_nand.h>
39#include <mach/spi.h> 38#include <mach/spi.h>
39
40#include "devices-imx31.h"
40#include "devices.h" 41#include "devices.h"
41 42
42/* Definitions for components on the Debug board */ 43/* Definitions for components on the Debug board */
@@ -189,7 +190,8 @@ static struct spi_board_info mx31_3ds_spi_devs[] __initdata = {
189/* 190/*
190 * NAND Flash 191 * NAND Flash
191 */ 192 */
192static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = { 193static const struct mxc_nand_platform_data
194mx31_3ds_nand_board_info __initconst = {
193 .width = 1, 195 .width = 1,
194 .hw_ecc = 1, 196 .hw_ecc = 1,
195#ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT 197#ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT
@@ -415,7 +417,7 @@ static void __init mxc_board_init(void)
415 "mx31_3ds"); 417 "mx31_3ds");
416 418
417 mxc_register_device(&mxc_uart_device0, &uart_pdata); 419 mxc_register_device(&mxc_uart_device0, &uart_pdata);
418 mxc_register_device(&mxc_nand_device, &imx31_3ds_nand_flash_pdata); 420 imx31_add_mxc_nand(&mx31_3ds_nand_board_info);
419 421
420 mxc_register_device(&mxc_spi_device1, &spi1_pdata); 422 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
421 spi_register_board_info(mx31_3ds_spi_devs, 423 spi_register_board_info(mx31_3ds_spi_devs,
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c
index edcc7114e829..f0a68e64e004 100644
--- a/arch/arm/mach-mx3/mach-mx31lite.c
+++ b/arch/arm/mach-mx3/mach-mx31lite.c
@@ -41,11 +41,11 @@
41#include <mach/imx-uart.h> 41#include <mach/imx-uart.h>
42#include <mach/iomux-mx3.h> 42#include <mach/iomux-mx3.h>
43#include <mach/irqs.h> 43#include <mach/irqs.h>
44#include <mach/mxc_nand.h>
45#include <mach/spi.h> 44#include <mach/spi.h>
46#include <mach/mxc_ehci.h> 45#include <mach/mxc_ehci.h>
47#include <mach/ulpi.h> 46#include <mach/ulpi.h>
48 47
48#include "devices-imx31.h"
49#include "devices.h" 49#include "devices.h"
50 50
51/* 51/*
@@ -65,7 +65,8 @@ static unsigned int mx31lite_pins[] = {
65 MX31_PIN_CSPI2_SS2__SS2, 65 MX31_PIN_CSPI2_SS2__SS2,
66}; 66};
67 67
68static struct mxc_nand_platform_data mx31lite_nand_board_info = { 68static const struct mxc_nand_platform_data
69mx31lite_nand_board_info __initconst = {
69 .width = 1, 70 .width = 1,
70 .hw_ecc = 1, 71 .hw_ecc = 1,
71}; 72};
@@ -249,7 +250,7 @@ static void __init mxc_board_init(void)
249 250
250 /* NOR and NAND flash */ 251 /* NOR and NAND flash */
251 platform_device_register(&physmap_flash_device); 252 platform_device_register(&physmap_flash_device);
252 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info); 253 imx31_add_mxc_nand(&mx31lite_nand_board_info);
253 254
254 mxc_register_device(&mxc_spi_device1, &spi1_pdata); 255 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
255 spi_register_board_info(&mc13783_spi_dev, 1); 256 spi_register_board_info(&mc13783_spi_dev, 1);
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index c1f335c5b2c6..d7fef469990a 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -48,10 +48,10 @@
48#include <mach/mmc.h> 48#include <mach/mmc.h>
49#include <mach/mx3_camera.h> 49#include <mach/mx3_camera.h>
50#include <mach/mx3fb.h> 50#include <mach/mx3fb.h>
51#include <mach/mxc_nand.h>
52#include <mach/mxc_ehci.h> 51#include <mach/mxc_ehci.h>
53#include <mach/ulpi.h> 52#include <mach/ulpi.h>
54 53
54#include "devices-imx31.h"
55#include "devices.h" 55#include "devices.h"
56#include "pcm037.h" 56#include "pcm037.h"
57 57
@@ -274,7 +274,8 @@ static struct platform_device pcm037_sram_device = {
274 .resource = &pcm038_sram_resource, 274 .resource = &pcm038_sram_resource,
275}; 275};
276 276
277static struct mxc_nand_platform_data pcm037_nand_board_info = { 277static const struct mxc_nand_platform_data
278pcm037_nand_board_info __initconst = {
278 .width = 1, 279 .width = 1,
279 .hw_ecc = 1, 280 .hw_ecc = 1,
280}; 281};
@@ -632,7 +633,7 @@ static void __init mxc_board_init(void)
632 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); 633 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
633 mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data); 634 mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data);
634 635
635 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 636 imx31_add_mxc_nand(&pcm037_nand_board_info);
636 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 637 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
637 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 638 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
638 mxc_register_device(&mx3_fb, &mx3fb_pdata); 639 mxc_register_device(&mx3_fb, &mx3fb_pdata);