[flashrom] [PATCH] Add W39L040

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Fri Dec 17 01:14:30 CET 2010


Hello Ivan,

this patch should add support for the W39L040 chip to flashrom. Please
try it on your hardware. If you can't compile flashrom yourself, ask
on the mailing list or our IRC channel (#flashrom on freenode).

Regards,
  Michael Karcher

---
 chipdrivers.h |    1 +
 flashchips.c  |   30 ++++++++++++++++++++++++++++++
 w39.c         |   16 ++++++++++++++++
 3 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/chipdrivers.h b/chipdrivers.h
index a65cb99..a6b97cb 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -110,6 +110,7 @@ int printlock_sst_fwhub(struct flashchip *flash);
 int unlock_sst_fwhub(struct flashchip *flash);
 
 /* w39.c */
+int printlock_w39l040(struct flashchip * flash);
 int printlock_w39v040a(struct flashchip *flash);
 int printlock_w39v040b(struct flashchip *flash);
 int printlock_w39v040c(struct flashchip *flash);
diff --git a/flashchips.c b/flashchips.c
index 8082160..4564d04 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -7573,6 +7573,36 @@ struct flashchip flashchips[] = {
 
 	{
 		.vendor		= "Winbond",
+		.name		= "W39L040",
+		.bustype	= CHIP_BUSTYPE_PARALLEL,
+		.manufacture_id	= WINBOND_ID,
+		.model_id	= WINBOND_W39L040,
+		.total_size	= 512,
+		.page_size	= 64 * 1024,
+		.feature_bits	= FEATURE_EITHER_RESET,
+		.tested		= TEST_OK_PR,
+		.probe		= probe_jedec,
+		.probe_timing	= 10, 
+		.block_erasers	=
+		{
+			{
+				.eraseblocks = { {4 * 1024, 128} },
+				.block_erase = erase_block_jedec,
+			}, {
+				.eraseblocks = { {64 * 1024, 8} },
+				.block_erase = erase_sector_jedec,
+			}, {
+				.eraseblocks = { {512 * 1024, 1} },
+				.block_erase = erase_chip_block_jedec,
+			}
+		},
+		.printlock	= printlock_w39l040,
+		.write		= write_jedec_1,
+		.read		= read_memmapped,
+	},
+
+	{
+		.vendor		= "Winbond",
 		.name		= "W39V040A",
 		.bustype	= CHIP_BUSTYPE_LPC,
 		.manufacture_id	= WINBOND_ID,
diff --git a/w39.c b/w39.c
index 65cf32f..2ab70fd 100644
--- a/w39.c
+++ b/w39.c
@@ -161,6 +161,22 @@ static int unlock_w39_fwh(struct flashchip *flash)
 	return 0;
 }
 
+int printlock_w39l040(struct flashchip * 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, 0x7fff2);
+	msg_cdbg("Top boot block:\n");
+	ret |= printlock_w39_bootblock_64k16k(lock);
+
+	return ret; 
+}
+
 int printlock_w39v040a(struct flashchip *flash)
 {
 	uint8_t lock;
-- 
1.7.2.3





More information about the flashrom mailing list