From: Quanyang Wang <quanyang.w...@windriver.com>

Set reading setting for read proto SNOR_PROTO_8_8_8_DTR with 10 dummy
cicles (will be doubled to be 20 in spi_nor_spimem_read_data) and
special read command "0xEE".

Set nor->cmd_ext_type to be SPI_NOR_EXT_REPEAT because the function
spi_nor_get_cmd_ext will check this, or else there is warning as below:

    spi-nor spi0.0: Unknown command extension type

This patch references to commit ad624dfd7bb6 ("mtd: spi-nor:
micron-st: allow using MT35XU512ABA in Octal DTR mode").

Signed-off-by: Quanyang Wang <quanyang.w...@windriver.com>
---
 drivers/mtd/spi-nor/macronix.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index 57a3860b2fa69..170fb57c57967 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -9,6 +9,8 @@
 
 #include "core.h"
 
+#define SPINOR_OP_MACRONIX_DTR_RD      0xEE
+
 static int
 mx25l25635_post_bfpt_fixups(struct spi_nor *nor,
                            const struct sfdp_parameter_header *bfpt_header,
@@ -33,6 +35,21 @@ static struct spi_nor_fixups mx25l25635_fixups = {
        .post_bfpt = mx25l25635_post_bfpt_fixups,
 };
 
+static void
+mx25uw51245g_post_sfdp_fixups(struct spi_nor *nor)
+{
+       /* Set the Fast Read settings. */
+       spi_nor_set_read_settings(&nor->params->reads[SNOR_CMD_READ_8_8_8_DTR],
+                                 0, 10, SPINOR_OP_MACRONIX_DTR_RD,
+                                 SNOR_PROTO_8_8_8_DTR);
+
+       nor->cmd_ext_type = SPI_NOR_EXT_REPEAT;
+}
+
+static struct spi_nor_fixups mx25uw51245g_fixups = {
+       .post_sfdp = mx25uw51245g_post_sfdp_fixups,
+};
+
 static const struct flash_info macronix_parts[] = {
        /* Macronix */
        { "mx25l512e",   INFO(0xc22010, 0, 64 * 1024,   1, SECT_4K) },
@@ -75,7 +92,8 @@ static const struct flash_info macronix_parts[] = {
                              SPI_NOR_QUAD_READ) },
        { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) },
        { "mx25uw51245g", INFO(0xc2813a, 0, 64 * 1024, 1024,
-                       SPI_NOR_OCTAL_DTR_READ | SPI_NOR_4B_OPCODES) },
+                       SPI_NOR_OCTAL_DTR_READ | SPI_NOR_4B_OPCODES)
+               .fixups = &mx25uw51245g_fixups },
        { "mx66l51235f", INFO(0xc2201a, 0, 64 * 1024, 1024,
                              SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                              SPI_NOR_4B_OPCODES) },
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11341): 
https://lists.yoctoproject.org/g/linux-yocto/message/11341
Mute This Topic: https://lists.yoctoproject.org/mt/91425134/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to