From 6e0b912f469a5595c138b3f7ddad77d691330e2f Mon Sep 17 00:00:00 2001 From: Sean Nelson Date: Fri, 19 Feb 2010 00:52:10 +0000 Subject: 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 Acked-by: Michael Karcher --- flashrom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index b8de3c1..d67680a 100644 --- a/flashrom.c +++ b/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. "); -- cgit v1.1