Skip to contentSkip to conversation

mtd: spi-nor: macronix: enable dual and quad read for MX25U25635F

PATCH In review Parth Pancholi 2 participants 3 messages Oct 24, 2024 – Nov 4, 2024

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

PATCH 1/1 mtd: spi-nor: macronix: enable dual and quad read for MX25U25635F

From: Parth Pancholi <[email protected]>

The MX25U25635F supports dual and quad read operations. Set the corresponding flags to enable these features in accordance with the hardware capabilities. This change also enables dual and quad read operations on the MX25U25645G, which shares the same ID and has a superset of the functionality provided by the MX25U25635F.

---
 drivers/mtd/spi-nor/macronix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/macronix.c +1 -1
index ea6be95e75a5..be55558c8ad0 100644
@@ -129,7 +129,7 @@ static const struct flash_info macronix_nor_parts[] = {
 		.id = SNOR_ID(0xc2, 0x25, 0x39),
 		.name = "mx25u25635f",
 		.size = SZ_32M,
-		.no_sfdp_flags = SECT_4K,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
 		.fixup_flags = SPI_NOR_4B_OPCODES,
 	}, {
 		.id = SNOR_ID(0xc2, 0x25, 0x3a),
Signature · 1 line
2.34.1
#1 lore raw
Quoted 9 lines · Parth Pancholi

From: Parth Pancholi <[email protected]>

The MX25U25635F supports dual and quad read operations. Set the corresponding flags to enable these features in accordance with the hardware capabilities. This change also enables dual and quad read operations on the MX25U25645G, which shares the same ID and has a superset of the functionality provided by the MX25U25635F.

Looks like the flash defines SFDP tables "Table 13. Parameter Table (0):
JEDEC Flash Parameter Tables".

We have some minimum testing requirements, please see them on
https://docs.kernel.org/driver-api/mtd/spi-nor.html

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 131

Quoted 13 lines
---
 drivers/mtd/spi-nor/macronix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/macronix.c +0 -0
index ea6be95e75a5..be55558c8ad0 100644
@@ -129,7 +129,7 @@ static const struct flash_info macronix_nor_parts[] = {
 		.id = SNOR_ID(0xc2, 0x25, 0x39),
 		.name = "mx25u25635f",
 		.size = SZ_32M,

if we want to switch to SFDP initialized params then we can remove the size

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 132

Quoted 2 lines
drivers/mtd/spi-nor/macronix.c +1 -1
-		.no_sfdp_flags = SECT_4K,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,

and this line as well.

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 133

Quoted 1 line
drivers/mtd/spi-nor/macronix.c +0 -0
 		.fixup_flags = SPI_NOR_4B_OPCODES,

If the flash defines the 4bait table (I don't see it in datasheet though), then this line as well. We may remove the entire entry and rely solely on the generic flash driver.

Quoted 2 lines
drivers/mtd/spi-nor/macronix.c +0 -0
 	}, {
 		.id = SNOR_ID(0xc2, 0x25, 0x3a),
#2 lore raw
Quoted 40 lines · Tudor Ambarus
Quoted 9 lines · Parth Pancholi

From: Parth Pancholi <[email protected]>

The MX25U25635F supports dual and quad read operations. Set the corresponding flags to enable these features in accordance with the hardware capabilities. This change also enables dual and quad read operations on the MX25U25645G, which shares the same ID and has a superset of the functionality provided by the MX25U25635F.

Looks like the flash defines SFDP tables "Table 13. Parameter Table (0):
JEDEC Flash Parameter Tables".

We have some minimum testing requirements, please see them on
https://docs.kernel.org/driver-api/mtd/spi-nor.html

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 131

Quoted 13 lines
---
 drivers/mtd/spi-nor/macronix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/macronix.c +0 -0
index ea6be95e75a5..be55558c8ad0 100644
@@ -129,7 +129,7 @@ static const struct flash_info macronix_nor_parts[] = {
 		.id = SNOR_ID(0xc2, 0x25, 0x39),
 		.name = "mx25u25635f",
 		.size = SZ_32M,

if we want to switch to SFDP initialized params then we can remove the size

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 132

Quoted 2 lines
drivers/mtd/spi-nor/macronix.c +1 -1
-		.no_sfdp_flags = SECT_4K,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,

and this line as well.

Quoted 8 lines

drivers/mtd/spi-nor/macronix.c static const struct flash_info macronix_nor_parts[] = { · line 133

Quoted 1 line
drivers/mtd/spi-nor/macronix.c +0 -0
 		.fixup_flags = SPI_NOR_4B_OPCODES,

If the flash defines the 4bait table (I don't see it in datasheet though), then this line as well. We may remove the entire entry and rely solely on the generic flash driver.

Quoted 2 lines
drivers/mtd/spi-nor/macronix.c +0 -0
 	}, {
 		.id = SNOR_ID(0xc2, 0x25, 0x3a),

Thank you for the review, Tudor.
I performed a quick test on the mx25u25645g (sharing the same ID as mx25u25635f) connected at TI AM69 device’s QSPI, removing the mx25u25635f entry to rely exclusively on the generic flash driver as suggested. So far, I did not see issue. I’ll perform additional tests and submit v2 with the mx25u25635f entry removed, along with minimal test logs.

Parth P