mtd: spi-nor: spansion: fix die erase support
Subsystems (2)
v2 cover mtd: spi-nor: spansion: fix die erase support
From: Takahiro Kuwano <[email protected]>
Changes in v2:
- Collected trailers
- Fixed author email in headers
Takahiro Kuwano (2):
mtd: spi-nor: spansion: use die erase for multi-die devices only
mtd: spi-nor: spansion: add die erase support in s28hx-t
drivers/mtd/spi-nor/spansion.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0
PATCH v2 1/2 mtd: spi-nor: spansion: use die erase for multi-die devices only
From: Takahiro Kuwano <[email protected]>
Die erase opcode is supported in multi-die devices only. For single die devices, default chip erase opcode must be used.
In s25hx_t_late_init(), die erase opcode is set only when the device is multi-die.
--- drivers/mtd/spi-nor/spansion.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/spansion.c +3 -1
@@ -674,7 +674,9 @@ static int s25hx_t_late_init(struct spi_nor *nor) params->ready = cypress_nor_sr_ready_and_clear;cypress_nor_ecc_init (nor); - params->die_erase_opcode =SPINOR_OP_CYPRESS_DIE_ERASE ; +if (params->n_dice >1 ) + params->die_erase_opcode =SPINOR_OP_CYPRESS_DIE_ERASE ; +return 0 ; }
Signature · 1 line
2.43.0
Re: [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only
Quoted 8 lines · On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
From: Takahiro Kuwano <[email protected]>
Die erase opcode is supported in multi-die devices only. For single die devices, default chip erase opcode must be used.
In
s25hx_t_late_init(), die erase opcode is set only when the device is multi-die.
Quoted 6 lines
Fixes 461d0babb544 ("mtd: spi-nor: spansion: enable die erase for multi die flashes")Reviewed-by Pratyush Yadav <[email protected]>Reviewed-by Tudor Ambarus <[email protected]>Reviewed-by Miquel Raynal <[email protected]>Signed-off-by Takahiro Kuwano <[email protected]>
PATCH v2 2/2 mtd: spi-nor: spansion: add die erase support in s28hx-t
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
S28Hx-T family has multi-die devices that support die erase opcode. Update die erase opcode when the device is multi-die.
--- drivers/mtd/spi-nor/spansion.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/spansion.c +3 -0
@@ -762,6 +762,9 @@ static int s28hx_t_late_init(struct spi_nor *nor) params->ready = cypress_nor_sr_ready_and_clear;cypress_nor_ecc_init (nor); +if (params->n_dice >1 ) + params->die_erase_opcode =SPINOR_OP_CYPRESS_DIE_ERASE ; +return 0 ; }
Signature · 1 line
2.43.0
Michael Walle
maintainerRe: [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t
Quoted 18 lines · On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
From: Takahiro Kuwano <[email protected]>
S28Hx-T family has multi-die devices that support die erase opcode. Update die erase opcode when the device is multi-die.
Reviewed-by Tudor Ambarus <[email protected]>Reviewed-by Pratyush Yadav <[email protected]>Reviewed-by Miquel Raynal <[email protected]>Signed-off-by Takahiro Kuwano <[email protected]>--- drivers/mtd/spi-nor/spansion.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mtd/spi-nor/spansion.c +0
-0
drivers/mtd/spi-nor/spansion.c static int s28hx_t_late_init(struct spi_nor *nor) · line 767
Quoted 6 lines
drivers/mtd/spi-nor/spansion.c +3
-0@@ -762,6 +762,9 @@ static int s28hx_t_late_init(struct spi_nor *nor) params->ready = cypress_nor_sr_ready_and_clear;cypress_nor_ecc_init (nor); +if (params->n_dice >1 ) + params->die_erase_opcode =SPINOR_OP_CYPRESS_DIE_ERASE ; +
So this seems to be a common theme for the spansion/cypress flashes. Does it make sense to have a .mfr_flag USE_DIE_ERASE or SUPPORTS_DIE_ERASE that can be set in the flash entry instead of having many different fixups?
-michael
[email protected]
reviewerRE: [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t
Quoted 23 lines · On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
Quoted 21 lines
From: Takahiro Kuwano <[email protected]>
S28Hx-T family has multi-die devices that support die erase opcode. Update die erase opcode when the device is multi-die.
Reviewed-by Tudor Ambarus <[email protected]>Reviewed-by Pratyush Yadav <[email protected]>Reviewed-by Miquel Raynal <[email protected]>Signed-off-by Takahiro Kuwano <[email protected]>--- drivers/mtd/spi-nor/spansion.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mtd/spi-nor/spansion.c +0
-0@@ -762,6 +762,9 @@ static int s28hx_t_late_init(struct spi_nor *nor) params->ready = cypress_nor_sr_ready_and_clear;cypress_nor_ecc_init (nor);
Quoted 8 lines
drivers/mtd/spi-nor/spansion.c static int s28hx_t_late_init(struct spi_nor *nor) · line 767
Quoted 3 lines
drivers/mtd/spi-nor/spansion.c +3
-0+if (params->n_dice >1 ) + params->die_erase_opcode =SPINOR_OP_CYPRESS_DIE_ERASE ; +So this seems to be a common theme for the spansion/cypress flashes. Does it make sense to have a .mfr_flag
USE_DIE_ERASEorSUPPORTS_DIE_ERASEthat can be set in the flash entry instead of having many different fixups?
Yes, actually I plan to cleanup spansion.c later on, by using mfr_flags. There are common features (incl. die-erase) across the device families that appear in different fixups. I think I need to consolidate them and reduce the number of fixup functions.
Thanks,
Takahiro
Quoted 1 line · On Wed, May 27 2026, [email protected] wrote:
From: Takahiro Kuwano <[email protected]>
Applied to spi-nor/next. Thanks!
Signature · 2 lines
Regards, Pratyush Yadav