From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-mtd <linux-mtd@lists.infradead.org>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>
Subject: How to handle write-protect pin of NAND device ?
Date: Mon, 27 Jan 2020 21:55:25 +0900 [thread overview]
Message-ID: <CAK7LNAR0FemABUg5uN5fhy5LRsOm7n5GhmFVVHE8T57knDM9Ug@mail.gmail.com> (raw)
Hi.
I have a question about the
WP_n pin of a NAND chip.
As far as I see, the NAND framework does not
handle it.
Instead, it is handled in a driver level.
I see some DT-bindings that handle the WP_n pin.
$ git grep wp -- Documentation/devicetree/bindings/mtd/
Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt:-
brcm,nand-has-wp : Some versions of this IP include a
write-protect
Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt:-
wp-gpios: GPIO specifier for the write protect pin.
Documentation/devicetree/bindings/mtd/ingenic,jz4780-nand.txt:
wp-gpios = <&gpf 22 GPIO_ACTIVE_LOW>;
Documentation/devicetree/bindings/mtd/nvidia-tegra20-nand.txt:-
wp-gpios: GPIO specifier for the write protect pin.
Documentation/devicetree/bindings/mtd/nvidia-tegra20-nand.txt:
wp-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_LOW>;
I wrote a patch to avoid read-only issue in some cases:
http://patchwork.ozlabs.org/patch/1229749/
Generally speaking, we expect NAND devices
are writable in Linux. So, I think my patch is OK.
However, I asked this myself:
Is there a useful case to assert the write protect
pin in order to make the NAND chip really read-only?
For example, the system recovery image is stored in
a read-only device, and the write-protect pin is
kept asserted to assure nobody accidentally corrupts it.
But, I am not sure if it should be handled in the
framework level with a more generic DT-binding.
Comments are appreciated.
--
Best Regards
Masahiro Yamada
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next reply other threads:[~2020-01-27 12:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-27 12:55 Masahiro Yamada [this message]
2020-01-27 14:35 ` How to handle write-protect pin of NAND device ? Miquel Raynal
2020-01-27 15:45 ` Boris Brezillon
2020-01-27 15:47 ` Miquel Raynal
2020-01-28 6:58 ` Boris Brezillon
2020-01-29 10:06 ` Masahiro Yamada
2020-01-29 13:36 ` Miquel Raynal
2020-01-29 13:53 ` Boris Brezillon
2020-01-29 13:59 ` Miquel Raynal
2020-01-29 14:49 ` Boris Brezillon
2020-01-29 14:52 ` Boris Brezillon
2020-01-29 15:00 ` Miquel Raynal
2020-01-29 15:17 ` Boris Brezillon
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=CAK7LNAR0FemABUg5uN5fhy5LRsOm7n5GhmFVVHE8T57knDM9Ug@mail.gmail.com \
--to=masahiroy@kernel.org \
--cc=bbrezillon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.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).