dt-bindings: serial: uartlite: Convert to json-schema
authorSean Anderson <sean.anderson@seco.com>
Thu, 26 Aug 2021 19:21:51 +0000 (15:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 08:05:32 +0000 (10:05 +0200)
This converts the existing documentation for the uartlite binding to
json-schema.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20210826192154.3202269-2-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt [deleted file]
Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt
deleted file mode 100644 (file)
index c37deb4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Xilinx Axi Uartlite controller Device Tree Bindings
----------------------------------------------------------
-
-Required properties:
-- compatible           : Can be either of
-                               "xlnx,xps-uartlite-1.00.a"
-                               "xlnx,opb-uartlite-1.00.b"
-- reg                  : Physical base address and size of the Axi Uartlite
-                         registers map.
-- interrupts           : Should contain the UART controller interrupt.
-
-Optional properties:
-- port-number          : Set Uart port number
-- clock-names          : Should be "s_axi_aclk"
-- clocks               : Input clock specifier. Refer to common clock bindings.
-
-Example:
-serial@800c0000 {
-       compatible = "xlnx,xps-uartlite-1.00.a";
-       reg = <0x0 0x800c0000 0x10000>;
-       interrupts = <0x0 0x6e 0x1>;
-       port-number = <0>;
-};
diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml
new file mode 100644 (file)
index 0000000..0cc94c9
--- /dev/null
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/xlnx,opb-uartlite.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Axi Uartlite
+
+maintainers:
+  - Peter Korsgaard <jacmet@sunsite.dk>
+
+properties:
+  compatible:
+    contains:
+      enum:
+        - xlnx,xps-uartlite-1.00.a
+        - xlnx,opb-uartlite-1.00.b
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  port-number:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Set Uart port number
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: s_axi_aclk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - $ref: /schemas/serial.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+      serial@800c0000 {
+        compatible = "xlnx,xps-uartlite-1.00.a";
+        reg = <0x800c0000 0x10000>;
+        interrupts = <0x0 0x6e 0x1>;
+        port-number = <0>;
+      };
+...