Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Haoyu Lu and committed by
Pratyush Yadav (Google)
cf6788ae 760e8c38

+4 -13
+4 -13
drivers/mtd/spi-nor/micron-st.c
··· 195 195 .post_sfdp = mt35xu512aba_post_sfdp_fixup, 196 196 }; 197 197 198 - static const struct spi_nor_fixups mt35xu01gbba_fixups = { 198 + static const struct spi_nor_fixups mt35_two_die_fixups = { 199 199 .post_sfdp = mt35xu512aba_post_sfdp_fixup, 200 200 .late_init = micron_st_nor_two_die_late_init, 201 201 }; ··· 212 212 .id = SNOR_ID(0x2c, 0x5b, 0x1b), 213 213 .mfr_flags = USE_FSR, 214 214 .fixup_flags = SPI_NOR_IO_MODE_EN_VOLATILE, 215 - .fixups = &mt35xu01gbba_fixups, 215 + .fixups = &mt35_two_die_fixups, 216 216 }, { 217 - /* 218 - * The MT35XU02GCBA flash device does not support chip erase, 219 - * according to its datasheet. It supports die erase, which 220 - * means the current driver implementation will likely need to 221 - * be converted to use die erase. Furthermore, similar to the 222 - * MT35XU01GBBA, the SPI_NOR_IO_MODE_EN_VOLATILE flag probably 223 - * needs to be enabled. 224 - * 225 - * TODO: Fix these and test on real hardware. 226 - */ 227 217 .id = SNOR_ID(0x2c, 0x5b, 0x1c), 228 218 .name = "mt35xu02g", 229 219 .sector_size = SZ_128K, 230 220 .size = SZ_256M, 231 221 .no_sfdp_flags = SECT_4K | SPI_NOR_OCTAL_READ, 232 222 .mfr_flags = USE_FSR, 233 - .fixup_flags = SPI_NOR_4B_OPCODES, 223 + .fixup_flags = SPI_NOR_4B_OPCODES | SPI_NOR_IO_MODE_EN_VOLATILE, 224 + .fixups = &mt35_two_die_fixups, 234 225 }, 235 226 }; 236 227