Re: [PATCH] mtd: spi-nor: macronix: Document support for additional flash aliases

From: Cheng Ming Lin

Date: Thu Apr 16 2026 - 02:11:27 EST


Hi Michael,

Michael Walle <mwalle@xxxxxxxxxx> 於 2026年4月15日週三 下午7:01寫道:
>
> Hi Cheng,
>
> On Fri Apr 10, 2026 at 11:10 AM CEST, Cheng Ming Lin wrote:
> > From: Cheng Ming Lin <chengminglin@xxxxxxxxxxx>
> >
> > 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.
>
> 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,
>
> Reviewed-by: Michael Walle <mwalle@xxxxxxxxxx>

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.

>
> Thanks,
> -michael
>
> >
> > Signed-off-by: Cheng Ming Lin <chengminglin@xxxxxxxxxxx>
> > ---
> > drivers/mtd/spi-nor/macronix.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
> > index e97f5cbd9..c557525b0 100644
> > --- a/drivers/mtd/spi-nor/macronix.c
> > +++ b/drivers/mtd/spi-nor/macronix.c
> > @@ -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,
> > }, {
>

Thanks,
Cheng Ming Lin