RE: [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t

From: Takahiro.Kuwano

Date: Thu May 28 2026 - 01:46:07 EST


>
> On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
> > From: Takahiro Kuwano <takahiro.kuwano@xxxxxxxxxxxx>
> >
> > 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 <tudor.ambarus@xxxxxxxxxx>
> > Reviewed-by: Pratyush Yadav <pratyush@xxxxxxxxxx>
> > Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
> > Signed-off-by: Takahiro Kuwano <takahiro.kuwano@xxxxxxxxxxxx>
> > ---
> > drivers/mtd/spi-nor/spansion.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
> > index b6023076903a..65227d989de1 100644
> > --- a/drivers/mtd/spi-nor/spansion.c
> > +++ b/drivers/mtd/spi-nor/spansion.c
> > @@ -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?

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