linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Yicong Yang <yangyicong@hisilicon.com>
To: <tudor.ambarus@microchip.com>, <linux-mtd@lists.infradead.org>
Cc: vigneshr@ti.com, sergei.shtylyov@cogentembedded.com,
	richard@nod.at, me@yadavpratyush.com, john.garry@huawei.com,
	linuxarm@huawei.com, yangyicong@hisilicon.com,
	alexander.sverdlin@nokia.com, miquel.raynal@bootlin.com
Subject: [RFC PATCH v2 2/2] mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()
Date: Tue, 12 May 2020 19:26:59 +0800	[thread overview]
Message-ID: <1589282819-42358-3-git-send-email-yangyicong@hisilicon.com> (raw)
In-Reply-To: <1589282819-42358-1-git-send-email-yangyicong@hisilicon.com>

If the flash's quad mode is enabled, it'll remain in the quad mode when
it's removed. If we drive the flash next time in SPI/Dual mode, then
problem occurs as the flash's quad enable bit is not cleared.

Disable the quad mode in spi_nor_restore(), the flash will leave
quad mode when remove. This will make sure the flash always enter the
correct mode when loaded.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 drivers/mtd/spi-nor/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 72e8d8b..564de02 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3004,6 +3004,9 @@ void spi_nor_restore(struct spi_nor *nor)
 	if (nor->addr_width == 4 && !(nor->flags & SNOR_F_4B_OPCODES) &&
 	    nor->flags & SNOR_F_BROKEN_RESET)
 		nor->params->set_4byte_addr_mode(nor, false);
+
+	/* disable quad mode */
+	spi_nor_quad_enable(nor, false);
 }
 EXPORT_SYMBOL_GPL(spi_nor_restore);
 
-- 
2.8.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2020-05-12 11:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 11:26 [RFC PATCH v2 0/2] Add support to Disable the flash quad mode Yicong Yang
2020-05-12 11:26 ` [RFC PATCH v2 1/2] mtd: spi-nor: Add capability to disable " Yicong Yang
2020-06-15 10:53   ` Pratyush Yadav
2020-06-16  7:10     ` Yicong Yang
2020-05-12 11:26 ` Yicong Yang [this message]
2020-06-15 10:56   ` [RFC PATCH v2 2/2] mtd: spi-nor: Disable the flash quad mode in spi_nor_restore() Pratyush Yadav
2020-06-15  9:19 ` [RFC PATCH v2 0/2] Add support to Disable the flash quad mode Yicong Yang

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=1589282819-42358-3-git-send-email-yangyicong@hisilicon.com \
    --to=yangyicong@hisilicon.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=john.garry@huawei.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxarm@huawei.com \
    --cc=me@yadavpratyush.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=tudor.ambarus@microchip.com \
    --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;
as well as URLs for NNTP newsgroup(s).