From: Leo Yu-Chi Liang <ycliang@andestech.com>
To: <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Vignesh R <vigneshr@ti.com>,
"Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
Jagan Teki <jagan@amarulasolutions.com>, <ycliang@andestech.com>
Subject: [PATCH 7/8] mtd: spi-nor: Add Macronix MX25U quad-mode fixups
Date: Fri, 17 Apr 2026 10:40:33 +0800 [thread overview]
Message-ID: <20260417024034.4046667-3-ycliang@andestech.com> (raw)
In-Reply-To: <20260417024034.4046667-1-ycliang@andestech.com>
Add quad mode (1-4-4) read and page program fixups for Macronix
MX25U1635E and MX25U25635F SPI NOR flash chips. These chips do not
properly expose their quad capabilities via SFDP, requiring explicit
fixup hooks.
The fixup enables SNOR_HWCAPS_READ_1_4_4 and SNOR_HWCAPS_PP_1_4_4
capabilities with the appropriate opcodes and protocols.
Both chips share the same fixup function since their quad mode
configuration is identical.
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
drivers/mtd/spi/spi-nor-core.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 937d79af64e..d8a073fef3f 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -4248,6 +4248,21 @@ static struct spi_nor_fixups macronix_octal_fixups = {
.post_sfdp = macronix_octal_post_sfdp_fixup,
.late_init = macronix_octal_late_init,
};
+
+static void macronix_quad_post_sfdp_fixup(struct spi_nor *nor,
+ struct spi_nor_flash_parameter *params)
+{
+ params->hwcaps.mask |= SNOR_HWCAPS_READ_1_4_4 | SNOR_HWCAPS_PP_1_4_4;
+ spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_4_4],
+ 0, 8, SPINOR_OP_READ_1_4_4,
+ SNOR_PROTO_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);
+}
+
+static struct spi_nor_fixups macronix_quad_fixups = {
+ .post_sfdp = macronix_quad_post_sfdp_fixup,
+};
#endif /* CONFIG_SPI_FLASH_MACRONIX */
#if CONFIG_IS_ENABLED(SPI_FLASH_WINBOND)
@@ -4544,9 +4559,13 @@ void spi_nor_set_fixups(struct spi_nor *nor)
#endif
#if CONFIG_IS_ENABLED(SPI_FLASH_MACRONIX)
- if (JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX &&
- nor->info->flags & SPI_NOR_OCTAL_DTR_READ)
- nor->fixups = ¯onix_octal_fixups;
+ if (JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX) {
+ if (nor->info->flags & SPI_NOR_OCTAL_DTR_READ)
+ nor->fixups = ¯onix_octal_fixups;
+ else if (!strcmp(nor->info->name, "mx25u1635e") ||
+ !strcmp(nor->info->name, "mx25u25635f"))
+ nor->fixups = ¯onix_quad_fixups;
+ }
#endif /* SPI_FLASH_MACRONIX */
#if CONFIG_IS_ENABLED(SPI_FLASH_WINBOND)
--
2.34.1
next prev parent reply other threads:[~2026-04-17 2:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 2:40 [PATCH 5/8] spi: atcspi200: Add spi-mem framework support Leo Yu-Chi Liang
2026-04-17 2:40 ` [PATCH 6/8] spi: atcspi200: Add data merge mode support Leo Yu-Chi Liang
2026-04-17 2:40 ` Leo Yu-Chi Liang [this message]
2026-04-17 6:56 ` [PATCH 7/8] mtd: spi-nor: Add Macronix MX25U quad-mode fixups Takahiro.Kuwano
2026-04-17 2:40 ` [PATCH 8/8] configs: ae350: Enable ATCSPI200 data merge mode Leo Yu-Chi Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260417024034.4046667-3-ycliang@andestech.com \
--to=ycliang@andestech.com \
--cc=jagan@amarulasolutions.com \
--cc=takahiro.kuwano@infineon.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox