summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Lu <hechushiguitu666@gmail.com>2026-03-31 17:53:51 +0800
committerPratyush Yadav (Google) <pratyush@kernel.org>2026-03-31 15:46:47 +0000
commitcf6788aed0cd911c2e7dded6f28214996dfabc30 (patch)
tree0ca947c08946a5cbc09c9cef9520d5e58cd2f552
parent760e8c382c2de149b84e69fb60cccc32f6725a3f (diff)
mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA
The MT35XU02GCBA flash device does not support chip erase according to its datasheet, but supports die erase. The existing code had a TODO comment noting that the SPI_NOR_IO_MODE_EN_VOLATILE flag probably needs to be enabled and the driver implementation needs to be converted to use die erase. This patch enables the SPI_NOR_IO_MODE_EN_VOLATILE flag and adds the mt35_two_die_fixups to the MT35XU02GCBA entry, which includes the micron_st_nor_two_die_late_init() function that sets up die erase support. With these changes, the flash device can properly use die erase operations instead of chip erase. Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com> Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org> [pratyush@kernel.org: drop the whole comment instead of just the TODO line] Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
-rw-r--r--drivers/mtd/spi-nor/micron-st.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index b2b473501d02..c75b0a1cd567 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -195,7 +195,7 @@ static const struct spi_nor_fixups mt35xu512aba_fixups = {
.post_sfdp = mt35xu512aba_post_sfdp_fixup,
};
-static const struct spi_nor_fixups mt35xu01gbba_fixups = {
+static const struct spi_nor_fixups mt35_two_die_fixups = {
.post_sfdp = mt35xu512aba_post_sfdp_fixup,
.late_init = micron_st_nor_two_die_late_init,
};
@@ -212,25 +212,16 @@ static const struct flash_info micron_nor_parts[] = {
.id = SNOR_ID(0x2c, 0x5b, 0x1b),
.mfr_flags = USE_FSR,
.fixup_flags = SPI_NOR_IO_MODE_EN_VOLATILE,
- .fixups = &mt35xu01gbba_fixups,
+ .fixups = &mt35_two_die_fixups,
}, {
- /*
- * The MT35XU02GCBA flash device does not support chip erase,
- * according to its datasheet. It supports die erase, which
- * means the current driver implementation will likely need to
- * be converted to use die erase. Furthermore, similar to the
- * MT35XU01GBBA, the SPI_NOR_IO_MODE_EN_VOLATILE flag probably
- * needs to be enabled.
- *
- * TODO: Fix these and test on real hardware.
- */
.id = SNOR_ID(0x2c, 0x5b, 0x1c),
.name = "mt35xu02g",
.sector_size = SZ_128K,
.size = SZ_256M,
.no_sfdp_flags = SECT_4K | SPI_NOR_OCTAL_READ,
.mfr_flags = USE_FSR,
- .fixup_flags = SPI_NOR_4B_OPCODES,
+ .fixup_flags = SPI_NOR_4B_OPCODES | SPI_NOR_IO_MODE_EN_VOLATILE,
+ .fixups = &mt35_two_die_fixups,
},
};