[flashrom] [PATCH 4/5] Use layout for verify operations too

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Dec 26 20:39:21 CET 2011


Am 24.12.2011 01:35 schrieb Stefan Tauner:
> this still reads the whole image in...
>
> Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>

This kills the flashrom reliability guarantee. If someone specifies an
image for inclusion and flashing goes wrong outside the image region
(accidental erase for a too large region, may happen for Macronix
eLiteFlash which has the same ID as normal Macronix flash or for any
chip/programmer driver bug), flashrom won't notice and the user is left
with garbage in the chip despite a "SUCCESS" message.

The only case where skipping verify of any region is allowable is an
unreadable region. Such an unreadable region should be skipped with a
message along the lines of "Skipping verify for inaccessible region
0xfoo-0xbar".

And in the end it boils down to the old problem: How do we specify
regions and their characteristics?

Suggestion, more of an RFC than a hard proposal:

struct region{
char *name;
unsigned int rwflags;
unsigned int start;
unsigned int end;
_Bool included;
};

rwflags would be a bit for each of may_write and may_read, or a bit for
each of dont_write and dont_read. Not sure which one is preferable.

This also means we need a new layout file version.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list