Changeset 1392 for trunk


Ignore:
Timestamp:
07/26/11 16:28:35 (10 months ago)
Author:
stefanct
Message:

Fix output of erase_and_write_flash and surroundings

see http://www.flashrom.org/pipermail/flashrom/2011-July/007220.html
for a discussion about the details.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Signed-off-by: Stefan Tauner <stefan.tauner@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Acked-by: Stefan Tauner <stefan.tauner@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/flashrom.c

    r1386 r1392  
    14721472                        if (do_something(flash, start, len, param1, param2, 
    14731473                                         eraser.block_erase)) { 
    1474                                 msg_cdbg("\n"); 
    14751474                                return 1; 
    14761475                        } 
     
    15231522 
    15241523        for (k = 0; k < NUM_ERASEFUNCTIONS; k++) { 
     1524                if (k != 0) 
     1525                        msg_cdbg("Looking for another erase function.\n"); 
    15251526                if (!usable_erasefunctions) { 
    15261527                        msg_cdbg("No usable erase functions left.\n"); 
    15271528                        break; 
    15281529                } 
    1529                 msg_cdbg("Looking at blockwise erase function %i... ", k); 
    1530                 if (check_block_eraser(flash, k, 1)) { 
    1531                         msg_cdbg("Looking for another erase function.\n"); 
     1530                msg_cdbg("Trying erase function %i... ", k); 
     1531                if (check_block_eraser(flash, k, 1)) 
    15321532                        continue; 
    1533                 } 
    15341533                usable_erasefunctions--; 
    1535                 msg_cdbg("trying... "); 
    1536                 ret = walk_eraseregions(flash, k, &erase_and_write_block_helper, curcontents, newcontents); 
    1537                 msg_cdbg("\n"); 
     1534                ret = walk_eraseregions(flash, k, &erase_and_write_block_helper, 
     1535                                        curcontents, newcontents); 
    15381536                /* If everything is OK, don't try another erase function. */ 
    15391537                if (!ret) 
     
    15451543                if (!usable_erasefunctions) 
    15461544                        continue; 
     1545                /* Reading the whole chip may take a while, inform the user even 
     1546                 * in non-verbose mode. 
     1547                 */ 
     1548                msg_cinfo("Reading current flash chip contents... "); 
    15471549                if (flash->read(flash, curcontents, 0, size)) { 
    15481550                        /* Now we are truly screwed. Read failed as well. */ 
    1549                         msg_cerr("Can't read anymore!\n"); 
     1551                        msg_cerr("Can't read anymore! Aborting.\n"); 
    15501552                        /* We have no idea about the flash chip contents, so 
    15511553                         * retrying with another erase function is pointless. 
     
    15531555                        break; 
    15541556                } 
     1557                msg_cinfo("done. "); 
    15551558        } 
    15561559        /* Free the scratchpad. */ 
     
    15601563                msg_cerr("FAILED!\n"); 
    15611564        } else { 
    1562                 msg_cinfo("Done.\n"); 
     1565                msg_cinfo("Erase/write done.\n"); 
    15631566        } 
    15641567        return ret; 
     
    19391942         * takes time as well. 
    19401943         */ 
    1941         msg_cdbg("Reading old flash chip contents... "); 
     1944        msg_cinfo("Reading old flash chip contents... "); 
    19421945        if (flash->read(flash, oldcontents, 0, size)) { 
    19431946                ret = 1; 
    1944                 msg_cdbg("FAILED.\n"); 
     1947                msg_cinfo("FAILED.\n"); 
    19451948                goto out; 
    19461949        } 
    1947         msg_cdbg("done.\n"); 
     1950        msg_cinfo("done.\n"); 
    19481951 
    19491952        // This should be moved into each flash part's code to do it  
Note: See TracChangeset for help on using the changeset viewer.