public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: "Jens Axboe" <axboe@kernel.dk>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Christian Marangi" <ansuelsmth@gmail.com>,
	"Simon Glass" <sjg@chromium.org>,
	"INAGAKI Hiroshi" <musashino.open@gmail.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Li Lingfeng" <lilingfeng3@huawei.com>,
	"Christian Heusel" <christian@heusel.eu>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	linux-block@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org,
	"Lorenzo Bianconi" <lorenzo@kernel.org>
Subject: [RFC PATCH v2 4/5] dt-bindings: block: Generalize and introduce property for partitions
Date: Wed, 25 Sep 2024 23:45:24 +0200	[thread overview]
Message-ID: <20240925214544.6114-5-ansuelsmth@gmail.com> (raw)
In-Reply-To: <20240925214544.6114-1-ansuelsmth@gmail.com>

Generalize property from MTD partitions schema and introduce property for
block partitions defined in OF.

Partition schema for block devices is a reduced schema of the MTD as
only a few property are supported for it. (reg, label and read-only)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../bindings/block/partitions/partition.yaml  | 33 +++++++++++++++++++
 .../bindings/block/partitions/partitions.yaml | 27 +++++++++++++++
 .../bindings/mtd/partitions/partition.yaml    | 10 ++----
 3 files changed, 62 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/block/partitions/partition.yaml
 create mode 100644 Documentation/devicetree/bindings/block/partitions/partitions.yaml

diff --git a/Documentation/devicetree/bindings/block/partitions/partition.yaml b/Documentation/devicetree/bindings/block/partitions/partition.yaml
new file mode 100644
index 000000000000..b9b1d8139e56
--- /dev/null
+++ b/Documentation/devicetree/bindings/block/partitions/partition.yaml
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/block/partitions/partition.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Partition
+
+description: |
+  This binding describes a single flash partition. Each partition must have its
+  relative offset and size specified. Depending on partition function extra
+  properties can be used.
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+properties:
+  reg:
+    description: partition's offset and size within the flash (in sector
+      block, 512byte)
+    maxItems: 1
+
+  label:
+    description: The label / name for this partition.
+
+  read-only:
+    description: This parameter, if present, is a hint that this partition
+      should only be mounted read-only. This is usually used for flash
+      partitions containing early-boot firmware images or data which should
+      not be clobbered.
+    type: boolean
+
+additionalProperties: true
diff --git a/Documentation/devicetree/bindings/block/partitions/partitions.yaml b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
new file mode 100644
index 000000000000..9c161aac364d
--- /dev/null
+++ b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/block/partitions/partitions.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Partitions
+
+description: |
+  This binding is generic and describes the content of the partitions container
+  node.
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+properties:
+  '#address-cells':
+    enum: [1, 2]
+
+  '#size-cells':
+    enum: [1, 2]
+
+patternProperties:
+  "^partition@[0-9a-f]+$":
+    $ref: partition.yaml
+
+unevaluatedProperties: false
diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
index 80d0452a2a33..e822d3219b68 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
@@ -6,6 +6,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Partition
 
+$ref: /schemas/block/partitions/partition.yaml
+
 description: |
   This binding describes a single flash partition. Each partition must have its
   relative offset and size specified. Depending on partition function extra
@@ -28,19 +30,11 @@ maintainers:
 properties:
   reg:
     description: partition's offset and size within the flash
-    maxItems: 1
 
   label:
     description: The label / name for this partition. If omitted, the label
       is taken from the node name (excluding the unit address).
 
-  read-only:
-    description: This parameter, if present, is a hint that this partition
-      should only be mounted read-only. This is usually used for flash
-      partitions containing early-boot firmware images or data which should
-      not be clobbered.
-    type: boolean
-
   lock:
     description: Do not unlock the partition at initialization time (not
       supported on all devices)
-- 
2.45.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2024-09-25 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 21:45 [RFC PATCH v2 0/5] block: partition table OF support Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 1/5] block: add support for defining read-only partitions Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 2/5] docs: block: Document support for read-only partition in cmdline part Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 3/5] block: add support for partition table defined in OF Christian Marangi
2024-09-25 21:45 ` Christian Marangi [this message]
2024-09-26 14:03   ` [RFC PATCH v2 4/5] dt-bindings: block: Generalize and introduce property for partitions Rob Herring
2024-09-25 21:45 ` [RFC PATCH v2 5/5] dt-bindings: mmc: Document support for partition table in mmc-card Christian Marangi
2024-09-26 14:15   ` Rob Herring
2024-09-29 13:13     ` Christian Marangi

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=20240925214544.6114-5-ansuelsmth@gmail.com \
    --to=ansuelsmth@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=christian@heusel.eu \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lilingfeng3@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=musashino.open@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=robh@kernel.org \
    --cc=sjg@chromium.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=viro@zeniv.linux.org.uk \
    /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