From: Naresh Solanki <naresh.solanki.2011@gmail.com>
To: Pratyush Yadav <pratyush@kernel.org>, Michael Walle <mwalle@kernel.org>
Cc: Takahiro Kuwano <takahiro.kuwano@infineon.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Naresh Solanki <naresh.solanki.2011@gmail.com>
Subject: [PATCH] mtd: spi-nor: spansion: add SPI_NOR_HAS_LOCK to s25fl064k
Date: Tue, 1 Dec 2026 12:45:21 +0530 [thread overview]
Message-ID: <20261201071521.216993-1-naresh.solanki.2011@gmail.com> (raw)
The s25fl064k entry also matches the Winbond W25Q64, which has the same
ID. Both protect blocks with the BP0-2 and TB bits of the status
register. Commit 3b1fba74306b ("mtd: spi-nor: winbond: W25Q64JV-Q/N:
Fill locking information") set SPI_NOR_HAS_LOCK and SPI_NOR_HAS_TB on
the winbond w25q64 entry, but that entry is never used for this ID, as
the spansion table is searched first. Set both flags on the s25fl064k
entry too.
Without SPI_NOR_HAS_LOCK the block protection is never cleared, so on a
W25Q64 that ships fully protected, erases and writes silently fail.
Signed-off-by: Naresh Solanki <naresh.solanki.2011@gmail.com>
---
Tested on a Tenda AC10 V5 router (Siflower SF19A2890, Winbond W25Q64,
OpenWrt with a 6.18 kernel). The flash ships with BP2-0 = 111: without
this patch every erase and write to it is silently ignored. With it,
the protection is cleared at probe (the BP bits are non-volatile, so
with CONFIG_MTD_SPI_NOR_SWP_DISABLE), and sysupgrade and the JFFS2
overlay work.
$ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
ef4017
$ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer
spansion
$ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname
s25fl064k
$ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
ad4c59a94e6205cf237f8734d01ca45d67d34ed35404b364595ff420b6259d32
$ hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
00000000 53 46 44 50 05 01 00 ff 00 05 01 10 80 00 00 ff |SFDP............|
00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000080 e5 20 f9 ff ff ff ff 03 44 eb 08 6b 08 3b 42 bb |. ......D..k.;B.|
00000090 fe ff ff ff ff ff 00 00 ff ff 40 eb 0c 20 0f 52 |..........@.. .R|
000000a0 10 d8 00 00 36 02 a6 00 82 ea 14 c4 e9 63 76 33 |....6........cv3|
000000b0 7a 75 7a 75 f7 a2 d5 5c 19 f7 4d ff e9 30 f8 80 |zuzu...\..M..0..|
000000c0
drivers/mtd/spi-nor/spansion.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index b1b14ed..9712ed3 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -1065,6 +1065,7 @@ static const struct flash_info spansion_nor_parts[] = {
.id = SNOR_ID(0xef, 0x40, 0x17),
.name = "s25fl064k",
.size = SZ_8M,
+ .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB,
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
}
};
--
2.53.0
reply other threads:[~2026-12-01 7:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261201071521.216993-1-naresh.solanki.2011@gmail.com \
--to=naresh.solanki.2011@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=takahiro.kuwano@infineon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®