]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mtd: spi-nor: winbond: Fix locking support for w25q256jwm
authorEliav Farber <farbere@amazon.com>
Wed, 18 Feb 2026 14:35:21 +0000 (14:35 +0000)
committerPratyush Yadav (Google) <pratyush@kernel.org>
Mon, 30 Mar 2026 14:06:45 +0000 (14:06 +0000)
The Winbond w25q256jwm device supports four Block Protect (BP) bits and
uses Status Register bit 6 as the Top/Bottom (TB) protect bit.

Update the flash parameters by enabling SPI_NOR_4BIT_BP and
SPI_NOR_TB_SR_BIT6. Without these flags, the locking configuration is
incorrect.

Reference:
https://www.winbond.com/hq/support/documentation/levelOne.jsp?__locale=en&DocNo=DA00-W25Q256JW.1

Signed-off-by: Eliav Farber <farbere@amazon.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
drivers/mtd/spi-nor/winbond.c

index fb855fe44733db5664c200520d19a6be33edc323..55f1209936d57d3277feb4612a9ceadcbbe53d75 100644 (file)
@@ -337,7 +337,7 @@ static const struct flash_info winbond_nor_parts[] = {
                .id = SNOR_ID(0xef, 0x80, 0x19),
                .name = "w25q256jwm",
                .size = SZ_32M,
-               .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB,
+               .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_NOR_4BIT_BP,
                .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
        }, {
                .id = SNOR_ID(0xef, 0x80, 0x20),