All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@norrbonn.se>
To: Tudor.Ambarus@microchip.com, Yong.Qin@cypress.com,
	James.Tomasetta@cypress.com
Cc: bbrezillon@kernel.org, richard@nod.at, marek.vasut@gmail.com,
	linux-mtd@lists.infradead.org, computersforpeace@gmail.com,
	dwmw2@infradead.org
Subject: Re: [PATCH v2 1/3] mtd: spi-nor: always respect write-protect input
Date: Tue, 19 Mar 2019 08:13:54 +0100	[thread overview]
Message-ID: <9fcc328f-ae13-a294-a56c-0b5a6247b26a@norrbonn.se> (raw)
In-Reply-To: <41859b7a-98ad-fc6d-242e-6e9ab810e038@microchip.com>



On 19/03/2019 07:59, Tudor.Ambarus@microchip.com wrote:
> Jonas, Yong,
> 
> On 03/12/2019 09:27 PM, Yong Qin wrote:
>> Hi Tudor,
>>
>> Good question.
>>
>> The WP# function is not available when the Quad mode is enabled (CR[1]=1). The WP# function is replaced by IO2 for input and output during Quad mode. With that said, if CR[1] is set to 1 (Quad mode enabled), the registers will not be protected.
>>
>> Technically default SRWD bit can be set as either 0 or 1. However, as most customers (applications) don't use this feature to protect registers, the default SRWD bit set to 0 might be a better choice, and reserve the option to change to 1 for the applications do need this feature.
> 
> I think I found the reason why SRWD bit is configurable, and disabled by
> default: => to allow the installation of the flash in a system with a grounded
> WP# pin while still enabling write to the BP bits.

I think this is bogus.  Why would you ground the SRWD pin?  That's a 
design error.

/Jonas

> 
> Jonas, Yong, what do you think?
> 
> Cheers,
> ta
> 
>>
>> Thanks,
>> Yong
>>
>> -----Original Message-----
>> From: Tudor.Ambarus@microchip.com <Tudor.Ambarus@microchip.com>
>> Sent: Tuesday, March 12, 2019 5:30 AM
>> To: Yong Qin <Yong.Qin@cypress.com>; jonas@norrbonn.se; James Tomasetta <James.Tomasetta@cypress.com>
>> Cc: linux-mtd@lists.infradead.org; bbrezillon@kernel.org; richard@nod.at; marek.vasut@gmail.com; computersforpeace@gmail.com; dwmw2@infradead.org
>> Subject: Re: [PATCH v2 1/3] mtd: spi-nor: always respect write-protect input
>>
>> Hi, Yong,
>>
>> Thank you for the explanation. There are still few things to clarify.
>>
>> On 03/11/2019 10:14 PM, Yong Qin wrote:
>>> SRWD bit (along with WP#) provides a way to protect Status and Configuration Registers from been modified unintendedly or by a malicious actor.
>>>
>>> By default, SRWD bit is 0, which means no protection on registers alternations. Registers can be modified easily by WRR command. (this is most of the application use cases).
>>>
>>> If set SRWD bit to 1, then when WP# is driven low during WRR command, WRR command will be ignored and Registers can't be modified. This provides a way to protect Registers, meanwhile still reserve the capability to modify Registers when necessary by driving WP# to high during WRR command.
>>
>> Does the SRWD bit protect the Status and Configuration Register bits even when in Quad Mode? WP# function is not available in Quad mode. How can one release this protection when in Quad Mode and SRWD set to 1?
>>
>> If SRWD bit is ignored in Quad Mode, then why didn't Cypress enable Status and Configuration Register bits protection by default? I.e., remove SRWD bit from SR1, make BIT(7) a NOP, and consider the Status and Configuration Register bits protection enabled by default when not in Quad Mode.
>>
>> Cheers,
>> ta
>>
>> This message and any attachments may contain confidential information from Cypress or its subsidiaries. If it has been received in error, please advise the sender and immediately delete this message.
>>

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

  reply	other threads:[~2019-03-19  7:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 22:07 [PATCH v2 0/3] spi-nor block protection Jonas Bonn
2019-01-29 22:07 ` [PATCH v2 1/3] mtd: spi-nor: always respect write-protect input Jonas Bonn
2019-03-10  9:58   ` Tudor.Ambarus
2019-03-10 10:42     ` Jonas Bonn
2019-03-11 14:05       ` Tudor.Ambarus
2019-03-11 20:14         ` Yong Qin
2019-03-12  9:29           ` Tudor.Ambarus
2019-03-12 19:27             ` Yong Qin
2019-03-19  6:59               ` Tudor.Ambarus
2019-03-19  7:13                 ` Jonas Bonn [this message]
2019-03-20  6:33                   ` Tudor.Ambarus
2019-03-20  7:06                     ` Jonas Bonn
2019-03-20  7:33                       ` Tudor.Ambarus
2019-03-20  7:39                         ` Jonas Bonn
2019-03-20 18:56                           ` Yong Qin
2019-03-20 21:05                             ` Jonas Bonn
2019-04-02  7:12                               ` Tudor.Ambarus
2019-04-27  6:23                                 ` [PATCH v3 1/1] " Jonas Bonn
2019-01-29 22:07 ` [PATCH v2 2/3] mtd: spi-nor: s25fl512s supports region locking Jonas Bonn
2019-03-19 16:30   ` Tudor.Ambarus
2019-01-29 22:07 ` [PATCH v2 3/3] mtd: spi-nor: allow setting the BPNV (default locked) bit Jonas Bonn
2019-03-10 10:06   ` Tudor.Ambarus
2019-02-14  9:21 ` [PATCH v2 0/3] spi-nor block protection Jonas Bonn
2019-02-14  9:33   ` Tudor.Ambarus

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=9fcc328f-ae13-a294-a56c-0b5a6247b26a@norrbonn.se \
    --to=jonas@norrbonn.se \
    --cc=James.Tomasetta@cypress.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=Yong.Qin@cypress.com \
    --cc=bbrezillon@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.