summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-06-26 17:04:16 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-06-26 17:04:16 +0000
commitb4061f61cdf951760020c6d4789023d4001b9782 (patch)
tree99b4aec1edbe35372a0fe653b5448f52c0fe98c8 /flashrom.c
parentbfa021dd80594e51fa25feee56457d545849e312 (diff)
downloadast2050-flashrom-b4061f61cdf951760020c6d4789023d4001b9782.zip
ast2050-flashrom-b4061f61cdf951760020c6d4789023d4001b9782.tar.gz
Move erase verification to generic code
Erase functions are no longer called from chip drivers and thus their internal erase verification can be moved to generic code. This also makes it easier to skip the verify step if desired and to differentiate between failed command submission and failed erase verification. Corresponding to flashrom svn r1353. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/flashrom.c b/flashrom.c
index 6979d84..13dd581 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1400,6 +1400,10 @@ static int erase_and_write_block_helper(struct flashchip *flash,
ret = erasefn(flash, start, len);
if (ret)
return ret;
+ if (check_erased_range(flash, start, len)) {
+ msg_cerr("ERASE FAILED!\n");
+ return -1;
+ }
/* Erase was successful. Adjust curcontents. */
memset(curcontents, 0xff, len);
skip = 0;
OpenPOWER on IntegriCloud