aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a3c7473dd409..d551ddd9537a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2866,6 +2866,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2866 */ 2866 */
2867 if (id_data[0] == id_data[6] && id_data[1] == id_data[7] && 2867 if (id_data[0] == id_data[6] && id_data[1] == id_data[7] &&
2868 id_data[0] == NAND_MFR_SAMSUNG && 2868 id_data[0] == NAND_MFR_SAMSUNG &&
2869 (chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
2869 id_data[5] != 0x00) { 2870 id_data[5] != 0x00) {
2870 /* Calc pagesize */ 2871 /* Calc pagesize */
2871 mtd->writesize = 2048 << (extid & 0x03); 2872 mtd->writesize = 2048 << (extid & 0x03);
@@ -2934,14 +2935,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2934 chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 32 - 1; 2935 chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 32 - 1;
2935 2936
2936 /* Set the bad block position */ 2937 /* Set the bad block position */
2937 if (!(busw & NAND_BUSWIDTH_16) && (*maf_id == NAND_MFR_STMICRO || 2938 if (mtd->writesize > 512 || (busw & NAND_BUSWIDTH_16))
2938 (*maf_id == NAND_MFR_SAMSUNG &&
2939 mtd->writesize == 512) ||
2940 *maf_id == NAND_MFR_AMD))
2941 chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
2942 else
2943 chip->badblockpos = NAND_LARGE_BADBLOCK_POS; 2939 chip->badblockpos = NAND_LARGE_BADBLOCK_POS;
2944 2940 else
2941 chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
2945 2942
2946 /* Get chip options, preserve non chip based options */ 2943 /* Get chip options, preserve non chip based options */
2947 chip->options &= ~NAND_CHIPOPTIONS_MSK; 2944 chip->options &= ~NAND_CHIPOPTIONS_MSK;