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/spitz.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/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 524f656dc56d..6ffa6134e107 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> |
@@ -595,11 +596,60 @@ static struct pxafb_mach_info spitz_pxafb_info = { | |||
595 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, | 596 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, |
596 | }; | 597 | }; |
597 | 598 | ||
599 | static struct mtd_partition sharpsl_nand_partitions[] = { | ||
600 | { | ||
601 | .name = "System Area", | ||
602 | .offset = 0, | ||
603 | .size = 7 * 1024 * 1024, | ||
604 | }, | ||
605 | { | ||
606 | .name = "Root Filesystem", | ||
607 | .offset = 7 * 1024 * 1024, | ||
608 | }, | ||
609 | { | ||
610 | .name = "Home Filesystem", | ||
611 | .offset = MTDPART_OFS_APPEND, | ||
612 | .size = MTDPART_SIZ_FULL, | ||
613 | }, | ||
614 | }; | ||
615 | |||
616 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
617 | |||
618 | static struct nand_bbt_descr sharpsl_bbt = { | ||
619 | .options = 0, | ||
620 | .offs = 4, | ||
621 | .len = 2, | ||
622 | .pattern = scan_ff_pattern | ||
623 | }; | ||
624 | |||
625 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { | ||
626 | .badblock_pattern = &sharpsl_bbt, | ||
627 | .partitions = sharpsl_nand_partitions, | ||
628 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), | ||
629 | }; | ||
630 | |||
631 | static struct resource sharpsl_nand_resources[] = { | ||
632 | { | ||
633 | .start = 0x0C000000, | ||
634 | .end = 0x0C000FFF, | ||
635 | .flags = IORESOURCE_MEM, | ||
636 | }, | ||
637 | }; | ||
638 | |||
639 | static struct platform_device sharpsl_nand_device = { | ||
640 | .name = "sharpsl-nand", | ||
641 | .id = -1, | ||
642 | .resource = sharpsl_nand_resources, | ||
643 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), | ||
644 | .dev.platform_data = &sharpsl_nand_platform_data, | ||
645 | }; | ||
646 | |||
598 | 647 | ||
599 | static struct platform_device *devices[] __initdata = { | 648 | static struct platform_device *devices[] __initdata = { |
600 | &spitzscoop_device, | 649 | &spitzscoop_device, |
601 | &spitzkbd_device, | 650 | &spitzkbd_device, |
602 | &spitzled_device, | 651 | &spitzled_device, |
652 | &sharpsl_nand_device, | ||
603 | }; | 653 | }; |
604 | 654 | ||
605 | static void spitz_poweroff(void) | 655 | static void spitz_poweroff(void) |
@@ -622,6 +672,14 @@ static void __init common_init(void) | |||
622 | pm_power_off = spitz_poweroff; | 672 | pm_power_off = spitz_poweroff; |
623 | arm_pm_restart = spitz_restart; | 673 | arm_pm_restart = spitz_restart; |
624 | 674 | ||
675 | if (machine_is_spitz()) { | ||
676 | sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; | ||
677 | } else if (machine_is_akita()) { | ||
678 | sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; | ||
679 | } else if (machine_is_borzoi()) { | ||
680 | sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; | ||
681 | } | ||
682 | |||
625 | PMCR = 0x00; | 683 | PMCR = 0x00; |
626 | 684 | ||
627 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ | 685 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ |
@@ -666,10 +724,29 @@ static struct i2c_board_info akita_i2c_board_info[] = { | |||
666 | }, | 724 | }, |
667 | }; | 725 | }; |
668 | 726 | ||
727 | static struct nand_bbt_descr sharpsl_akita_bbt = { | ||
728 | .options = 0, | ||
729 | .offs = 4, | ||
730 | .len = 1, | ||
731 | .pattern = scan_ff_pattern | ||
732 | }; | ||
733 | |||
734 | static struct nand_ecclayout akita_oobinfo = { | ||
735 | .eccbytes = 24, | ||
736 | .eccpos = { | ||
737 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, | ||
738 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, | ||
739 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, | ||
740 | .oobfree = {{0x08, 0x09}} | ||
741 | }; | ||
742 | |||
669 | static void __init akita_init(void) | 743 | static void __init akita_init(void) |
670 | { | 744 | { |
671 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; | 745 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; |
672 | 746 | ||
747 | sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; | ||
748 | sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; | ||
749 | |||
673 | /* We just pretend the second element of the array doesn't exist */ | 750 | /* We just pretend the second element of the array doesn't exist */ |
674 | spitz_pcmcia_config.num_devs = 1; | 751 | spitz_pcmcia_config.num_devs = 1; |
675 | platform_scoop_config = &spitz_pcmcia_config; | 752 | platform_scoop_config = &spitz_pcmcia_config; |