• Carl-Daniel Hailfinger's avatar
    Always read the flash chip before writing · 42d38a9d
    Carl-Daniel Hailfinger authored
    
    This will allow flashrom to skip erase of already-erased blocks and to
    skip write of blocks which already have the wanted contents.
    
    Avoid emergency messages by checking if the chip contents after a failed
    write operation (erase/write) are unchanged.
    
    Keep the emergency messages after a failed pure erase. That part is
    debatable because if someone wants erase, he pretty sure doesn't care
    about the flash contents anymore.
    
    Please note that this introduces additional overhead of a full chip read
    before write. This is frowned upon by people with slow programmers. A
    followup patch will make this configurable.
    
    Corresponding to flashrom svn r1215.
    Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
    Acked-by: default avatarStefan Reinauer <stepan@coreboot.org>
    42d38a9d
flashrom.c 48.6 KB