* [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support
@ 2026-05-27 9:05 tkuw584924
2026-05-27 9:05 ` [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only tkuw584924
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: tkuw584924 @ 2026-05-27 9:05 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Takahiro Kuwano
From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
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(-)
--
2.43.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only
2026-05-27 9:05 [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support tkuw584924
@ 2026-05-27 9:05 ` tkuw584924
2026-05-27 13:03 ` Michael Walle
2026-05-27 9:05 ` [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t tkuw584924
2026-05-28 13:58 ` [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support Pratyush Yadav
2 siblings, 1 reply; 7+ messages in thread
From: tkuw584924 @ 2026-05-27 9:05 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Takahiro Kuwano, stable
From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
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.
Fixes: 461d0babb544 ("mtd: spi-nor: spansion: enable die erase for multi die flashes")
Cc: stable@kernel.org
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
---
drivers/mtd/spi-nor/spansion.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index 8498c7003d88..b6023076903a 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -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;
}
--
2.43.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t
2026-05-27 9:05 [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support tkuw584924
2026-05-27 9:05 ` [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only tkuw584924
@ 2026-05-27 9:05 ` tkuw584924
2026-05-27 13:02 ` Michael Walle
2026-05-28 13:58 ` [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support Pratyush Yadav
2 siblings, 1 reply; 7+ messages in thread
From: tkuw584924 @ 2026-05-27 9:05 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Takahiro Kuwano
From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
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@linaro.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
---
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;
+
return 0;
}
--
2.43.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t
2026-05-27 9:05 ` [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t tkuw584924
@ 2026-05-27 13:02 ` Michael Walle
2026-05-28 5:45 ` Takahiro.Kuwano
0 siblings, 1 reply; 7+ messages in thread
From: Michael Walle @ 2026-05-27 13:02 UTC (permalink / raw)
To: tkuw584924, Tudor Ambarus, Pratyush Yadav, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Takahiro Kuwano
[-- Attachment #1.1: Type: text/plain, Size: 1269 bytes --]
On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
> From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
>
> 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@linaro.org>
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
> ---
> 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?
-michael
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
[-- Attachment #2: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only
2026-05-27 9:05 ` [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only tkuw584924
@ 2026-05-27 13:03 ` Michael Walle
0 siblings, 0 replies; 7+ messages in thread
From: Michael Walle @ 2026-05-27 13:03 UTC (permalink / raw)
To: tkuw584924, Tudor Ambarus, Pratyush Yadav, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, Takahiro Kuwano, stable
[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]
On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
> From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
>
> 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.
>
> Fixes: 461d0babb544 ("mtd: spi-nor: spansion: enable die erase for multi die flashes")
> Cc: stable@kernel.org
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
[-- Attachment #2: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t
2026-05-27 13:02 ` Michael Walle
@ 2026-05-28 5:45 ` Takahiro.Kuwano
0 siblings, 0 replies; 7+ messages in thread
From: Takahiro.Kuwano @ 2026-05-28 5:45 UTC (permalink / raw)
To: mwalle, tkuw584924, tudor.ambarus, pratyush, miquel.raynal,
richard, vigneshr
Cc: linux-mtd, linux-kernel
>
> On Wed May 27, 2026 at 11:05 AM CEST, tkuw584924 wrote:
> > From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
> >
> > 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@linaro.org>
> > Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> > Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
> > ---
> > 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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support
2026-05-27 9:05 [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support tkuw584924
2026-05-27 9:05 ` [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only tkuw584924
2026-05-27 9:05 ` [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t tkuw584924
@ 2026-05-28 13:58 ` Pratyush Yadav
2 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-05-28 13:58 UTC (permalink / raw)
To: tkuw584924
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
Takahiro Kuwano
On Wed, May 27 2026, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <takahiro.kuwano@infineon.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] 7+ messages in thread
end of thread, other threads:[~2026-05-28 13:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 9:05 [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support tkuw584924
2026-05-27 9:05 ` [PATCH v2 1/2] mtd: spi-nor: spansion: use die erase for multi-die devices only tkuw584924
2026-05-27 13:03 ` Michael Walle
2026-05-27 9:05 ` [PATCH v2 2/2] mtd: spi-nor: spansion: add die erase support in s28hx-t tkuw584924
2026-05-27 13:02 ` Michael Walle
2026-05-28 5:45 ` Takahiro.Kuwano
2026-05-28 13:58 ` [PATCH v2 0/2] mtd: spi-nor: spansion: fix die erase support Pratyush Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox