From: Florian Fainelli <florian.fainelli@broadcom.com>
To: linux-mtd@lists.infradead.org
Cc: bcm-kernel-feedback-list@broadcom.com,
David Regan <david.regan@broadcom.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Aleksandr Mineev <sanderrrs@gmail.com>,
Ziyang Huang <hzyitc@outlook.com>
Subject: [PATCH] mtd: nand: spi: fmsh: add FM25S01 support
Date: Mon, 30 Nov 2026 14:49:42 -0800 [thread overview]
Message-ID: <20261130224944.1690846-1-florian.fainelli@broadcom.com> (raw)
From: David Regan <david.regan@broadcom.com>
FM25S01 is an earlier, lower-density sibling of the already supported
FM25S01A (same manufacturer ID, same read/write/update cache variants
and memory geometry, 1 bit/512 bytes ECC requirement), identified by
device ID 0xa1. Unlike FM25S01A it exposes a real ECC OOB region
(64/64 split) rather than none.
Signed-off-by: David Regan <david.regan@broadcom.com>
[florian: commit message]
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/mtd/nand/spi/fmsh.c | 39 +++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/mtd/nand/spi/fmsh.c b/drivers/mtd/nand/spi/fmsh.c
index 6352e9c9e502..2bf73e6dfb7a 100644
--- a/drivers/mtd/nand/spi/fmsh.c
+++ b/drivers/mtd/nand/spi/fmsh.c
@@ -112,6 +112,31 @@ static int fm25g01b_ecc_get_status(struct spinand_device *spinand,
return -EINVAL;
}
+static int fm25s01_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section)
+ return -ERANGE;
+
+ region->offset = 64;
+ region->length = 64;
+
+ return 0;
+}
+
+static int fm25s01_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section)
+ return -ERANGE;
+
+ /* reserve 2 bytes for the BBM */
+ region->offset = 2;
+ region->length = 62;
+
+ return 0;
+}
+
static int fm25s01a_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
{
@@ -185,6 +210,11 @@ static const struct mtd_ooblayout_ops fm25g01b_ooblayout = {
.free = fm25g01b_ooblayout_free,
};
+static const struct mtd_ooblayout_ops fm25s01_ooblayout = {
+ .ecc = fm25s01_ooblayout_ecc,
+ .free = fm25s01_ooblayout_free,
+};
+
static const struct mtd_ooblayout_ops fm25s01a_ooblayout = {
.ecc = fm25s01a_ooblayout_ecc,
.free = fm25s01a_ooblayout_free,
@@ -216,6 +246,15 @@ static const struct spinand_info fmsh_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&fm25g01b_ooblayout,
fm25g01b_ecc_get_status)),
+ SPINAND_INFO("FM25S01",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa1),
+ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(1, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&fm25s01_ooblayout, NULL)),
SPINAND_INFO("FM25S01A",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4),
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
--
2.34.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next reply other threads:[~2026-11-30 22:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 22:49 Florian Fainelli [this message]
2026-11-30 22:56 ` [PATCH] mtd: nand: spi: fmsh: add FM25S01 support sashiko-bot
2026-11-30 23:01 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130224944.1690846-1-florian.fainelli@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=david.regan@broadcom.com \
--cc=hzyitc@outlook.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sanderrrs@gmail.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.