* [PATCH 0/2] mtd: spinand: winbond: add support for additional SPI-NAND devices
@ 2026-08-07 6:43 Md Sadre Alam
2026-08-07 6:43 ` [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW Md Sadre Alam
2026-08-07 6:43 ` [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW Md Sadre Alam
0 siblings, 2 replies; 5+ messages in thread
From: Md Sadre Alam @ 2026-08-07 6:43 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr, tudor.ambarus, s-k6, linux-mtd,
linux-kernel
Cc: varadarajan.narayanan
This series adds support for three Winbond SPI-NAND devices that
are currently not recognized by the winbond SPI-NAND driver.
The W25N01KW and W25N02LW share page geometry and ECC handling
with existing supported devices and therefore reuse the existing
OOB layout definitions and ECC status callbacks.
The W25N04LW uses a different page and spare-area organization
from the existing W25N04KV/W25N04KW devices and requires a
dedicated OOB layout description.
Md Sadre Alam (2):
mtd: spinand: winbond: add support for W25N04LW
mtd: spinand: winbond: Add support for W25N01KW and W25N02LW
drivers/mtd/nand/spi/winbond.c | 50 ++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW
2026-08-07 6:43 [PATCH 0/2] mtd: spinand: winbond: add support for additional SPI-NAND devices Md Sadre Alam
@ 2026-08-07 6:43 ` Md Sadre Alam
2026-08-07 13:52 ` Miquel Raynal
2026-08-07 6:43 ` [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW Md Sadre Alam
1 sibling, 1 reply; 5+ messages in thread
From: Md Sadre Alam @ 2026-08-07 6:43 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr, tudor.ambarus, s-k6, linux-mtd,
linux-kernel
Cc: varadarajan.narayanan
Add support for Winbond W25N04LW 4Gbit SPI-NAND.
It has 8-bit on-die ECC and a 4096+256 byte page
(4096 byte main area, 128 byte usable OOB once
on-chip ECC hides the 128 byte parity area),
organized as 2048 blocks of 64 pages each, unlike
the existing 2048 byte page W25N04KV/W25N04KW parts.
Signed-off-by: Md Sadre Alam <md.alam@oss.qualcomm.com>
---
drivers/mtd/nand/spi/winbond.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 9b78c1e6cbc9..b0147b7cb76f 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -345,6 +345,29 @@ static const struct mtd_ooblayout_ops w25n02kv_ooblayout = {
.free = w25n02kv_ooblayout_free,
};
+static int w25n04lw_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ return -ERANGE;
+}
+
+static int w25n04lw_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section)
+ return -ERANGE;
+
+ region->offset = 2;
+ region->length = mtd->oobsize - 2;
+
+ return 0;
+}
+
+static const struct mtd_ooblayout_ops w25n04lw_ooblayout = {
+ .ecc = w25n04lw_ooblayout_ecc,
+ .free = w25n04lw_ooblayout_free,
+};
+
static int w25n01jw_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
{
@@ -768,6 +791,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_INFO("W25N04LW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb2, 0x23),
+ NAND_MEMORG(1, 4096, 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(&w25n04lw_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.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW
2026-08-07 6:43 [PATCH 0/2] mtd: spinand: winbond: add support for additional SPI-NAND devices Md Sadre Alam
2026-08-07 6:43 ` [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW Md Sadre Alam
@ 2026-08-07 6:43 ` Md Sadre Alam
2026-08-07 13:50 ` Miquel Raynal
1 sibling, 1 reply; 5+ messages in thread
From: Md Sadre Alam @ 2026-08-07 6:43 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr, tudor.ambarus, s-k6, linux-mtd,
linux-kernel
Cc: varadarajan.narayanan
Add support for the Winbond W25N01KW and W25N02LW SPI-NAND
devices.
The W25N01KW shares the same geometry, OOB layout, and ECC
status handling as the existing W25N01KV, while the W25N02LW
matches the existing W25N02KV/W25N02KW devices and reuses
their OOB layout and ECC status callback.
Signed-off-by: Md Sadre Alam <md.alam@oss.qualcomm.com>
---
drivers/mtd/nand/spi/winbond.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index b0147b7cb76f..3bffa13bfa68 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -704,6 +704,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_INFO("W25N01KW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbe, 0x21),
+ NAND_MEMORG(1, 2048, 96, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(4, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_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),
@@ -759,6 +768,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_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(&w25n02kv_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),
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW
2026-08-07 6:43 ` [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW Md Sadre Alam
@ 2026-08-07 13:50 ` Miquel Raynal
0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2026-08-07 13:50 UTC (permalink / raw)
To: Md Sadre Alam
Cc: richard, vigneshr, tudor.ambarus, s-k6, linux-mtd, linux-kernel,
varadarajan.narayanan
Hi Sadre,
On 07/08/2026 at 12:13:39 +0530, Md Sadre Alam <md.alam@oss.qualcomm.com> wrote:
> Add support for the Winbond W25N01KW and W25N02LW SPI-NAND
> devices.
>
> The W25N01KW shares the same geometry, OOB layout, and ECC
> status handling as the existing W25N01KV, while the W25N02LW
> matches the existing W25N02KV/W25N02KW devices and reuses
> their OOB layout and ECC status callback.
>
> Signed-off-by: Md Sadre Alam <md.alam@oss.qualcomm.com>
> ---
Sashiko raises a point:
- [Medium] The device ID `0x12, 0x22` for W25N02LW breaks the
established pattern for Winbond 1.8V SPI NAND devices and is highly
likely a typo for `0xb2, 0x22`.
Can you please check?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW
2026-08-07 6:43 ` [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW Md Sadre Alam
@ 2026-08-07 13:52 ` Miquel Raynal
0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2026-08-07 13:52 UTC (permalink / raw)
To: Md Sadre Alam
Cc: richard, vigneshr, tudor.ambarus, s-k6, linux-mtd, linux-kernel,
varadarajan.narayanan
On 07/08/2026 at 12:13:38 +0530, Md Sadre Alam <md.alam@oss.qualcomm.com> wrote:
> Add support for Winbond W25N04LW 4Gbit SPI-NAND.
> It has 8-bit on-die ECC and a 4096+256 byte page
> (4096 byte main area, 128 byte usable OOB once
> on-chip ECC hides the 128 byte parity area),
That is not what you did below. Below you declare 254 free bytes.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-07 13:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 6:43 [PATCH 0/2] mtd: spinand: winbond: add support for additional SPI-NAND devices Md Sadre Alam
2026-08-07 6:43 ` [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW Md Sadre Alam
2026-08-07 13:52 ` Miquel Raynal
2026-08-07 6:43 ` [PATCH 2/2] mtd: spinand: winbond: add support for W25N01KW and W25N02LW Md Sadre Alam
2026-08-07 13:50 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox