diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-12-10 10:49:12 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-12-10 10:49:12 -0500 |
commit | c4956ed6fab26347ab1a712727da84b2501ab2dd (patch) | |
tree | 6ac59589a722faaa70a1865ff8050c5274ba0216 /arch/arm/mach-pxa | |
parent | c80a7b265fedef584a1bb8baf92a5b289a66e039 (diff) | |
parent | 6af7a8eb1eb2b5a0967fccf61e750b085d60ad48 (diff) |
Merge branch 'misc/mtd/sharpsl-nand' of git://git.kernel.org/pub/scm/linux/kernel/git/lumag/tosa-2.6
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/corgi.c | 54 | ||||
-rw-r--r-- | arch/arm/mach-pxa/poodle.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 77 |
3 files changed, 182 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 65558d6aa220..b65be8e7792a 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/ads7846.h> | 27 | #include <linux/spi/ads7846.h> |
28 | #include <linux/spi/corgi_lcd.h> | 28 | #include <linux/spi/corgi_lcd.h> |
29 | #include <linux/mtd/sharpsl.h> | ||
29 | #include <video/w100fb.h> | 30 | #include <video/w100fb.h> |
30 | 31 | ||
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
@@ -541,11 +542,61 @@ err_free_1: | |||
541 | static inline void corgi_init_spi(void) {} | 542 | static inline void corgi_init_spi(void) {} |
542 | #endif | 543 | #endif |
543 | 544 | ||
545 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
546 | { | ||
547 | .name = "System Area", | ||
548 | .offset = 0, | ||
549 | .size = 7 * 1024 * 1024, | ||
550 | }, | ||
551 | { | ||
552 | .name = "Root Filesystem", | ||
553 | .offset = 7 * 1024 * 1024, | ||
554 | .size = 25 * 1024 * 1024, | ||
555 | }, | ||
556 | { | ||
557 | .name = "Home Filesystem", | ||
558 | .offset = MTDPART_OFS_APPEND, | ||
559 | .size = MTDPART_SIZ_FULL, | ||
560 | }, | ||
561 | }; | ||
562 | |||
563 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
564 | |||
565 | static struct nand_bbt_descr sharpsl_bbt = { | ||
566 | .options = 0, | ||
567 | .offs = 4, | ||
568 | .len = 2, | ||
569 | .pattern = scan_ff_pattern | ||
570 | }; | ||
571 | |||
572 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
573 | .badblock_pattern = &sharpsl_bbt, | ||
574 | .partitions = sharpsl_nand_partitions, | ||
575 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
576 | }; | ||
577 | |||
578 | static struct resource sharpsl_nand_resources[] = { | ||
579 | { | ||
580 | .start = 0x0C000000, | ||
581 | .end = 0x0C000FFF, | ||
582 | .flags = IORESOURCE_MEM, | ||
583 | }, | ||
584 | }; | ||
585 | |||
586 | static struct platform_device sharpsl_nand_device = { | ||
587 | .name = "sharpsl-nand", | ||
588 | .id = -1, | ||
589 | .resource = sharpsl_nand_resources, | ||
590 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
591 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
592 | }; | ||
593 | |||
544 | static struct platform_device *devices[] __initdata = { | 594 | static struct platform_device *devices[] __initdata = { |
545 | &corgiscoop_device, | 595 | &corgiscoop_device, |
546 | &corgifb_device, | 596 | &corgifb_device, |
547 | &corgikbd_device, | 597 | &corgikbd_device, |
548 | &corgiled_device, | 598 | &corgiled_device, |
599 | &sharpsl_nand_device, | ||
549 | }; | 600 | }; |
550 | 601 | ||
551 | static void corgi_poweroff(void) | 602 | static void corgi_poweroff(void) |
@@ -585,6 +636,9 @@ static void __init corgi_init(void) | |||
585 | 636 | ||
586 | platform_scoop_config = &corgi_pcmcia_config; | 637 | platform_scoop_config = &corgi_pcmcia_config; |
587 | 638 | ||
639 | if (machine_is_husky()) | ||
640 | sharpsl_nand_partitions[1].size = 53 * 1024 * 1024; | ||
641 | |||
588 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 642 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
589 | } | 643 | } |
590 | 644 | ||
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) |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 3be76ee2bdbf..7672b09c31b9 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/spi/spi.h> | 30 | #include <linux/spi/spi.h> |
31 | #include <linux/spi/ads7846.h> | 31 | #include <linux/spi/ads7846.h> |
32 | #include <linux/spi/corgi_lcd.h> | 32 | #include <linux/spi/corgi_lcd.h> |
33 | #include <linux/mtd/sharpsl.h> | ||
33 | 34 | ||
34 | #include <asm/setup.h> | 35 | #include <asm/setup.h> |
35 | #include <asm/memory.h> | 36 | #include <asm/memory.h> |
@@ -608,11 +609,60 @@ static struct pxafb_mach_info spitz_pxafb_info = { | |||
608 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, | 609 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, |
609 | }; | 610 | }; |
610 | 611 | ||
612 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
613 | { | ||
614 | .name = "System Area", | ||
615 | .offset = 0, | ||
616 | .size = 7 * 1024 * 1024, | ||
617 | }, | ||
618 | { | ||
619 | .name = "Root Filesystem", | ||
620 | .offset = 7 * 1024 * 1024, | ||
621 | }, | ||
622 | { | ||
623 | .name = "Home Filesystem", | ||
624 | .offset = MTDPART_OFS_APPEND, | ||
625 | .size = MTDPART_SIZ_FULL, | ||
626 | }, | ||
627 | }; | ||
628 | |||
629 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
630 | |||
631 | static struct nand_bbt_descr sharpsl_bbt = { | ||
632 | .options = 0, | ||
633 | .offs = 4, | ||
634 | .len = 2, | ||
635 | .pattern = scan_ff_pattern | ||
636 | }; | ||
637 | |||
638 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
639 | .badblock_pattern = &sharpsl_bbt, | ||
640 | .partitions = sharpsl_nand_partitions, | ||
641 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
642 | }; | ||
643 | |||
644 | static struct resource sharpsl_nand_resources[] = { | ||
645 | { | ||
646 | .start = 0x0C000000, | ||
647 | .end = 0x0C000FFF, | ||
648 | .flags = IORESOURCE_MEM, | ||
649 | }, | ||
650 | }; | ||
651 | |||
652 | static struct platform_device sharpsl_nand_device = { | ||
653 | .name = "sharpsl-nand", | ||
654 | .id = -1, | ||
655 | .resource = sharpsl_nand_resources, | ||
656 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
657 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
658 | }; | ||
659 | |||
611 | 660 | ||
612 | static struct platform_device *devices[] __initdata = { | 661 | static struct platform_device *devices[] __initdata = { |
613 | &spitzscoop_device, | 662 | &spitzscoop_device, |
614 | &spitzkbd_device, | 663 | &spitzkbd_device, |
615 | &spitzled_device, | 664 | &spitzled_device, |
665 | &sharpsl_nand_device, | ||
616 | }; | 666 | }; |
617 | 667 | ||
618 | static void spitz_poweroff(void) | 668 | static void spitz_poweroff(void) |
@@ -635,6 +685,14 @@ static void __init common_init(void) | |||
635 | pm_power_off = spitz_poweroff; | 685 | pm_power_off = spitz_poweroff; |
636 | arm_pm_restart = spitz_restart; | 686 | arm_pm_restart = spitz_restart; |
637 | 687 | ||
688 | if (machine_is_spitz()) { | ||
689 | sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; | ||
690 | } else if (machine_is_akita()) { | ||
691 | sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; | ||
692 | } else if (machine_is_borzoi()) { | ||
693 | sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; | ||
694 | } | ||
695 | |||
638 | PMCR = 0x00; | 696 | PMCR = 0x00; |
639 | 697 | ||
640 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ | 698 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ |
@@ -679,10 +737,29 @@ static struct i2c_board_info akita_i2c_board_info[] = { | |||
679 | }, | 737 | }, |
680 | }; | 738 | }; |
681 | 739 | ||
740 | static struct nand_bbt_descr sharpsl_akita_bbt = { | ||
741 | .options = 0, | ||
742 | .offs = 4, | ||
743 | .len = 1, | ||
744 | .pattern = scan_ff_pattern | ||
745 | }; | ||
746 | |||
747 | static struct nand_ecclayout akita_oobinfo = { | ||
748 | .eccbytes = 24, | ||
749 | .eccpos = { | ||
750 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, | ||
751 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, | ||
752 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, | ||
753 | .oobfree = {{0x08, 0x09}} | ||
754 | }; | ||
755 | |||
682 | static void __init akita_init(void) | 756 | static void __init akita_init(void) |
683 | { | 757 | { |
684 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; | 758 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; |
685 | 759 | ||
760 | sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; | ||
761 | sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; | ||
762 | |||
686 | /* We just pretend the second element of the array doesn't exist */ | 763 | /* We just pretend the second element of the array doesn't exist */ |
687 | spitz_pcmcia_config.num_devs = 1; | 764 | spitz_pcmcia_config.num_devs = 1; |
688 | platform_scoop_config = &spitz_pcmcia_config; | 765 | platform_scoop_config = &spitz_pcmcia_config; |