Skip to contentSkip to conversation

mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA

PATCH Superseded Haoyu Lu 2 participants 2 messages Mar 23 – Mar 30

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Haoyu Lu

author
#0 lore raw

PATCH 1/1 mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA

From: "haoyu.lu" <[email protected]>

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 mt35xu01gbba_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.

---
 drivers/mtd/spi-nor/micron-st.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/micron-st.c +2 -1
index 88033384a71e..4e8c6ef14697 100644
@@ -220,7 +220,8 @@ static const struct flash_info micron_nor_parts[] = {
 		.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 = &mt35xu01gbba_fixups,
 	},
 };
 
Signature · 1 line
2.53.0.windows.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Haoyu Lu

From: "haoyu.lu" <[email protected]>

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 mt35xu01gbba_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.

---
 drivers/mtd/spi-nor/micron-st.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/micron-st.c +0 -0
index 88033384a71e..4e8c6ef14697 100644

drivers/mtd/spi-nor/micron-st.c static const struct flash_info micron_nor_parts[] = { · line 222

Quoted 3 lines
drivers/mtd/spi-nor/micron-st.c +0 -0
@@ -220,7 +220,8 @@ static const struct flash_info micron_nor_parts[] = {
 		.size = SZ_256M,
 		.no_sfdp_flags = SECT_4K | SPI_NOR_OCTAL_READ,
 		.mfr_flags = USE_FSR,

Since the TODO comment is now resolved with this patch, please remove it.

drivers/mtd/spi-nor/micron-st.c static const struct flash_info micron_nor_parts[] = { · line 224

Quoted 3 lines
drivers/mtd/spi-nor/micron-st.c +2 -1
-		.fixup_flags = SPI_NOR_4B_OPCODES,
+		.fixup_flags = SPI_NOR_4B_OPCODES | SPI_NOR_IO_MODE_EN_VOLATILE,
+		.fixups = &mt35xu01gbba_fixups,

Also, rename mt35xu01gbba_fixups to something like "mt35_two_die_fixups" so the naming isn't confusing.

With that,

Quoted 2 lines
drivers/mtd/spi-nor/micron-st.c +0 -0
 	},
 };
Signature · 2 lines
Regards,
Pratyush Yadav