From: Ansuel Smith <ansuelsmth@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Ansuel Smith <ansuelsmth@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Manivannan Sadhasivam <mani@kernel.org>,
linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 1/2] dt-bindings: mtd: partitions: Document new dynamic-partition nodes
Date: Thu, 19 May 2022 01:32:57 +0200 [thread overview]
Message-ID: <20220518233258.5483-2-ansuelsmth@gmail.com> (raw)
In-Reply-To: <20220518233258.5483-1-ansuelsmth@gmail.com>
Document new dynamic-partition nodes used to provide an OF node for
partition registred at runtime by parsers. This is required for nvmem
system to declare and detect nvmem-cells.
With these special partitions, the reg / offset is not required.
The label binding is used to match the partition allocated by the
parser at runtime and the parser will provide reg and offset of the mtd.
NVMEM will use the data from the parser and provide the NVMEM cells
declared in the DTS, "connecting" the dynamic partition with a
static declaration of cells in them.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
.../mtd/partitions/dynamic-partition.yaml | 57 +++++++++++++++++++
.../mtd/partitions/qcom,smem-part.yaml | 4 ++
2 files changed, 61 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mtd/partitions/dynamic-partition.yaml
diff --git a/Documentation/devicetree/bindings/mtd/partitions/dynamic-partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/dynamic-partition.yaml
new file mode 100644
index 000000000000..f57d7b9cae7f
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partitions/dynamic-partition.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/partitions/dynamic-partition.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dynamic Partition
+
+description: |
+ This binding describes a single flash partition that is dynamically allocated
+ by a dedicated parser that is not a fixed-partition parser.
+
+ Each child of the parser partition node is then compared and if a match with
+ the provided label is found then the OF node is assigned.
+
+ These special partition definition can be used to give a dynamic partition
+ an OF node to declare NVMEM cells. An example is declaring the partition
+ label and all the NVMEM cells in it. The parser will detect the correct reg
+ and offset and the NVMEM will register the cells in it based on the data
+ extracted by the parser.
+
+maintainers:
+ - Ansuel Smith <ansuelsmth@gmail.com>
+
+properties:
+ label:
+ description: The label / name for the partition assigned by the parser at
+ runtime. This is needed for sybsystem like NVMEM to define cells and
+ register with this OF node.
+
+required:
+ - label
+
+additionalProperties: true
+
+examples:
+ - |
+ flash {
+ partitions {
+ compatible = "qcom,smem-part";
+
+ partition-art {
+ compatible = "nvmem-cells";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ label = "0:art";
+
+ macaddr_art_0: macaddr@0 {
+ reg = <0x0 0x6>;
+ };
+
+ macaddr_art_6: macaddr@6 {
+ reg = <0x6 0x6>;
+ };
+ };
+ };
+ };
diff --git a/Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml b/Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml
index cf3f8c1e035d..b6fa25949fe2 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml
@@ -19,6 +19,10 @@ properties:
compatible:
const: qcom,smem-part
+patternProperties:
+ "^partition-[0-9a-z]+$":
+ $ref: dynamic-partition.yaml#
+
required:
- compatible
--
2.34.1
next prev parent reply other threads:[~2022-05-18 23:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 23:32 [PATCH v4 0/2] Add nvmem support for dynamic partitions Ansuel Smith
2022-05-18 23:32 ` Ansuel Smith [this message]
2022-06-01 21:06 ` [PATCH v4 1/2] dt-bindings: mtd: partitions: Document new dynamic-partition nodes Rob Herring
2022-06-03 22:57 ` Ansuel Smith
2022-06-06 13:36 ` Rob Herring
2022-05-18 23:32 ` [PATCH v4 2/2] mtd: core: introduce of support for dynamic partitions Ansuel Smith
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=20220518233258.5483-2-ansuelsmth@gmail.com \
--to=ansuelsmth@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mani@kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.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).