diff options
author | Sean Nelson <audiohacked@gmail.com> | 2010-02-19 00:52:10 +0000 |
---|---|---|
committer | Sean Nelson <audiohacked@gmail.com> | 2010-02-19 00:52:10 +0000 |
commit | 6e0b912f469a5595c138b3f7ddad77d691330e2f (patch) | |
tree | 1a47f0ac8bfdb814720ae28cbd96678e7424894b /flashrom.c | |
parent | ce5fad038d2802e6caec11da1bfc7dc9780e7ee5 (diff) | |
download | flashrom-6e0b912f469a5595c138b3f7ddad77d691330e2f.tar.gz flashrom-6e0b912f469a5595c138b3f7ddad77d691330e2f.tar.bz2 flashrom-6e0b912f469a5595c138b3f7ddad77d691330e2f.zip |
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>
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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. "); |