flashchips: Add XTX Tech. XT25F..B 3.3V family
These are old versions of the 3.3V family, that don't seem to be
manufactured anymore. Except for the smallest 16Mbit chip, they
have QPI support which newer versions lack. The block-protection
seems to follow Winbond's model.
Datasheets used:
https://xonstorage.blob.core.windows.net/pdf/xtx_xt25f16bsoigu_xonjuly20_20_link.pdf
https://www.lcsc.com/datasheet/lcsc_datasheet_2410121518_XTX-XT25F32BSOIGU-S_C558851.pdf
https://www.lcsc.com/datasheet/lcsc_datasheet_2411220126_XTX-XT25F64BSSIGU_C3202692.pdf
https://www.lcsc.com/datasheet/lcsc_datasheet_2410121527_XTX-XT25F128BSSIGU_C558845.pdf
Change-Id: Ifc5607674fabf1466155d821e7d5e88886d3b21b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/284
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/flashchips.c b/flashchips.c
index ec8cdf9..bd44491 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -22097,6 +22097,229 @@
},
{
+ .vendor = "XTX Technology",
+ .name = "XT25F16B",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F16B,
+ .total_size = 2048,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_OTP | FEATURE_QIO,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 512} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 64} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 32} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {2048 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {2048 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ },
+ },
+ .reg_bits =
+ {
+ .qe = {STATUS2, 1, RW},
+ .srp = {STATUS1, 7, RW},
+ .bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
+ .tb = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like TB */
+ .sec = {STATUS1, 6, RW}, /* Called BP4 in datasheet, acts like SEC */
+ .cmp = {STATUS2, 6, RW},
+ },
+ .wp_write_cfg = spi_wp_write_cfg,
+ .wp_read_cfg = spi_wp_read_cfg,
+ .wp_get_ranges = spi_wp_get_available_ranges,
+ .decode_range = decode_range_spi25,
+ .printlock = spi_prettyprint_status_register_bp4_srwd,
+ .unlock = spi_disable_blockprotect_bp4_srwd,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ .prepare_access = spi_prepare_io,
+ .finish_access = spi_finish_io,
+ },
+
+ {
+ .vendor = "XTX Technology",
+ .name = "XT25F32B",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F32B,
+ .total_size = 4096,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_OTP | FEATURE_QPI_SRP,
+ .dummy_cycles = { .qpi_read_params = { 4, 4, 6, 8 } },
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 1024} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 128} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 64} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {4096 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {4096 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ },
+ },
+ .reg_bits =
+ {
+ .qe = {STATUS2, 1, RW},
+ .srp = {STATUS1, 7, RW},
+ .srl = {STATUS2, 0, RW},
+ .bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
+ .tb = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like TB */
+ .sec = {STATUS1, 6, RW}, /* Called BP4 in datasheet, acts like SEC */
+ .cmp = {STATUS2, 6, RW},
+ },
+ .wp_write_cfg = spi_wp_write_cfg,
+ .wp_read_cfg = spi_wp_read_cfg,
+ .wp_get_ranges = spi_wp_get_available_ranges,
+ .decode_range = decode_range_spi25,
+ .printlock = spi_prettyprint_status_register_bp4_srwd,
+ .unlock = spi_disable_blockprotect_bp4_srwd,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ .prepare_access = spi_prepare_io,
+ .finish_access = spi_finish_io,
+ },
+
+ {
+ .vendor = "XTX Technology",
+ .name = "XT25F64B",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F64B,
+ .total_size = 8192,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_WRSR_EXT2 |
+ FEATURE_OTP | FEATURE_QPI_SRP,
+ .dummy_cycles = { .qpi_read_params = { 4, 4, 6, 8 } },
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 2048} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 256} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 128} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {8192 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {8192 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ },
+ },
+ .reg_bits =
+ {
+ .qe = {STATUS2, 1, RW},
+ .srp = {STATUS1, 7, RW},
+ .srl = {STATUS2, 0, RW},
+ .bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
+ .tb = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like TB */
+ .sec = {STATUS1, 6, RW}, /* Called BP4 in datasheet, acts like SEC */
+ .cmp = {STATUS2, 6, RW},
+ },
+ .wp_write_cfg = spi_wp_write_cfg,
+ .wp_read_cfg = spi_wp_read_cfg,
+ .wp_get_ranges = spi_wp_get_available_ranges,
+ .decode_range = decode_range_spi25,
+ .printlock = spi_prettyprint_status_register_bp4_srwd,
+ .unlock = spi_disable_blockprotect_bp4_srwd,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ .prepare_access = spi_prepare_io,
+ .finish_access = spi_finish_io,
+ },
+
+ {
+ .vendor = "XTX Technology",
+ .name = "XT25F128B",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F128B,
+ .total_size = 16384,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_WRSR_EXT2 |
+ FEATURE_OTP | FEATURE_QPI_SRP,
+ .dummy_cycles = { .qpi_read_params = { 4, 4, 6, 8 } },
+ .tested = TEST_UNTESTED,
+ .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 = { {16384 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {16384 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ },
+ },
+ .reg_bits =
+ {
+ .qe = {STATUS2, 1, RW},
+ .srp = {STATUS1, 7, RW},
+ .srl = {STATUS2, 0, RW},
+ .bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
+ .tb = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like TB */
+ .sec = {STATUS1, 6, RW}, /* Called BP4 in datasheet, acts like SEC */
+ .cmp = {STATUS2, 6, RW},
+ .wps = {STATUS2, 4, RW},
+ },
+ .wp_write_cfg = spi_wp_write_cfg,
+ .wp_read_cfg = spi_wp_read_cfg,
+ .wp_get_ranges = spi_wp_get_available_ranges,
+ .decode_range = decode_range_spi25,
+ .printlock = spi_prettyprint_status_register_bp4_srwd,
+ .unlock = spi_disable_blockprotect_bp4_srwd,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ .prepare_access = spi_prepare_io,
+ .finish_access = spi_finish_io,
+ },
+
+ {
.vendor = "Zetta Device",
.name = "ZD25D20",
.bustype = BUS_SPI,
diff --git a/include/flashchips.h b/include/flashchips.h
index 9f498cd..ce3d83e 100644
--- a/include/flashchips.h
+++ b/include/flashchips.h
@@ -1035,6 +1035,10 @@
#define XTX_XT25F02E 0x4012
#define XTX_XT25F04D 0x4013
#define XTX_XT25F08B 0x4014
+#define XTX_XT25F16B 0x4015 /* Same as XT25F16F */
+#define XTX_XT25F32B 0x4016 /* Same as XT25F32F */
+#define XTX_XT25F64B 0x4017 /* Same as XT25F64F */
+#define XTX_XT25F128B 0x4018 /* Same as XT25F128F/XTBF128F */
#define ZETTADEVICE_ID 0xBA /* Zetta Device */
#define ZETTADEVICE_ZD25D20 0x2012