Patchwork [2/2] mtd: cfi_cmdset_0002: 65 nm changes

login
register
mail settings
Submitter Hoyler, Gernot
Date Aug. 29, 2013, 3:14 p.m.
Message ID <201308291714.49766.Gernot.Hoyler@spansion.com>
Download mbox | patch
Permalink /patch/270823/
State New
Headers show

Comments

Hoyler, Gernot - Aug. 29, 2013, 3:14 p.m.
To increase both program throughput and data reliability, Spansion recommends
to operate today's flash devices that are built in 65 nm or smaller process
technology in block write mode. For example, the Spansion S29GL-S family
internally programs data in chunks of 32 bytes. Therefore a writesize of a multiple
of 32 bytes would be fine in general. A value of 512 has been found a good
compromise between maximum throughput (the larger the better) and risk of
data loss during a power failure event (the smaller the better).


Signed-off-by: Gernot Hoyler <Gernot.Hoyler@spansion.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index b8f7b87..9952fde 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -196,9 +196,17 @@  static void fixup_use_write_buffers(struct mtd_info *mtd)
 {
 	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
+	struct cfi_pri_amdstd *extp = cfi->cmdset_priv;
+
 	if (cfi->cfiq->BufWriteTimeoutTyp) {
 		pr_debug("Using buffer write method\n" );
 		mtd->_write = cfi_amdstd_write_buffers;
+
+		if (extp->SiliconRevision >= 0x1C) {
+			mtd->writesize = 512;
+			mtd->flags &= ~MTD_BIT_WRITEABLE;
+			printk(KERN_INFO "Setting mtd writesize = 512 bytes\n");
+		}
 	}
 }