Skip to contentSkip to conversation

mtd: spi-nor: macronix: Document support for additional flash aliases

PATCH Applied Cheng Ming Lin 2 participants 8 messages Apr 10 – Sep 4

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

PATCH 1/1 mtd: spi-nor: macronix: Document support for additional flash aliases

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

---
 drivers/mtd/spi-nor/macronix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/spi-nor/macronix.c +3 -3
index e97f5cbd9..c557525b0 100644
@@ -138,7 +138,7 @@ static const struct flash_info macronix_nor_parts[] = {
 		.id = SNOR_ID(0xc2, 0x20, 0x19),
 		.fixups = &mx25l25635_fixups
 	}, {
-		/* MX66L51235F */
+		/* MX25L51245G, MX25L51273G, MX66L51235F */
 		.id = SNOR_ID(0xc2, 0x20, 0x1a),
 		.fixup_flags = SPI_NOR_4B_OPCODES,
 		.fixups = &macronix_qpp4b_fixups,
@@ -186,11 +186,11 @@ static const struct flash_info macronix_nor_parts[] = {
 		.size = SZ_16M,
 		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
 	}, {
-		/* MX25U51245G */
+		/* MX25U51245G, MX25U51293G */
 		.id = SNOR_ID(0xc2, 0x25, 0x3a),
 		.fixups = &macronix_qpp4b_fixups,
 	}, {
-		/* MX66U1G45G */
+		/* MX66U1G45G, MX66U1G93G */
 		.id = SNOR_ID(0xc2, 0x25, 0x3b),
 		.fixups = &macronix_qpp4b_fixups,
 	}, {
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 9 lines · Cheng Ming Lin

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

Quoted 7 lines

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

Hi Cheng,

could you please provide an SFDP dump of all these chips? See [1] for more information.

Thanks,
-michael

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html

#2 lore raw

Hi Michael,

Michael Walle <[email protected]> 於 2026年4月10日週五 下午5:26寫道:

Quoted 17 lines · Cheng Ming Lin
Quoted 15 lines

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

Quoted 6 lines
Quoted 1 line

Hi Cheng,

could you please provide an SFDP dump of all these chips? See [1] for more information.

Sure. I will reply with the SFDP data as soon as I have them ready.

Quoted 5 lines

Thanks,
-michael

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html

Thanks,
Cheng Ming Lin

#3 lore raw
In reply to Michael Walle

Hi Michael,

Michael Walle <[email protected]> 於 2026年4月10日週五 下午5:26寫道:

Quoted 17 lines · Cheng Ming Lin
Quoted 15 lines

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

Quoted 6 lines
Quoted 1 line

Hi Cheng,

could you please provide an SFDP dump of all these chips? See [1] for more information.

1. MX25L51245G
zynq> cat /sys/kernel/debug/spi-nor/spi2.0/params

name            (null)
id              c2 20 1a c2 20 1a
size            64.0 MiB
write size      1
page size       256
address nbytes  4
flags           4B_OPCODES | HAS_4BAIT | SOFT_RESET

zynq> xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 53464450060102ff00060110300000ffc2000104100100ff84000102c000 00ffffffffffffffffffffffffffffffffffe520fbffffffff1f44eb086b 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ffd649c50081df 04e34403673830b030b0f7bdd55c4a9e29fff050f985ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffff7fefffff215cdcffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffff003600279df9c06485cbffffffffffff

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 7281b0a355a4497ec6256c57b81c3d2b303bc34220cb77790278d719d7465276 /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

2. MX25L51273G
zynq> cat /sys/kernel/debug/spi-nor/spi2.0/params

name            (null)
id              c2 20 1a c2 20 1a
size            64.0 MiB
write size      1
page size       256
address nbytes  4
flags           4B_OPCODES | HAS_4BAIT | SOFT_RESET

zynq> xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 53464450060102ff00060110300000ffc2000104100100ff84000102c000 00ffffffffffffffffffffffffffffffffffe520fbffffffff1f44eb086b 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ffd649c50081df 04e34403673830b030b0f7bdd55c4a9e29fff050f985ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffff7fefffff215cdcffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffff003600279df9c06485cbffffffffffff

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 7281b0a355a4497ec6256c57b81c3d2b303bc34220cb77790278d719d7465276 /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

3. MX25U51293G
zynq> cat /sys/kernel/debug/spi-nor/spi2.0/params

name            (null)
id              c2 25 3a c2 25 3a
size            64.0 MiB
write size      1
page size       256
address nbytes  4
flags           4B_OPCODES | HAS_4BAIT | SOFT_RESET

zynq> xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 53464450060102ff00060110300000ffc2000104100100ff84000102c000 00ffffffffffffffffffffffffffffffffffe520fbffffffff1f44eb086b 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ff8749b50082df 04e24403673830b030b0f7bdd55c4a9e29fff050f985ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffff7f8fffff215cdcffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffff002050169df9c06485cbffffffffffff

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp faa50d0c2c8f26dbdfb400c995bd19a4a492404336588a72c596088c5641164f /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

4. MX66U1G93G
zynq> cat /sys/kernel/debug/spi-nor/spi2.0/params

name            (null)
id              c2 25 3b c2 25 3b
size            128 MiB
write size      1
page size       256
address nbytes  4
flags           4B_OPCODES | HAS_4BAIT | SOFT_RESET

zynq> xxd -p /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 53464450060102ff00060110300000ffc2000104100100ff84000102c000 00ffffffffffffffffffffffffffffffffffe520fbffffffff3f44eb086b 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ff8749b50082df 04e24403673830b030b0f7bdd55c4a9e29fff050f985ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffff7f8fffff215cdcffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffff002050169df9c06485cbffffffffffff

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp f693537f8b6660a8ed937dab65eff3821f58e03c026a64b153ddccbfd9a6df0c /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

Quoted 5 lines

Thanks,
-michael

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html

Thanks,
Cheng Ming Lin

maintainer
#4 lore raw

Hi

thanks for providing the dumps.

Quoted 1 line

1. MX25L51245G

..

Quoted 5 lines

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 7281b0a355a4497ec6256c57b81c3d2b303bc34220cb77790278d719d7465276 /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

2. MX25L51273G

..

Quoted 3 lines

zynq> sha256sum /sys/bus/spi/devices/spi2.0/spi-nor/sfdp 7281b0a355a4497ec6256c57b81c3d2b303bc34220cb77790278d719d7465276 /sys/bus/spi/devices/spi2.0/spi-nor/sfdp

Different parts, same ID, same SFDP :(( Are they the same from a software perspective? With Macronix reusing the same ID for different flash chips it makes software support for different features really hard. And with even with the SFDP being the very same, it's impossible to distinguish them during auto probing.

-michael

maintainer Reviewed-by on v1 1/1
#5 lore raw
In reply to Cheng Ming Lin

Hi Cheng,

Quoted 6 lines · Cheng Ming Lin

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Quoted 8 lines

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

Honestly, this sounds a bit hyperbolic. Macronix is notoriously bad with reusing flash ids where you actually have to be able to tell them apart from each other in software.

So, if you really have to reuse your flash ids, how about having an unique id in the SFDP tables, like in a manufacturer specific table? That would really help us. Could you please discuss that with your product management?

Anyway,

Thanks,
-michael

Quoted 33 lines
---
 drivers/mtd/spi-nor/macronix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/spi-nor/macronix.c +3 -3
index e97f5cbd9..c557525b0 100644
@@ -138,7 +138,7 @@ static const struct flash_info macronix_nor_parts[] = {
 		.id = SNOR_ID(0xc2, 0x20, 0x19),
 		.fixups = &mx25l25635_fixups
 	}, {
-		/* MX66L51235F */
+		/* MX25L51245G, MX25L51273G, MX66L51235F */
 		.id = SNOR_ID(0xc2, 0x20, 0x1a),
 		.fixup_flags = SPI_NOR_4B_OPCODES,
 		.fixups = &macronix_qpp4b_fixups,
@@ -186,11 +186,11 @@ static const struct flash_info macronix_nor_parts[] = {
 		.size = SZ_16M,
 		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
 	}, {
-		/* MX25U51245G */
+		/* MX25U51245G, MX25U51293G */
 		.id = SNOR_ID(0xc2, 0x25, 0x3a),
 		.fixups = &macronix_qpp4b_fixups,
 	}, {
-		/* MX66U1G45G */
+		/* MX66U1G45G, MX66U1G93G */
 		.id = SNOR_ID(0xc2, 0x25, 0x3b),
 		.fixups = &macronix_qpp4b_fixups,
 	}, {
#6 lore raw

Hi Michael,

Michael Walle <[email protected]> 於 2026年4月15日週三 下午7:01寫道:

Quoted 23 lines

Hi Cheng,

Quoted 6 lines · Cheng Ming Lin

From: Cheng Ming Lin <[email protected]>

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Quoted 8 lines

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

While this change does not affect the functional driver logic, it significantly improves the searchability of the kernel source tree. This helps users easily verify that their specific physical part is fully supported, preventing confusion and deterring redundant patch submissions that attempt to add duplicate entries for these alias parts.

Honestly, this sounds a bit hyperbolic. Macronix is notoriously bad with reusing flash ids where you actually have to be able to tell them apart from each other in software.

Quoted 8 lines

So, if you really have to reuse your flash ids, how about having an unique id in the SFDP tables, like in a manufacturer specific table? That would really help us. Could you please discuss that with your product management?

Anyway,

Fair point. I agree that simply adding comments in the code is just a documentation improvement and doesn't solve the actual software burden caused by shared JEDEC IDs.

Your suggestion to embed a unique ID in the manufacturer-specific SFDP tables to programmatically distinguish these different part numbers is a much better solution. I will definitely take this specific request back to our product management to see how we can implement this in future product planning.

Thanks for the R-b and the feedback.

Quoted 29 lines

Thanks,
-michael

Quoted 25 lines
---
 drivers/mtd/spi-nor/macronix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/spi-nor/macronix.c +2 -2
index e97f5cbd9..c557525b0 100644
@@ -138,7 +138,7 @@ static const struct flash_info macronix_nor_parts[] = {
              .id = SNOR_ID(0xc2, 0x20, 0x19),
              .fixups = &mx25l25635_fixups
      }, {
-             /* MX66L51235F */
+             /* MX25L51245G, MX25L51273G, MX66L51235F */
              .id = SNOR_ID(0xc2, 0x20, 0x1a),
              .fixup_flags = SPI_NOR_4B_OPCODES,
              .fixups = &macronix_qpp4b_fixups,
@@ -186,11 +186,11 @@ static const struct flash_info macronix_nor_parts[] = {
              .size = SZ_16M,
              .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
      }, {
-             /* MX25U51245G */
+             /* MX25U51245G, MX25U51293G */
Quoted 9 lines

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

Quoted 8 lines
drivers/mtd/spi-nor/macronix.c +1 -1
              .id = SNOR_ID(0xc2, 0x25, 0x3a),
              .fixups = &macronix_qpp4b_fixups,
      }, {
-             /* MX66U1G45G */
+             /* MX66U1G45G, MX66U1G93G */
              .id = SNOR_ID(0xc2, 0x25, 0x3b),
              .fixups = &macronix_qpp4b_fixups,
      }, {

Thanks,
Cheng Ming Lin

maintainer Applied
#7 lore raw
In reply to Cheng Ming Lin
Quoted 8 lines · Cheng Ming Lin

Several Macronix SPI NOR flash devices share the same ID. For instance, the MX25L51245G and MX25L51273G share the same ID (0xc2201a) with the currently listed MX66L51235F.

Add these equivalent part numbers to the comments above their corresponding flash_info entries.

[...]

Applied, thanks!

[1/1] mtd: spi-nor: macronix: Document support for additional flash aliases

      commit: 85b6110155cab6b67c9072c19f21dcb620c2819d

Best regards,

Signature · 1 line
Michael Walle <[email protected]>