1 From 04e9ab75267489224364fa510a88ada83e11c325 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 10 Dec 2020 18:23:52 +0100
4 Subject: [PATCH] dt-bindings: mtd: convert "fixed-partitions" to the
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This standardizes its documentation, allows validating with Makefile
11 checks and helps writing DTS files.
14 1. Dropped "Partitions can be represented by sub-nodes of a flash
15 device." as we also support subpartitions (don't have to be part of
17 2. Dropped "to Linux" as bindings are meant to be os agnostic.
19 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
20 Link: https://lore.kernel.org/r/20201210172352.31632-1-zajec5@gmail.com
21 Signed-off-by: Rob Herring <robh@kernel.org>
23 .../devicetree/bindings/mtd/partition.txt | 131 +--------------
24 .../mtd/partitions/fixed-partitions.yaml | 152 ++++++++++++++++++
25 2 files changed, 154 insertions(+), 129 deletions(-)
26 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
28 --- a/Documentation/devicetree/bindings/mtd/partition.txt
29 +++ b/Documentation/devicetree/bindings/mtd/partition.txt
30 @@ -24,137 +24,10 @@ another partitioning method.
31 Available bindings are listed in the "partitions" subdirectory.
37 -Partitions can be represented by sub-nodes of a flash device. This can be used
38 -on platforms which have strong conventions about which portions of a flash are
39 -used for what purposes, but which don't use an on-flash partition table such
42 -The partition table should be a subnode of the flash node and should be named
43 -'partitions'. This node should have the following property:
44 -- compatible : (required) must be "fixed-partitions"
45 -Partitions are then defined in subnodes of the partitions node.
46 +Deprecated: partitions defined in flash node
47 +============================================
49 For backwards compatibility partitions as direct subnodes of the flash device are
50 supported. This use is discouraged.
51 NOTE: also for backwards compatibility, direct subnodes that have a compatible
52 string are not considered partitions, as they may be used for other bindings.
54 -#address-cells & #size-cells must both be present in the partitions subnode of the
55 -flash device. There are two valid values for both:
56 -<1>: for partitions that require a single 32-bit cell to represent their
57 - size/address (aka the value is below 4 GiB)
58 -<2>: for partitions that require two 32-bit cells to represent their
59 - size/address (aka the value is 4 GiB or greater).
62 -- reg : The partition's offset and size within the flash
65 -- label : The label / name for this partition. If omitted, the label is taken
66 - from the node name (excluding the unit address).
67 -- read-only : This parameter, if present, is a hint to Linux that this
68 - partition should only be mounted read-only. This is usually used for flash
69 - partitions containing early-boot firmware images or data which should not be
71 -- lock : Do not unlock the partition at initialization time (not supported on
73 -- slc-mode: This parameter, if present, allows one to emulate SLC mode on a
74 - partition attached to an MLC NAND thus making this partition immune to
75 - paired-pages corruptions
82 - compatible = "fixed-partitions";
83 - #address-cells = <1>;
88 - reg = <0x0000000 0x100000>;
93 - reg = <0x0100000 0x200000>;
100 - compatible = "fixed-partitions";
101 - #address-cells = <1>;
104 - /* a 4 GiB partition */
106 - label = "filesystem";
107 - reg = <0x00000000 0x1 0x00000000>;
114 - compatible = "fixed-partitions";
115 - #address-cells = <2>;
118 - /* an 8 GiB partition */
120 - label = "filesystem #1";
121 - reg = <0x0 0x00000000 0x2 0x00000000>;
124 - /* a 4 GiB partition */
125 - partition@200000000 {
126 - label = "filesystem #2";
127 - reg = <0x2 0x00000000 0x1 0x00000000>;
134 - compatible = "fixed-partitions";
135 - #address-cells = <1>;
139 - label = "bootloader";
140 - reg = <0x000000 0x100000>;
145 - label = "firmware";
146 - reg = <0x100000 0xe00000>;
147 - compatible = "brcm,trx";
150 - calibration@f00000 {
151 - label = "calibration";
152 - reg = <0xf00000 0x100000>;
153 - compatible = "fixed-partitions";
154 - ranges = <0 0xf00000 0x100000>;
155 - #address-cells = <1>;
160 - reg = <0x000000 0x080000>;
165 - reg = <0x080000 0x080000>;
171 +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
173 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
176 +$id: http://devicetree.org/schemas/mtd/partitions/fixed-partitions.yaml#
177 +$schema: http://devicetree.org/meta-schemas/core.yaml#
179 +title: Fixed partitions
182 + This binding can be used on platforms which have strong conventions about
183 + which portions of a flash are used for what purposes, but which don't use an
184 + on-flash partition table such as RedBoot.
186 + The partition table should be a node named "partitions". Partitions are then
187 + defined as subnodes.
190 + - Rafał Miłecki <rafal@milecki.pl>
194 + const: fixed-partitions
196 + "#address-cells": true
198 + "#size-cells": true
202 + description: node describing a single flash partition
207 + description: partition's offset and size within the flash
211 + description: The label / name for this partition. If omitted, the label
212 + is taken from the node name (excluding the unit address).
215 + description: This parameter, if present, is a hint that this partition
216 + should only be mounted read-only. This is usually used for flash
217 + partitions containing early-boot firmware images or data which should
222 + description: Do not unlock the partition at initialization time (not
223 + supported on all devices)
227 + description: This parameter, if present, allows one to emulate SLC mode
228 + on a partition attached to an MLC NAND thus making this partition
229 + immune to paired-pages corruptions
239 +additionalProperties: true
244 + compatible = "fixed-partitions";
245 + #address-cells = <1>;
250 + reg = <0x0000000 0x100000>;
255 + reg = <0x0100000 0x200000>;
260 + compatible = "fixed-partitions";
261 + #address-cells = <1>;
264 + /* a 4 GiB partition */
266 + label = "filesystem";
267 + reg = <0x00000000 0x1 0x00000000>;
272 + compatible = "fixed-partitions";
273 + #address-cells = <2>;
276 + /* an 8 GiB partition */
278 + label = "filesystem #1";
279 + reg = <0x0 0x00000000 0x2 0x00000000>;
282 + /* a 4 GiB partition */
283 + partition@200000000 {
284 + label = "filesystem #2";
285 + reg = <0x2 0x00000000 0x1 0x00000000>;
290 + compatible = "fixed-partitions";
291 + #address-cells = <1>;
295 + label = "bootloader";
296 + reg = <0x000000 0x100000>;
301 + compatible = "brcm,trx";
302 + label = "firmware";
303 + reg = <0x100000 0xe00000>;
306 + calibration@f00000 {
307 + compatible = "fixed-partitions";
308 + label = "calibration";
309 + reg = <0xf00000 0x100000>;
310 + ranges = <0 0xf00000 0x100000>;
311 + #address-cells = <1>;
316 + reg = <0x000000 0x080000>;
321 + reg = <0x080000 0x080000>;