From: Chunyan Zhang <chunyan.zhang@unisoc.com>
To: Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Orson Zhai <orsonzhai@gmail.com>,
Baolin Wang <baolin.wang7@gmail.com>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Chunyan Zhang <chunyan.zhang@unisoc.com>
Subject: [PATCH v2 2/5] dt-bindings: serial: Convert sprd-uart to json-schema
Date: Mon, 11 Nov 2019 17:02:27 +0800 [thread overview]
Message-ID: <20191111090230.3402-3-chunyan.zhang@unisoc.com> (raw)
In-Reply-To: <20191111090230.3402-1-chunyan.zhang@unisoc.com>
Convert the sprd-uart binding to DT schema using json-schema.
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
.../devicetree/bindings/serial/sprd-uart.txt | 32 ---------
.../devicetree/bindings/serial/sprd-uart.yaml | 69 +++++++++++++++++++
2 files changed, 69 insertions(+), 32 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/serial/sprd-uart.txt
create mode 100644 Documentation/devicetree/bindings/serial/sprd-uart.yaml
diff --git a/Documentation/devicetree/bindings/serial/sprd-uart.txt b/Documentation/devicetree/bindings/serial/sprd-uart.txt
deleted file mode 100644
index 9607dc616205..000000000000
--- a/Documentation/devicetree/bindings/serial/sprd-uart.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-* Spreadtrum serial UART
-
-Required properties:
-- compatible: must be one of:
- * "sprd,sc9836-uart"
- * "sprd,sc9860-uart", "sprd,sc9836-uart"
-
-- reg: offset and length of the register set for the device
-- interrupts: exactly one interrupt specifier
-- clock-names: Should contain following entries:
- "enable" for UART module enable clock,
- "uart" for UART clock,
- "source" for UART source (parent) clock.
-- clocks: Should contain a clock specifier for each entry in clock-names.
- UART clock and source clock are optional properties, but enable clock
- is required.
-
-Optional properties:
-- dma-names: Should contain "rx" for receive and "tx" for transmit channels.
-- dmas: A list of dma specifiers, one for each entry in dma-names.
-
-Example:
- uart0: serial@0 {
- compatible = "sprd,sc9860-uart",
- "sprd,sc9836-uart";
- reg = <0x0 0x100>;
- interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
- dma-names = "rx", "tx";
- dmas = <&ap_dma 19>, <&ap_dma 20>;
- clock-names = "enable", "uart", "source";
- clocks = <&clk_ap_apb_gates 9>, <&clk_uart0>, <&ext_26m>;
- };
diff --git a/Documentation/devicetree/bindings/serial/sprd-uart.yaml b/Documentation/devicetree/bindings/serial/sprd-uart.yaml
new file mode 100644
index 000000000000..0cc4668a9b9c
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/sprd-uart.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright 2019 Unisoc Inc.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/serial/sprd-uart.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Spreadtrum serial UART
+
+maintainers:
+ - Orson Zhai <orsonzhai@gmail.com>
+ - Baolin Wang <baolin.wang7@gmail.com>
+ - Chunyan Zhang <zhang.lyra@gmail.com>
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - sprd,sc9860-uart
+ - const: sprd,sc9836-uart
+ - const: sprd,sc9836-uart
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ minItems: 1
+ maxItems: 3
+
+ clock-names:
+ description: "enable" for UART module enable clock, "uart" for UART
+ clock, "source" for UART source (parent) clock.
+ items:
+ - const: enable
+ - const: uart
+ - const: source
+
+ dmas:
+ minItems: 1
+ maxItems: 2
+
+ dma-names:
+ minItems: 1
+ items:
+ - const: rx
+ - const: tx
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+examples:
+ - |
+ serial@0 {
+ compatible = "sprd,sc9860-uart", "sprd,sc9836-uart";
+ reg = <0x0 0x100>;
+ interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+ dma-names = "rx", "tx";
+ dmas = <&ap_dma 19>, <&ap_dma 20>;
+ clock-names = "enable", "uart", "source";
+ clocks = <&clk_ap_apb_gates 9>, <&clk_uart0>, <&ext_26m>;
+ };
+
+...
--
2.20.1
next prev parent reply other threads:[~2019-11-11 9:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 9:02 [PATCH v2 0/5] Add Unisoc's SC9863A support Chunyan Zhang
2019-11-11 9:02 ` [PATCH v2 1/5] dt-bindings: arm: Convert sprd board/soc bindings to json-schema Chunyan Zhang
2019-11-14 19:19 ` Rob Herring
2019-11-11 9:02 ` Chunyan Zhang [this message]
2019-11-14 20:52 ` [PATCH v2 2/5] dt-bindings: serial: Convert sprd-uart " Rob Herring
2019-11-15 1:34 ` Chunyan Zhang
2019-11-15 1:49 ` Rob Herring
2019-11-15 11:14 ` Chunyan Zhang
2019-11-15 13:31 ` Rob Herring
2019-11-11 9:02 ` [PATCH v2 3/5] dt-bindings: arm: Add bindings for Unisoc SC9863A Chunyan Zhang
2019-11-11 9:02 ` [PATCH v2 4/5] dt-bindings: serial: Add a new compatible string for SC9863A Chunyan Zhang
2019-11-12 0:56 ` Rob Herring
2019-11-12 1:38 ` Chunyan Zhang
2019-11-14 0:06 ` Rob Herring
2019-11-14 7:56 ` Chunyan Zhang
2019-11-11 9:02 ` [PATCH v2 5/5] arm64: dts: Add Unisoc's SC9863A SoC support Chunyan Zhang
2019-11-14 21:05 ` Rob Herring
2019-11-15 8:59 ` Chunyan Zhang
2019-11-15 14:43 ` Rob Herring
2019-11-25 8:33 ` Chunyan Zhang
2019-12-02 16:33 ` Rob Herring
2019-12-06 10:09 ` Chunyan Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191111090230.3402-3-chunyan.zhang@unisoc.com \
--to=chunyan.zhang@unisoc.com \
--cc=baolin.wang7@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=orsonzhai@gmail.com \
--cc=robh+dt@kernel.org \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).