generic: copy backport, hack, pending patch and config from 6.1 to 6.6
[openwrt/staging/981213.git] / target / linux / generic / pending-6.6 / 450-08-dt-bindings-block-add-basic-bindings-for-block-devic.patch
1 From 9ffc1d7d73609a89eb264d6066340f8b7b3b0ebe Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Mon, 7 Aug 2023 21:19:45 +0100
4 Subject: [PATCH 08/15] dt-bindings: block: add basic bindings for block
5 devices
6
7 Add bindings for block devices which are used to allow referencing
8 nvmem bits on them.
9
10 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
11 ---
12 .../bindings/block/block-device.yaml | 22 ++++++++
13 .../devicetree/bindings/block/partition.yaml | 50 +++++++++++++++++++
14 .../devicetree/bindings/block/partitions.yaml | 20 ++++++++
15 3 files changed, 92 insertions(+)
16 create mode 100644 Documentation/devicetree/bindings/block/block-device.yaml
17 create mode 100644 Documentation/devicetree/bindings/block/partition.yaml
18 create mode 100644 Documentation/devicetree/bindings/block/partitions.yaml
19
20 --- /dev/null
21 +++ b/Documentation/devicetree/bindings/block/block-device.yaml
22 @@ -0,0 +1,22 @@
23 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
24 +%YAML 1.2
25 +---
26 +$id: http://devicetree.org/schemas/block/block-device.yaml#
27 +$schema: http://devicetree.org/meta-schemas/core.yaml#
28 +
29 +title: block storage device
30 +
31 +description: |
32 + This binding is generic and describes a block-oriented storage device.
33 +
34 +maintainers:
35 + - Daniel Golle <daniel@makrotopia.org>
36 +
37 +properties:
38 + partitions:
39 + $ref: /schemas/block/partitions.yaml
40 +
41 + nvmem-layout:
42 + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml#
43 +
44 +unevaluatedProperties: false
45 --- /dev/null
46 +++ b/Documentation/devicetree/bindings/block/partition.yaml
47 @@ -0,0 +1,50 @@
48 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
49 +%YAML 1.2
50 +---
51 +$id: http://devicetree.org/schemas/block/partition.yaml#
52 +$schema: http://devicetree.org/meta-schemas/core.yaml#
53 +
54 +title: Partition on a block device
55 +
56 +description: |
57 + This binding describes a partition on a block device.
58 + Partitions may be matched by a combination of partition number, name,
59 + and UUID.
60 +
61 +maintainers:
62 + - Daniel Golle <daniel@makrotopia.org>
63 +
64 +properties:
65 + $nodename:
66 + pattern: '^block-partition-.+$'
67 +
68 + partnum:
69 + description:
70 + Matches partition by number if present.
71 +
72 + partname:
73 + "$ref": "/schemas/types.yaml#/definitions/string"
74 + description:
75 + Matches partition by PARTNAME if present.
76 +
77 + uuid:
78 + "$ref": "/schemas/types.yaml#/definitions/string"
79 + description:
80 + Matches partition by PARTUUID if present.
81 +
82 + nvmem-layout:
83 + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml#
84 + description:
85 + This container may reference an NVMEM layout parser.
86 +
87 +anyOf:
88 + - required:
89 + - partnum
90 +
91 + - required:
92 + - partname
93 +
94 + - required:
95 + - uuid
96 +
97 +unevaluatedProperties: false
98 --- /dev/null
99 +++ b/Documentation/devicetree/bindings/block/partitions.yaml
100 @@ -0,0 +1,20 @@
101 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
102 +%YAML 1.2
103 +---
104 +$id: http://devicetree.org/schemas/block/partitions.yaml#
105 +$schema: http://devicetree.org/meta-schemas/core.yaml#
106 +
107 +title: Partitions on block devices
108 +
109 +description: |
110 + This binding is generic and describes the content of the partitions container
111 + node.
112 +
113 +maintainers:
114 + - Daniel Golle <daniel@makrotopia.org>
115 +
116 +patternProperties:
117 + "^block-partition-.+$":
118 + $ref: partition.yaml
119 +
120 +unevaluatedProperties: false