Skip to contentSkip to conversation

mtd: spi-nor: sst: Unlock addition for sst26vf016

PATCH In review [email protected] 2 participants 2 messages Mar 31, 2023

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

PATCH 1/1 mtd: spi-nor: sst: Unlock addition for sst26vf016

From: Guillaume Socquet <[email protected]>

Modify sst26vf016 flash_info struct so when such device is detected by the driver it may be unlocked for write operation as sst26vf064.

---
 drivers/mtd/spi-nor/sst.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/sst.c +3 -1
index 63bcc97bf978..99c8a19493f5 100644
@@ -110,7 +110,9 @@ static const struct flash_info sst_nor_parts[] = {
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
 	{ "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32)
-		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) },
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)
+		.fixups = &sst26vf_nor_fixups },
 	{ "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128)
 		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
Signature · 6 lines
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw

Hi, Nicolas,

Quoted 16 lines · On 3/31/23 10:55, [email protected] wrote:

From: Guillaume Socquet <[email protected]>

Modify sst26vf016 flash_info struct so when such device is detected by the driver it may be unlocked for write operation as sst26vf064.

---
 drivers/mtd/spi-nor/sst.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/sst.c +0 -0
index 63bcc97bf978..99c8a19493f5 100644

drivers/mtd/spi-nor/sst.c static const struct flash_info sst_nor_parts[] = { · line 114

Quoted 6 lines
drivers/mtd/spi-nor/sst.c +2 -1
@@ -110,7 +110,9 @@ static const struct flash_info sst_nor_parts[] = {
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
 			      SPI_NOR_QUAD_READ) },
 	{ "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32)
-		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) },
+		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)

If I remember correctly this flash has SFDP support. If so, we may be able to get rid of the "NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)". You can check whether the flash defines the SFDP tables or not by dumping the sfdp sysfs entry. Check the link from below on how to do that.

Also the sector size and nsectors should be superfluous if the SFDP tables are present.

drivers/mtd/spi-nor/sst.c static const struct flash_info sst_nor_parts[] = { · line 115

Quoted 1 line
drivers/mtd/spi-nor/sst.c +1 -0
+		.fixups = &sst26vf_nor_fixups },

So I'd try:

{ "sst26vf016b", INFO(0xbf2641, 0, 0, 0)

		PARSE_SFDP
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
		.fixups = &sst26vf_nor_fixups },

We ask people that update or add new flash entries to do an erase, verify erase, write, read back and compare test. Also to dump the sysfs entries. Here's how to do that:

https://lore.kernel.org/lkml/[email protected]/T/

Cheers,
ta

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/