Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <p.yadav@ti.com>
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,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/2] mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()
Date: Fri, 3 Jul 2020 11:52:09 +0000	[thread overview]
Message-ID: <157c20a4-2a7e-601a-34ef-66baaa17eb7b@microchip.com> (raw)
In-Reply-To: <20200703111924.tyrvzbbgd7ak53qf@ti.com>

On 7/3/20 2:19 PM, Pratyush Yadav wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 02/07/20 11:02AM, Tudor.Ambarus@microchip.com wrote:
>> On 6/16/20 4:02 PM, Yicong Yang wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> 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.
>>
>> Please describe the problems that occur. When QE bit is one the flash
>> operates in Standard/Dual/Quad SPI modes. WP# and RESET#/HOLD# are
>> affected as they change their functionality to IO2 and IO3 when QE
>> is 1. Is there anything else?
> 
> IIUC if we do anything that introduces a state on the flash, we want to
> clear that state up on restore. That's what we (will) do for 8D mode and

correct

> for 4-byte addressing mode. Does that not apply here?

yes, it does. I've just asked Yicong to describe in the commit message
the problems that he encounters, for better understanding. Standard and
Dual modes should still work with QE = 1. The only problem that I see
is that WP# and RESET#/HOLD# are changing their functionality to IO2
and IO3 when QE is 1. Is there anything else that I miss?
> 
>> While I find the intention good, there might be some problems here:
>> 1/ w25q jvm variants come with QE "fixed" to 1. This probably means
>> that QE is not writable, and a writing of QE to zero will be ignored,
>> but we have to check.
> 
> In that case they shouldn't have a quad_enable() hook, no?

Right. Although this scenario should be a false positive, probably the
write of QE bit is ignored. There is a superfluous write of QE indeed,
but maybe we can live with it.

> 
>> 2/S25FS128S: CR1NV[1] can set the default power-on state for the
>> CR1V[1] to 1, i.e. QE to be set to 1 at power-on by default. The
>> logic here complicates a bit, and maybe we'll have to amend the
>> patch.
>>

We can come with a patch on top of these for 2/. Yicong, please address
the minor comments and resubmit.

Cheers.

>>>
>>> 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.
>> s/correct/ Standard/Dual SPI
>>
>> Cheers,
>> ta
> 
> --
> Regards,
> Pratyush Yadav
> Texas Instruments India
> 

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

  reply	other threads:[~2020-07-03 11:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 13:02 [PATCH 0/2] Add support to Disable the flash quad mode Yicong Yang
2020-06-16 13:02 ` [PATCH 1/2] mtd: spi-nor: Add capability to disable " Yicong Yang
2020-07-02 11:07   ` Tudor.Ambarus
2020-06-16 13:02 ` [PATCH 2/2] mtd: spi-nor: Disable the flash quad mode in spi_nor_restore() Yicong Yang
2020-07-02 11:02   ` Tudor.Ambarus
2020-07-03 11:19     ` Pratyush Yadav
2020-07-03 11:52       ` Tudor.Ambarus [this message]
2020-07-06  6:47         ` Yicong Yang
2020-09-01  6:16   ` Matthias Weißer
2020-09-01  9:48     ` Pratyush Yadav
2020-09-01 10:08       ` Matthias Weißer
2020-09-01 11:11         ` Pratyush Yadav
2020-09-01 11:41     ` Yicong Yang
2020-09-01 14:20     ` Yicong Yang
2020-09-02  7:50       ` Vignesh Raghavendra
2020-09-02 10:12         ` Yicong Yang
2020-09-03  5:59           ` Vignesh Raghavendra
2020-09-04  7:54             ` Yicong Yang
2020-09-04  9:35               ` Matthias Weißer
2020-09-02 12:15       ` Matthias Weißer
2020-09-03  3:03         ` Yicong Yang
2020-09-03  5:33           ` Matthias Weißer
2020-09-04  7:56             ` 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=157c20a4-2a7e-601a-34ef-66baaa17eb7b@microchip.com \
    --to=tudor.ambarus@microchip.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=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=vigneshr@ti.com \
    --cc=yangyicong@hisilicon.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