aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/nand_base.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 0fd22cce0ecc..b0f091aca097 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2900,6 +2900,19 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2900 mtd->writesize = type->pagesize; 2900 mtd->writesize = type->pagesize;
2901 mtd->oobsize = mtd->writesize / 32; 2901 mtd->oobsize = mtd->writesize / 32;
2902 busw = type->options & NAND_BUSWIDTH_16; 2902 busw = type->options & NAND_BUSWIDTH_16;
2903
2904 /*
2905 * Check for Spansion/AMD ID + repeating 5th, 6th byte since
2906 * some Spansion chips have erasesize that conflicts with size
2907 * listed in nand_ids table
2908 * Data sheet (5 byte ID): Spansion S30ML-P ORNAND (p.39)
2909 */
2910 if (*maf_id == NAND_MFR_AMD && id_data[4] != 0x00 &&
2911 id_data[5] == 0x00 && id_data[6] == 0x00 &&
2912 id_data[7] == 0x00 && mtd->writesize == 512) {
2913 mtd->erasesize = 128 * 1024;
2914 mtd->erasesize <<= ((id_data[3] & 0x03) << 1);
2915 }
2903 } 2916 }
2904 2917
2905 /* Try to identify manufacturer */ 2918 /* Try to identify manufacturer */