Skip to contentSkip to conversation

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

PATCH In review Ley Foon Tan 2 participants 2 messages Jan 24, 2022 – Jan 25, 2022

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

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

The Macronix mx66u1g45g [1] is a 1.8V, 1Gbit (128MB) flash device that supports x1, x2, or x4 operation.

The mx66u1g45g is the smaller sibling of the mx66u2g45g that is already supported.

Tested on StarFive Dubhe hardware on FPGA. Validated by erase and read back, write and read back.

[1] https://www.macronix.com/Lists/Datasheet/Attachments/7877/MX66U1G45G,%201.8V,%201Gb,%20v1.4.pdf

---
 drivers/mtd/spi-nor/macronix.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/macronix.c +3 -0
index 97dba1ae7fb1..79ee808c5442 100644
@@ -97,6 +97,9 @@ static const struct flash_info macronix_parts[] = {
 			      SPI_NOR_QUAD_READ) },
 	{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048)
 		NO_SFDP_FLAGS(SPI_NOR_QUAD_READ) },
+	{ "mx66u1g45g",  INFO(0xc2253b, 0, 64 * 1024, 2048)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
 	{ "mx66u2g45g",	 INFO(0xc2253c, 0, 64 * 1024, 4096)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 21 lines · Ley Foon Tan

The Macronix mx66u1g45g [1] is a 1.8V, 1Gbit (128MB) flash device that supports x1, x2, or x4 operation.

The mx66u1g45g is the smaller sibling of the mx66u2g45g that is already supported.

Tested on StarFive Dubhe hardware on FPGA. Validated by erase and read back, write and read back.

[1] https://www.macronix.com/Lists/Datasheet/Attachments/7877/MX66U1G45G,%201.8V,%201Gb,%20v1.4.pdf

---
 drivers/mtd/spi-nor/macronix.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/macronix.c +0 -0
index 97dba1ae7fb1..79ee808c5442 100644

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

Quoted 6 lines
drivers/mtd/spi-nor/macronix.c +3 -0
@@ -97,6 +97,9 @@ static const struct flash_info macronix_parts[] = {
 			      SPI_NOR_QUAD_READ) },
 	{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048)
 		NO_SFDP_FLAGS(SPI_NOR_QUAD_READ) },
+	{ "mx66u1g45g",  INFO(0xc2253b, 0, 64 * 1024, 2048)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },

This is the "legacy" way of defining flags. I see from the datasheet that SFDP is supported. Please use PARSE_SFDP to allow these parameters to be discovered via SFDP. If one of the SFDP table has wrong data then please use fixup hooks to correct it.

You also need to dump the SFDP table and some other flash parameters in the patch comments. See [0] for an example.

[0] https://patchwork.ozlabs.org/project/linux-mtd/patch/[email protected]/

Quoted 7 lines
drivers/mtd/spi-nor/macronix.c +0 -0
 	{ "mx66u2g45g",	 INFO(0xc2253c, 0, 64 * 1024, 4096)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
Signature · 1 line
2.25.1
Signature · 7 lines
Regards,
Pratyush Yadav
Texas Instruments Inc.

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