1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

Print an error message on read errors and abort instead of proceeding anyway

Improve error checking in file write, chip read and chip verify.
Refactor the read routines a bit to split reading from file writing.

Log for a failed read:
[...]
Found chip "Winbond W25x16" (2048 KB, SPI) at physical address
0xffe00000.
Reading flash... Invalid OPCODE 0x03
Read operation failed!
FAILED.

Corresponding to flashrom svn r1079.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stephen Kou <stephen@hyarros.com>
This commit is contained in:
Carl-Daniel Hailfinger
2010-07-13 23:56:13 +00:00
parent 4d3e9ca733
commit 1748c5701f
3 changed files with 46 additions and 19 deletions

View File

@ -579,7 +579,7 @@ void map_flash_registers(struct flashchip *flash);
int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len);
int erase_flash(struct flashchip *flash);
struct flashchip *probe_flash(struct flashchip *first_flash, int force);
int read_flash(struct flashchip *flash, char *filename);
int read_flash_to_file(struct flashchip *flash, char *filename);
void check_chip_supported(struct flashchip *flash);
int check_max_decode(enum chipbustype buses, uint32_t size);
int min(int a, int b);