[PATCH v3 3/3] mtd: nand: add support for H27UCG8T2B(16K + 1280)

Huang Shijie b32955 at freescale.com
Fri Jan 3 03:08:38 EST 2014


Assume that:
          tmp = ((extid >> 2) & 0x04) | (extid & 0x03));

>From H27UCG8T2B's datasheet, we know that:
   (1) the oob size is 640 when the tmp is 6;
   (2) the oob size got from (1) is just the per 8K oob size.
       the real oob size should be multipled with the ((page size) / 8K).

Signed-off-by: Huang Shijie <b32955 at freescale.com>
---
 drivers/mtd/nand/nand_base.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 2c2f7af..5be3a71 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3245,10 +3245,17 @@ static void nand_parse_hynix(struct mtd_info *mtd, struct nand_chip *chip,
 		case 5:
 			mtd->oobsize = 16;
 			break;
+		case 6:
+			mtd->oobsize = 640;
+			break;
 		default:
 			mtd->oobsize = 640;
 			break;
 		}
+
+		/* See H27UCG8T2B (p.22) */
+		if (mtd->writesize > SZ_8K)
+			mtd->oobsize *= mtd->writesize / SZ_8K;
 	} else {
 		switch (tmp) {
 		case 0:
-- 
1.7.2.rc3





More information about the linux-mtd mailing list