* [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema
@ 2019-09-17 8:36 Simon Horman
2019-09-17 10:04 ` Ulrich Hecht
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Simon Horman @ 2019-09-17 8:36 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni
Cc: Rob Herring, Mark Rutland, Magnus Damm, Geert Uytterhoeven,
Chris Brandt, Yoshihiro Kaneko, linux-rtc, devicetree,
linux-renesas-soc, Simon Horman
Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
to json-schema. Also name bindings documentation file according to the
compat string being documented.
Also correct syntax error in interrupts field in example.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
* Based on v5.3
* Tested using:
# ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
# ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
---
.../devicetree/bindings/rtc/renesas,sh-rtc.yaml | 66 ++++++++++++++++++++++
Documentation/devicetree/bindings/rtc/rtc-sh.txt | 28 ---------
2 files changed, 66 insertions(+), 28 deletions(-)
create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt
diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
new file mode 100644
index 000000000000..07dbcd4436ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Real Time Clock for Renesas SH and ARM SoCs
+
+maintainers:
+ - Chris Brandt <chris.brandt@renesas.com>
+ - Geert Uytterhoeven <geert+renesas@glider.be>
+
+properties:
+ compatible:
+ items:
+ - const: renesas,r7s72100-rtc # RZ/A1H
+ - const: renesas,sh-rtc
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 3
+
+ interrupt-names:
+ items:
+ - const: alarm
+ - const: period
+ - const: carry
+
+ clocks:
+ # The functional clock source for the RTC controller must be listed
+ # first (if it exists). Additionally, potential clock counting sources
+ # are to be listed.
+ true
+
+ clock-names:
+ # The functional clock must be labeled as "fck". Other clocks
+ # may be named in accordance to the SoC hardware manuals.
+ true
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - clocks
+ - clock-names
+
+examples:
+ - |
+ #include <dt-bindings/clock/r7s72100-clock.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ rtc: rtc@fcff1000 {
+ compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+ reg = <0xfcff1000 0x2e>;
+ interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "alarm", "period", "carry";
+ clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+ <&rtc_x3_clk>, <&extal_clk>;
+ clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
+ };
diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
deleted file mode 100644
index 7676c7d28874..000000000000
--- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-* Real Time Clock for Renesas SH and ARM SoCs
-
-Required properties:
-- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
- fallback.
-- reg: physical base address and length of memory mapped region.
-- interrupts: 3 interrupts for alarm, period, and carry.
-- interrupt-names: The interrupts should be labeled as "alarm", "period", and
- "carry".
-- clocks: The functional clock source for the RTC controller must be listed
- first (if exists). Additionally, potential clock counting sources are to be
- listed.
-- clock-names: The functional clock must be labeled as "fck". Other clocks
- may be named in accordance to the SoC hardware manuals.
-
-
-Example:
-rtc: rtc@fcff1000 {
- compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
- reg = <0xfcff1000 0x2e>;
- interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
- GIC_SPI 277 IRQ_TYPE_EDGE_RISING
- GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
- interrupt-names = "alarm", "period", "carry";
- clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
- <&rtc_x3_clk>, <&extal_clk>;
- clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
-};
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema
2019-09-17 8:36 [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema Simon Horman
@ 2019-09-17 10:04 ` Ulrich Hecht
2019-09-17 10:31 ` Simon Horman
2019-09-17 13:00 ` Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Hecht @ 2019-09-17 10:04 UTC (permalink / raw)
To: Simon Horman, Alessandro Zummo, Alexandre Belloni
Cc: Rob Herring, Mark Rutland, Magnus Damm, Geert Uytterhoeven,
Chris Brandt, Yoshihiro Kaneko, linux-rtc, devicetree,
linux-renesas-soc
> On September 17, 2019 at 10:36 AM Simon Horman <horms+renesas@verge.net.au> wrote:
>
>
> Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
> to json-schema. Also name bindings documentation file according to the
> compat string being documented.
>
> Also correct syntax error in interrupts field in example.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> * Based on v5.3
> * Tested using:
> # ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> # ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> ---
> .../devicetree/bindings/rtc/renesas,sh-rtc.yaml | 66 ++++++++++++++++++++++
> Documentation/devicetree/bindings/rtc/rtc-sh.txt | 28 ---------
> 2 files changed, 66 insertions(+), 28 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> new file mode 100644
> index 000000000000..07dbcd4436ce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Real Time Clock for Renesas SH and ARM SoCs
> +
> +maintainers:
> + - Chris Brandt <chris.brandt@renesas.com>
> + - Geert Uytterhoeven <geert+renesas@glider.be>
> +
> +properties:
> + compatible:
> + items:
> + - const: renesas,r7s72100-rtc # RZ/A1H
> + - const: renesas,sh-rtc
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 3
> +
> + interrupt-names:
> + items:
> + - const: alarm
> + - const: period
> + - const: carry
> +
> + clocks:
> + # The functional clock source for the RTC controller must be listed
> + # first (if it exists). Additionally, potential clock counting sources
> + # are to be listed.
> + true
> +
> + clock-names:
> + # The functional clock must be labeled as "fck". Other clocks
> + # may be named in accordance to the SoC hardware manuals.
> + true
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-names
> + - clocks
> + - clock-names
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/r7s72100-clock.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + rtc: rtc@fcff1000 {
> + compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> + reg = <0xfcff1000 0x2e>;
> + interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "alarm", "period", "carry";
> + clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> + <&rtc_x3_clk>, <&extal_clk>;
> + clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> + };
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> deleted file mode 100644
> index 7676c7d28874..000000000000
> --- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -* Real Time Clock for Renesas SH and ARM SoCs
> -
> -Required properties:
> -- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
> - fallback.
> -- reg: physical base address and length of memory mapped region.
> -- interrupts: 3 interrupts for alarm, period, and carry.
> -- interrupt-names: The interrupts should be labeled as "alarm", "period", and
> - "carry".
> -- clocks: The functional clock source for the RTC controller must be listed
> - first (if exists). Additionally, potential clock counting sources are to be
> - listed.
> -- clock-names: The functional clock must be labeled as "fck". Other clocks
> - may be named in accordance to the SoC hardware manuals.
> -
> -
> -Example:
> -rtc: rtc@fcff1000 {
> - compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> - reg = <0xfcff1000 0x2e>;
> - interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> - GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> - GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> - interrupt-names = "alarm", "period", "carry";
> - clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> - <&rtc_x3_clk>, <&extal_clk>;
> - clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> -};
> --
> 2.11.0
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema
2019-09-17 8:36 [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema Simon Horman
2019-09-17 10:04 ` Ulrich Hecht
@ 2019-09-17 10:31 ` Simon Horman
2019-09-17 13:00 ` Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-09-17 10:31 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni
Cc: Rob Herring, Mark Rutland, Magnus Damm, Geert Uytterhoeven,
Chris Brandt, Yoshihiro Kaneko, linux-rtc, devicetree,
linux-renesas-soc
On Tue, Sep 17, 2019 at 10:36:34AM +0200, Simon Horman wrote:
> Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
> to json-schema. Also name bindings documentation file according to the
> compat string being documented.
>
> Also correct syntax error in interrupts field in example.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> * Based on v5.3
> * Tested using:
> # ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> # ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
The above should read:
* Tested using:
# ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
# ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> ---
> .../devicetree/bindings/rtc/renesas,sh-rtc.yaml | 66 ++++++++++++++++++++++
> Documentation/devicetree/bindings/rtc/rtc-sh.txt | 28 ---------
> 2 files changed, 66 insertions(+), 28 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> new file mode 100644
> index 000000000000..07dbcd4436ce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Real Time Clock for Renesas SH and ARM SoCs
> +
> +maintainers:
> + - Chris Brandt <chris.brandt@renesas.com>
> + - Geert Uytterhoeven <geert+renesas@glider.be>
> +
> +properties:
> + compatible:
> + items:
> + - const: renesas,r7s72100-rtc # RZ/A1H
> + - const: renesas,sh-rtc
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 3
> +
> + interrupt-names:
> + items:
> + - const: alarm
> + - const: period
> + - const: carry
> +
> + clocks:
> + # The functional clock source for the RTC controller must be listed
> + # first (if it exists). Additionally, potential clock counting sources
> + # are to be listed.
> + true
> +
> + clock-names:
> + # The functional clock must be labeled as "fck". Other clocks
> + # may be named in accordance to the SoC hardware manuals.
> + true
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-names
> + - clocks
> + - clock-names
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/r7s72100-clock.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + rtc: rtc@fcff1000 {
> + compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> + reg = <0xfcff1000 0x2e>;
> + interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "alarm", "period", "carry";
> + clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> + <&rtc_x3_clk>, <&extal_clk>;
> + clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> + };
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> deleted file mode 100644
> index 7676c7d28874..000000000000
> --- a/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -* Real Time Clock for Renesas SH and ARM SoCs
> -
> -Required properties:
> -- compatible: Should be "renesas,r7s72100-rtc" and "renesas,sh-rtc" as a
> - fallback.
> -- reg: physical base address and length of memory mapped region.
> -- interrupts: 3 interrupts for alarm, period, and carry.
> -- interrupt-names: The interrupts should be labeled as "alarm", "period", and
> - "carry".
> -- clocks: The functional clock source for the RTC controller must be listed
> - first (if exists). Additionally, potential clock counting sources are to be
> - listed.
> -- clock-names: The functional clock must be labeled as "fck". Other clocks
> - may be named in accordance to the SoC hardware manuals.
> -
> -
> -Example:
> -rtc: rtc@fcff1000 {
> - compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> - reg = <0xfcff1000 0x2e>;
> - interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> - GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> - GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> - interrupt-names = "alarm", "period", "carry";
> - clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> - <&rtc_x3_clk>, <&extal_clk>;
> - clock-names = "fck", "rtc_x1", "rtc_x3", "extal";
> -};
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema
2019-09-17 8:36 [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema Simon Horman
2019-09-17 10:04 ` Ulrich Hecht
2019-09-17 10:31 ` Simon Horman
@ 2019-09-17 13:00 ` Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2019-09-17 13:00 UTC (permalink / raw)
To: Simon Horman
Cc: Alessandro Zummo, Alexandre Belloni, Mark Rutland, Magnus Damm,
Geert Uytterhoeven, Chris Brandt, Yoshihiro Kaneko,
open list:REAL TIME CLOCK (RTC) SUBSYSTEM, devicetree,
open list:MEDIA DRIVERS FOR RENESAS - FCP
On Tue, Sep 17, 2019 at 3:37 AM Simon Horman <horms+renesas@verge.net.au> wrote:
>
> Convert Real Time Clock for Renesas SH and ARM SoCs bindings documentation
> to json-schema. Also name bindings documentation file according to the
> compat string being documented.
>
> Also correct syntax error in interrupts field in example.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> * Based on v5.3
> * Tested using:
> # ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> # ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/renesas,bsc.yaml
> ---
> .../devicetree/bindings/rtc/renesas,sh-rtc.yaml | 66 ++++++++++++++++++++++
> Documentation/devicetree/bindings/rtc/rtc-sh.txt | 28 ---------
> 2 files changed, 66 insertions(+), 28 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> new file mode 100644
> index 000000000000..07dbcd4436ce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/renesas,sh-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Real Time Clock for Renesas SH and ARM SoCs
> +
> +maintainers:
> + - Chris Brandt <chris.brandt@renesas.com>
> + - Geert Uytterhoeven <geert+renesas@glider.be>
> +
> +properties:
> + compatible:
> + items:
> + - const: renesas,r7s72100-rtc # RZ/A1H
> + - const: renesas,sh-rtc
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 3
> +
> + interrupt-names:
> + items:
> + - const: alarm
> + - const: period
> + - const: carry
> +
> + clocks:
> + # The functional clock source for the RTC controller must be listed
> + # first (if it exists). Additionally, potential clock counting sources
> + # are to be listed.
> + true
Surely you can give some range...
> +
> + clock-names:
> + # The functional clock must be labeled as "fck". Other clocks
> + # may be named in accordance to the SoC hardware manuals.
> + true
While not ideal, you can do:
minItems: 1
maxItems: 4
items:
enum: [ set, of, possible, clock, names, in, any, order ]
Note 'items' here is a schema, not a list.
Your dt-schema install may need updating as I only recently adjusted
the meta-schema to allow this.
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-17 13:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 8:36 [PATCH] dt-bindings: rtc: rtc-sh: convert bindings to json-schema Simon Horman
2019-09-17 10:04 ` Ulrich Hecht
2019-09-17 10:31 ` Simon Horman
2019-09-17 13:00 ` Rob Herring
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).