summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-06-08 10:42:23 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-03-08 23:21:22 +0100
commit229204da53b31d576fcc1c93a33626943ea8202c (patch)
treed383c2136538b6f79d1b6730e4f9407b324d8566 /drivers/mtd/nand/nand_base.c
parent10d4e75c36f6c16311dde1461f318210da357219 (diff)
downloadop-kernel-dev-229204da53b31d576fcc1c93a33626943ea8202c.zip
op-kernel-dev-229204da53b31d576fcc1c93a33626943ea8202c.tar.gz
mtd: nand: Move AMD/Spansion specific init/detection logic in nand_amd.c
Move AMD/Spansion specific initialization/detection logic into nand_amd.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index f45e3bb..a9060bc 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3825,8 +3825,6 @@ EXPORT_SYMBOL_GPL(nand_decode_ext_id);
static void nand_decode_id(struct nand_chip *chip, struct nand_flash_dev *type)
{
struct mtd_info *mtd = nand_to_mtd(chip);
- u8 *id_data = chip->id.data;
- int maf_id = id_data[0];
mtd->erasesize = type->erasesize;
mtd->writesize = type->pagesize;
@@ -3834,19 +3832,6 @@ static void nand_decode_id(struct nand_chip *chip, struct nand_flash_dev *type)
/* All legacy ID NAND are small-page, SLC */
chip->bits_per_cell = 1;
-
- /*
- * Check for Spansion/AMD ID + repeating 5th, 6th byte since
- * some Spansion chips have erasesize that conflicts with size
- * listed in nand_ids table.
- * Data sheet (5 byte ID): Spansion S30ML-P ORNAND (p.39)
- */
- if (maf_id == NAND_MFR_AMD && id_data[4] != 0x00 && id_data[5] == 0x00
- && id_data[6] == 0x00 && id_data[7] == 0x00
- && mtd->writesize == 512) {
- mtd->erasesize = 128 * 1024;
- mtd->erasesize <<= ((id_data[3] & 0x03) << 1);
- }
}
/*
@@ -3872,8 +3857,7 @@ static void nand_decode_bbm_options(struct nand_chip *chip)
* Micron devices with 2KiB pages and on SLC Samsung, Hynix, Toshiba,
* AMD/Spansion, and Macronix. All others scan only the first page.
*/
- if (nand_is_slc(chip) &&
- (maf_id == NAND_MFR_AMD || maf_id == NAND_MFR_MACRONIX))
+ if (nand_is_slc(chip) && maf_id == NAND_MFR_MACRONIX)
chip->bbt_options |= NAND_BBT_SCAN2NDPAGE;
}
OpenPOWER on IntegriCloud