summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-10 09:25:44 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-10 09:25:44 +0000
commita58f6e9b547fd1930a673c526db4476f2ccfaa77 (patch)
treee5023db15f8d89dd681843c8b2e195476445f5c2 /flashrom.c
parentf20b7beff054eb316088d590094d9efbc68dbee1 (diff)
downloadast2050-flashrom-a58f6e9b547fd1930a673c526db4476f2ccfaa77.zip
ast2050-flashrom-a58f6e9b547fd1930a673c526db4476f2ccfaa77.tar.gz
Refine messages related to erase/write recovery
We are more verbose inside erase_and_write_flash() although it does not matter as much as at the end of the whole process in doit(). New output for the non-fatal (i.e. read-protected + successful recovery read) case: Reading old flash chip contents... done. Erasing and writing flash chip... spi_block_erase_d8 failed during command execution at address 0x8000 Reading current flash chip contents... done. spi_chip_erase_c7 failed during command execution FAILED! Uh oh. Erase/write failed. Checking if anything has changed. Reading current flash chip contents... done. Good, writing to the flash chip apparently didn't do anything. Please check the connections (especially those to write protection pins) between the programmer and the flash chip. If you think the error is caused by flashrom please report this on IRC at chat.freenode.net (channel #flashrom) or mail flashrom@flashrom.org, thanks! Corresponding to flashrom svn r1790. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/flashrom.c b/flashrom.c
index 9e87164..b3661c1 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1521,7 +1521,7 @@ int erase_and_write_flash(struct flashctx *flash, uint8_t *oldcontents, uint8_t
static void nonfatal_help_message(void)
{
- msg_gerr("Writing to the flash chip apparently didn't do anything.\n");
+ msg_gerr("Good, writing to the flash chip apparently didn't do anything.\n");
#if CONFIG_INTERNAL == 1
if (programmer == PROGRAMMER_INTERNAL)
msg_gerr("This means we have to add special support for your board, programmer or flash\n"
@@ -2008,16 +2008,18 @@ int doit(struct flashctx *flash, int force, const char *filename, int read_it,
if (write_it) {
if (erase_and_write_flash(flash, oldcontents, newcontents)) {
- msg_cerr("Uh oh. Erase/write failed. Checking if "
- "anything changed.\n");
+ msg_cerr("Uh oh. Erase/write failed. Checking if anything has changed.\n");
+ msg_cinfo("Reading current flash chip contents... ");
if (!flash->chip->read(flash, newcontents, 0, size)) {
+ msg_cinfo("done.\n");
if (!memcmp(oldcontents, newcontents, size)) {
- msg_cinfo("Good. It seems nothing was changed.\n");
nonfatal_help_message();
ret = 1;
goto out;
}
- }
+ msg_cerr("Apparently at least some data has changed.\n");
+ } else
+ msg_cerr("Can't even read anymore!\n");
emergency_help_message();
ret = 1;
goto out;
OpenPOWER on IntegriCloud