]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[MTD] [NAND] Add support for 4KiB pages.
authorThomas Gleixner <tglx@linutronix.de>
Wed, 12 Dec 2007 16:27:03 +0000 (17:27 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 6 Apr 2009 14:01:56 +0000 (07:01 -0700)
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>
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h

index 0793ca39cc88777c1c95ad75d82e4045d5063e19..facee262b4ba7fa257874ecc3f6c0fd857be7015 100644 (file)
@@ -82,6 +82,20 @@ static struct nand_ecclayout nand_oob_64 = {
                 .length = 38}}
 };
 
+static struct nand_ecclayout nand_oob_128 = {
+       .eccbytes = 48,
+       .eccpos = {
+                  80, 81, 82, 83, 84, 85, 86, 87,
+                  88, 89, 90, 91, 92, 93, 94, 95,
+                  96, 97, 98, 99, 100, 101, 102, 103,
+                  104, 105, 106, 107, 108, 109, 110, 111,
+                  112, 113, 114, 115, 116, 117, 118, 119,
+                  120, 121, 122, 123, 124, 125, 126, 127},
+       .oobfree = {
+               {.offset = 2,
+                .length = 78}}
+};
+
 static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd,
                           int new_state);
 
@@ -2638,6 +2652,9 @@ int nand_scan_tail(struct mtd_info *mtd)
                case 64:
                        chip->ecc.layout = &nand_oob_64;
                        break;
+               case 128:
+                       chip->ecc.layout = &nand_oob_128;
+                       break;
                default:
                        printk(KERN_WARNING "No oob scheme defined for "
                               "oobsize %d\n", mtd->oobsize);
@@ -2767,6 +2784,7 @@ int nand_scan_tail(struct mtd_info *mtd)
                        break;
                case 4:
                case 8:
+               case 16:
                        mtd->subpage_sft = 2;
                        break;
                }
index db5b63da2a7e46d619a746233cf40b4a8397e4c9..7efb9be34662b4aeb905adb246e366b2f9a1a58f 100644 (file)
@@ -43,8 +43,8 @@ extern void nand_wait_ready(struct mtd_info *mtd);
  * is supported now. If you add a chip with bigger oobsize/page
  * adjust this accordingly.
  */
-#define NAND_MAX_OOBSIZE       64
-#define NAND_MAX_PAGESIZE      2048
+#define NAND_MAX_OOBSIZE       128
+#define NAND_MAX_PAGESIZE      4096
 
 /*
  * Constants for hardware specific CLE/ALE/NCE function