diff options
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-devkit8000.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3touchbook.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-sdp-flash.c | 5 |
6 files changed, 5 insertions, 118 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index e679a2cc86c3..05442945fc67 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -61,8 +61,6 @@ | |||
61 | #define SB_T35_SMSC911X_GPIO 65 | 61 | #define SB_T35_SMSC911X_GPIO 65 |
62 | 62 | ||
63 | #define NAND_BLOCK_SIZE SZ_128K | 63 | #define NAND_BLOCK_SIZE SZ_128K |
64 | #define GPMC_CS0_BASE 0x60 | ||
65 | #define GPMC_CS0_BASE_ADDR (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE) | ||
66 | 64 | ||
67 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 65 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
68 | #include <linux/smsc911x.h> | 66 | #include <linux/smsc911x.h> |
@@ -223,28 +221,12 @@ static struct omap_nand_platform_data cm_t35_nand_data = { | |||
223 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), | 221 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), |
224 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 222 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
225 | .cs = 0, | 223 | .cs = 0, |
226 | .gpmc_cs_baseaddr = (void __iomem *)GPMC_CS0_BASE_ADDR, | ||
227 | .gpmc_baseaddr = (void __iomem *)OMAP34XX_GPMC_VIRT, | ||
228 | 224 | ||
229 | }; | 225 | }; |
230 | 226 | ||
231 | static struct resource cm_t35_nand_resource = { | ||
232 | .flags = IORESOURCE_MEM, | ||
233 | }; | ||
234 | |||
235 | static struct platform_device cm_t35_nand_device = { | ||
236 | .name = "omap2-nand", | ||
237 | .id = -1, | ||
238 | .num_resources = 1, | ||
239 | .resource = &cm_t35_nand_resource, | ||
240 | .dev = { | ||
241 | .platform_data = &cm_t35_nand_data, | ||
242 | }, | ||
243 | }; | ||
244 | |||
245 | static void __init cm_t35_init_nand(void) | 227 | static void __init cm_t35_init_nand(void) |
246 | { | 228 | { |
247 | if (platform_device_register(&cm_t35_nand_device) < 0) | 229 | if (gpmc_nand_init(&cm_t35_nand_data) < 0) |
248 | pr_err("CM-T35: Unable to register NAND device\n"); | 230 | pr_err("CM-T35: Unable to register NAND device\n"); |
249 | } | 231 | } |
250 | #else | 232 | #else |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index f8303f7bbe76..96e16f76ff44 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -59,9 +59,6 @@ | |||
59 | #include "mux.h" | 59 | #include "mux.h" |
60 | #include "hsmmc.h" | 60 | #include "hsmmc.h" |
61 | 61 | ||
62 | #define GPMC_CS0_BASE 0x60 | ||
63 | #define GPMC_CS_SIZE 0x30 | ||
64 | |||
65 | #define NAND_BLOCK_SIZE SZ_128K | 62 | #define NAND_BLOCK_SIZE SZ_128K |
66 | 63 | ||
67 | #define OMAP_DM9000_GPIO_IRQ 25 | 64 | #define OMAP_DM9000_GPIO_IRQ 25 |
@@ -105,20 +102,6 @@ static struct omap_nand_platform_data devkit8000_nand_data = { | |||
105 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 102 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
106 | }; | 103 | }; |
107 | 104 | ||
108 | static struct resource devkit8000_nand_resource = { | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }; | ||
111 | |||
112 | static struct platform_device devkit8000_nand_device = { | ||
113 | .name = "omap2-nand", | ||
114 | .id = -1, | ||
115 | .dev = { | ||
116 | .platform_data = &devkit8000_nand_data, | ||
117 | }, | ||
118 | .num_resources = 1, | ||
119 | .resource = &devkit8000_nand_resource, | ||
120 | }; | ||
121 | |||
122 | static struct omap2_hsmmc_info mmc[] = { | 105 | static struct omap2_hsmmc_info mmc[] = { |
123 | { | 106 | { |
124 | .mmc = 1, | 107 | .mmc = 1, |
@@ -591,8 +574,6 @@ static void __init devkit8000_flash_init(void) | |||
591 | u8 cs = 0; | 574 | u8 cs = 0; |
592 | u8 nandcs = GPMC_CS_NUM + 1; | 575 | u8 nandcs = GPMC_CS_NUM + 1; |
593 | 576 | ||
594 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
595 | |||
596 | /* find out the chip-select on which NAND exists */ | 577 | /* find out the chip-select on which NAND exists */ |
597 | while (cs < GPMC_CS_NUM) { | 578 | while (cs < GPMC_CS_NUM) { |
598 | u32 ret = 0; | 579 | u32 ret = 0; |
@@ -614,13 +595,9 @@ static void __init devkit8000_flash_init(void) | |||
614 | 595 | ||
615 | if (nandcs < GPMC_CS_NUM) { | 596 | if (nandcs < GPMC_CS_NUM) { |
616 | devkit8000_nand_data.cs = nandcs; | 597 | devkit8000_nand_data.cs = nandcs; |
617 | devkit8000_nand_data.gpmc_cs_baseaddr = (void *) | ||
618 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
619 | devkit8000_nand_data.gpmc_baseaddr = (void *) | ||
620 | (gpmc_base_add); | ||
621 | 598 | ||
622 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 599 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
623 | if (platform_device_register(&devkit8000_nand_device) < 0) | 600 | if (gpmc_nand_init(&devkit8000_nand_data) < 0) |
624 | printk(KERN_ERR "Unable to register NAND device\n"); | 601 | printk(KERN_ERR "Unable to register NAND device\n"); |
625 | } | 602 | } |
626 | } | 603 | } |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 69b154cdc75d..dc5a7e8790c0 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -48,9 +48,6 @@ | |||
48 | #include "mux.h" | 48 | #include "mux.h" |
49 | #include "hsmmc.h" | 49 | #include "hsmmc.h" |
50 | 50 | ||
51 | #define GPMC_CS0_BASE 0x60 | ||
52 | #define GPMC_CS_SIZE 0x30 | ||
53 | |||
54 | #define NAND_BLOCK_SIZE SZ_128K | 51 | #define NAND_BLOCK_SIZE SZ_128K |
55 | 52 | ||
56 | static struct mtd_partition omap3beagle_nand_partitions[] = { | 53 | static struct mtd_partition omap3beagle_nand_partitions[] = { |
@@ -93,20 +90,6 @@ static struct omap_nand_platform_data omap3beagle_nand_data = { | |||
93 | .dev_ready = NULL, | 90 | .dev_ready = NULL, |
94 | }; | 91 | }; |
95 | 92 | ||
96 | static struct resource omap3beagle_nand_resource = { | ||
97 | .flags = IORESOURCE_MEM, | ||
98 | }; | ||
99 | |||
100 | static struct platform_device omap3beagle_nand_device = { | ||
101 | .name = "omap2-nand", | ||
102 | .id = -1, | ||
103 | .dev = { | ||
104 | .platform_data = &omap3beagle_nand_data, | ||
105 | }, | ||
106 | .num_resources = 1, | ||
107 | .resource = &omap3beagle_nand_resource, | ||
108 | }; | ||
109 | |||
110 | /* DSS */ | 93 | /* DSS */ |
111 | 94 | ||
112 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) | 95 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) |
@@ -424,8 +407,6 @@ static void __init omap3beagle_flash_init(void) | |||
424 | u8 cs = 0; | 407 | u8 cs = 0; |
425 | u8 nandcs = GPMC_CS_NUM + 1; | 408 | u8 nandcs = GPMC_CS_NUM + 1; |
426 | 409 | ||
427 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
428 | |||
429 | /* find out the chip-select on which NAND exists */ | 410 | /* find out the chip-select on which NAND exists */ |
430 | while (cs < GPMC_CS_NUM) { | 411 | while (cs < GPMC_CS_NUM) { |
431 | u32 ret = 0; | 412 | u32 ret = 0; |
@@ -447,12 +428,9 @@ static void __init omap3beagle_flash_init(void) | |||
447 | 428 | ||
448 | if (nandcs < GPMC_CS_NUM) { | 429 | if (nandcs < GPMC_CS_NUM) { |
449 | omap3beagle_nand_data.cs = nandcs; | 430 | omap3beagle_nand_data.cs = nandcs; |
450 | omap3beagle_nand_data.gpmc_cs_baseaddr = (void *) | ||
451 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
452 | omap3beagle_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add); | ||
453 | 431 | ||
454 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 432 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
455 | if (platform_device_register(&omap3beagle_nand_device) < 0) | 433 | if (gpmc_nand_init(&omap3beagle_nand_data) < 0) |
456 | printk(KERN_ERR "Unable to register NAND device\n"); | 434 | printk(KERN_ERR "Unable to register NAND device\n"); |
457 | } | 435 | } |
458 | } | 436 | } |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 2f5f8233dd5b..288f9d5c7291 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -54,9 +54,6 @@ | |||
54 | 54 | ||
55 | #include <asm/setup.h> | 55 | #include <asm/setup.h> |
56 | 56 | ||
57 | #define GPMC_CS0_BASE 0x60 | ||
58 | #define GPMC_CS_SIZE 0x30 | ||
59 | |||
60 | #define NAND_BLOCK_SIZE SZ_128K | 57 | #define NAND_BLOCK_SIZE SZ_128K |
61 | 58 | ||
62 | #define OMAP3_AC_GPIO 136 | 59 | #define OMAP3_AC_GPIO 136 |
@@ -106,20 +103,6 @@ static struct omap_nand_platform_data omap3touchbook_nand_data = { | |||
106 | .dev_ready = NULL, | 103 | .dev_ready = NULL, |
107 | }; | 104 | }; |
108 | 105 | ||
109 | static struct resource omap3touchbook_nand_resource = { | ||
110 | .flags = IORESOURCE_MEM, | ||
111 | }; | ||
112 | |||
113 | static struct platform_device omap3touchbook_nand_device = { | ||
114 | .name = "omap2-nand", | ||
115 | .id = -1, | ||
116 | .dev = { | ||
117 | .platform_data = &omap3touchbook_nand_data, | ||
118 | }, | ||
119 | .num_resources = 1, | ||
120 | .resource = &omap3touchbook_nand_resource, | ||
121 | }; | ||
122 | |||
123 | #include "sdram-micron-mt46h32m32lf-6.h" | 106 | #include "sdram-micron-mt46h32m32lf-6.h" |
124 | 107 | ||
125 | static struct omap2_hsmmc_info mmc[] = { | 108 | static struct omap2_hsmmc_info mmc[] = { |
@@ -458,8 +441,6 @@ static void __init omap3touchbook_flash_init(void) | |||
458 | u8 cs = 0; | 441 | u8 cs = 0; |
459 | u8 nandcs = GPMC_CS_NUM + 1; | 442 | u8 nandcs = GPMC_CS_NUM + 1; |
460 | 443 | ||
461 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
462 | |||
463 | /* find out the chip-select on which NAND exists */ | 444 | /* find out the chip-select on which NAND exists */ |
464 | while (cs < GPMC_CS_NUM) { | 445 | while (cs < GPMC_CS_NUM) { |
465 | u32 ret = 0; | 446 | u32 ret = 0; |
@@ -481,13 +462,9 @@ static void __init omap3touchbook_flash_init(void) | |||
481 | 462 | ||
482 | if (nandcs < GPMC_CS_NUM) { | 463 | if (nandcs < GPMC_CS_NUM) { |
483 | omap3touchbook_nand_data.cs = nandcs; | 464 | omap3touchbook_nand_data.cs = nandcs; |
484 | omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *) | ||
485 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
486 | omap3touchbook_nand_data.gpmc_baseaddr = | ||
487 | (void *) (gpmc_base_add); | ||
488 | 465 | ||
489 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 466 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
490 | if (platform_device_register(&omap3touchbook_nand_device) < 0) | 467 | if (gpmc_nand_init(&omap3touchbook_nand_data) < 0) |
491 | printk(KERN_ERR "Unable to register NAND device\n"); | 468 | printk(KERN_ERR "Unable to register NAND device\n"); |
492 | } | 469 | } |
493 | } | 470 | } |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 4ceeb56c414c..7fe3296faa25 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -58,8 +58,6 @@ | |||
58 | #define OVERO_GPIO_USBH_NRESET 183 | 58 | #define OVERO_GPIO_USBH_NRESET 183 |
59 | 59 | ||
60 | #define NAND_BLOCK_SIZE SZ_128K | 60 | #define NAND_BLOCK_SIZE SZ_128K |
61 | #define GPMC_CS0_BASE 0x60 | ||
62 | #define GPMC_CS_SIZE 0x30 | ||
63 | 61 | ||
64 | #define OVERO_SMSC911X_CS 5 | 62 | #define OVERO_SMSC911X_CS 5 |
65 | #define OVERO_SMSC911X_GPIO 176 | 63 | #define OVERO_SMSC911X_GPIO 176 |
@@ -269,28 +267,11 @@ static struct omap_nand_platform_data overo_nand_data = { | |||
269 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 267 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
270 | }; | 268 | }; |
271 | 269 | ||
272 | static struct resource overo_nand_resource = { | ||
273 | .flags = IORESOURCE_MEM, | ||
274 | }; | ||
275 | |||
276 | static struct platform_device overo_nand_device = { | ||
277 | .name = "omap2-nand", | ||
278 | .id = -1, | ||
279 | .dev = { | ||
280 | .platform_data = &overo_nand_data, | ||
281 | }, | ||
282 | .num_resources = 1, | ||
283 | .resource = &overo_nand_resource, | ||
284 | }; | ||
285 | |||
286 | |||
287 | static void __init overo_flash_init(void) | 270 | static void __init overo_flash_init(void) |
288 | { | 271 | { |
289 | u8 cs = 0; | 272 | u8 cs = 0; |
290 | u8 nandcs = GPMC_CS_NUM + 1; | 273 | u8 nandcs = GPMC_CS_NUM + 1; |
291 | 274 | ||
292 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
293 | |||
294 | /* find out the chip-select on which NAND exists */ | 275 | /* find out the chip-select on which NAND exists */ |
295 | while (cs < GPMC_CS_NUM) { | 276 | while (cs < GPMC_CS_NUM) { |
296 | u32 ret = 0; | 277 | u32 ret = 0; |
@@ -312,12 +293,9 @@ static void __init overo_flash_init(void) | |||
312 | 293 | ||
313 | if (nandcs < GPMC_CS_NUM) { | 294 | if (nandcs < GPMC_CS_NUM) { |
314 | overo_nand_data.cs = nandcs; | 295 | overo_nand_data.cs = nandcs; |
315 | overo_nand_data.gpmc_cs_baseaddr = (void *) | ||
316 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
317 | overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add); | ||
318 | 296 | ||
319 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 297 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
320 | if (platform_device_register(&overo_nand_device) < 0) | 298 | if (gpmc_nand_init(&overo_nand_data) < 0) |
321 | printk(KERN_ERR "Unable to register NAND device\n"); | 299 | printk(KERN_ERR "Unable to register NAND device\n"); |
322 | } | 300 | } |
323 | } | 301 | } |
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c b/arch/arm/mach-omap2/board-sdp-flash.c index 2d026328e385..2638c834dec2 100644 --- a/arch/arm/mach-omap2/board-sdp-flash.c +++ b/arch/arm/mach-omap2/board-sdp-flash.c | |||
@@ -162,11 +162,6 @@ __init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs) | |||
162 | sdp_nand_data.parts = sdp_nand_parts.parts; | 162 | sdp_nand_data.parts = sdp_nand_parts.parts; |
163 | sdp_nand_data.nr_parts = sdp_nand_parts.nr_parts; | 163 | sdp_nand_data.nr_parts = sdp_nand_parts.nr_parts; |
164 | 164 | ||
165 | sdp_nand_data.gpmc_cs_baseaddr = (void *)(OMAP34XX_GPMC_VIRT + | ||
166 | GPMC_CS0_BASE + | ||
167 | cs * GPMC_CS_SIZE); | ||
168 | sdp_nand_data.gpmc_baseaddr = (void *) (OMAP34XX_GPMC_VIRT); | ||
169 | |||
170 | gpmc_nand_init(&sdp_nand_data); | 165 | gpmc_nand_init(&sdp_nand_data); |
171 | } | 166 | } |
172 | #else | 167 | #else |