devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: mtd: partitions: add UBI binding
@ 2022-02-17 10:24 Rafał Miłecki
  2022-03-02 21:59 ` Rob Herring
  2022-06-10 12:19 ` Daniel Golle
  0 siblings, 2 replies; 6+ messages in thread
From: Rafał Miłecki @ 2022-02-17 10:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	devicetree, linux-kernel, Tom Rini, Ricardo Salveti, Michal Simek,
	Jorge Ramirez-Ortiz, Sean Anderson, u-boot,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

UBI is often used on embedded devices to store UBI volumes with device
configuration / calibration data. Such volumes may need to be documented
and referenced for proper boot & setup.

Some examples:
1. U-Boot environment variables
2. Device calibration data
3. Default setup (e.g. initial password)

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/mtd/partitions/ubi.yaml          | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi.yaml

diff --git a/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml b/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml
new file mode 100644
index 000000000000..cd081f06d4cb
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partitions/ubi.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/partitions/ubi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: UBI (Unsorted Block Images) device
+
+description: |
+  UBI is a layer providing logical volumes (consisting of logical blocks) on top
+  of raw flash devices. It deals with low-level flash issues (bit-flips, bad
+  physical eraseblocks, wearing) providing a reliable data storage.
+
+  UBI device is built and stored in a single flash partition.
+
+  Some (usually embedded) devices use UBI volumes of specific names or indexes
+  to store setup / configuration data. This binding allows describing such
+  volumes so they can be identified and referenced by consumers.
+
+maintainers:
+  - Rafał Miłecki <rafal@milecki.pl>
+
+allOf:
+  - $ref: partition.yaml#
+
+properties:
+  compatible:
+    const: ubi
+
+patternProperties:
+  "^volume-[0-9a-f]+$":
+    type: object
+    description: UBI volume
+    properties:
+      volume-name:
+        $ref: /schemas/types.yaml#/definitions/string
+      volume-id:
+        $ref: /schemas/types.yaml#/definitions/uint32
+    anyOf:
+      - required:
+          - volume-name
+      - required:
+          - volume-id
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    partitions {
+        compatible = "fixed-partitions";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        partition@0 {
+            compatible = "ubi";
+            reg = <0x0000000 0x1000000>;
+            label = "filesystem";
+
+            env: volume-0 {
+                volume-name = "u-boot-env";
+            };
+
+            calibration: volume-1 {
+                volume-id = <99>;
+            };
+        };
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-10 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 10:24 [PATCH] dt-bindings: mtd: partitions: add UBI binding Rafał Miłecki
2022-03-02 21:59 ` Rob Herring
2022-03-03  8:32   ` Rafał Miłecki
2022-04-27 12:46     ` Rafał Miłecki
2022-05-09 20:11     ` Rob Herring
2022-06-10 12:19 ` Daniel Golle

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).