diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2009-09-25 13:15:28 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-11-30 20:02:46 -0500 |
commit | b1e3719e655a74065bdc5ddc58d6f1566dfe8138 (patch) | |
tree | 05517dfd8d261db4909ea93cd8ceb125e0c1d171 /arch | |
parent | d6587c34a6de8e2e577dfc149f2d4352752dafdf (diff) |
[ARM] pxa: add onenand support for SAAR
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/saar.c | 96 |
1 files changed, 95 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index de588636f724..926258703deb 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
@@ -22,9 +22,13 @@ | |||
22 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
23 | #include <linux/smc91x.h> | 23 | #include <linux/smc91x.h> |
24 | #include <linux/mfd/da903x.h> | 24 | #include <linux/mfd/da903x.h> |
25 | #include <linux/mtd/mtd.h> | ||
26 | #include <linux/mtd/partitions.h> | ||
27 | #include <linux/mtd/onenand.h> | ||
25 | 28 | ||
26 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | #include <asm/mach/flash.h> | ||
28 | 32 | ||
29 | #include <mach/pxa930.h> | 33 | #include <mach/pxa930.h> |
30 | #include <plat/i2c.h> | 34 | #include <plat/i2c.h> |
@@ -33,7 +37,7 @@ | |||
33 | #include "devices.h" | 37 | #include "devices.h" |
34 | #include "generic.h" | 38 | #include "generic.h" |
35 | 39 | ||
36 | #define GPIO_LCD_RESET (16) | 40 | #define GPIO_LCD_RESET (16) |
37 | 41 | ||
38 | /* SAAR MFP configurations */ | 42 | /* SAAR MFP configurations */ |
39 | static mfp_cfg_t saar_mfp_cfg[] __initdata = { | 43 | static mfp_cfg_t saar_mfp_cfg[] __initdata = { |
@@ -56,6 +60,31 @@ static mfp_cfg_t saar_mfp_cfg[] __initdata = { | |||
56 | /* Ethernet */ | 60 | /* Ethernet */ |
57 | DF_nCS1_nCS3, | 61 | DF_nCS1_nCS3, |
58 | GPIO97_GPIO, | 62 | GPIO97_GPIO, |
63 | |||
64 | /* DFI */ | ||
65 | DF_INT_RnB_ND_INT_RnB, | ||
66 | DF_nRE_nOE_ND_nRE, | ||
67 | DF_nWE_ND_nWE, | ||
68 | DF_CLE_nOE_ND_CLE, | ||
69 | DF_nADV1_ALE_ND_ALE, | ||
70 | DF_nADV2_ALE_nCS3, | ||
71 | DF_nCS0_ND_nCS0, | ||
72 | DF_IO0_ND_IO0, | ||
73 | DF_IO1_ND_IO1, | ||
74 | DF_IO2_ND_IO2, | ||
75 | DF_IO3_ND_IO3, | ||
76 | DF_IO4_ND_IO4, | ||
77 | DF_IO5_ND_IO5, | ||
78 | DF_IO6_ND_IO6, | ||
79 | DF_IO7_ND_IO7, | ||
80 | DF_IO8_ND_IO8, | ||
81 | DF_IO9_ND_IO9, | ||
82 | DF_IO10_ND_IO10, | ||
83 | DF_IO11_ND_IO11, | ||
84 | DF_IO12_ND_IO12, | ||
85 | DF_IO13_ND_IO13, | ||
86 | DF_IO14_ND_IO14, | ||
87 | DF_IO15_ND_IO15, | ||
59 | }; | 88 | }; |
60 | 89 | ||
61 | #define SAAR_ETH_PHYS (0x14000000) | 90 | #define SAAR_ETH_PHYS (0x14000000) |
@@ -485,12 +514,77 @@ static void __init saar_init_i2c(void) | |||
485 | #else | 514 | #else |
486 | static inline void saar_init_i2c(void) {} | 515 | static inline void saar_init_i2c(void) {} |
487 | #endif | 516 | #endif |
517 | |||
518 | #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) | ||
519 | static struct mtd_partition saar_onenand_partitions[] = { | ||
520 | { | ||
521 | .name = "bootloader", | ||
522 | .offset = 0, | ||
523 | .size = SZ_1M, | ||
524 | .mask_flags = MTD_WRITEABLE, | ||
525 | }, { | ||
526 | .name = "reserved", | ||
527 | .offset = MTDPART_OFS_APPEND, | ||
528 | .size = SZ_128K, | ||
529 | .mask_flags = MTD_WRITEABLE, | ||
530 | }, { | ||
531 | .name = "reserved", | ||
532 | .offset = MTDPART_OFS_APPEND, | ||
533 | .size = SZ_8M, | ||
534 | .mask_flags = MTD_WRITEABLE, | ||
535 | }, { | ||
536 | .name = "kernel", | ||
537 | .offset = MTDPART_OFS_APPEND, | ||
538 | .size = (SZ_2M + SZ_1M), | ||
539 | .mask_flags = 0, | ||
540 | }, { | ||
541 | .name = "filesystem", | ||
542 | .offset = MTDPART_OFS_APPEND, | ||
543 | .size = SZ_48M, | ||
544 | .mask_flags = 0, | ||
545 | } | ||
546 | }; | ||
547 | |||
548 | static struct flash_platform_data saar_onenand_info = { | ||
549 | .parts = saar_onenand_partitions, | ||
550 | .nr_parts = ARRAY_SIZE(saar_onenand_partitions), | ||
551 | }; | ||
552 | |||
553 | #define SMC_CS0_PHYS_BASE (0x10000000) | ||
554 | |||
555 | static struct resource saar_resource_onenand[] = { | ||
556 | [0] = { | ||
557 | .start = SMC_CS0_PHYS_BASE, | ||
558 | .end = SMC_CS0_PHYS_BASE + SZ_1M, | ||
559 | .flags = IORESOURCE_MEM, | ||
560 | }, | ||
561 | }; | ||
562 | |||
563 | static struct platform_device saar_device_onenand = { | ||
564 | .name = "onenand-flash", | ||
565 | .id = -1, | ||
566 | .dev = { | ||
567 | .platform_data = &saar_onenand_info, | ||
568 | }, | ||
569 | .resource = saar_resource_onenand, | ||
570 | .num_resources = ARRAY_SIZE(saar_resource_onenand), | ||
571 | }; | ||
572 | |||
573 | static void __init saar_init_onenand(void) | ||
574 | { | ||
575 | platform_device_register(&saar_device_onenand); | ||
576 | } | ||
577 | #else | ||
578 | static void __init saar_init_onenand(void) {} | ||
579 | #endif | ||
580 | |||
488 | static void __init saar_init(void) | 581 | static void __init saar_init(void) |
489 | { | 582 | { |
490 | /* initialize MFP configurations */ | 583 | /* initialize MFP configurations */ |
491 | pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg)); | 584 | pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg)); |
492 | 585 | ||
493 | platform_device_register(&smc91x_device); | 586 | platform_device_register(&smc91x_device); |
587 | saar_init_onenand(); | ||
494 | 588 | ||
495 | saar_init_i2c(); | 589 | saar_init_i2c(); |
496 | saar_init_lcd(); | 590 | saar_init_lcd(); |