mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
Here's a very quick patch to fix the missing unlock code
Fixes missing unlock for certain chips: * unlock_49lf00x * Pm49fl002 * Pm49fl004 * unlock_49flxxxc * SST49LF160C * unlock_winbond_fwhub * W39V080FA * W39V080FA (dual mode) Fixes missing printlock for certain chip: * printlock_w39v040c * W39V040C Corresponding to flashrom svn r907. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
This commit is contained in:
12
flashrom.c
12
flashrom.c
@ -838,6 +838,9 @@ notfound:
|
||||
flash->vendor, flash->name, flash->total_size,
|
||||
flashbuses_to_text(flash->bustype), base);
|
||||
|
||||
if (flash->printlock)
|
||||
flash->printlock(flash);
|
||||
|
||||
return flash;
|
||||
}
|
||||
|
||||
@ -1147,12 +1150,18 @@ int doit(struct flashchip *flash, int force, char *filename, int read_it, int wr
|
||||
fprintf(stderr, "Continuing anyway.\n");
|
||||
}
|
||||
}
|
||||
if (flash->unlock)
|
||||
flash->unlock(flash);
|
||||
|
||||
if (erase_flash(flash)) {
|
||||
emergency_help_message();
|
||||
programmer_shutdown();
|
||||
return 1;
|
||||
}
|
||||
} else if (read_it) {
|
||||
if (flash->unlock)
|
||||
flash->unlock(flash);
|
||||
|
||||
if (read_flash(flash, filename)) {
|
||||
programmer_shutdown();
|
||||
return 1;
|
||||
@ -1160,6 +1169,9 @@ int doit(struct flashchip *flash, int force, char *filename, int read_it, int wr
|
||||
} else {
|
||||
struct stat image_stat;
|
||||
|
||||
if (flash->unlock)
|
||||
flash->unlock(flash);
|
||||
|
||||
if (flash->tested & TEST_BAD_ERASE) {
|
||||
fprintf(stderr, "Erase is not working on this chip "
|
||||
"and erase is needed for write. ");
|
||||
|
Reference in New Issue
Block a user