[flashrom] [PATCH 11/12] Add support for Spansion S25FL...S chips.

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Sat Jun 15 19:34:00 CEST 2013


 - S25FL128S
 - S25FL256S uniform version (defunct due to addressing)
 - S25FL512S uniform version (defunct due to addressing)

Merge Intel S33 status register functions with this one's.

Signed-off-by: Nikolay Nikolaev <evrinoma at gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 chipdrivers.h     |    4 +-
 flashchips.c      |  130 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 flashchips.h      |    3 ++
 spi25_statusreg.c |    8 ++--
 4 files changed, 128 insertions(+), 17 deletions(-)

diff --git a/chipdrivers.h b/chipdrivers.h
index fce3ed4..d12b38f 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -91,8 +91,8 @@ int spi_disable_blockprotect_at25f512b(struct flashctx *flash);
 int spi_disable_blockprotect_at25fs010(struct flashctx *flash);
 int spi_disable_blockprotect_at25fs040(struct flashctx *flash);
 int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash);
-int spi_prettyprint_status_register_s33(struct flashctx *flash);
-int spi_disable_blockprotect_s33(struct flashctx *flash);
+int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash);
+int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash);
 int spi_prettyprint_status_register_sst25(struct flashctx *flash);
 int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash);
 int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash);
diff --git a/flashchips.c b/flashchips.c
index 599dd10..47966e8 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -5160,8 +5160,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -5199,8 +5199,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -5238,8 +5238,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -5277,8 +5277,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -5316,8 +5316,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -5355,8 +5355,8 @@ const struct flashchip flashchips[] = {
 				.block_erase = spi_block_erase_c7,
 			}
 		},
-		.printlock	= spi_prettyprint_status_register_s33,
-		.unlock		= spi_disable_blockprotect_s33,
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd,
+		.unlock		= spi_disable_blockprotect_bp2_ep_srwd,
 		.write		= spi_chip_write_256,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
@@ -8392,6 +8392,112 @@ const struct flashchip flashchips[] = {
 	},
 
 	{
+		.vendor		= "Spansion",
+		.name		= "S25FL128S......0", /* uniform 256kB sectors */
+		.bustype	= BUS_SPI,
+		.manufacture_id	= SPANSION_ID,
+		.model_id	= SPANSION_S25FL128,
+		.total_size	= 16384,
+		.page_size	= 256,
+		/* supports 4B addressing */
+		/* OTP: 1024B total, 32B reserved; read 0x4B; write 0x42 */
+		.feature_bits	= FEATURE_WRSR_WREN | FEATURE_OTP,
+		.tested		= TEST_UNTESTED,
+		.probe		= probe_spi_rdid,
+		.probe_timing	= TIMING_ZERO,
+		.block_erasers	= {
+			{
+				.eraseblocks = { {4 * 1024, 4096} },
+				.block_erase = spi_block_erase_20,
+			}, {
+				.eraseblocks = { {256 * 1024, 64} },
+				.block_erase = spi_block_erase_d8,
+			}, {
+				.eraseblocks = { { 16384 * 1024, 1} },
+				.block_erase = spi_block_erase_60,
+			}, {
+				.eraseblocks = { { 16384 * 1024, 1} },
+				.block_erase = spi_block_erase_c7,
+			}
+		},
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd, /* TODO: SR2 and many others */
+		.unlock		= spi_disable_blockprotect_bp2_srwd, /* TODO: various other locks */
+		.write		= spi_chip_write_256, /* Multi I/O supported */
+		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
+		.voltage	= {2700, 3600},
+	},
+
+	{
+		.vendor		= "Spansion",
+		.name		= "S25FL256S......0", /* uniform 256kB sectors */
+		.bustype	= BUS_SPI,
+		.manufacture_id	= SPANSION_ID,
+		.model_id	= SPANSION_S25FL256,
+		.total_size	= 32768,
+		.page_size	= 256,
+		/* supports 4B addressing */
+		/* OTP: 1024B total, 32B reserved; read 0x4B; write 0x42 */
+		.feature_bits	= FEATURE_WRSR_WREN | FEATURE_OTP,
+		.tested		= TEST_BAD_REW,
+		.probe		= probe_spi_rdid,
+		.probe_timing	= TIMING_ZERO,
+		.block_erasers	= {
+			{
+				.eraseblocks = { {4 * 1024, 8192} },
+				.block_erase = spi_block_erase_20,
+			}, {
+				.eraseblocks = { {256 * 1024, 128} },
+				.block_erase = spi_block_erase_d8,
+			}, {
+				.eraseblocks = { { 32768 * 1024, 1} },
+				.block_erase = spi_block_erase_60,
+			}, {
+				.eraseblocks = { { 32768 * 1024, 1} },
+				.block_erase = spi_block_erase_c7,
+			}
+		},
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd, /* TODO: SR2 and many others */
+		.unlock		= spi_disable_blockprotect_bp2_srwd, /* TODO: various other locks */
+		.write		= spi_chip_write_256, /* Multi I/O supported */
+		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
+		.voltage	= {2700, 3600},
+	},
+
+	{
+		.vendor		= "Spansion",
+		.name		= "S25FL512S",
+		.bustype	= BUS_SPI,
+		.manufacture_id	= SPANSION_ID,
+		.model_id	= SPANSION_S25FL512,
+		.total_size	= 65536,
+		.page_size	= 256,
+		/* supports 4B addressing */
+		/* supports SFDP */
+		/* OTP: 1024B total, 32B reserved; read 0x4B; write 0x42 */
+		.feature_bits	= FEATURE_WRSR_WREN | FEATURE_OTP,
+		.tested		= TEST_BAD_REW,
+		.probe		= probe_spi_rdid,
+		.probe_timing	= TIMING_ZERO,
+		.block_erasers	= {
+			{
+				.eraseblocks = { {256 * 1024, 256} },
+				.block_erase = spi_block_erase_d8,
+			}, {
+				.eraseblocks = { { 65536 * 1024, 1} },
+				.block_erase = spi_block_erase_60,
+			}, {
+				.eraseblocks = { { 65536 * 1024, 1} },
+				.block_erase = spi_block_erase_c7,
+			}
+		},
+		.printlock	= spi_prettyprint_status_register_bp2_ep_srwd, /* TODO: SR2 and many others */
+		.unlock		= spi_disable_blockprotect_bp2_srwd, /* TODO: various other locks */
+		.write		= spi_chip_write_256, /* Multi I/O supported */
+		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
+		.voltage	= {2700, 3600},
+	},
+
+	{
 		.vendor		= "SST",
 		.name		= "SST25LF040A",
 		.bustype	= BUS_SPI,
diff --git a/flashchips.h b/flashchips.h
index 1a4b932..8a14762 100644
--- a/flashchips.h
+++ b/flashchips.h
@@ -528,6 +528,9 @@
 #define SPANSION_S25FL016A	0x0214
 #define SPANSION_S25FL032A	0x0215	/* Same as S25FL032P, but the latter supports EDI and CFI */
 #define SPANSION_S25FL064A	0x0216	/* Same as S25FL064P, but the latter supports EDI and CFI */
+#define SPANSION_S25FL128	0x2018
+#define SPANSION_S25FL256	0x0219
+#define SPANSION_S25FL512	0x0220
 #define SPANSION_S25FL204	0x4013
 #define SPANSION_S25FL208	0x4014
 #define SPANSION_S25FL216	0x4015	/* Same as S25FL216K, but the latter supports OTP, 3 status regs, quad I/O, SFDP etc. */
diff --git a/spi25_statusreg.c b/spi25_statusreg.c
index 33dd780..8759299 100644
--- a/spi25_statusreg.c
+++ b/spi25_statusreg.c
@@ -584,15 +584,17 @@ int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash)
 	return 0;
 }
 
-/* === Intel === */
+/* === Intel/Numonyx/Micron - Spansion === */
 
+/* Used by Intel/Numonyx S33 and Spansion S25FL-S chips */
 /* TODO: Clear P_FAIL and E_FAIL with Clear SR Fail Flags Command (30h) here? */
-int spi_disable_blockprotect_s33(struct flashctx *flash)
+int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash)
 {
 	return spi_disable_blockprotect_bp2_srwd(flash);
 }
 
-int spi_prettyprint_status_register_s33(struct flashctx *flash)
+/* Used by Intel/Numonyx S33 and Spansion S25FL-S chips */
+int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash)
 {
 	uint8_t status = spi_read_status_register(flash);
 	msg_cdbg("Chip status register is %02x\n", status);
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list