Commit 34c5bf6c authored by Brian Norris's avatar Brian Norris Committed by David Woodhouse

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: default avatarBrian Norris <norris@broadcom.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent eea116ed
...@@ -2859,7 +2859,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, ...@@ -2859,7 +2859,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
/* /*
* Field definitions are in the following datasheets: * Field definitions are in the following datasheets:
* Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) * 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 * Check for wraparound + Samsung ID + nonzero 6th byte
* to decide what to do. * to decide what to do.
...@@ -2872,7 +2872,20 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, ...@@ -2872,7 +2872,20 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
mtd->writesize = 2048 << (extid & 0x03); mtd->writesize = 2048 << (extid & 0x03);
extid >>= 2; extid >>= 2;
/* Calc oobsize */ /* 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; extid >>= 2;
/* Calc blocksize */ /* Calc blocksize */
mtd->erasesize = (128 * 1024) << mtd->erasesize = (128 * 1024) <<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment