* [PATCH v2 0/2] mtd: spi-nor: macronix: Add support for MX25L12833F and MX25L12845G
@ 2026-06-05 0:57 Cheng Ming Lin
2026-06-05 0:57 ` [PATCH v2 1/2] mtd: spi-nor: " Cheng Ming Lin
2026-06-05 0:57 ` [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D Cheng Ming Lin
0 siblings, 2 replies; 6+ messages in thread
From: Cheng Ming Lin @ 2026-06-05 0:57 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Takahiro Kuwano, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, alvinzhou, Cheng Ming Lin
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Add support for Macronix MX25L12833F and MX25L12845G SPI NOR flashes.
These parts share the same JEDEC ID (0xc2, 0x20, 0x18) as the legacy
MX25L12805D.
Changes in v2:
- Patch 1: Changed the fixup hook from late_init to post_bfpt. Since
the legacy MX25L12805D lacks SFDP, it will not execute post_bfpt.
This safely isolates the newer MX25L12833F/45G (which support SFDP)
and enables 4PP for them without breaking the legacy part.
- Patch 1: Added detailed comments inside the fixup function explaining
the ID collision and the rationale behind the hook choice, as
suggested by reviewers.
- Patch 2 (New): Added a separate patch to restore the missing .size
and .no_sfdp_flags fallback parameters for the legacy MX25L12805D.
This fixes a probe failure caused by a previous commit and includes
the appropriate Fixes and Cc: stable tags.
Cheng Ming Lin (2):
mtd: spi-nor: Add support for MX25L12833F and MX25L12845G
mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D
drivers/mtd/spi-nor/macronix.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] mtd: spi-nor: Add support for MX25L12833F and MX25L12845G
2026-06-05 0:57 [PATCH v2 0/2] mtd: spi-nor: macronix: Add support for MX25L12833F and MX25L12845G Cheng Ming Lin
@ 2026-06-05 0:57 ` Cheng Ming Lin
2026-06-05 5:02 ` Miquel Raynal
2026-06-05 0:57 ` [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D Cheng Ming Lin
1 sibling, 1 reply; 6+ messages in thread
From: Cheng Ming Lin @ 2026-06-05 0:57 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Takahiro Kuwano, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, alvinzhou, Cheng Ming Lin
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Add support for Macronix MX25L12833F and MX25L12845G SPI NOR flashes.
These parts share the same JEDEC ID (0xc2, 0x20, 0x18) as the legacy
MX25L12805D.
The newer flashes support SFDP and 1-4-4 Page Program in 3-byte address
mode, but this 4PP capability is not defined in their SFDP tables.
Conversely, the legacy MX25L12805D lacks SFDP support entirely and does
not support 4PP.
To safely enable 4PP for the newer flashes without breaking the legacy
part, introduce a post_bfpt fixup. Since the legacy MX25L12805D does
not support SFDP, it falls back to static parameters and will never
execute the post_bfpt hook. The newer flashes will successfully parse
the BFPT, trigger the hook, and safely append the SNOR_HWCAPS_PP_1_4_4
capability.
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
drivers/mtd/spi-nor/macronix.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index e97f5cbd9..febcef6a1 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -83,6 +83,25 @@ mx25l3255e_late_init_fixups(struct spi_nor *nor)
return 0;
}
+static int
+mx25l12805d_4pp3b_post_bfpt_fixups(struct spi_nor *nor)
+{
+ struct spi_nor_flash_parameter *params = nor->params;
+
+ /*
+ * JEDEC ID 0xc22018 is shared by MX25L12805D (no SFDP, no 4PP) and
+ * MX25L12833F/MX25L12845G (support SFDP and 4PP in 3-byte mode).
+ * The legacy 05D lacks SFDP and will not execute this hook. For
+ * the newer flashes, 3-byte 1-4-4 PP is not defined in SFDP, so
+ * we safely enable it here.
+ */
+ params->hwcaps.mask |= SNOR_HWCAPS_PP_1_4_4;
+ spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP_1_4_4],
+ SPINOR_OP_PP_1_4_4, SNOR_PROTO_1_4_4);
+
+ return 0;
+}
+
static const struct spi_nor_fixups mx25l25635_fixups = {
.post_bfpt = mx25l25635_post_bfpt_fixups,
.post_sfdp = macronix_qpp4b_post_sfdp_fixups,
@@ -96,6 +115,10 @@ static const struct spi_nor_fixups mx25l3255e_fixups = {
.late_init = mx25l3255e_late_init_fixups,
};
+static const struct spi_nor_fixups mx25l12805d_4pp3b_fixups = {
+ .post_bfpt = mx25l12805d_4pp3b_post_bfpt_fixups,
+};
+
static const struct flash_info macronix_nor_parts[] = {
{
.id = SNOR_ID(0xc2, 0x20, 0x10),
@@ -130,9 +153,10 @@ static const struct flash_info macronix_nor_parts[] = {
.size = SZ_8M,
.no_sfdp_flags = SECT_4K,
}, {
- /* MX25L12805D */
+ /* MX25L12805D, MX25L12833F, MX25L12845G */
.id = SNOR_ID(0xc2, 0x20, 0x18),
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP,
+ .fixups = &mx25l12805d_4pp3b_fixups,
}, {
/* MX25L25635E, MX25L25645G */
.id = SNOR_ID(0xc2, 0x20, 0x19),
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D
2026-06-05 0:57 [PATCH v2 0/2] mtd: spi-nor: macronix: Add support for MX25L12833F and MX25L12845G Cheng Ming Lin
2026-06-05 0:57 ` [PATCH v2 1/2] mtd: spi-nor: " Cheng Ming Lin
@ 2026-06-05 0:57 ` Cheng Ming Lin
2026-06-05 5:05 ` Miquel Raynal
2026-06-05 8:07 ` kernel test robot
1 sibling, 2 replies; 6+ messages in thread
From: Cheng Ming Lin @ 2026-06-05 0:57 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Takahiro Kuwano, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, alvinzhou, Cheng Ming Lin, stable
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
In a previous effort to drop flash_info fields and rely on SFDP, the
static size and no_sfdp_flags were removed from the MX25L12805D entry
(JEDEC ID 0xc22018).
At that time, the legacy MX25L12805D was already EOL and unavailable
for physical testing. Verification was inadvertently performed using
the newer MX25L12833F, which shares the same JEDEC ID but supports
SFDP. As a result, the probe succeeded during testing, leading to
the mistaken removal of the fallback parameters.
Since the actual MX25L12805D lacks SFDP support entirely, it strictly
requires these static parameters.
Restore .size = SZ_16M and .no_sfdp_flags = SECT_4K to this entry
to fix the probe failure for the legacy part.
Fixes: 947c86e481a0 ("mtd: spi-nor: macronix: Drop the redundant flash info fields")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
drivers/mtd/spi-nor/macronix.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index febcef6a1..4cb7c1e98 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -155,7 +155,9 @@ static const struct flash_info macronix_nor_parts[] = {
}, {
/* MX25L12805D, MX25L12833F, MX25L12845G */
.id = SNOR_ID(0xc2, 0x20, 0x18),
+ .size = SZ_16M,
.flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP,
+ .no_sfdp_flags = SECT_4K,
.fixups = &mx25l12805d_4pp3b_fixups,
}, {
/* MX25L25635E, MX25L25645G */
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] mtd: spi-nor: Add support for MX25L12833F and MX25L12845G
2026-06-05 0:57 ` [PATCH v2 1/2] mtd: spi-nor: " Cheng Ming Lin
@ 2026-06-05 5:02 ` Miquel Raynal
0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2026-06-05 5:02 UTC (permalink / raw)
To: Cheng Ming Lin
Cc: Pratyush Yadav, Michael Walle, Takahiro Kuwano,
Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
alvinzhou, Cheng Ming Lin
Hello Cheng Ming,
On 05/06/2026 at 08:57:19 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
> From: Cheng Ming Lin <chengminglin@mxic.com.tw>
>
> Add support for Macronix MX25L12833F and MX25L12845G SPI NOR flashes.
> These parts share the same JEDEC ID (0xc2, 0x20, 0x18) as the legacy
> MX25L12805D.
>
> The newer flashes support SFDP and 1-4-4 Page Program in 3-byte address
> mode, but this 4PP capability is not defined in their SFDP tables.
> Conversely, the legacy MX25L12805D lacks SFDP support entirely and does
> not support 4PP.
>
> To safely enable 4PP for the newer flashes without breaking the legacy
> part, introduce a post_bfpt fixup. Since the legacy MX25L12805D does
> not support SFDP, it falls back to static parameters and will never
> execute the post_bfpt hook. The newer flashes will successfully parse
> the BFPT, trigger the hook, and safely append the SNOR_HWCAPS_PP_1_4_4
> capability.
>
> Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
LGTM.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D
2026-06-05 0:57 ` [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D Cheng Ming Lin
@ 2026-06-05 5:05 ` Miquel Raynal
2026-06-05 8:07 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2026-06-05 5:05 UTC (permalink / raw)
To: Cheng Ming Lin
Cc: Pratyush Yadav, Michael Walle, Takahiro Kuwano,
Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
alvinzhou, Cheng Ming Lin, stable
Hello,
> In a previous effort to drop flash_info fields and rely on SFDP, the
> static size and no_sfdp_flags were removed from the MX25L12805D entry
> (JEDEC ID 0xc22018).
>
> At that time, the legacy MX25L12805D was already EOL and unavailable
> for physical testing. Verification was inadvertently performed using
> the newer MX25L12833F, which shares the same JEDEC ID but supports
> SFDP. As a result, the probe succeeded during testing, leading to
> the mistaken removal of the fallback parameters.
>
> Since the actual MX25L12805D lacks SFDP support entirely, it strictly
> requires these static parameters.
>
> Restore .size = SZ_16M and .no_sfdp_flags = SECT_4K to this entry
> to fix the probe failure for the legacy part.
>
> Fixes: 947c86e481a0 ("mtd: spi-nor: macronix: Drop the redundant flash info fields")
> Cc: stable@vger.kernel.org
> Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D
2026-06-05 0:57 ` [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D Cheng Ming Lin
2026-06-05 5:05 ` Miquel Raynal
@ 2026-06-05 8:07 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-06-05 8:07 UTC (permalink / raw)
To: Cheng Ming Lin, Pratyush Yadav, Michael Walle, Takahiro Kuwano,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: oe-kbuild-all, linux-mtd, linux-kernel, alvinzhou, Cheng Ming Lin,
stable
Hi Cheng,
kernel test robot noticed the following build errors:
[auto build test ERROR on mtd/spi-nor/next]
[also build test ERROR on linus/master v7.1-rc6 next-20260604]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Cheng-Ming-Lin/mtd-spi-nor-Add-support-for-MX25L12833F-and-MX25L12845G/20260605-090612
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next
patch link: https://lore.kernel.org/r/20260605005720.1857413-3-linchengming884%40gmail.com
patch subject: [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D
config: x86_64-rhel-9.4-func (https://download.01.org/0day-ci/archive/20260605/202606051000.gRYPMoXy-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260605/202606051000.gRYPMoXy-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606051000.gRYPMoXy-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/mtd/spi-nor/macronix.c:119:22: error: initialization of 'int (*)(struct spi_nor *, const struct sfdp_parameter_header *, const struct sfdp_bfpt *)' from incompatible pointer type 'int (*)(struct spi_nor *)' [-Wincompatible-pointer-types]
119 | .post_bfpt = mx25l12805d_4pp3b_post_bfpt_fixups,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/spi-nor/macronix.c:119:22: note: (near initialization for 'mx25l12805d_4pp3b_fixups.post_bfpt')
vim +119 drivers/mtd/spi-nor/macronix.c
117
118 static const struct spi_nor_fixups mx25l12805d_4pp3b_fixups = {
> 119 .post_bfpt = mx25l12805d_4pp3b_post_bfpt_fixups,
120 };
121
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-05 8:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 0:57 [PATCH v2 0/2] mtd: spi-nor: macronix: Add support for MX25L12833F and MX25L12845G Cheng Ming Lin
2026-06-05 0:57 ` [PATCH v2 1/2] mtd: spi-nor: " Cheng Ming Lin
2026-06-05 5:02 ` Miquel Raynal
2026-06-05 0:57 ` [PATCH v2 2/2] mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D Cheng Ming Lin
2026-06-05 5:05 ` Miquel Raynal
2026-06-05 8:07 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox