* [PATCH v2 01/13] mtd: spinand: winbond: Fix an OOB layout inconsistency with W25NxxLW chips
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 02/13] mtd: spinand: winbond: Generalize the KV OOB layout Miquel Raynal
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
W35NxxKV, KW, LV and LW have the same OOB layout pattern. Though, in the
KV and KW cases, they have been exposing the user data section that is
non protected. In the 08LW case, the choice has been to derive slightly
from this and to only expose the ECC protected user bytes.
Make sure 04LW which has been merged this cycle follows the 08LW
choice. All LV and LW chips should use the same layout.
Fixes: ea609469a3e3 ("mtd: spinand: winbond: add support for W25N04LW")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 810975808c97..49fa545a4113 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -836,7 +836,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25n08lw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W35N04JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x23),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 4, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 02/13] mtd: spinand: winbond: Generalize the KV OOB layout
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 01/13] mtd: spinand: winbond: Fix an OOB layout inconsistency with " Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 03/13] mtd: spinand: winbond: Generalize the LW " Miquel Raynal
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
All W25NxxKV and W25NxxKW chips use the same OOB layout. Rename the
helpers and structures to make it more obvious.
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 52 ++++++++++++++++++------------------------
1 file changed, 22 insertions(+), 30 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 49fa545a4113..bf5696037b75 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -318,16 +318,11 @@ static int w25n01kv_ooblayout_ecc(struct mtd_info *mtd, int section,
return 0;
}
-static int w25n02kv_ooblayout_ecc(struct mtd_info *mtd, int section,
- struct mtd_oob_region *region)
+static int w25nxxkv_kw_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
{
- int num_sections = 4;
- int offset = 64;
-
- if (mtd->oobsize == 256) {
- num_sections = 8;
- offset = 128;
- }
+ unsigned int offset = mtd->oobsize / 2;
+ unsigned int num_sections = mtd->writesize / 512;
if (section >= num_sections)
return -ERANGE;
@@ -338,24 +333,21 @@ static int w25n02kv_ooblayout_ecc(struct mtd_info *mtd, int section,
return 0;
}
-static int w25n02kv_ooblayout_free(struct mtd_info *mtd, int section,
- struct mtd_oob_region *region)
+/*
+ * The OOB layout is the same for all the W25NxxKV/KW/LV/LW chips: each
+ * 16-byte section holds 4 unprotected "User Data II" bytes followed by
+ * 12 ECC-protected "User Data I" bytes.
+ *
+ * This layout exposes both User Data I and II for backward compatibility.
+ */
+static int w25nxxkv_kw_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
{
- int num_sections = 4;
-
- if (mtd->oobsize == 256)
- num_sections = 8;
+ unsigned int num_sections = mtd->writesize / 512;
if (section >= num_sections)
return -ERANGE;
- /*
- * For at least W25N04KW and W25N04LW, this region is actually
- * split in two:
- * ECC-protected "User Data I" at + 4 offset, length 12
- * unprotected "User Data II" at + 2 offset, length 2
- * This returns the full region for backwards compatibility.
- */
region->offset = (16 * section) + 2;
region->length = 14;
@@ -364,12 +356,12 @@ static int w25n02kv_ooblayout_free(struct mtd_info *mtd, int section,
static const struct mtd_ooblayout_ops w25n01kv_ooblayout = {
.ecc = w25n01kv_ooblayout_ecc,
- .free = w25n02kv_ooblayout_free,
+ .free = w25nxxkv_kw_ooblayout_free,
};
-static const struct mtd_ooblayout_ops w25n02kv_ooblayout = {
- .ecc = w25n02kv_ooblayout_ecc,
- .free = w25n02kv_ooblayout_free,
+static const struct mtd_ooblayout_ops w25nxxkv_kw_ooblayout = {
+ .ecc = w25nxxkv_kw_ooblayout_ecc,
+ .free = w25nxxkv_kw_ooblayout_free,
};
static int w25n08lw_ooblayout_ecc(struct mtd_info *mtd, int section,
@@ -786,7 +778,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W25N02KW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -795,7 +787,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W35N02JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 2, 1),
@@ -818,7 +810,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W25N04KW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x23),
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 1, 1, 1),
@@ -827,7 +819,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W25N04LW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 03/13] mtd: spinand: winbond: Generalize the LW OOB layout
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 01/13] mtd: spinand: winbond: Fix an OOB layout inconsistency with " Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 02/13] mtd: spinand: winbond: Generalize the KV OOB layout Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 04/13] mtd: spinand: winbond: Rename the ->set_cont_read() helper Miquel Raynal
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
All W25NxxLV and W25NxxLW chips use the same OOB layout. Rename the
helpers and structures to make it more obvious, and improve the comment
to reflect this situation.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 43 ++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index bf5696037b75..0288788ff0d0 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -339,6 +339,8 @@ static int w25nxxkv_kw_ooblayout_ecc(struct mtd_info *mtd, int section,
* 12 ECC-protected "User Data I" bytes.
*
* This layout exposes both User Data I and II for backward compatibility.
+ * See w25nxxlv_lw_ooblayout_free() for a variant that only exposes the
+ * ECC-protected bytes.
*/
static int w25nxxkv_kw_ooblayout_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
@@ -364,37 +366,38 @@ static const struct mtd_ooblayout_ops w25nxxkv_kw_ooblayout = {
.free = w25nxxkv_kw_ooblayout_free,
};
-static int w25n08lw_ooblayout_ecc(struct mtd_info *mtd, int section,
- struct mtd_oob_region *region)
+/*
+ * The second half of the OOB is not accessible when the on-die ECC
+ * engine is enabled. This prevents accessing the ECC bytes.
+ */
+static int w25nxxlv_lw_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
{
- /*
- * With ecc enabled the parity bits are not accessible. So we can
- * only see page + 128. Without ecc the full page + 256 is accessible.
- * To make it simple just return the area as not accessible.
- */
return -ERANGE;
}
-static int w25n08lw_ooblayout_free(struct mtd_info *mtd, int section,
- struct mtd_oob_region *region)
+/*
+ * Same layout as w25nxxkv_kw_ooblayout_free(), except that only the
+ * ECC-protected "User Data I" bytes are exposed. The non ECC-protected
+ * "User Data II" bytes are not exposed.
+ */
+static int w25nxxlv_lw_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
{
- if (section > 7)
+ unsigned int num_sections = mtd->writesize / 512;
+
+ if (section >= num_sections)
return -ERANGE;
- /*
- * Only expose the ECC protected "User Data I" bytes. The "User Data II"
- * bytes at offset + 2 are not covered by the on-die ECC engine, and the
- * first two bytes of the section hold the BBM.
- */
region->offset = (16 * section) + 4;
region->length = 12;
return 0;
}
-static const struct mtd_ooblayout_ops w25n08lw_ooblayout = {
- .ecc = w25n08lw_ooblayout_ecc,
- .free = w25n08lw_ooblayout_free,
+static const struct mtd_ooblayout_ops w25nxxlv_lw_ooblayout = {
+ .ecc = w25nxxlv_lw_ooblayout_ecc,
+ .free = w25nxxlv_lw_ooblayout_free,
};
static int w25n01jw_ooblayout_ecc(struct mtd_info *mtd, int section,
@@ -828,7 +831,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n08lw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25n02kv_ecc_get_status)),
SPINAND_INFO("W35N04JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x23),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 4, 1),
@@ -852,7 +855,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants,
&cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25n08lw_ooblayout, w25n02kv_ecc_get_status),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25n02kv_ecc_get_status),
SPINAND_CONT_READ(w25n0xjw_set_cont_read)),
};
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 04/13] mtd: spinand: winbond: Rename the ->set_cont_read() helper
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (2 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 03/13] mtd: spinand: winbond: Generalize the LW " Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 05/13] mtd: spinand: winbond: Rename the ->ecc_get_status() helper Miquel Raynal
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
All W25N chips (KV, JV, LV, KW, JW, LW) seem to share the same helper.
W35N chips have one more item to configure in their callback, but
otherwise are also very close.
Rename the helper to clarify its use.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 0288788ff0d0..95b6c3b80eea 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -582,7 +582,7 @@ static int w25n0xjw_hs_cfg(struct spinand_device *spinand,
return w25n0xjw_set_sr4_hs(spinand, w25n0xjw_op_needs_hs(op));
}
-static int w25n0xjw_set_cont_read(struct spinand_device *spinand, bool enable)
+static int w25n_set_cont_read(struct spinand_device *spinand, bool enable)
{
u8 mask = enable ? 0 : WINBOND_CFG_BUF_READ;
@@ -726,7 +726,7 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&w25n01jw_ooblayout, w25w35nxxjw_ecc_get_status),
SPINAND_CONFIGURE_CHIP(w25n0xjw_hs_cfg),
- SPINAND_CONT_READ(w25n0xjw_set_cont_read)),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W25N01KV", /* 3.3V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21),
NAND_MEMORG(1, 2048, 96, 64, 1024, 20, 1, 1, 1),
@@ -772,7 +772,7 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&w25m02gv_ooblayout, w25w35nxxjw_ecc_get_status),
SPINAND_CONFIGURE_CHIP(w25n0xjw_hs_cfg),
- SPINAND_CONT_READ(w25n0xjw_set_cont_read)),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W25N02KV", /* 3.3V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -856,7 +856,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&cont_read_cache_variants),
0,
SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25n02kv_ecc_get_status),
- SPINAND_CONT_READ(w25n0xjw_set_cont_read)),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
};
static int winbond_spinand_init(struct spinand_device *spinand)
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 05/13] mtd: spinand: winbond: Rename the ->ecc_get_status() helper
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (3 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 04/13] mtd: spinand: winbond: Rename the ->set_cont_read() helper Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 06/13] mtd: spinand: winbond: Add 1S_1S_1S continuous read variant Miquel Raynal
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
Most W25N chips (KV, LV, KW, LW) seem to share the same helper.
Rename the helper to clarify its use.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 95b6c3b80eea..e3cd6950e61e 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -470,8 +470,8 @@ static const struct mtd_ooblayout_ops w35n01jw_ooblayout = {
.free = w35n01jw_ooblayout_free,
};
-static int w25n02kv_ecc_get_status(struct spinand_device *spinand,
- u8 status)
+static int w25nxxkv_kw_lv_lw_ecc_get_status(struct spinand_device *spinand,
+ u8 status)
{
struct nand_device *nand = spinand_to_nand(spinand);
u8 mbf = 0;
@@ -735,7 +735,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25n01kv_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W35N01JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdc, 0x21),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 1, 1),
@@ -781,7 +781,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W25N02KW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -790,7 +790,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W35N02JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 2, 1),
@@ -813,7 +813,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W25N04KW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x23),
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 1, 1, 1),
@@ -822,7 +822,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W25N04LW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -831,7 +831,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_variants,
&update_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W35N04JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x23),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 4, 1),
@@ -855,7 +855,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants,
&cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25n02kv_ecc_get_status),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status),
SPINAND_CONT_READ(w25n_set_cont_read)),
};
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 06/13] mtd: spinand: winbond: Add 1S_1S_1S continuous read variant
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (4 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 05/13] mtd: spinand: winbond: Rename the ->ecc_get_status() helper Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 07/13] mtd: spinand: winbond: Add basic support for W25N02LV Miquel Raynal
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
The speed jump is not amazing, yet the feature exists and brings a few %
of extra speed.
$ flash_speed /dev/mtd0 -C
...
page read speed is 966 KiB/s
testing multiple pages read speed
2 page read speed is 977 KiB/s
3 page read speed is 984 KiB/s
4 page read speed is 984 KiB/s
5 page read speed is 987 KiB/s
6 page read speed is 991 KiB/s
7 page read speed is 992 KiB/s
8 page read speed is 988 KiB/s
9 page read speed is 992 KiB/s
10 page read speed is 991 KiB/s
11 page read speed is 995 KiB/s
12 page read speed is 991 KiB/s
13 page read speed is 995 KiB/s
14 page read speed is 995 KiB/s
15 page read speed is 995 KiB/s
16 page read speed is 996 KiB/s
32 page read speed is 992 KiB/s
64 page read speed is 996 KiB/s
...
Data integrity can be checked with the new mtd-utils tool:
$ nandcontreadtest /dev/mtd0
testing 2 blocks from 0 to 1 (2 good), seed 37
success: verified 524288 bytes read in 517.787 ms (988.82 KiB/s)
Link: https://lore.kernel.org/linux-mtd/20261030144108.2211604-1-miquel.raynal@bootlin.com
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index e3cd6950e61e..6beda45366c8 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -39,6 +39,13 @@
* always at least provide the column. Keep using address cycles, but
* reduce the number of dummy cycles accordingly.
*/
+#define WINBOND_CONT_READ_FROM_CACHE_1S_1S_1S_OP(ndummy, buf, len, freq) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
+ SPI_MEM_OP_ADDR(1, 0, 1), \
+ SPI_MEM_OP_DUMMY(ndummy - 1, 1), \
+ SPI_MEM_OP_DATA_IN(len, buf, 1), \
+ SPI_MEM_OP_MAX_FREQ(freq))
+
#define WINBOND_CONT_READ_FROM_CACHE_FAST_1S_1S_1S_OP(ndummy, buf, len, freq) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
SPI_MEM_OP_ADDR(1, 0, 1), \
@@ -216,7 +223,8 @@ static SPINAND_OP_VARIANTS(cont_read_cache_variants,
WINBOND_CONT_READ_FROM_CACHE_1S_1S_4S_OP(4, NULL, 0, 0),
WINBOND_CONT_READ_FROM_CACHE_1S_2S_2S_OP(4, NULL, 0, 0),
WINBOND_CONT_READ_FROM_CACHE_1S_1S_2S_OP(4, NULL, 0, 0),
- WINBOND_CONT_READ_FROM_CACHE_FAST_1S_1S_1S_OP(4, NULL, 0, 0));
+ WINBOND_CONT_READ_FROM_CACHE_FAST_1S_1S_1S_OP(4, NULL, 0, 0),
+ WINBOND_CONT_READ_FROM_CACHE_1S_1S_1S_OP(3, NULL, 0, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 07/13] mtd: spinand: winbond: Add basic support for W25N02LV
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (5 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 06/13] mtd: spinand: winbond: Add 1S_1S_1S continuous read variant Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 08/13] mtd: spinand: winbond: Add basic support for W25N04LV Miquel Raynal
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
$ nandbiterrs -i /dev/mtd0
incremental biterrors test
Successfully corrected 0 bit errors per subpage
Inserted biterror @ 0/5
Read reported 1 corrected bit errors
Successfully corrected 1 bit errors per subpage
Inserted biterror @ 0/2
Read reported 2 corrected bit errors
Successfully corrected 2 bit errors per subpage
Inserted biterror @ 0/0
Read reported 3 corrected bit errors
Successfully corrected 3 bit errors per subpage
Inserted biterror @ 1/7
Read reported 4 corrected bit errors
Successfully corrected 4 bit errors per subpage
Inserted biterror @ 1/5
Read reported 5 corrected bit errors
Successfully corrected 5 bit errors per subpage
Inserted biterror @ 1/2
Read reported 6 corrected bit errors
Successfully corrected 6 bit errors per subpage
Inserted biterror @ 1/0
Read reported 7 corrected bit errors
Successfully corrected 7 bit errors per subpage
Inserted biterror @ 2/6
Read reported 8 corrected bit errors
Successfully corrected 8 bit errors per subpage
Inserted biterror @ 2/5
Failed to recover 1 bitflips
Read error after 9 bit errors per page
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 6beda45366c8..8f29b5a2bd47 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -210,6 +210,22 @@ static SPINAND_OP_VARIANTS(cont_read_cache_dual_quad_dtr_variants,
/* The 1S_1D_1D variant would require 4.5 dummy bytes, this is not possible */
WINBOND_CONT_READ_FROM_CACHE_FAST_1S_1S_1S_OP(4, NULL, 0, 0));
+/*
+ * Unlike the other devices, W25NxxLV/LW capable chips have an absolute maximum
+ * frequency of 133MHz.
+ */
+
+static SPINAND_OP_VARIANTS(w25nxxlv_read_cache_variants,
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4D_4D_OP(0, 8, NULL, 0, 66 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(0, 2, NULL, 0, 66 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_1D_OP(0, 2, NULL, 0, 66 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 0));
+
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0, 0),
@@ -799,6 +815,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_INFO("W25N02LV", /* 3.3V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x8a, 0x22),
+ NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
+ NAND_ECCREQ(8, 512),
+ SPINAND_INFO_OP_VARIANTS(&w25nxxlv_read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W35N02JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 2, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 08/13] mtd: spinand: winbond: Add basic support for W25N04LV
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (6 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 07/13] mtd: spinand: winbond: Add basic support for W25N02LV Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 09/13] mtd: spinand: winbond: Add basic support for W25N02LW Miquel Raynal
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
$ nandbiterrs -i /dev/mtd0
incremental biterrors test
Successfully corrected 0 bit errors per subpage
Inserted biterror @ 0/5
Read reported 1 corrected bit errors
Successfully corrected 1 bit errors per subpage
Inserted biterror @ 0/2
Read reported 2 corrected bit errors
Successfully corrected 2 bit errors per subpage
Inserted biterror @ 0/0
Read reported 3 corrected bit errors
Successfully corrected 3 bit errors per subpage
Inserted biterror @ 1/7
Read reported 4 corrected bit errors
Successfully corrected 4 bit errors per subpage
Inserted biterror @ 1/5
Read reported 5 corrected bit errors
Successfully corrected 5 bit errors per subpage
Inserted biterror @ 1/2
Read reported 6 corrected bit errors
Successfully corrected 6 bit errors per subpage
Inserted biterror @ 1/0
Read reported 7 corrected bit errors
Successfully corrected 7 bit errors per subpage
Inserted biterror @ 2/6
Read reported 8 corrected bit errors
Successfully corrected 8 bit errors per subpage
Inserted biterror @ 2/5
Failed to recover 1 bitflips
Read error after 9 bit errors per page
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 8f29b5a2bd47..7c963adac954 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -856,6 +856,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25nxxkv_kw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_INFO("W25N04LV", /* 3.3V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x8b, 0x23),
+ NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
+ NAND_ECCREQ(8, 512),
+ SPINAND_INFO_OP_VARIANTS(&w25nxxlv_read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W25N04LW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 09/13] mtd: spinand: winbond: Add basic support for W25N02LW
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (7 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 08/13] mtd: spinand: winbond: Add basic support for W25N04LV Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 10/13] mtd: spinand: winbond: Add continuous read support for W25N02LV Miquel Raynal
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
$ nandbiterrs -i /dev/mtd0
incremental biterrors test
Successfully corrected 0 bit errors per subpage
Inserted biterror @ 0/5
Read reported 1 corrected bit errors
Successfully corrected 1 bit errors per subpage
Inserted biterror @ 0/2
Read reported 2 corrected bit errors
Successfully corrected 2 bit errors per subpage
Inserted biterror @ 0/0
Read reported 3 corrected bit errors
Successfully corrected 3 bit errors per subpage
Inserted biterror @ 1/7
Read reported 4 corrected bit errors
Successfully corrected 4 bit errors per subpage
Inserted biterror @ 1/5
Read reported 5 corrected bit errors
Successfully corrected 5 bit errors per subpage
Inserted biterror @ 1/2
Read reported 6 corrected bit errors
Successfully corrected 6 bit errors per subpage
Inserted biterror @ 1/0
Read reported 7 corrected bit errors
Successfully corrected 7 bit errors per subpage
Inserted biterror @ 2/6
Read reported 8 corrected bit errors
Successfully corrected 8 bit errors per subpage
Inserted biterror @ 2/5
Failed to recover 1 bitflips
Read error after 9 bit errors per page
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 7c963adac954..b7a31dc83327 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -824,6 +824,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_INFO("W25N02LW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x12, 0x22),
+ NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
+ NAND_ECCREQ(8, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
SPINAND_INFO("W35N02JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 2, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 10/13] mtd: spinand: winbond: Add continuous read support for W25N02LV
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (8 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 09/13] mtd: spinand: winbond: Add basic support for W25N02LW Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 11/13] mtd: spinand: winbond: Add continuous read support for W25N04LV Miquel Raynal
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
LV chips have DDR support, otherwise they support the same variants as
the other chips.
$ nandcontreadtest /dev/mtd0
testing 10 blocks from 0 to 9 (10 good), seed 27
success: verified 1310720 bytes read in 756.306 ms (1692.44 KiB/s)
$ flash_speed /dev/mtd0 -C
1 page read speed is 1580 KiB/s
2 page read speed is 1580 KiB/s
3 page read speed is 1615 KiB/s
4 page read speed is 1641 KiB/s
5 page read speed is 1643 KiB/s
6 page read speed is 1643 KiB/s
7 page read speed is 1657 KiB/s
8 page read speed is 1662 KiB/s
9 page read speed is 1680 KiB/s
10 page read speed is 1666 KiB/s
11 page read speed is 1692 KiB/s
12 page read speed is 1690 KiB/s
13 page read speed is 1677 KiB/s
14 page read speed is 1696 KiB/s
15 page read speed is 1690 KiB/s
16 page read speed is 1684 KiB/s
32 page read speed is 1684 KiB/s
64 page read speed is 1706 KiB/s
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index b7a31dc83327..cdfd5a5778c6 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -226,6 +226,17 @@ static SPINAND_OP_VARIANTS(w25nxxlv_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 0));
+static SPINAND_OP_VARIANTS(w25nxxlv_cont_read_cache_variants,
+ WINBOND_CONT_READ_FROM_CACHE_1S_4D_4D_OP(11, NULL, 0, 66 * HZ_PER_MHZ),
+ WINBOND_CONT_READ_FROM_CACHE_1S_1D_4D_OP(5, NULL, 0, 66 * HZ_PER_MHZ),
+ WINBOND_CONT_READ_FROM_CACHE_1S_4S_4S_OP(6, NULL, 0, 0),
+ WINBOND_CONT_READ_FROM_CACHE_1S_1S_4S_OP(4, NULL, 0, 0),
+ WINBOND_CONT_READ_FROM_CACHE_1S_2S_2S_OP(4, NULL, 0, 0),
+ WINBOND_CONT_READ_FROM_CACHE_1S_1S_2S_OP(4, NULL, 0, 0),
+ /* The 1S_1D_1D variant would require 4.5 dummy bytes, this is not possible */
+ WINBOND_CONT_READ_FROM_CACHE_FAST_1S_1S_1S_OP(4, NULL, 0, 0),
+ WINBOND_CONT_READ_FROM_CACHE_1S_1S_1S_OP(3, NULL, 0, 0));
+
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0, 0),
@@ -819,11 +830,13 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x8a, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
NAND_ECCREQ(8, 512),
- SPINAND_INFO_OP_VARIANTS(&w25nxxlv_read_cache_variants,
- &write_cache_variants,
- &update_cache_variants),
+ SPINAND_INFO_OP_VARIANTS_WITH_CONT(&w25nxxlv_read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants,
+ &w25nxxlv_cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W25N02LW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x12, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 11/13] mtd: spinand: winbond: Add continuous read support for W25N04LV
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (9 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 10/13] mtd: spinand: winbond: Add continuous read support for W25N02LV Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 12/13] mtd: spinand: winbond: Add continuous read support for W25N02LW Miquel Raynal
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
LV chips have DDR support, otherwise they support the same variants as
the other chips.
$ nandcontreadtest /dev/mtd0
testing 2 blocks from 0 to 1 (2 good), seed 29
success: verified 524288 bytes read in 291.735 ms (1755.02 KiB/s)
$ flash_speed /dev/mtd0 -C
1 page read speed is 1673 KiB/s
2 page read speed is 1718 KiB/s
3 page read speed is 1737 KiB/s
4 page read speed is 1741 KiB/s
5 page read speed is 1764 KiB/s
6 page read speed is 1764 KiB/s
7 page read speed is 1762 KiB/s
8 page read speed is 1753 KiB/s
9 page read speed is 1774 KiB/s
10 page read speed is 1764 KiB/s
11 page read speed is 1774 KiB/s
12 page read speed is 1777 KiB/s
13 page read speed is 1777 KiB/s
14 page read speed is 1763 KiB/s
15 page read speed is 1777 KiB/s
16 page read speed is 1790 KiB/s
32 page read speed is 1777 KiB/s
64 page read speed is 1777 KiB/s
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index cdfd5a5778c6..1dc6d78a515d 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -882,11 +882,13 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x8b, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
NAND_ECCREQ(8, 512),
- SPINAND_INFO_OP_VARIANTS(&w25nxxlv_read_cache_variants,
- &write_cache_variants,
- &update_cache_variants),
+ SPINAND_INFO_OP_VARIANTS_WITH_CONT(&w25nxxlv_read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants,
+ &w25nxxlv_cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W25N04LW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 12/13] mtd: spinand: winbond: Add continuous read support for W25N02LW
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (10 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 11/13] mtd: spinand: winbond: Add continuous read support for W25N04LV Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-11-18 17:08 ` [PATCH v2 13/13] mtd: spinand: winbond: Add continuous read support for W25N04LW Miquel Raynal
2026-12-04 21:33 ` [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
LW chips follow the existing patterns, we can reuse the existing
set_cont_read() helper as well as the existing continuous read variants.
$ nandcontreadtest /dev/mtd0
testing 2 blocks from 0 to 1 (2 good), seed 22
success: verified 262144 bytes read in 202.780 ms (1262.45 KiB/s)
$ flash_speed /dev/mtd0 -C
1 page read speed is 1185 KiB/s
2 page read speed is 1207 KiB/s
3 page read speed is 1223 KiB/s
4 page read speed is 1242 KiB/s
5 page read speed is 1250 KiB/s
6 page read speed is 1263 KiB/s
7 page read speed is 1260 KiB/s
8 page read speed is 1267 KiB/s
9 page read speed is 1260 KiB/s
10 page read speed is 1263 KiB/s
11 page read speed is 1264 KiB/s
12 page read speed is 1263 KiB/s
13 page read speed is 1253 KiB/s
14 page read speed is 1272 KiB/s
15 page read speed is 1276 KiB/s
16 page read speed is 1267 KiB/s
32 page read speed is 1280 KiB/s
64 page read speed is 1280 KiB/s
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 1dc6d78a515d..b5fc8106bdab 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -841,11 +841,13 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x12, 0x22),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
NAND_ECCREQ(8, 512),
- SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
- &write_cache_variants,
- &update_cache_variants),
+ SPINAND_INFO_OP_VARIANTS_WITH_CONT(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants,
+ &cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W35N02JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 2, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 13/13] mtd: spinand: winbond: Add continuous read support for W25N04LW
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (11 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 12/13] mtd: spinand: winbond: Add continuous read support for W25N02LW Miquel Raynal
@ 2026-11-18 17:08 ` Miquel Raynal
2026-12-04 21:33 ` [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-11-18 17:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
LW chips follow the existing patterns, we can reuse the existing
set_cont_read() helper as well as the existing continuous read variants.
$ nandcontreadtest /dev/mtd0
testing 2 blocks from 0 to 1 (2 good), seed 22
success: verified 524288 bytes read in 405.770 ms (1261.80 KiB/s)
$ flash_speed /dev/mtd0 -C
1 page read speed is 1230 KiB/s
2 page read speed is 1242 KiB/s
3 page read speed is 1247 KiB/s
4 page read speed is 1261 KiB/s
5 page read speed is 1263 KiB/s
6 page read speed is 1263 KiB/s
7 page read speed is 1266 KiB/s
8 page read speed is 1261 KiB/s
9 page read speed is 1272 KiB/s
10 page read speed is 1269 KiB/s
11 page read speed is 1271 KiB/s
12 page read speed is 1269 KiB/s
13 page read speed is 1268 KiB/s
14 page read speed is 1272 KiB/s
15 page read speed is 1276 KiB/s
16 page read speed is 1273 KiB/s
32 page read speed is 1273 KiB/s
64 page read speed is 1261 KiB/s
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index b5fc8106bdab..1f7f5c7c8224 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -895,11 +895,13 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
NAND_ECCREQ(8, 512),
- SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
- &write_cache_variants,
- &update_cache_variants),
+ SPINAND_INFO_OP_VARIANTS_WITH_CONT(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants,
+ &cont_read_cache_variants),
0,
- SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status)),
+ SPINAND_ECCINFO(&w25nxxlv_lw_ooblayout, w25nxxkv_kw_lv_lw_ecc_get_status),
+ SPINAND_CONT_READ(w25n_set_cont_read)),
SPINAND_INFO("W35N04JW", /* 1.8V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x23),
NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 4, 1),
--
2.56.0
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips
2026-11-18 17:08 [PATCH v2 00/13] mtd: spinand winbond: Add support for W25NxxLV and W25NxxLW chips Miquel Raynal
` (12 preceding siblings ...)
2026-11-18 17:08 ` [PATCH v2 13/13] mtd: spinand: winbond: Add continuous read support for W25N04LW Miquel Raynal
@ 2026-12-04 21:33 ` Miquel Raynal
13 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2026-12-04 21:33 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Daisuke Mizobuchi,
Dominique Martinet, Miquel Raynal
Cc: Thomas Petazzoni, Steam Lin, linux-mtd, linux-kernel
On Wed, 18 Nov 2026 18:08:17 +0100, Miquel Raynal wrote:
> These chips mostly reuse the existing infrastructure and have been
> tested using the mtd-utils test suite. In particular, I wrote and
> contributed a new tool to ease continuous read testing:
> https://lore.kernel.org/linux-mtd/20261030144108.2211604-1-miquel.raynal@bootlin.com/T/#u
>
> A bit of reorganization and renaming is being done as well as
> preparation.
>
> [...]
Applied to nand/next, thanks!
[01/13] mtd: spinand: winbond: Fix an OOB layout inconsistency with W25NxxLW chips
commit: b2b807ba5250f40ccc69b4a843bc869cf8010884
[02/13] mtd: spinand: winbond: Generalize the KV OOB layout
commit: 1d85251ba8e06d66ecf9605b0bff8d45d9afbb20
[03/13] mtd: spinand: winbond: Generalize the LW OOB layout
commit: 204fca5d4a3e4b445f51c390a71d5159e9e61a44
[04/13] mtd: spinand: winbond: Rename the ->set_cont_read() helper
commit: b0c9582e57f864be5a7118c22ea82b9c31724028
[05/13] mtd: spinand: winbond: Rename the ->ecc_get_status() helper
commit: c54e6f98574139ecc617139eb252eba355b6002a
[06/13] mtd: spinand: winbond: Add 1S_1S_1S continuous read variant
commit: 4fe240d1fb6f8e9dc579be44668248957c7e970e
[07/13] mtd: spinand: winbond: Add basic support for W25N02LV
commit: 2534cda24112d80a53f2b329720da8ed2e61c8e9
[08/13] mtd: spinand: winbond: Add basic support for W25N04LV
commit: 27534302acadf6dc2f39ed522be3442ea1db1b69
[09/13] mtd: spinand: winbond: Add basic support for W25N02LW
commit: 18df4d2bed8ec67e2f22e2be5b16adc307dd2cec
[10/13] mtd: spinand: winbond: Add continuous read support for W25N02LV
commit: e81c441547c8f74447705b5e641a42abef82c72a
[11/13] mtd: spinand: winbond: Add continuous read support for W25N04LV
commit: 724bf00bbc99c503a13c3b058f63754bf109f6d7
[12/13] mtd: spinand: winbond: Add continuous read support for W25N02LW
commit: e0222e62cf4195ea0f0618b829a0d07e0080115b
[13/13] mtd: spinand: winbond: Add continuous read support for W25N04LW
commit: 908d527eac0788631686de902416b0fe4fd94ad3
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
^ permalink raw reply [flat|nested] 15+ messages in thread