Skip to contentSkip to conversation

dt-bindings: serial: brcm,bcm6345-uart: convert to the json-schema

PATCH Superseded Rafał Miłecki 4 participants 5 messages Aug 19, 2021 – Aug 30, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: serial: brcm,bcm6345-uart: convert to the json-schema

From: Rafał Miłecki <[email protected]>

This helps validating DTS files.

In example periph_clk@0 was replaced with periph_clk to fix validation.

---
I've verified this binding using the
make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml

---
 .../bindings/serial/brcm,bcm6345-uart.txt     | 36 ------------
 .../bindings/serial/brcm,bcm6345-uart.yaml    | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt deleted +0 -36
deleted file mode 100644
index 8b2b0460259a..000000000000
@@ -1,36 +0,0 @@
-* BCM63xx UART
-
-Required properties:
-
-- compatible: "brcm,bcm6345-uart"
-
-- reg: The base address of the UART register bank.
-
-- interrupts: A single interrupt specifier.
-
-- clocks: Clock driving the hardware; used to figure out the baud rate
-  divisor.
-
-
-Optional properties:
-
-- clock-names: Should be "refclk".
-
-Example:
-
-	uart0: serial@14e00520 {
-		compatible = "brcm,bcm6345-uart";
-		reg = <0x14e00520 0x18>;
-		interrupt-parent = <&periph_intc>;
-		interrupts = <2>;
-		clocks = <&periph_clk>;
-		clock-names = "refclk";
-	};
-
-	clocks {
-		periph_clk: periph_clk@0 {
-			compatible = "fixed-clock";
-			#clock-cells = <0>;
-			clock-frequency = <54000000>;
-		};
-	};
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.26.2
maintainer
#2 lore raw
In reply to Rafał Miłecki
Quoted 76 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files.

In example periph_clk@0 was replaced with periph_clk to fix validation.

---
I've verified this binding using the
make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml

---
 .../bindings/serial/brcm,bcm6345-uart.txt     | 36 ------------
 .../bindings/serial/brcm,bcm6345-uart.yaml    | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt deleted +0 -36
deleted file mode 100644
index 8b2b0460259a..000000000000
@@ -1,36 +0,0 @@
-* BCM63xx UART
-
-Required properties:
-
-- compatible: "brcm,bcm6345-uart"
-
-- reg: The base address of the UART register bank.
-
-- interrupts: A single interrupt specifier.
-
-- clocks: Clock driving the hardware; used to figure out the baud rate
-  divisor.
-
-
-Optional properties:
-
-- clock-names: Should be "refclk".
-
-Example:
-
-	uart0: serial@14e00520 {
-		compatible = "brcm,bcm6345-uart";
-		reg = <0x14e00520 0x18>;
-		interrupt-parent = <&periph_intc>;
-		interrupts = <2>;
-		clocks = <&periph_clk>;
-		clock-names = "refclk";
-	};
-
-	clocks {
-		periph_clk: periph_clk@0 {
-			compatible = "fixed-clock";
-			#clock-cells = <0>;
-			clock-frequency = <54000000>;
-		};
-	};
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +11 -0
new file mode 100644
index 000000000000..0d4d03fc58ba
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/brcm,bcm6345-uart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM63xx UART
+
+maintainers:
+  - Rafał Miłecki <[email protected]>
+

Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +10 -0
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:
+    const: brcm,bcm6345-uart
+
+  reg:
+    maxItems: 1
+    description: The base address of the UART register bank

Drop. Don't need generic descriptions.

Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml line 24

Quoted 3 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +3 -0
+
+  interrupts:
+    description: A single interrupt specifier

Replace with 'maxItems: 1'

Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml line 28

Quoted 4 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +4 -0
+
+  clocks:
+    description: >
+      Clock driving the hardware; used to figure out the baud rate divisor

Replace with 'maxItems: 1'

Quoted 18 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +18 -0
+
+  clock-names:
+    const: refclk
+
+unevaluatedProperties: false
+
+required:
+  - reg
+  - interrupts
+  - clocks
+
+examples:
+  - |
+    serial@14e00520 {
+        compatible = "brcm,bcm6345-uart";
+        reg = <0x14e00520 0x18>;
+        interrupt-parent = <&periph_intc>;
+        interrupts = <2>;

Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml line 56

Quoted 10 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +10 -0
+        clocks = <&periph_clk>;
+        clock-names = "refclk";
+    };
+
+    clocks {
+        periph_clk: periph_clk {
+            compatible = "fixed-clock";
+            #clock-cells = <0>;
+            clock-frequency = <54000000>;
+        };

You don't need to show the clock provider (or any other) in examples.

Quoted 5 lines
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +1 -0
+    };
Signature · 1 line
2.26.2
#3 lore raw

PATCH v2 1/1 dt-bindings: serial: brcm,bcm6345-uart: convert to the json-schema

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files.

Redundant generic descriptions (e.g. "The base address of the UART register bank") were dropped and periph_clk was dropped from example as not required.

---
 .../bindings/serial/brcm,bcm6345-uart.txt     | 36 --------------
 .../bindings/serial/brcm,bcm6345-uart.yaml    | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt deleted +0 -36
deleted file mode 100644
index 8b2b0460259a..000000000000
@@ -1,36 +0,0 @@
-* BCM63xx UART
-
-Required properties:
-
-- compatible: "brcm,bcm6345-uart"
-
-- reg: The base address of the UART register bank.
-
-- interrupts: A single interrupt specifier.
-
-- clocks: Clock driving the hardware; used to figure out the baud rate
-  divisor.
-
-
-Optional properties:
-
-- clock-names: Should be "refclk".
-
-Example:
-
-	uart0: serial@14e00520 {
-		compatible = "brcm,bcm6345-uart";
-		reg = <0x14e00520 0x18>;
-		interrupt-parent = <&periph_intc>;
-		interrupts = <2>;
-		clocks = <&periph_clk>;
-		clock-names = "refclk";
-	};
-
-	clocks {
-		periph_clk: periph_clk@0 {
-			compatible = "fixed-clock";
-			#clock-cells = <0>;
-			clock-frequency = <54000000>;
-		};
-	};
Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v2 1/1
#4 lore raw
Quoted 9 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files.

Redundant generic descriptions (e.g. "The base address of the UART register bank") were dropped and periph_clk was dropped from example as not required.

Quoted 8 lines
---
 .../bindings/serial/brcm,bcm6345-uart.txt     | 36 --------------
 .../bindings/serial/brcm,bcm6345-uart.yaml    | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.yaml