Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115986
b: refs/heads/master
c: 8c64038
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and David Woodhouse committed Aug 7, 2008
1 parent 53a48fd commit 75688f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf93ae02600e2c752bf2570085e7970a1c0f2b94
refs/heads/master: 8c64038e4c077b2b37c6b27d0c40c77a3ddfaeef
10 changes: 10 additions & 0 deletions trunk/drivers/mtd/devices/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/mtd/devices/mtd_dataflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
* 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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit 75688f9

Please sign in to comment.