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

Gernot Hoyler Gernot.Hoyler at spansion.com
Thu Aug 29 11:14:49 EDT 2013


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 at spansion.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

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");
+		}
 	}
 }
 
-- 
1.7.4.2




More information about the linux-mtd mailing list