Refactor unlocking of many chips with locking at register space address +2

This includes PMC Pm49*, SST 49LF00*, ST M50* and Winbond W39* families.
The erase and write test status bits of all affected chips have been reset.

Corresponding to flashrom svn r1833.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
diff --git a/chipdrivers.h b/chipdrivers.h
index 03d922d..57b1340 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -131,7 +131,6 @@
 int erase_block_82802ab(struct flashctx *flash, unsigned int page, unsigned int pagesize);
 int write_82802ab(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 void print_status_82802ab(uint8_t status);
-int unlock_82802ab(struct flashctx *flash);
 int unlock_28f004s5(struct flashctx *flash);
 int unlock_lh28f008bjt(struct flashctx *flash);
 
@@ -146,15 +145,20 @@
 int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize);
 int erase_chip_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize);
 
+int unlock_regspace2_uniform_32k(struct flashctx *flash);
+int unlock_regspace2_uniform_64k(struct flashctx *flash);
+int unlock_regspace2_block_eraser_0(struct flashctx *flash);
+int unlock_regspace2_block_eraser_1(struct flashctx *flash);
+int unlock_regspace2_block(const struct flashctx *flash, chipaddr off);
+int printlock_regspace2_uniform_64k(struct flashctx *flash);
+int printlock_regspace2_block_eraser_0(struct flashctx *flash);
+int printlock_regspace2_block_eraser_1(struct flashctx *flash);
+
 /* m29f400bt.c */
 int probe_m29f400bt(struct flashctx *flash);
 int write_m29f400bt(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 void protect_m29f400bt(struct flashctx *flash, chipaddr bios);
 
-/* pm49fl00x.c */
-int unlock_49fl00x(struct flashctx *flash);
-int lock_49fl00x(struct flashctx *flash);
-
 /* sst28sf040.c */
 int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 int erase_sector_28sf040(struct flashctx *flash, unsigned int address, unsigned int sector_size);
@@ -164,7 +168,6 @@
 
 /* sst49lfxxxc.c */
 int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size);
-int unlock_49lfxxxc(struct flashctx *flash);
 
 /* sst_fwhub.c */
 int printlock_sst_fwhub(struct flashctx *flash);
@@ -184,8 +187,6 @@
 int printlock_w39v080a(struct flashctx *flash);
 int printlock_w39v080fa(struct flashctx *flash);
 int printlock_w39v080fa_dual(struct flashctx *flash);
-int unlock_w39v040fb(struct flashctx *flash);
-int unlock_w39v080fa(struct flashctx *flash);
 int printlock_at49f(struct flashctx *flash);
 
 /* w29ee011.c */
@@ -193,8 +194,6 @@
 
 /* stm50.c */
 int erase_sector_stm50(struct flashctx *flash, unsigned int block, unsigned int blocksize);
-int unlock_stm50_uniform(struct flashctx *flash);
-int unlock_stm50_nonuniform(struct flashctx *flash);
 
 /* en29lv640b.c */
 int probe_en29lv640b(struct flashctx *flash);