Skip to contentSkip to conversation

mtd: spi-nor: macronix: Add support for mx66l2g45g

PATCH In review Sebastian Falbesoner 4 participants 4 messages Feb 15, 2024 – Feb 22, 2024

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

PATCH 1/1 mtd: spi-nor: macronix: Add support for mx66l2g45g

From: Sebastian Falbesoner <[email protected]>

For reference, see the corresponding entry in u-boot, introduced in commit baef13ec9d592a27b5d3bf03967bfd2bebd65157:

[ in drivers/mtd/spi/spi-nor-ids.c:274 ]
----
{ INFO("mx66l2g45g", 0xc2201c, 0, 64 * 1024, 4096,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
----

---
 drivers/mtd/spi-nor/macronix.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/spi-nor/macronix.c +6 -0
index ea6be95e75a5..1a8f8b654dda 100644
@@ -90,6 +90,12 @@ static const struct flash_info macronix_nor_parts[] = {
 		.name = "mx66l1g45g",
 		.size = SZ_128M,
 		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+	}, {
+		.id = SNOR_ID(0xc2, 0x20, 0x1c),
+		.name = "mx66l2g45g",
+		.size = SZ_256M,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+		.fixup_flags = SPI_NOR_4B_OPCODES,
 	}, {
 		.id = SNOR_ID(0xc2, 0x23, 0x14),
 		.name = "mx25v8035f",
Signature · 6 lines
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw
Quoted 6 lines · Sebastian Falbesoner

From: Sebastian Falbesoner <[email protected]>

For reference, see the corresponding entry in u-boot, introduced in commit baef13ec9d592a27b5d3bf03967bfd2bebd65157:

[ in drivers/mtd/spi/spi-nor-ids.c:274 ]

I think this should go to stable as well?

Quoted 17 lines

----
{ INFO("mx66l2g45g", 0xc2201c, 0, 64 * 1024, 4096,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
----

---
 drivers/mtd/spi-nor/macronix.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/spi-nor/macronix.c +0 -0
index ea6be95e75a5..1a8f8b654dda 100644
@@ -90,6 +90,12 @@ static const struct flash_info macronix_nor_parts[] = {
 		.name = "mx66l1g45g",
 		.size = SZ_128M,

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

Quoted 10 lines
drivers/mtd/spi-nor/macronix.c +6 -0
 		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+	}, {
+		.id = SNOR_ID(0xc2, 0x20, 0x1c),
+		.name = "mx66l2g45g",
+		.size = SZ_256M,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+		.fixup_flags = SPI_NOR_4B_OPCODES,
 	}, {
 		.id = SNOR_ID(0xc2, 0x23, 0x14),
 		.name = "mx25v8035f",

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

maintainer
#2 lore raw
In reply to Sebastian Falbesoner

Hi,

Quoted 4 lines · Sebastian Falbesoner

From: Sebastian Falbesoner <[email protected]>

For reference, see the corresponding entry in u-boot, introduced in commit baef13ec9d592a27b5d3bf03967bfd2bebd65157:

Please keep in mind that you still need a proper commit message, SFDP dumps and test have it included in linux, see [1].

Quoted 19 lines

[ in drivers/mtd/spi/spi-nor-ids.c:274 ]
----
{ INFO("mx66l2g45g", 0xc2201c, 0, 64 * 1024, 4096,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
----

---
 drivers/mtd/spi-nor/macronix.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/spi-nor/macronix.c +0 -0
index ea6be95e75a5..1a8f8b654dda 100644
@@ -90,6 +90,12 @@ static const struct flash_info macronix_nor_parts[] = {
 		.name = "mx66l1g45g",
 		.size = SZ_128M,

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

Quoted 10 lines
drivers/mtd/spi-nor/macronix.c +6 -0
 		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+	}, {
+		.id = SNOR_ID(0xc2, 0x20, 0x1c),
+		.name = "mx66l2g45g",
+		.size = SZ_256M,
+		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+		.fixup_flags = SPI_NOR_4B_OPCODES,
 	}, {
 		.id = SNOR_ID(0xc2, 0x23, 0x14),
 		.name = "mx25v8035f",

I'm pretty sure, this flash will work without any modification by using the generic driver (and maybe using the vendor fixups). See also previous discussions [2]. Thus, I think the following should be enough:
+ { .id = SNOR_ID(0xc2, 0x20, 0x1c) }

*But* there is already a patchset under review to add SNOR_ID(0xc2) to match any macronix flashes. Therefore, with the patch in [2] applied, this flash should work without any further entries.

-michael

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html
[2] https://lore.kernel.org/linux-mtd/?q=mx66l2g45g
[3] https://lore.kernel.org/r/[email protected]/

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

#3 lore raw

Hi,

Quoted 9 lines

I'm pretty sure, this flash will work without any modification by using the generic driver (and maybe using the vendor fixups). See also previous discussions [2]. Thus, I think the following should be enough:

(quoted diff) +1 -0
+	{ .id = SNOR_ID(0xc2, 0x20, 0x1c) }

*But* there is already a patchset under review to add SNOR_ID(0xc2) to match any macronix flashes. Therefore, with the patch in [2] applied, this flash should work without any further entries.

It looks like that series it taking a while. If you want to speed things up, add this to the macronix_nor_parts[], test whether it works for your flash and submit a patch for it.

+ /* Need the manufacturer fixups. Keep this last */
+ { .id = SNOR_ID(0xc2) }

-michael

Quoted 3 lines

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html
[2] https://lore.kernel.org/linux-mtd/?q=mx66l2g45g
[3] https://lore.kernel.org/r/[email protected]/

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