diff options
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 304765140634..ec6841d8e956 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2983,19 +2983,18 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, | |||
2983 | /* | 2983 | /* |
2984 | * Field definitions are in the following datasheets: | 2984 | * Field definitions are in the following datasheets: |
2985 | * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) | 2985 | * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) |
2986 | * New style (6 byte ID): Samsung K9GBG08U0M (p.40) | 2986 | * New style (6 byte ID): Samsung K9GAG08U0F (p.44) |
2987 | * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22) | 2987 | * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22) |
2988 | * | 2988 | * |
2989 | * Check for ID length, cell type, and Hynix/Samsung ID to decide what | 2989 | * Check for ID length, cell type, and Hynix/Samsung ID to decide what |
2990 | * to do. | 2990 | * to do. |
2991 | */ | 2991 | */ |
2992 | if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG && | 2992 | if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG) { |
2993 | (chip->cellinfo & NAND_CI_CELLTYPE_MSK)) { | ||
2994 | /* Calc pagesize */ | 2993 | /* Calc pagesize */ |
2995 | mtd->writesize = 2048 << (extid & 0x03); | 2994 | mtd->writesize = 2048 << (extid & 0x03); |
2996 | extid >>= 2; | 2995 | extid >>= 2; |
2997 | /* Calc oobsize */ | 2996 | /* Calc oobsize */ |
2998 | switch (extid & 0x03) { | 2997 | switch (((extid >> 2) & 0x04) | (extid & 0x03)) { |
2999 | case 1: | 2998 | case 1: |
3000 | mtd->oobsize = 128; | 2999 | mtd->oobsize = 128; |
3001 | break; | 3000 | break; |
@@ -3005,9 +3004,16 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, | |||
3005 | case 3: | 3004 | case 3: |
3006 | mtd->oobsize = 400; | 3005 | mtd->oobsize = 400; |
3007 | break; | 3006 | break; |
3008 | default: | 3007 | case 4: |
3009 | mtd->oobsize = 436; | 3008 | mtd->oobsize = 436; |
3010 | break; | 3009 | break; |
3010 | case 5: | ||
3011 | mtd->oobsize = 512; | ||
3012 | break; | ||
3013 | case 6: | ||
3014 | default: /* Other cases are "reserved" (unknown) */ | ||
3015 | mtd->oobsize = 640; | ||
3016 | break; | ||
3011 | } | 3017 | } |
3012 | extid >>= 2; | 3018 | extid >>= 2; |
3013 | /* Calc blocksize */ | 3019 | /* Calc blocksize */ |