From: Michael Walle <michael@walle.cc>
To: Vignesh Raghavendra <vigneshr@ti.com>
Cc: David Bauer <mail@david-bauer.net>,
tudor.ambarus@microchip.com, miquel.raynal@bootlin.com,
richard@nod.at, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/2] mtd: spi-nor: add block protection flags to macronix
Date: Mon, 08 Mar 2021 16:20:39 +0100 [thread overview]
Message-ID: <346332bf6ab0dd92b9ffd9e126b6b97c@walle.cc> (raw)
In-Reply-To: <9eb05563-70b4-1653-d818-6a039f1c53ff@ti.com>
Am 2021-03-08 15:20, schrieb Vignesh Raghavendra:
> On 3/3/21 3:18 PM, David Bauer wrote:
>> Macronix flash chips support block protection by using BP bits in the
>> read status register. Add the corresponding flag to indicate block
>> protection support.
>>
>> Otherwise, locked blocks are not unlocked when requested.
>>
>> Signed-off-by: David Bauer <mail@david-bauer.net>
>> ---
>> drivers/mtd/spi-nor/macronix.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi-nor/macronix.c
>> b/drivers/mtd/spi-nor/macronix.c
>> index 9203abaac229..2d39dd32a64e 100644
>> --- a/drivers/mtd/spi-nor/macronix.c
>> +++ b/drivers/mtd/spi-nor/macronix.c
>> @@ -94,6 +94,7 @@ static const struct flash_info macronix_parts[] = {
>>
>> static void macronix_default_init(struct spi_nor *nor)
>> {
>> + nor->flags |= SNOR_F_HAS_LOCK;
>
> We need to take into account the state of TB bit (Config Reg bit3).
> This
> is an OTP bit and driver should not ideally change it but should
> consider the state of the bit.
>
> Without looking at TB bit, current locking implementation would be
> incomplete.
If someone wants to dig into that, some time ago I tried it myself:
https://github.com/mwalle/linux/commit/1a56154bbe1696268d1245eea9e170a2feb7ca46
https://github.com/mwalle/linux/commit/7f3d4f7cbac87a6c5b900be7164dabb8991b0f93
I've never managed to post them to the list and they aren't tested
and they have yet another new flag.. And there was some catch with
it, I don't remember anymore right now.
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2021-03-08 15:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 9:48 [PATCH 1/2] mtd: spi-nor: add block protection flags to macronix David Bauer
2021-03-03 9:48 ` [PATCH 2/2] mtd: spi-nor: use 4 bit BP for large Macronix flash David Bauer
2021-03-08 12:37 ` Michael Walle
2021-03-08 18:01 ` David Bauer
2021-03-09 7:49 ` Tudor.Ambarus
2021-03-08 9:16 ` [PATCH 1/2] mtd: spi-nor: add block protection flags to macronix Michael Walle
2021-03-08 10:32 ` [PATCH 2/2] mtd: spi-nor: use 4 bit BP for large Macronix flash Michael Walle
2021-03-08 14:20 ` [PATCH 1/2] mtd: spi-nor: add block protection flags to macronix Vignesh Raghavendra
2021-03-08 15:20 ` Michael Walle [this message]
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=346332bf6ab0dd92b9ffd9e126b6b97c@walle.cc \
--to=michael@walle.cc \
--cc=linux-mtd@lists.infradead.org \
--cc=mail@david-bauer.net \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--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