Skip to contentSkip to conversation

mtd: spi-nor: winbond: fix W25Q256 and W25Q512 chips configuration

PATCH In review Jakub Czapiga 2 participants 2 messages Mar 17, 2025 – Mar 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: winbond: fix W25Q256 and W25Q512 chips configuration

Fill and fix configuration of Winbond chips:
- W25Q512JVQ (+lock, +tb)
- W25Q256JW (+lock, +tb)
- W25Q256JVM (+lock, +tb, +4k, +dual, +quad)
- W25Q512JWM (+lock, +tb)

Top-Bottom selection bit is SR(6). All mentioned chips have 4-bit long Block-Protection field.

---
 drivers/mtd/spi-nor/winbond.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/winbond.c +6 -1
index 8d0a00d69e12..8ebb1461a4e9 100644
@@ -145,6 +145,7 @@ static const struct flash_info winbond_nor_parts[] = {
 		.id = SNOR_ID(0xef, 0x40, 0x20),
 		.name = "w25q512jvq",
 		.size = SZ_64M,
+		.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, 0x50, 0x12),
@@ -190,6 +191,7 @@ static const struct flash_info winbond_nor_parts[] = {
 		.id = SNOR_ID(0xef, 0x60, 0x19),
 		.name = "w25q256jw",
 		.size = SZ_32M,
+		.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, 0x60, 0x20),
@@ -221,6 +223,9 @@ static const struct flash_info winbond_nor_parts[] = {
 	}, {
 		.id = SNOR_ID(0xef, 0x70, 0x19),
 		.name = "w25q256jvm",
+		.size = SZ_32M,
+		.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, 0x71, 0x19),
 		.name = "w25m512jv",
@@ -249,7 +254,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),
Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog
#1 lore raw
Quoted 19 lines · Jakub Czapiga

Fill and fix configuration of Winbond chips:
- W25Q512JVQ (+lock, +tb)
- W25Q256JW (+lock, +tb)
- W25Q256JVM (+lock, +tb, +4k, +dual, +quad)
- W25Q512JWM (+lock, +tb)

Top-Bottom selection bit is SR(6). All mentioned chips have 4-bit long Block-Protection field.

---
 drivers/mtd/spi-nor/winbond.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/winbond.c +0 -0
index 8d0a00d69e12..8ebb1461a4e9 100644

drivers/mtd/spi-nor/winbond.c static const struct flash_info winbond_nor_parts[] = { · line 146

Quoted 2 lines
drivers/mtd/spi-nor/winbond.c +0 -0
@@ -145,6 +145,7 @@ static const struct flash_info winbond_nor_parts[] = {
 		.id = SNOR_ID(0xef, 0x40, 0x20),
 		.name = "w25q512jvq",

drop the name on next version and add it as a comment

drivers/mtd/spi-nor/winbond.c static const struct flash_info winbond_nor_parts[] = { · line 147

Quoted 1 line
drivers/mtd/spi-nor/winbond.c +0 -0
 		.size = SZ_64M,

drop size if flash supports SFDP

drivers/mtd/spi-nor/winbond.c static const struct flash_info winbond_nor_parts[] = { · line 149

Quoted 2 lines
drivers/mtd/spi-nor/winbond.c +1 -0
+		.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,

drop no_sfdp_flags if flash supports SFDP.

Btw, switching to SFDP shall be done in a dedicated patch, then come with the BP patch on top of it. Comment applies to all patches.

drivers/mtd/spi-nor/winbond.c static const struct flash_info winbond_nor_parts[] = { · line 195

Quoted 8 lines
drivers/mtd/spi-nor/winbond.c +1 -0
 	}, {
 		.id = SNOR_ID(0xef, 0x50, 0x12),
@@ -190,6 +191,7 @@ static const struct flash_info winbond_nor_parts[] = {
 		.id = SNOR_ID(0xef, 0x60, 0x19),
 		.name = "w25q256jw",
 		.size = SZ_32M,
+		.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,

same comments as above for this flash and all from below.

Cheers,
ta

Quoted 21 lines
drivers/mtd/spi-nor/winbond.c +4 -1
 	}, {
 		.id = SNOR_ID(0xef, 0x60, 0x20),
@@ -221,6 +223,9 @@ static const struct flash_info winbond_nor_parts[] = {
 	}, {
 		.id = SNOR_ID(0xef, 0x70, 0x19),
 		.name = "w25q256jvm",
+		.size = SZ_32M,
+		.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, 0x71, 0x19),
 		.name = "w25m512jv",
@@ -249,7 +254,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),