diff mbox series

Add support for XMC XM25QH128A. Read/write tested.

Message ID 20221013171016.4233-1-foss@volatilesystems.org
State New
Headers show
Series Add support for XMC XM25QH128A. Read/write tested. | expand

Commit Message

Stijn Segers Oct. 13, 2022, 5:10 p.m. UTC
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
---
 flashchips.c         | 49 ++++++++++++++++++++++++++++++++++++++++++++
 include/flashchips.h |  1 +
 2 files changed, 50 insertions(+)
diff mbox series

Patch

diff --git a/flashchips.c b/flashchips.c
index 47a37ee..e3fd368 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -19707,6 +19707,55 @@  const struct flashchip flashchips[] = {
 		.voltage	= {1650, 1950},
 	},
 
+	{
+		.vendor		= "XMC",
+		.name		= "XM25QH128A",
+		.bustype	= BUS_SPI,
+		.manufacture_id	= ST_ID,
+		.model_id	= XMC_XM25QH128A,
+		.total_size	= 16384,
+		.page_size	= 256,
+		.feature_bits	= FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI | FEATURE_WRSR2,
+		.tested		= TEST_OK_PREW,
+		.probe		= probe_spi_rdid,
+		.probe_timing	= TIMING_ZERO,
+		.block_erasers	=
+		{
+			{
+				.eraseblocks = { {4 * 1024, 4096} },
+				.block_erase = spi_block_erase_20,
+			}, {
+				.eraseblocks = { {32 * 1024, 512} },
+				.block_erase = spi_block_erase_52,
+			}, {
+				.eraseblocks = { {64 * 1024, 256} },
+				.block_erase = spi_block_erase_d8,
+			}, {
+				.eraseblocks = { {16 * 1024 * 1024, 1} },
+				.block_erase = spi_block_erase_60,
+			}, {
+				.eraseblocks = { {16 * 1024 * 1024, 1} },
+				.block_erase = spi_block_erase_c7,
+			}
+		},
+		.printlock	= spi_prettyprint_status_register_plain,
+		.unlock		= spi_disable_blockprotect,
+		.write		= spi_chip_write_256,
+		.read		= spi_chip_read,
+		.voltage	= {2700, 3600},
+		.reg_bits	=
+		{
+			.srp    = {STATUS1, 7, RW},
+			.srl    = {STATUS2, 0, RW},
+			.bp     = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
+			.tb     = {STATUS1, 5, RW},
+			.sec    = {STATUS1, 6, RW},
+			.cmp    = {STATUS2, 6, RW},
+		},
+		.decode_range	= decode_range_spi25,
+	},
+
+
 	{
 		.vendor		= "XMC",
 		.name		= "XM25QH128C",
diff --git a/include/flashchips.h b/include/flashchips.h
index 5df42dc..8317da7 100644
--- a/include/flashchips.h
+++ b/include/flashchips.h
@@ -818,6 +818,7 @@ 
 #define ST_M45PE16		0x4015
 #define XMC_XM25QH64C		0x4017
 #define XMC_XM25QU64C		0x4117
+#define XMC_XM25QH128A		0x7018
 #define XMC_XM25QH128C		0x4018
 #define XMC_XM25QU128C		0x4118
 #define XMC_XM25QH256C		0x4019