]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[MTD] make dataflash write-verify be optional
authorDavid Brownell <dbrownell@users.sourceforge.net>
Thu, 7 Aug 2008 04:55:14 +0000 (21:55 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 7 Aug 2008 10:49:00 +0000 (11:49 +0100)
This adds a WRITE_VERIFY Kconfig option to the DataFlash driver,
closely mirroring the similar NAND and ONENAND options, giving
an option to disable some code that's currently always enabled.

Removing this step probably saves a millisecond or so per page
when writing data, which will add up quickly since these pages
are small (the largest is 1 KiB).  It doesn't seem to add a
lot in terms of reliability, and wouldn't detect errors which
crop up when transferring data to the on-chip SRAM buffer.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/Kconfig
drivers/mtd/devices/mtd_dataflash.c

index 88f4df047464a0f1c207ab2b0cda07b93faf7cf6..6fde0a2e3567d589fb4757a12eb49929b1c6c463 100644 (file)
@@ -59,6 +59,16 @@ config MTD_DATAFLASH
          Sometimes DataFlash chips are packaged inside MMC-format
          cards; at this writing, the MMC stack won't handle those.
 
+config MTD_DATAFLASH_WRITE_VERIFY
+       bool "Verify DataFlash page writes"
+       depends on MTD_DATAFLASH
+       help
+         This adds an extra check when data is written to the flash.
+         It may help if you are verifying chip setup (timings etc) on
+         your board.  There is a rare possibility that even though the
+         device thinks the write was successful, a bit could have been
+         flipped accidentally due to device wear or something else.
+
 config MTD_DATAFLASH_OTP
        bool "DataFlash OTP support (Security Register)"
        depends on MTD_DATAFLASH
index 90161277902bff4b7662a404d1fb45cc38d4aacc..6dd9aff8bb2d37181fb711c98f9d839f1fd52a15 100644 (file)
  * doesn't (yet) use these for any kind of i/o overlap or prefetching.
  *
  * Sometimes DataFlash is packaged in MMC-format cards, although the
- * MMC stack can't use SPI (yet), or distinguish between MMC and DataFlash
+ * MMC stack can't (yet?) distinguish between MMC and DataFlash
  * protocols during enumeration.
  */
 
-#define CONFIG_DATAFLASH_WRITE_VERIFY
-
 /* reads can bypass the buffers */
 #define OP_READ_CONTINUOUS     0xE8
 #define OP_READ_PAGE           0xD2
@@ -403,7 +401,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
                (void) dataflash_waitready(priv->spi);
 
 
-#ifdef CONFIG_DATAFLASH_WRITE_VERIFY
+#ifdef CONFIG_MTD_DATAFLASH_VERIFY_WRITE
 
                /* (3) Compare to Buffer1 */
                addr = pageaddr << priv->page_offset;
@@ -432,7 +430,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
                } else
                        status = 0;
 
-#endif /* CONFIG_DATAFLASH_WRITE_VERIFY */
+#endif /* CONFIG_MTD_DATAFLASH_VERIFY_WRITE */
 
                remaining = remaining - writelen;
                pageaddr++;