From: Vignesh Raghavendra <vigneshr@ti.com>
To: Michael Walle <michael@walle.cc>,
Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: <linux-mtd@lists.infradead.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 1/2] dt-bindings: mtd: spi-nor: document new flag
Date: Thu, 19 Dec 2019 11:03:33 +0530 [thread overview]
Message-ID: <2dfc30a7-3261-d783-8256-f72458a0141b@ti.com> (raw)
In-Reply-To: <af3692dba69e85fa8136ab3d170bef39@walle.cc>
Hi Michael,
[...]
>>> +- no-unlock : By default, linux unlocks the whole flash because there
>>> + are legacy flash devices which are locked by default
>>> + after reset. Set this flag if you don't want linux to
>>> + unlock the whole flash automatically. In this case you
>>> + can control the non-volatile bits by the
>>> + flash_lock/flash_unlock tools.
>>>
>>
>> Current SPI NOR framework unconditionally unlocks entire flash which
>> I agree is not the best thing to do, but I don't think we need
>> new DT property here. MTD cmdline partitions and DT partitions already
>> provide a way to specify that a partition should remain locked[1][2]
>
> I know that the MTD layer has the same kind of unlocking. But that
> unlocking is done on a per mtd partition basis. Eg. consider something
> like the following
>
> mtd1 bootloader (locked)
> mtd2 firmware (locked)
> mtd3 kernel
> mtd4 environment
>
> Further assume, that the end of mtd2 aligns with one of the possible
> locking areas which are supported by the flash chip. Eg. the first quarter.
>
> The mtd layer would do two (or four, if "lock" property is set) unlock()
> calls, one for mtd1 and one for mtd2.
>
> My point here is, that the mtd partitions doesn't always map to the
> locking regions of the SPI flash (at least if the are not merged together).
>
You are right! This will be an issue if existing partitions are not
aligned to locking regions.
I take my comments back... But I am not sure if a new DT property is the
needed. This does not describe HW and is specific to Linux SPI NOR
stack. How about a module parameter instead?
Module parameter won't provide per flash granularity in controlling
unlocking behavior. But I don't think that matters.
Tudor,
You had a patch doing something similar. Does module param sound good to
you?
--
Regards
Vignesh
next prev parent reply other threads:[~2019-12-19 5:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-14 19:19 [PATCH 1/2] dt-bindings: mtd: spi-nor: document new flag Michael Walle
2019-12-14 19:19 ` [PATCH 2/2] mtd: spi-nor: add option to keep lock bits Michael Walle
2019-12-16 8:54 ` [PATCH 1/2] dt-bindings: mtd: spi-nor: document new flag Vignesh Raghavendra
2019-12-16 10:29 ` Michael Walle
2019-12-19 5:33 ` Vignesh Raghavendra [this message]
2019-12-20 12:46 ` Michael Walle
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=2dfc30a7-3261-d783-8256-f72458a0141b@ti.com \
--to=vigneshr@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=tudor.ambarus@microchip.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).