[2nd RESEND PATCH v2 3/6] mtd: spi-nor: Check nor->info before setting macronix_octal_fixups

tkuw584924 at gmail.com tkuw584924 at gmail.com
Fri Sep 27 03:18:08 CEST 2024


From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>

The macronix_octal_fixups should be set only when mfr and flags match.

Fixes: df3d5f9e41 ("mtd: spi-nor: add support for Macronix Octal flash")
Acked-by: Tudor Ambarus <tudor.ambarus at linaro.org>
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
Cc: JaimeLiao <jaimeliao.tw at gmail.com>
---
 drivers/mtd/spi/spi-nor-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 4dfc110b02a..6eaed3da392 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -4067,7 +4067,9 @@ void spi_nor_set_fixups(struct spi_nor *nor)
 #endif
 
 #if CONFIG_IS_ENABLED(SPI_FLASH_MACRONIX)
-	nor->fixups = &macronix_octal_fixups;
+	if (JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX &&
+	    nor->info->flags & SPI_NOR_OCTAL_DTR_READ)
+		nor->fixups = &macronix_octal_fixups;
 #endif /* SPI_FLASH_MACRONIX */
 }
 
-- 
2.34.1



More information about the U-Boot mailing list