diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-10-16 11:17:05 -0400 |
---|---|---|
committer | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-10-29 14:08:37 -0400 |
commit | 6af7a8eb1eb2b5a0967fccf61e750b085d60ad48 (patch) | |
tree | 05b7d4d994bf5582c037a39c0df152c5a651d858 /arch/arm/mach-pxa/poodle.c | |
parent | a20c7ab570ffdce1d6f67c7acf8c1c502a3b3839 (diff) |
[MTD] sharpsl-nand: move registration to board code
Finally move registration of sharpsl-nand device to board-specific code.
sharpsl nand driver is now clean and simple.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/poodle.c')
-rw-r--r-- | arch/arm/mach-pxa/poodle.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 2e3bd8b1523b..a45afdf25202 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
25 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
26 | #include <linux/mtd/sharpsl.h> | ||
26 | 27 | ||
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -413,9 +414,59 @@ static struct pxafb_mach_info poodle_fb_info = { | |||
413 | .lcd_conn = LCD_COLOR_TFT_16BPP, | 414 | .lcd_conn = LCD_COLOR_TFT_16BPP, |
414 | }; | 415 | }; |
415 | 416 | ||
417 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
418 | { | ||
419 | .name = "System Area", | ||
420 | .offset = 0, | ||
421 | .size = 7 * 1024 * 1024, | ||
422 | }, | ||
423 | { | ||
424 | .name = "Root Filesystem", | ||
425 | .offset = 7 * 1024 * 1024, | ||
426 | .size = 22 * 1024 * 1024, | ||
427 | }, | ||
428 | { | ||
429 | .name = "Home Filesystem", | ||
430 | .offset = MTDPART_OFS_APPEND, | ||
431 | .size = MTDPART_SIZ_FULL, | ||
432 | }, | ||
433 | }; | ||
434 | |||
435 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
436 | |||
437 | static struct nand_bbt_descr sharpsl_bbt = { | ||
438 | .options = 0, | ||
439 | .offs = 4, | ||
440 | .len = 2, | ||
441 | .pattern = scan_ff_pattern | ||
442 | }; | ||
443 | |||
444 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
445 | .badblock_pattern = &sharpsl_bbt, | ||
446 | .partitions = sharpsl_nand_partitions, | ||
447 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
448 | }; | ||
449 | |||
450 | static struct resource sharpsl_nand_resources[] = { | ||
451 | { | ||
452 | .start = 0x0C000000, | ||
453 | .end = 0x0C000FFF, | ||
454 | .flags = IORESOURCE_MEM, | ||
455 | }, | ||
456 | }; | ||
457 | |||
458 | static struct platform_device sharpsl_nand_device = { | ||
459 | .name = "sharpsl-nand", | ||
460 | .id = -1, | ||
461 | .resource = sharpsl_nand_resources, | ||
462 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
463 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
464 | }; | ||
465 | |||
416 | static struct platform_device *devices[] __initdata = { | 466 | static struct platform_device *devices[] __initdata = { |
417 | &poodle_locomo_device, | 467 | &poodle_locomo_device, |
418 | &poodle_scoop_device, | 468 | &poodle_scoop_device, |
469 | &sharpsl_nand_device, | ||
419 | }; | 470 | }; |
420 | 471 | ||
421 | static void poodle_poweroff(void) | 472 | static void poodle_poweroff(void) |