diff options
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 7299d87a1cb3..6d447c9ce8ab 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/spi/spi.h> | 31 | #include <linux/spi/spi.h> |
32 | #include <linux/spi/ads7846.h> | 32 | #include <linux/spi/ads7846.h> |
33 | #include <linux/spi/corgi_lcd.h> | 33 | #include <linux/spi/corgi_lcd.h> |
34 | #include <linux/mtd/sharpsl.h> | ||
34 | 35 | ||
35 | #include <asm/setup.h> | 36 | #include <asm/setup.h> |
36 | #include <asm/memory.h> | 37 | #include <asm/memory.h> |
@@ -613,6 +614,54 @@ static struct pxafb_mach_info spitz_pxafb_info = { | |||
613 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, | 614 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, |
614 | }; | 615 | }; |
615 | 616 | ||
617 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
618 | { | ||
619 | .name = "System Area", | ||
620 | .offset = 0, | ||
621 | .size = 7 * 1024 * 1024, | ||
622 | }, | ||
623 | { | ||
624 | .name = "Root Filesystem", | ||
625 | .offset = 7 * 1024 * 1024, | ||
626 | }, | ||
627 | { | ||
628 | .name = "Home Filesystem", | ||
629 | .offset = MTDPART_OFS_APPEND, | ||
630 | .size = MTDPART_SIZ_FULL, | ||
631 | }, | ||
632 | }; | ||
633 | |||
634 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
635 | |||
636 | static struct nand_bbt_descr sharpsl_bbt = { | ||
637 | .options = 0, | ||
638 | .offs = 4, | ||
639 | .len = 2, | ||
640 | .pattern = scan_ff_pattern | ||
641 | }; | ||
642 | |||
643 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
644 | .badblock_pattern = &sharpsl_bbt, | ||
645 | .partitions = sharpsl_nand_partitions, | ||
646 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
647 | }; | ||
648 | |||
649 | static struct resource sharpsl_nand_resources[] = { | ||
650 | { | ||
651 | .start = 0x0C000000, | ||
652 | .end = 0x0C000FFF, | ||
653 | .flags = IORESOURCE_MEM, | ||
654 | }, | ||
655 | }; | ||
656 | |||
657 | static struct platform_device sharpsl_nand_device = { | ||
658 | .name = "sharpsl-nand", | ||
659 | .id = -1, | ||
660 | .resource = sharpsl_nand_resources, | ||
661 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
662 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
663 | }; | ||
664 | |||
616 | 665 | ||
617 | static struct mtd_partition sharpsl_rom_parts[] = { | 666 | static struct mtd_partition sharpsl_rom_parts[] = { |
618 | { | 667 | { |
@@ -648,6 +697,7 @@ static struct platform_device *devices[] __initdata = { | |||
648 | &spitzscoop_device, | 697 | &spitzscoop_device, |
649 | &spitzkbd_device, | 698 | &spitzkbd_device, |
650 | &spitzled_device, | 699 | &spitzled_device, |
700 | &sharpsl_nand_device, | ||
651 | &sharpsl_rom_device, | 701 | &sharpsl_rom_device, |
652 | }; | 702 | }; |
653 | 703 | ||
@@ -671,6 +721,14 @@ static void __init common_init(void) | |||
671 | pm_power_off = spitz_poweroff; | 721 | pm_power_off = spitz_poweroff; |
672 | arm_pm_restart = spitz_restart; | 722 | arm_pm_restart = spitz_restart; |
673 | 723 | ||
724 | if (machine_is_spitz()) { | ||
725 | sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; | ||
726 | } else if (machine_is_akita()) { | ||
727 | sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; | ||
728 | } else if (machine_is_borzoi()) { | ||
729 | sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; | ||
730 | } | ||
731 | |||
674 | PMCR = 0x00; | 732 | PMCR = 0x00; |
675 | 733 | ||
676 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ | 734 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ |
@@ -715,10 +773,29 @@ static struct i2c_board_info akita_i2c_board_info[] = { | |||
715 | }, | 773 | }, |
716 | }; | 774 | }; |
717 | 775 | ||
776 | static struct nand_bbt_descr sharpsl_akita_bbt = { | ||
777 | .options = 0, | ||
778 | .offs = 4, | ||
779 | .len = 1, | ||
780 | .pattern = scan_ff_pattern | ||
781 | }; | ||
782 | |||
783 | static struct nand_ecclayout akita_oobinfo = { | ||
784 | .eccbytes = 24, | ||
785 | .eccpos = { | ||
786 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, | ||
787 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, | ||
788 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, | ||
789 | .oobfree = {{0x08, 0x09}} | ||
790 | }; | ||
791 | |||
718 | static void __init akita_init(void) | 792 | static void __init akita_init(void) |
719 | { | 793 | { |
720 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; | 794 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; |
721 | 795 | ||
796 | sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; | ||
797 | sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; | ||
798 | |||
722 | /* We just pretend the second element of the array doesn't exist */ | 799 | /* We just pretend the second element of the array doesn't exist */ |
723 | spitz_pcmcia_config.num_devs = 1; | 800 | spitz_pcmcia_config.num_devs = 1; |
724 | platform_scoop_config = &spitz_pcmcia_config; | 801 | platform_scoop_config = &spitz_pcmcia_config; |