From: Michael Walle <michael@walle.cc>
To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Michael Walle" <michael@walle.cc>
Subject: [RFC PATCH 0/4] mtd: core: OTP nvmem provider support
Date: Mon, 22 Mar 2021 19:19:45 +0100 [thread overview]
Message-ID: <20210322181949.2805-1-michael@walle.cc> (raw)
The goal is to fetch a (base) MAC address from the OTP region of a SPI NOR
flash.
This is the first part, where I try to add the nvmem provider support to
the MTD core.
I'm not sure about the device tree bindings. Consider the following two
variants:
(1)
flash@0 {
..
otp {
compatible = "mtd-user-otp";
#address-cells = <1>;
#size-cells = <1>;
serial-number@0 {
reg = <0x0 0x8>;
};
};
};
(2)
flash@0 {
..
otp {
compatible = "mtd-user-otp";
#address-cells = <1>;
#size-cells = <1>;
some-useful-name {
compatible = "nvmem-cells";
serial-number@0 {
reg = <0x0 0x8>;
};
};
};
};
Both bindings use a subnode "opt[-N]". We cannot have the nvmem cells as
children to the flash node because of the legacy partition binding.
(1) seems to be the form which is used almost everywhere in the kernel.
That is, the nvmem cells are just children of the parent node.
(2) seem to be more natural, because there might also be other properties
inside the otp subnode and might be more future-proof.
At the moment this patch implements (1).
Michael Walle (4):
nvmem: core: allow specifying of_node
dt-bindings: mtd: add YAML schema for the generic MTD bindings
dt-bindings: mtd: add OTP bindings
mtd: core: add OTP nvmem provider support
.../devicetree/bindings/mtd/common.txt | 16 +-
.../devicetree/bindings/mtd/mtd.yaml | 110 +++++++++++++
drivers/mtd/mtdcore.c | 149 ++++++++++++++++++
drivers/nvmem/core.c | 4 +-
include/linux/mtd/mtd.h | 2 +
include/linux/nvmem-provider.h | 2 +
6 files changed, 267 insertions(+), 16 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mtd/mtd.yaml
--
2.20.1
next reply other threads:[~2021-03-22 18:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 18:19 Michael Walle [this message]
2021-03-22 18:19 ` [RFC PATCH 1/4] nvmem: core: allow specifying of_node Michael Walle
2021-03-30 10:35 ` Srinivas Kandagatla
2021-03-22 18:19 ` [RFC PATCH 2/4] dt-bindings: mtd: add YAML schema for the generic MTD bindings Michael Walle
2021-03-27 17:04 ` Rob Herring
2021-03-22 18:19 ` [RFC PATCH 3/4] dt-bindings: mtd: add OTP bindings Michael Walle
2021-03-27 17:09 ` Rob Herring
2021-03-30 10:07 ` Michael Walle
2021-03-22 18:19 ` [RFC PATCH 4/4] mtd: core: add OTP nvmem provider support Michael Walle
2021-03-30 9:42 ` [RFC PATCH 0/4] mtd: core: " Srinivas Kandagatla
2021-03-30 9:49 ` 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=20210322181949.2805-1-michael@walle.cc \
--to=michael@walle.cc \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=rafal@milecki.pl \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).