Add support for Winbond W39F010/W39L010/W39L020

W39F010 is a 128kB parallel 5V flash chip, 16k bootblocks.
W39L010 is a 128kB parallel 3.3V flash chip, 8k bootblocks.
W39L020 is a 256kB parallel 3.3V flash chip, 64k/16k bootblocks.

The W39F010 code was tested with a satasii programmer. The first write
attempt after an erase returned with verify failure, but the second
write attempt was succesful:
http://paste.flashrom.org/view.php?id=1418

Corresponding to flashrom svn r1620.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
diff --git a/w39.c b/w39.c
index da61d23..9dcb06a 100644
--- a/w39.c
+++ b/w39.c
@@ -115,6 +115,15 @@
 	return 0;
 }
 
+static int printlock_w39_single_bootblock(uint8_t lock, uint16_t kB)
+{
+	msg_cdbg("Software %d kB bootblock locking is %sactive.\n", kB, (lock & 0x03) ? "" : "not ");
+	if (lock & 0x03)
+		return -1;
+
+	return 0;
+}
+
 static int printlock_w39_bootblock_64k16k(uint8_t lock)
 {
 	msg_cdbg("Software 64 kB bootblock locking is %sactive.\n",
@@ -160,6 +169,54 @@
 	return 0;
 }
 
+int printlock_w39f010(struct flashctx *flash)
+{
+	uint8_t lock;
+	int ret;
+
+	lock = w39_idmode_readb(flash, 0x00002);
+	msg_cdbg("Bottom boot block:\n");
+	ret = printlock_w39_single_bootblock(lock, 16);
+
+	lock = w39_idmode_readb(flash, 0x1fff2);
+	msg_cdbg("Top boot block:\n");
+	ret |= printlock_w39_single_bootblock(lock, 16);
+
+	return ret;
+}
+
+int printlock_w39l010(struct flashctx *flash)
+{
+	uint8_t lock;
+	int ret;
+
+	lock = w39_idmode_readb(flash, 0x00002);
+	msg_cdbg("Bottom boot block:\n");
+	ret = printlock_w39_single_bootblock(lock, 8);
+
+	lock = w39_idmode_readb(flash, 0x1fff2);
+	msg_cdbg("Top boot block:\n");
+	ret |= printlock_w39_single_bootblock(lock, 8);
+
+	return ret;
+}
+
+int printlock_w39l020(struct flashctx *flash)
+{
+	uint8_t lock;
+	int ret;
+
+	lock = w39_idmode_readb(flash, 0x00002);
+	msg_cdbg("Bottom boot block:\n");
+	ret = printlock_w39_bootblock_64k16k(lock);
+
+	lock = w39_idmode_readb(flash, 0x3fff2);
+	msg_cdbg("Top boot block:\n");
+	ret |= printlock_w39_bootblock_64k16k(lock);
+
+	return ret;
+}
+
 int printlock_w39l040(struct flashctx *flash)
 {
 	uint8_t lock;