mtd: nand: Samsung MLC - new OOB sizes

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Oct 24 20:59:04 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=34c5bf6cc78e56537e0d508f5979f27ea8a64e31
Commit:     34c5bf6cc78e56537e0d508f5979f27ea8a64e31
Parent:     eea116ed0497dc9c4a981b8c7017d758fc835ded
Author:     Brian Norris <norris at broadcom.com>
AuthorDate: Fri Aug 20 10:50:43 2010 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun Oct 24 23:43:44 2010 +0100

    mtd: nand: Samsung MLC - new OOB sizes
    
    There are some additions to the detection scheme used by Samsung
    MLC NAND. These simple changes to support the 400- and 436-byte OOB
    are found in the following data sheet:
    
    Samsung K9GBG08U0M (p.40)
    
    Signed-off-by: Brian Norris <norris at broadcom.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nand_base.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 1ae953c..596ac84 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2859,7 +2859,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 		/*
 		 * Field definitions are in the following datasheets:
 		 * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32)
-		 * New style   (6 byte ID): Samsung K9GAG08U0D (p.40)
+		 * New style   (6 byte ID): Samsung K9GBG08U0M (p.40)
 		 *
 		 * Check for wraparound + Samsung ID + nonzero 6th byte
 		 * to decide what to do.
@@ -2872,7 +2872,20 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 			mtd->writesize = 2048 << (extid & 0x03);
 			extid >>= 2;
 			/* Calc oobsize */
-			mtd->oobsize = (extid & 0x03) == 0x01 ? 128 : 218;
+			switch (extid & 0x03) {
+			case 1:
+				mtd->oobsize = 128;
+				break;
+			case 2:
+				mtd->oobsize = 218;
+				break;
+			case 3:
+				mtd->oobsize = 400;
+				break;
+			default:
+				mtd->oobsize = 436;
+				break;
+			}
 			extid >>= 2;
 			/* Calc blocksize */
 			mtd->erasesize = (128 * 1024) <<



More information about the linux-mtd-cvs mailing list