aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2007-12-12 11:27:03 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-04-06 10:01:56 -0400
commit81ec5364a58c0545b694dee02fe65b9ae48f37b6 (patch)
treebc45bdf4930c3e2677354a6d2e3a8d6ca028eb0c
parent45b09076149f1360e15919ca7e004e8d3810a0f7 (diff)
[MTD] [NAND] Add support for 4KiB pages.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/nand_base.c18
-rw-r--r--include/linux/mtd/nand.h4
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 0793ca39cc88..facee262b4ba 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -82,6 +82,20 @@ static struct nand_ecclayout nand_oob_64 = {
82 .length = 38}} 82 .length = 38}}
83}; 83};
84 84
85static struct nand_ecclayout nand_oob_128 = {
86 .eccbytes = 48,
87 .eccpos = {
88 80, 81, 82, 83, 84, 85, 86, 87,
89 88, 89, 90, 91, 92, 93, 94, 95,
90 96, 97, 98, 99, 100, 101, 102, 103,
91 104, 105, 106, 107, 108, 109, 110, 111,
92 112, 113, 114, 115, 116, 117, 118, 119,
93 120, 121, 122, 123, 124, 125, 126, 127},
94 .oobfree = {
95 {.offset = 2,
96 .length = 78}}
97};
98
85static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, 99static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd,
86 int new_state); 100 int new_state);
87 101
@@ -2638,6 +2652,9 @@ int nand_scan_tail(struct mtd_info *mtd)
2638 case 64: 2652 case 64:
2639 chip->ecc.layout = &nand_oob_64; 2653 chip->ecc.layout = &nand_oob_64;
2640 break; 2654 break;
2655 case 128:
2656 chip->ecc.layout = &nand_oob_128;
2657 break;
2641 default: 2658 default:
2642 printk(KERN_WARNING "No oob scheme defined for " 2659 printk(KERN_WARNING "No oob scheme defined for "
2643 "oobsize %d\n", mtd->oobsize); 2660 "oobsize %d\n", mtd->oobsize);
@@ -2767,6 +2784,7 @@ int nand_scan_tail(struct mtd_info *mtd)
2767 break; 2784 break;
2768 case 4: 2785 case 4:
2769 case 8: 2786 case 8:
2787 case 16:
2770 mtd->subpage_sft = 2; 2788 mtd->subpage_sft = 2;
2771 break; 2789 break;
2772 } 2790 }
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index db5b63da2a7e..7efb9be34662 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -43,8 +43,8 @@ extern void nand_wait_ready(struct mtd_info *mtd);
43 * is supported now. If you add a chip with bigger oobsize/page 43 * is supported now. If you add a chip with bigger oobsize/page
44 * adjust this accordingly. 44 * adjust this accordingly.
45 */ 45 */
46#define NAND_MAX_OOBSIZE 64 46#define NAND_MAX_OOBSIZE 128
47#define NAND_MAX_PAGESIZE 2048 47#define NAND_MAX_PAGESIZE 4096
48 48
49/* 49/*
50 * Constants for hardware specific CLE/ALE/NCE function 50 * Constants for hardware specific CLE/ALE/NCE function