flashchips: Add newer gen. XTX Tech. XT25F..F 3.3V parts
These F versions don't support QPI but have a 3rd status register.
There are non-volatile DC bits, that control the number of dummy
cycles for dual- and quad-i/o reads. As we don't check such bits,
we only enable dual- and quad-output commands for now.
Datasheets used:
https://en.xtxtech.com/download/?AId=516
https://en.xtxtech.com/download/?AId=257
https://en.xtxtech.com/download/?AId=450
https://en.xtxtech.com/download/?AId=454
https://en.xtxtech.com/download/?AId=531
Change-Id: Icc187d835a65357a72854d0a04c17e9f54beaee9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/285
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/flashchips.c b/flashchips.c
index bd44491..b6ac9c7 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -22320,6 +22320,240 @@
},
{
+ .vendor = "XTX Technology",
+ .name = "XT25F16F",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F16B,
+ .total_size = 2048,
+ .page_size = 256,
+ /* Supports full QIO but has a non-volatile DC bit. */
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_WRSR2 | FEATURE_WRSR3 | FEATURE_OTP |
+ FEATURE_FAST_READ | FEATURE_FAST_READ_DOUT | FEATURE_FAST_READ_QOUT,
+ .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},
+ .dc = {{STATUS3, 0, 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 = "XT25F32F",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F32B,
+ .total_size = 4096,
+ .page_size = 256,
+ /* Supports full QIO but has a non-volatile DC bit. */
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_WRSR2 | FEATURE_WRSR3 | FEATURE_OTP |
+ FEATURE_FAST_READ | FEATURE_FAST_READ_DOUT | FEATURE_FAST_READ_QOUT,
+ .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},
+ .dc = {{STATUS3, 0, 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 = "XT25F64F",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F64B,
+ .total_size = 8192,
+ .page_size = 256,
+ /* Supports full QIO but has a non-volatile DC bit. */
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_WRSR2 | FEATURE_WRSR3 | FEATURE_OTP |
+ FEATURE_FAST_READ | FEATURE_FAST_READ_DOUT | FEATURE_FAST_READ_QOUT,
+ .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},
+ .dc = {{STATUS3, 0, 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 = "XT25F128F/XT25BF128F",
+ .bustype = BUS_SPI,
+ .manufacture_id = XTX_ID,
+ .model_id = XTX_XT25F128B,
+ .total_size = 16384,
+ .page_size = 256,
+ /* Supports full QIO but has a non-volatile DC bit. */
+ .feature_bits = FEATURE_WRSR_EITHER | FEATURE_WRSR_EXT2 |
+ FEATURE_WRSR2 | FEATURE_WRSR3 | FEATURE_OTP |
+ FEATURE_FAST_READ | FEATURE_FAST_READ_DOUT | FEATURE_FAST_READ_QOUT,
+ .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},
+ .dc = {{STATUS3, 0, RW}, {STATUS3, 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 = {STATUS3, 2, 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,