Skip to contentSkip to conversation

dt-bindings: mfd: Convert Allwinner GPADC bindings to a schema

PATCH Superseded Maxime Ripard 3 participants 12 messages Aug 13, 2019 – Aug 19, 2019

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 dt-bindings: mfd: Convert Allwinner GPADC bindings to a schema

From: Maxime Ripard <[email protected]>

The Allwinner SoCs have an embedded GPADC that is doing thermal reading as well, 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.

---
 .../iio/adc/allwinner,sun8i-a33-ths.yaml      | 43 +++++++++++
 .../bindings/mfd/allwinner,sun4i-a10-ts.yaml  | 76 +++++++++++++++++++
 .../devicetree/bindings/mfd/sun4i-gpadc.txt   | 59 --------------
 3 files changed, 119 insertions(+), 59 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun8i-a33-ths.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt
Documentation/devicetree/bindings/iio/adc/allwinner,sun8i-a33-ths.yaml new file +43 -0
new file mode 100644
index 000000000000..d74962c0f5ae
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/allwinner,sun8i-a33-ths.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner A33 Thermal Sensor Device Tree Bindings
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Maxime Ripard <[email protected]>
+
+properties:
+  "#io-channel-cells":
+    const: 0
+
+  "#thermal-sensor-cells":
+    const: 0
+
+  compatible:
+    const: allwinner,sun8i-a33-ths
+
+  reg:
+    maxItems: 1
+
+required:
+  - "#io-channel-cells"
+  - "#thermal-sensor-cells"
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    ths: ths@1c25000 {
+        compatible = "allwinner,sun8i-a33-ths";
+        reg = <0x01c25000 0x100>;
+        #thermal-sensor-cells = <0>;
+        #io-channel-cells = <0>;
+    };
+
+...
Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml new file +76 -0

76 lines not on this page · raw message

Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt deleted +0 -59

59 lines not on this page · raw message

Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/5 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.

---
 .../watchdog/allwinner,sun4i-a10-wdt.yaml     | 50 +++++++++++++++++++
 .../bindings/watchdog/sunxi-wdt.txt           | 22 --------
 2 files changed, 50 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 +50 -0
new file mode 100644
index 000000000000..93df27ec1664
@@ -0,0 +1,50 @@
+# 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
+
+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
+
+  timeout-sec:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Contains the watchdog timeout in seconds.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: 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
deleted file mode 100644
index e65198d82a2b..000000000000
@@ -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
#2 lore raw

Re: [PATCH 2/5] dt-bindings: watchdog: Convert Allwinner watchdog to a schema

Quoted 47 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.

---
 .../watchdog/allwinner,sun4i-a10-wdt.yaml     | 50 +++++++++++++++++++
 .../bindings/watchdog/sunxi-wdt.txt           | 22 --------
 2 files changed, 50 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 +24 -0
new file mode 100644
index 000000000000..93df27ec1664
@@ -0,0 +1,50 @@
+# 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
+
+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:

Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml line 34

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml new file +10 -0
+          - const: allwinner,suniv-f1c100s-wdt
+          - const: allwinner,sun4i-a10-wdt
+
+  reg:
+    maxItems: 1
+
+  timeout-sec:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Contains the watchdog timeout in seconds.

Can you do a common watchdog schema to include with this and the node name at least.

Rob

#3 lore raw

PATCH 3/5 dt-bindings: watchdog: sun4i: Add the watchdog interrupts

In reply to 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.

---
 .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml           | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +5 -0
index 93df27ec1664..4ace89f129b4 100644
@@ -28,6 +28,9 @@ properties:
   reg:
     maxItems: 1
 
+  interrupts:
+    maxItems: 1
+
   timeout-sec:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -36,6 +39,7 @@ properties:
 required:
   - compatible
   - reg
+  - interrupts
 
 additionalProperties: false
 
@@ -44,6 +48,7 @@ examples:
     wdt: watchdog@1c20c90 {
         compatible = "allwinner,sun4i-a10-wdt";
         reg = <0x01c20c90 0x10>;
+        interrupts = <24>;
         timeout-sec = <10>;
     };
 
Signature · 1 line
2.21.0
Reviewed-by on v1 3/5
#4 lore raw

Re: [PATCH 3/5] dt-bindings: watchdog: sun4i: Add the watchdog interrupts

Quoted 9 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.

I'm fine with fixing errors like this in the conversion patch.

Quoted 4 lines
---
 .../bindings/watchdog/allwinner,sun4i-a10-wdt.yaml           | 5 +++++
 1 file changed, 5 insertions(+)

Either way:

#5 lore raw

PATCH 4/5 ARM: dts: sun8i: a83t: Remove the watchdog clock

In reply to Maxime Ripard

From: Maxime Ripard <[email protected]>

The watchdog binding doesn't define a clock, and it indeed looks like there's no explicit clock feeding it.

Let's remove it from our DT.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/sun8i-a83t.dtsi +0 -1
index 523be6611c50..15f8c80f69a5 100644
@@ -817,7 +817,6 @@
 			compatible = "allwinner,sun6i-a31-wdt";
 			reg = <0x01c20ca0 0x20>;
 			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&osc24M>;
 		};
 
 		spdif: spdif@1c21000 {
Signature · 1 line
2.21.0
#6 lore raw

Re: [PATCH 4/5] ARM: dts: sun8i: a83t: Remove the watchdog clock

Quoted 5 lines · Maxime Ripard

From: Maxime Ripard <[email protected]>

The watchdog binding doesn't define a clock, and it indeed looks like there's no explicit clock feeding it.

The diagram on page 133 of the manual shows OSC24M / 750 feeding the watchdog.

Other manuals, such as the A10 one, mention:

Watchdog clock source is OSC24M. if the OSC24M is turned off, the watchdog will not work.

So in fact it does use a clock signal. It's just that we've been lazy, since the clock rate is fixed and is always on.

ChenYu

Quoted 22 lines

Let's remove it from our DT.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/sun8i-a83t.dtsi +0 -2
index 523be6611c50..15f8c80f69a5 100644
@@ -817,7 +817,6 @@
                        compatible = "allwinner,sun6i-a31-wdt";
                        reg = <0x01c20ca0 0x20>;
                        interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&osc24M>;
                };
 
                spdif: spdif@1c21000 {
--

2.21.0

#7 lore raw

PATCH 5/5 ARM: dts: sunxi: Add missing watchdog interrupts

In reply to Maxime Ripard

From: 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
index 077d45c7db6f..eed9fcb46185 100644
@@ -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
index 4e725afe7203..29a825f7afd1 100644
@@ -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
index 916f99db6206..b32d2d7cad4e 100644
@@ -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
index 9ad8e445b240..aeb682e757f2 100644
@@ -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
index 09e20768228c..f1be554b5894 100644
@@ -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
Acked-by on v1 5/5
#8 lore raw

Re: [PATCH 5/5] ARM: dts: sunxi: Add missing watchdog interrupts

Quoted 7 lines · Maxime Ripard

From: 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.

On a separate note, the A31 has four watchdogs in the timer block, and one interrupt for each watchdog. Should we expand the node to encompass all of them, or add separate nodes for each additional one?

Thanks

#9 lore raw

Re: [PATCH 5/5] ARM: dts: sunxi: Add missing watchdog interrupts

Quoted 7 lines · Chen-Yu Tsai
Quoted 6 lines · Maxime Ripard

From: 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.

Quoted 7 lines
Quoted 1 line

On a separate note, the A31 has four watchdogs in the timer block, and one interrupt for each watchdog. Should we expand the node to encompass all of them, or add separate nodes for each additional one?

Yep, I guess that's the idea considering the register range.

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Reviewed-by on v1 1/5
#10 lore raw
In reply to Maxime Ripard
Quoted 10 lines · Maxime Ripard

From: Maxime Ripard <[email protected]>

The Allwinner SoCs have an embedded GPADC that is doing thermal reading as well, 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.

Quoted 8 lines
---
 .../iio/adc/allwinner,sun8i-a33-ths.yaml      | 43 +++++++++++
 .../bindings/mfd/allwinner,sun4i-a10-ts.yaml  | 76 +++++++++++++++++++
 .../devicetree/bindings/mfd/sun4i-gpadc.txt   | 59 --------------
 3 files changed, 119 insertions(+), 59 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun8i-a33-ths.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt
author Applied
#11 lore raw
Quoted 20 lines · Rob Herring
Quoted 10 lines · Maxime Ripard

From: Maxime Ripard <[email protected]>

The Allwinner SoCs have an embedded GPADC that is doing thermal reading as well, 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.

Quoted 8 lines
---
 .../iio/adc/allwinner,sun8i-a33-ths.yaml      | 43 +++++++++++
 .../bindings/mfd/allwinner,sun4i-a10-ts.yaml  | 76 +++++++++++++++++++
 .../devicetree/bindings/mfd/sun4i-gpadc.txt   | 59 --------------
 3 files changed, 119 insertions(+), 59 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun8i-a33-ths.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/sun4i-gpadc.txt
Quoted 1 line

Applied, thanks

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel