* [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2
@ 2026-12-06 1:56 Pengji Li
2026-12-06 2:13 ` sashiko-bot
2026-12-06 2:23 ` Daniel Palmer
0 siblings, 2 replies; 3+ messages in thread
From: Pengji Li @ 2026-12-06 1:56 UTC (permalink / raw)
To: Miquel Raynal, linux-mtd
Cc: Richard Weinberger, Vignesh Raghavendra, Daniel Palmer,
linux-kernel, Pengji Li
Add the CD EA 11 device using the geometry and cache read operations
from Daniel Palmer's earlier submission. Reuse the existing FORESEE
program-load and cache-update variants for single and quad writes.
The device requires four bits of ECC per 512 bytes. Reuse the default
SPI-NAND ECC status handling and OOB layout. Status 00 does not
distinguish a clean read from up to three corrected bits in an ECC
step; status 01 reports four corrected bits.
The device allows one PROGRAM EXECUTE per page and requires programming
pages in increasing order within an eraseblock. The driver uses the
existing SPI-NAND write path without tracking the history of each page.
Link: https://lore.kernel.org/linux-mtd/20210811084924.52293-1-daniel@0x0f.com/
Signed-off-by: Pengji Li <wjjsn@qq.com>
---
Testing:
The 2021 review observed successful ECC reads with incorrect data.
nandbiterrs injects errors by programming the same page again, beyond
the device's one-program-per-page limit. nandflipbits erases the block
and restores only visible data and OOB, so it cannot preserve the
original hidden ECC. These tests do not establish the device's on-die
ECC behavior at four bitflips under the specified programming limits.
On a TCL T20 Pro running a Linux 6.18.64 OpenWrt RAM image, four raw
reads of a once-programmed page after read disturb each showed two
bitflips in the same 512-byte ECC step. In all four paired reads with
on-die ECC enabled, the entire 2048-byte page matched the original.
This used the existing SPI-NAND read path. Separate 6.18.64 RAM images
verified single and quad program loads and data readback on this board.
The available setup cannot manually inject four or more errors into
the same ECC step while preserving the original hidden ECC and
respecting the device's programming limits. Three-bit correction,
four-bit correction and uncorrectable reads above four bits remain
unverified on hardware.
This mtd/next version was build-tested with W=1 on MIPS; the board
results above are from Linux 6.18.64.
OpenCode assisted with the implementation and T20 Pro tests.
drivers/mtd/nand/spi/foresee.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index 5ff183160..f323f5c98 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -94,6 +94,13 @@ static int f35sqb002g_ecc_get_status(struct spinand_device *spinand, u8 status)
return -EINVAL;
}
+static SPINAND_OP_VARIANTS(fs35nd01g_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),
+ 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_1S_1S_OP(0, 1, NULL, 0, 0));
+
static const struct spinand_info foresee_spinand_table[] = {
SPINAND_INFO("F35SQA002G",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x72, 0x72),
@@ -125,6 +132,14 @@ static const struct spinand_info foresee_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&f35sqa002g_ooblayout,
f35sqb002g_ecc_get_status)),
+ SPINAND_INFO("FS35ND01G-S1Y2",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xea, 0x11),
+ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(4, 512),
+ SPINAND_INFO_OP_VARIANTS(&fs35nd01g_read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(NULL, NULL)),
};
static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = {
base-commit: b3b86fbd14b98c6a1786308ba0ecd666827dcb0e
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2
2026-12-06 1:56 [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2 Pengji Li
@ 2026-12-06 2:13 ` sashiko-bot
2026-12-06 2:23 ` Daniel Palmer
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-06 2:13 UTC (permalink / raw)
To: Pengji Li, Miquel Raynal, linux-mtd
Cc: Richard Weinberger, Vignesh Raghavendra, Daniel Palmer
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mtd: spinand: foresee: missing fast 1S-1S-1S read cache op
for FS35ND01G-S1Y2
--
commit 268eb3b01482d49ce51c6bba9569c3e029dd2438
Author: Pengji Li <wjjsn@qq.com>
mtd: spinand: foresee: Add support for FS35ND01G-S1Y2
This commit adds SPI-NAND support for the FORESEE FS35ND01G-S1Y2 flash
chip with its geometry, ECC configuration, and read cache op variants.
Link: https://lore.kernel.org/linux-mtd/20210811084924.52293-1-daniel@0x0f.com/
> diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
> index 5ff18316092cd..f323f5c9836c0 100644
> --- a/drivers/mtd/nand/spi/foresee.c
> +++ b/drivers/mtd/nand/spi/foresee.c
> @@ -94,6 +94,13 @@ static int f35sqb002g_ecc_get_status(struct spinand_device *spinand, u8 status)
> return -EINVAL;
> }
>
> +static SPINAND_OP_VARIANTS(fs35nd01g_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),
> + 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_1S_1S_OP(0, 1, NULL, 0, 0));
> +
[Severity: Medium]
Should fs35nd01g_read_cache_variants include
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0, 0) before
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP?
Unlike read_cache_variants in this file and the other SPI-NAND drivers,
omitting opcode 0x0b forces 1-bit SPI buses to select opcode 0x03 in
spinand_select_op_variant().
On controllers such as spi-qpic-snand, qcom_spi_supports_op() accepts
0x03 during probe, but qcom_spi_read_page() -> qcom_spi_cmd_mapping()
only maps 0x0b for 1-bit cache reads and fails page reads with
-EOPNOTSUPP.
--
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_1C2EB0529BA7F35EC3D29801F15479667909@qq.com?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2
2026-12-06 1:56 [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2 Pengji Li
2026-12-06 2:13 ` sashiko-bot
@ 2026-12-06 2:23 ` Daniel Palmer
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Palmer @ 2026-12-06 2:23 UTC (permalink / raw)
To: Pengji Li
Cc: Miquel Raynal, linux-mtd, Richard Weinberger, Vignesh Raghavendra,
linux-kernel
Hi Pengji,
On Sun, 6 Dec 2026 at 10:56, Pengji Li <wjjsn@qq.com> wrote:
>
> Add the CD EA 11 device using the geometry and cache read operations
> from Daniel Palmer's earlier submission. Reuse the existing FORESEE
> program-load and cache-update variants for single and quad writes.
>
> The device requires four bits of ECC per 512 bytes. Reuse the default
> SPI-NAND ECC status handling and OOB layout. Status 00 does not
> distinguish a clean read from up to three corrected bits in an ECC
> step; status 01 reports four corrected bits.
>
> The device allows one PROGRAM EXECUTE per page and requires programming
> pages in increasing order within an eraseblock. The driver uses the
> existing SPI-NAND write path without tracking the history of each page.
>
> Link: https://lore.kernel.org/linux-mtd/20210811084924.52293-1-daniel@0x0f.com/
> Signed-off-by: Pengji Li <wjjsn@qq.com>
I think since this is based on my earlier patch maybe it should have a
co-authored tag.
But I don't mind either way. I'm just glad to have one less patch in
my personal trees that I have to rebase. :)
Cheers,
Daniel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-06 2:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06 1:56 [PATCH] mtd: spinand: foresee: Add support for FS35ND01G-S1Y2 Pengji Li
2026-12-06 2:13 ` sashiko-bot
2026-12-06 2:23 ` Daniel Palmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox