diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/Kconfig | 10 | ||||
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 88f4df047464..6fde0a2e3567 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig | |||
@@ -59,6 +59,16 @@ config MTD_DATAFLASH | |||
59 | Sometimes DataFlash chips are packaged inside MMC-format | 59 | Sometimes DataFlash chips are packaged inside MMC-format |
60 | cards; at this writing, the MMC stack won't handle those. | 60 | cards; at this writing, the MMC stack won't handle those. |
61 | 61 | ||
62 | config MTD_DATAFLASH_WRITE_VERIFY | ||
63 | bool "Verify DataFlash page writes" | ||
64 | depends on MTD_DATAFLASH | ||
65 | help | ||
66 | This adds an extra check when data is written to the flash. | ||
67 | It may help if you are verifying chip setup (timings etc) on | ||
68 | your board. There is a rare possibility that even though the | ||
69 | device thinks the write was successful, a bit could have been | ||
70 | flipped accidentally due to device wear or something else. | ||
71 | |||
62 | config MTD_DATAFLASH_OTP | 72 | config MTD_DATAFLASH_OTP |
63 | bool "DataFlash OTP support (Security Register)" | 73 | bool "DataFlash OTP support (Security Register)" |
64 | depends on MTD_DATAFLASH | 74 | depends on MTD_DATAFLASH |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 90161277902b..6dd9aff8bb2d 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -30,12 +30,10 @@ | |||
30 | * doesn't (yet) use these for any kind of i/o overlap or prefetching. | 30 | * doesn't (yet) use these for any kind of i/o overlap or prefetching. |
31 | * | 31 | * |
32 | * Sometimes DataFlash is packaged in MMC-format cards, although the | 32 | * Sometimes DataFlash is packaged in MMC-format cards, although the |
33 | * MMC stack can't use SPI (yet), or distinguish between MMC and DataFlash | 33 | * MMC stack can't (yet?) distinguish between MMC and DataFlash |
34 | * protocols during enumeration. | 34 | * protocols during enumeration. |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #define CONFIG_DATAFLASH_WRITE_VERIFY | ||
38 | |||
39 | /* reads can bypass the buffers */ | 37 | /* reads can bypass the buffers */ |
40 | #define OP_READ_CONTINUOUS 0xE8 | 38 | #define OP_READ_CONTINUOUS 0xE8 |
41 | #define OP_READ_PAGE 0xD2 | 39 | #define OP_READ_PAGE 0xD2 |
@@ -403,7 +401,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
403 | (void) dataflash_waitready(priv->spi); | 401 | (void) dataflash_waitready(priv->spi); |
404 | 402 | ||
405 | 403 | ||
406 | #ifdef CONFIG_DATAFLASH_WRITE_VERIFY | 404 | #ifdef CONFIG_MTD_DATAFLASH_VERIFY_WRITE |
407 | 405 | ||
408 | /* (3) Compare to Buffer1 */ | 406 | /* (3) Compare to Buffer1 */ |
409 | addr = pageaddr << priv->page_offset; | 407 | addr = pageaddr << priv->page_offset; |
@@ -432,7 +430,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
432 | } else | 430 | } else |
433 | status = 0; | 431 | status = 0; |
434 | 432 | ||
435 | #endif /* CONFIG_DATAFLASH_WRITE_VERIFY */ | 433 | #endif /* CONFIG_MTD_DATAFLASH_VERIFY_WRITE */ |
436 | 434 | ||
437 | remaining = remaining - writelen; | 435 | remaining = remaining - writelen; |
438 | pageaddr++; | 436 | pageaddr++; |