2021-04-24 11:07:54

by Michael Walle

[permalink] [raw]
Subject: [PATCH v2 2/5] dt-bindings: mtd: add YAML schema for the generic MTD bindings

Convert MTD's common.txt to mtd.yaml.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changes since v1:
- none

Changes since RFC:
- use real device compatibles

.../devicetree/bindings/mtd/common.txt | 16 +-------
.../devicetree/bindings/mtd/mtd.yaml | 39 +++++++++++++++++++
2 files changed, 40 insertions(+), 15 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mtd/mtd.yaml

diff --git a/Documentation/devicetree/bindings/mtd/common.txt b/Documentation/devicetree/bindings/mtd/common.txt
index fc068b923d7a..ae16f9ea8606 100644
--- a/Documentation/devicetree/bindings/mtd/common.txt
+++ b/Documentation/devicetree/bindings/mtd/common.txt
@@ -1,15 +1 @@
-* Common properties of all MTD devices
-
-Optional properties:
-- label: user-defined MTD device name. Can be used to assign user
- friendly names to MTD devices (instead of the flash model or flash
- controller based name) in order to ease flash device identification
- and/or describe what they are used for.
-
-Example:
-
- flash@0 {
- label = "System-firmware";
-
- /* flash type specific properties */
- };
+This file has been moved to mtd.yaml.
diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation/devicetree/bindings/mtd/mtd.yaml
new file mode 100644
index 000000000000..086b0ecd1604
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/mtd.yaml
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/mtd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MTD (Memory Technology Device) Device Tree Bindings
+
+maintainers:
+ - Miquel Raynal <[email protected]>
+ - Richard Weinberger <[email protected]>
+
+properties:
+ $nodename:
+ pattern: "^flash(@.*)?$"
+
+ label:
+ description:
+ User-defined MTD device name. Can be used to assign user friendly
+ names to MTD devices (instead of the flash model or flash controller
+ based name) in order to ease flash device identification and/or
+ describe what they are used for.
+
+additionalProperties: true
+
+examples:
+ - |
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ flash@0 {
+ reg = <0>;
+ compatible = "jedec,spi-nor";
+ label = "System-firmware";
+ };
+ };
+
+...
--
2.20.1


2021-05-10 11:03:43

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] dt-bindings: mtd: add YAML schema for the generic MTD bindings

On Sat, 2021-04-24 at 11:06:05 UTC, Michael Walle wrote:
> Convert MTD's common.txt to mtd.yaml.
>
> Signed-off-by: Michael Walle <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

2021-05-18 18:32:13

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] dt-bindings: mtd: add YAML schema for the generic MTD bindings

On Mon, May 10, 2021 at 5:44 AM Miquel Raynal <[email protected]> wrote:
>
> On Sat, 2021-04-24 at 11:06:05 UTC, Michael Walle wrote:
> > Convert MTD's common.txt to mtd.yaml.
> >
> > Signed-off-by: Michael Walle <[email protected]>
> > Reviewed-by: Rob Herring <[email protected]>
>
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

This is causing a warning in linux-next:

/builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-mux.example.dt.yaml:
spi-flash@0: $nodename:0: 'spi-flash@0' does not match '^flash(@.*)?$'
From schema: /builds/robherring/linux-dt/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml

Rob

2021-05-18 21:09:56

by Michael Walle

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] dt-bindings: mtd: add YAML schema for the generic MTD bindings

Am 2021-05-17 17:12, schrieb Rob Herring:
> On Mon, May 10, 2021 at 5:44 AM Miquel Raynal
> <[email protected]> wrote:
>>
>> On Sat, 2021-04-24 at 11:06:05 UTC, Michael Walle wrote:
>> > Convert MTD's common.txt to mtd.yaml.
>> >
>> > Signed-off-by: Michael Walle <[email protected]>
>> > Reviewed-by: Rob Herring <[email protected]>
>>
>> Applied to
>> https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
>> mtd/next, thanks.
>
> This is causing a warning in linux-next:
>
> /builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-mux.example.dt.yaml:
> spi-flash@0: $nodename:0: 'spi-flash@0' does not match '^flash(@.*)?$'
> From schema:
> /builds/robherring/linux-dt/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml

For reference, the patch which fixes this:
https://lore.kernel.org/linux-devicetree/[email protected]/

-michael