* [PATCH v3] mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA
@ 2026-03-31 9:53 Haoyu Lu
2026-03-31 15:47 ` Pratyush Yadav
0 siblings, 1 reply; 2+ messages in thread
From: Haoyu Lu @ 2026-03-31 9:53 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd, linux-kernel, Haoyu Lu
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>
---
v3: Squash v1 and v2 into a single patch based on spi-nor/next as requested
v2: Remove TODO comment and rename mt35xu01gbba_fixups to mt35_two_die_fixups per review.
drivers/mtd/spi-nor/micron-st.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index 88033384a71e..c22d62545391 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -188,7 +188,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,
};
@@ -205,7 +205,7 @@ 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,
@@ -215,7 +215,6 @@ static const struct flash_info micron_nor_parts[] = {
* 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",
@@ -223,7 +223,8 @@ static const struct flash_info micron_nor_parts[] = {
.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,
},
};
--
2.53.0.windows.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA
2026-03-31 9:53 [PATCH v3] mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA Haoyu Lu
@ 2026-03-31 15:47 ` Pratyush Yadav
0 siblings, 0 replies; 2+ messages in thread
From: Pratyush Yadav @ 2026-03-31 15:47 UTC (permalink / raw)
To: Haoyu Lu
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel
On Tue, Mar 31 2026, Haoyu Lu wrote:
> 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>
Applied to spi-nor/next. Thanks!
[...]
--
Regards,
Pratyush Yadav
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-31 15:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 9:53 [PATCH v3] mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA Haoyu Lu
2026-03-31 15:47 ` Pratyush Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox