diff options
author | Brian Norris <norris@broadcom.com> | 2010-08-20 13:50:43 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-24 18:43:44 -0400 |
commit | 34c5bf6cc78e56537e0d508f5979f27ea8a64e31 (patch) | |
tree | 8fcd9a81d5317f92e3ac5268deee49e87b638a78 /drivers/mtd/nand | |
parent | eea116ed0497dc9c4a981b8c7017d758fc835ded (diff) |
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@broadcom.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | 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 1ae953c4eccc..596ac848b46d 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, | |||
2859 | /* | 2859 | /* |
2860 | * Field definitions are in the following datasheets: | 2860 | * Field definitions are in the following datasheets: |
2861 | * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) | 2861 | * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) |
2862 | * New style (6 byte ID): Samsung K9GAG08U0D (p.40) | 2862 | * New style (6 byte ID): Samsung K9GBG08U0M (p.40) |
2863 | * | 2863 | * |
2864 | * Check for wraparound + Samsung ID + nonzero 6th byte | 2864 | * Check for wraparound + Samsung ID + nonzero 6th byte |
2865 | * to decide what to do. | 2865 | * to decide what to do. |
@@ -2872,7 +2872,20 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, | |||
2872 | mtd->writesize = 2048 << (extid & 0x03); | 2872 | mtd->writesize = 2048 << (extid & 0x03); |
2873 | extid >>= 2; | 2873 | extid >>= 2; |
2874 | /* Calc oobsize */ | 2874 | /* Calc oobsize */ |
2875 | mtd->oobsize = (extid & 0x03) == 0x01 ? 128 : 218; | 2875 | switch (extid & 0x03) { |
2876 | case 1: | ||
2877 | mtd->oobsize = 128; | ||
2878 | break; | ||
2879 | case 2: | ||
2880 | mtd->oobsize = 218; | ||
2881 | break; | ||
2882 | case 3: | ||
2883 | mtd->oobsize = 400; | ||
2884 | break; | ||
2885 | default: | ||
2886 | mtd->oobsize = 436; | ||
2887 | break; | ||
2888 | } | ||
2876 | extid >>= 2; | 2889 | extid >>= 2; |
2877 | /* Calc blocksize */ | 2890 | /* Calc blocksize */ |
2878 | mtd->erasesize = (128 * 1024) << | 2891 | mtd->erasesize = (128 * 1024) << |