dt-bindings: watchdog: Add YAML schemas for the generic watchdog bindings
PATCH RESEND v2 1/6 dt-bindings: watchdog: Add YAML schemas for the generic watchdog bindings
From: Maxime Ripard <[email protected]>
The watchdogs have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
---
Changes from v1:
- New patch
--- .../bindings/watchdog/watchdog.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/watchdog.yaml
Documentation/devicetree/bindings/watchdog/watchdog.yaml new file +26 -0
@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/watchdog.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Watchdog Generic Bindings + +maintainers: + - Guenter Roeck <[email protected]> + - Wim Van Sebroeck <[email protected]> + +description: | + This document describes generic bindings which can be used to + describe watchdog devices in a device tree. + +properties: + $nodename: + pattern: "^watchdog(@.*|-[0-9a-f])?$" + + timeout-sec: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Contains the watchdog timeout in seconds. + +...
Signature · 1 line
2.21.0
PATCH RESEND v2 2/6 dt-bindings: watchdog: Convert Allwinner watchdog to a schema
From: Maxime Ripard <[email protected]>
The Allwinner SoCs have a watchdog supported in Linux, with a matching Device Tree binding.
Now that we have the DT validation in place, let's convert the device tree bindings for that controller over to a YAML schemas.
---
Changes from v1:
- Use generic watchdog schema
- Use unevaluatedProperties instead of additionalProperties
--- .../watchdog/allwinner,sun4i-a10-wdt.yaml | 48 +++++++++++++++++++ .../bindings/watchdog/sunxi-wdt.txt | 22 --------- 2 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml new file +48 -0
@@ -0,0 +1,48 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/allwinner,sun4i-a10-wdt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner A10 Watchdog Device Tree Bindings + +allOf: + - $ref: "watchdog.yaml#" + +maintainers: + - Chen-Yu Tsai <[email protected]> + - Maxime Ripard <[email protected]> + +properties: + compatible: + oneOf: + - const: allwinner,sun4i-a10-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,sun50i-a64-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,sun50i-h6-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,suniv-f1c100s-wdt + - const: allwinner,sun4i-a10-wdt + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + wdt: watchdog@1c20c90 { + compatible = "allwinner,sun4i-a10-wdt"; + reg = <0x01c20c90 0x10>; + timeout-sec = <10>; + }; + +...
Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt deleted +0 -22
@@ -1,22 +0,0 @@ -Allwinner SoCs Watchdog timer - -Required properties: - -- compatible : should be one of - "allwinner,sun4i-a10-wdt" - "allwinner,sun6i-a31-wdt" - "allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt" - "allwinner,sun50i-h6-wdt","allwinner,sun6i-a31-wdt" - "allwinner,suniv-f1c100s-wdt", "allwinner,sun4i-a10-wdt" -- reg : Specifies base physical address and size of the registers. - -Optional properties: -- timeout-sec : Contains the watchdog timeout in seconds - -Example: - -wdt: watchdog@1c20c90 { - compatible = "allwinner,sun4i-a10-wdt"; - reg = <0x01c20c90 0x10>; - timeout-sec = <10>; -};
Signature · 1 line
2.21.0
Re: [PATCH RESEND v2 2/6] dt-bindings: watchdog: Convert Allwinner watchdog to a schema
Quoted 11 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The Allwinner SoCs have a watchdog supported in Linux, with a matching Device Tree binding.
Now that we have the DT validation in place, let's convert the device tree bindings for that controller over to a YAML schemas.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 97 lines
---
Changes from v1:
- Use generic watchdog schema
- Use unevaluatedProperties instead of additionalProperties--- .../watchdog/allwinner,sun4i-a10-wdt.yaml | 48 +++++++++++++++++++ .../bindings/watchdog/sunxi-wdt.txt | 22 --------- 2 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/sunxi-wdt.txtDocumentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml new file +48
-0@@ -0,0 +1,48 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/allwinner,sun4i-a10-wdt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner A10 Watchdog Device Tree Bindings + +allOf: + - $ref: "watchdog.yaml#" + +maintainers: + - Chen-Yu Tsai <[email protected]> + - Maxime Ripard <[email protected]> + +properties: + compatible: + oneOf: + - const: allwinner,sun4i-a10-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,sun50i-a64-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,sun50i-h6-wdt + - const: allwinner,sun6i-a31-wdt + - items: + - const: allwinner,suniv-f1c100s-wdt + - const: allwinner,sun4i-a10-wdt + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + wdt: watchdog@1c20c90 { + compatible = "allwinner,sun4i-a10-wdt"; + reg = <0x01c20c90 0x10>; + timeout-sec = <10>; + }; + +...Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt deleted +0
-22@@ -1,22 +0,0 @@ -Allwinner SoCs Watchdog timer - -Required properties: - -- compatible : should be one of - "allwinner,sun4i-a10-wdt" - "allwinner,sun6i-a31-wdt" - "allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt" - "allwinner,sun50i-h6-wdt","allwinner,sun6i-a31-wdt" - "allwinner,suniv-f1c100s-wdt", "allwinner,sun4i-a10-wdt" -- reg : Specifies base physical address and size of the registers. - -Optional properties: -- timeout-sec : Contains the watchdog timeout in seconds - -Example: - -wdt: watchdog@1c20c90 { - compatible = "allwinner,sun4i-a10-wdt"; - reg = <0x01c20c90 0x10>; - timeout-sec = <10>; -};Signature · 1 line
2.21.0
PATCH RESEND v2 3/6 dt-bindings: watchdog: sun4i: Add the watchdog interrupts
In reply to Maxime RipardFrom: Maxime Ripard <[email protected]>
The Allwinner watchdog has an interrupt, either shared or dedicated depending on the SoC, that has been described in some DT, but not all of them.
The binding is also completely missing that description. Let's add that property to be consistent.
--- .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +5 -0
@@ -31,9 +31,13 @@ properties: reg: maxItems: 1 + interrupts: + maxItems: 1 + required: - compatible - reg + - interrupts unevaluatedProperties: false
@@ -42,6 +46,7 @@ examples: wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <24>; timeout-sec = <10>; };
Signature · 1 line
2.21.0
Re: [PATCH RESEND v2 3/6] dt-bindings: watchdog: sun4i: Add the watchdog interrupts
Quoted 11 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The Allwinner watchdog has an interrupt, either shared or dedicated depending on the SoC, that has been described in some DT, but not all of them.
The binding is also completely missing that description. Let's add that property to be consistent.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 33 lines
--- .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +5
-0@@ -31,9 +31,13 @@ properties: reg: maxItems: 1 + interrupts: + maxItems: 1 + required: - compatible - reg + - interrupts unevaluatedProperties: false@@ -42,6 +46,7 @@ examples: wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <24>; timeout-sec = <10>; };Signature · 1 line
2.21.0
PATCH RESEND v2 4/6 dt-bindings: watchdog: sun4i: Add the watchdog clock
In reply to Maxime RipardFrom: Maxime Ripard <[email protected]>
The Allwinner watchdog has a clock that has been described in some DT, but not all of them.
The binding is also completely missing that description. Let's add that property to be consistent.
---
Changes from v1:
- New patch
--- .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +5 -0
@@ -31,12 +31,16 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + interrupts: maxItems: 1 required: - compatible - reg + - clocks - interrupts unevaluatedProperties: false
@@ -47,6 +51,7 @@ examples: compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <24>; + clocks = <&osc24M>; timeout-sec = <10>; };
Signature · 1 line
2.21.0
Re: [PATCH RESEND v2 4/6] dt-bindings: watchdog: sun4i: Add the watchdog clock
Quoted 11 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The Allwinner watchdog has a clock that has been described in some DT, but not all of them.
The binding is also completely missing that description. Let's add that property to be consistent.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 40 lines
---
Changes from v1:
- New patch--- .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +5
-0@@ -31,12 +31,16 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + interrupts: maxItems: 1 required: - compatible - reg + - clocks - interrupts unevaluatedProperties: false@@ -47,6 +51,7 @@ examples: compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <24>; + clocks = <&osc24M>; timeout-sec = <10>; };Signature · 1 line
2.21.0
PATCH RESEND v2 5/6 ARM: dts: sunxi: Add missing watchdog interrupts
In reply to Maxime RipardFrom: Maxime Ripard <[email protected]>
The watchdog has an interrupt on all our SoCs, but it wasn't always listed. Add it to the devicetree where it's missing.
--- arch/arm/boot/dts/sun4i-a10.dtsi | 1 + arch/arm/boot/dts/sun5i.dtsi | 1 + arch/arm/boot/dts/sun6i-a31.dtsi | 1 + arch/arm/boot/dts/sun7i-a20.dtsi | 1 + arch/arm/boot/dts/sun8i-r40.dtsi | 1 + 5 files changed, 5 insertions(+)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -0
@@ -815,6 +815,7 @@ wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <24>; }; rtc: rtc@1c20d00 {
arch/arm/boot/dts/sun5i.dtsi +1 -0
@@ -600,6 +600,7 @@ wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <24>; }; ir0: ir@1c21800 {
arch/arm/boot/dts/sun6i-a31.dtsi +1 -0
@@ -744,6 +744,7 @@ wdt1: watchdog@1c20ca0 { compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; }; spdif: spdif@1c21000 {
arch/arm/boot/dts/sun7i-a20.dtsi +1 -0
@@ -1115,6 +1115,7 @@ wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; }; rtc: rtc@1c20d00 {
arch/arm/boot/dts/sun8i-r40.dtsi +1 -0
@@ -404,6 +404,7 @@ wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; }; uart0: serial@1c28000 {
Signature · 1 line
2.21.0
PATCH RESEND v2 6/6 ARM: dts: sunxi: Add missing watchdog clocks
In reply to Maxime RipardFrom: Maxime Ripard <[email protected]>
The watchdog has a clock on all our SoCs, but it wasn't always listed. Add it to the devicetree where it's missing.
---
Changes from v1:
- New patch
--- arch/arm/boot/dts/sun4i-a10.dtsi | 1 + arch/arm/boot/dts/sun5i.dtsi | 1 + arch/arm/boot/dts/sun6i-a31.dtsi | 1 + arch/arm/boot/dts/sun7i-a20.dtsi | 1 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 1 + arch/arm/boot/dts/sun8i-r40.dtsi | 1 + arch/arm/boot/dts/sun8i-v3s.dtsi | 1 + arch/arm/boot/dts/sunxi-h3-h5.dtsi | 1 + arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 + arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 2 ++ 10 files changed, 11 insertions(+)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -0
@@ -816,6 +816,7 @@ compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <24>; + clocks = <&osc24M>; }; rtc: rtc@1c20d00 {
arch/arm/boot/dts/sun5i.dtsi +1 -0
@@ -601,6 +601,7 @@ compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <24>; + clocks = <&osc24M>; }; ir0: ir@1c21800 {
arch/arm/boot/dts/sun6i-a31.dtsi +1 -0
@@ -745,6 +745,7 @@ compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; spdif: spdif@1c21000 {
arch/arm/boot/dts/sun7i-a20.dtsi +1 -0
@@ -1116,6 +1116,7 @@ compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; rtc: rtc@1c20d00 {
arch/arm/boot/dts/sun8i-a23-a33.dtsi +1 -0
@@ -452,6 +452,7 @@ compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; pwm: pwm@1c21400 {
arch/arm/boot/dts/sun8i-r40.dtsi +1 -0
@@ -405,6 +405,7 @@ compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; uart0: serial@1c28000 {
arch/arm/boot/dts/sun8i-v3s.dtsi +1 -0
@@ -339,6 +339,7 @@ compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; lradc: lradc@1c22800 {
arch/arm/boot/dts/sunxi-h3-h5.dtsi +1 -0
@@ -574,6 +574,7 @@ compatible = "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; spdif: spdif@1c21000 {
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1 -0
@@ -1169,6 +1169,7 @@ "allwinner,sun6i-a31-wdt"; reg = <0x01c20ca0 0x20>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; }; };
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +2 -0
@@ -225,6 +225,7 @@ "allwinner,sun6i-a31-wdt"; reg = <0x030090a0 0x20>; interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; /* Broken on some H6 boards */ status = "disabled"; };
@@ -725,6 +726,7 @@ "allwinner,sun6i-a31-wdt"; reg = <0x07020400 0x20>; interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&osc24M>; }; r_intc: interrupt-controller@7021000 {
Signature · 1 line
2.21.0
Quoted 7 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The watchdogs have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Ping?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Quoted 7 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The watchdogs have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 45 lines
---
Changes from v1:
- New patch--- .../bindings/watchdog/watchdog.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/watchdog.yamlDocumentation/devicetree/bindings/watchdog/watchdog.yaml new file +26
-0@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/watchdog.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Watchdog Generic Bindings + +maintainers: + - Guenter Roeck <[email protected]> + - Wim Van Sebroeck <[email protected]> + +description: | + This document describes generic bindings which can be used to + describe watchdog devices in a device tree. + +properties: + $nodename: + pattern: "^watchdog(@.*|-[0-9a-f])?$" + + timeout-sec: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Contains the watchdog timeout in seconds. + +...Signature · 1 line
2.21.0
Hi Guenther,
Quoted 10 lines · Guenter Roeck
Quoted 7 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The watchdogs have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Thanks for reviewing this, which tree should this go through? Yours or Rob's?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Guenter Roeck
maintainerQuoted 9 lines · Maxime Ripard
Hi Guenther,
Quoted 6 lines · Guenter Roeck
Quoted 5 lines · Maxime Ripard
From: Maxime Ripard <[email protected]>
The watchdogs have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Reviewed-by Rob Herring <[email protected]>Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Thanks for reviewing this, which tree should this go through? Yours or Rob's?
I added the watchdog patches to my watchdog-next tree, where Wim usually pick them up. I would be ok with Rob picking them up too if he wants to.
Guenter