diff mbox series

dt-bindings: Convert Xilinx watchdog bindings to json-schema

Message ID 20220818124207.61313-1-srinivas.neeli@xilinx.com
State Changes Requested, archived
Headers show
Series dt-bindings: Convert Xilinx watchdog bindings to json-schema | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 71 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Srinivas Neeli Aug. 18, 2022, 12:42 p.m. UTC
Convert Xilinx watchdog bindings to DT schema format using json-schema

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
---
 .../bindings/watchdog/of-xilinx-wdt.txt       | 26 -------
 .../bindings/watchdog/xlnx,xps-timebase.yaml  | 71 +++++++++++++++++++
 2 files changed, 71 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml

Comments

Krzysztof Kozlowski Aug. 18, 2022, 1:39 p.m. UTC | #1
On 18/08/2022 15:42, Srinivas Neeli wrote:
> Convert Xilinx watchdog bindings to DT schema format using json-schema
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>

Use subject perfixes matching the subsystem (git log --oneline -- ...).


> diff --git a/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml b/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml
> new file mode 100644
> index 000000000000..fd2e3f2df54c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml

xlnx,xps-timebase-wdt.yaml
(name should be matching compatibles)

> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/watchdog/xlnx,xps-timebase.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Xilinx AXI/PLB softcore and window Watchdog Timer
> +
> +allOf:
> +  - $ref: "watchdog.yaml#"

No need for quotes. Put the allOf just above "properties".

> +
> +maintainers:
> +  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> +  - Srinivas Neeli <srinivas.neeli@xilinx.com>
> +
> +description:
> +  The Timebase watchdog timer(WDT) is a free-running 32 bit counter.
> +  WDT uses a dual-expiration architecture. After one expiration of
> +  the timeout interval, an interrupt is generated and the WDT state
> +  bit is set to one in the status register. If the state bit is not
> +  cleared (by writing a one to the state bit) before the next
> +  expiration of the timeout interval, a WDT reset is generated.
> +
> +properties:
> +  compatible:
> +    oneOf:

There is no other option, so no need for oneOf.

> +      - items:

You do not have items, just one item. Drop items as well.

> +          - enum:
> +              - xlnx,xps-timebase-wdt-1.01.a
> +              - xlnx,xps-timebase-wdt-1.00.a
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 1

instead maxItems

> +
> +  clock-frequency:
> +    $ref: /schemas/types.yaml#/definitions/uint32

No need for ref. This is a standard property.

> +    description: Frequency of clock in Hz

Would be useful to add constraints (minimum/maximum and default), but
that's not a big deal.

> +
> +  xlnx,wdt-interval:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Watchdog timeout interval
> +    minimum: 8
> +    maximum: 32
> +
> +  xlnx,wdt-enable-once:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [0, 1]
> +    description: If watchdog is configured as enable once,
> +                 then the watchdog cannot be disabled after
> +                 it has been enabled.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    watchdog@40100000 {
> +      compatible = "xlnx,xps-timebase-wdt-1.00.a";
> +      reg = <0x40100000 0x1000>;
> +      clock-frequency = <50000000>;
> +      clocks = <&clkc 15>;
> +      xlnx,wdt-enable-once = <0x0>;
> +      xlnx,wdt-interval = <0x1b>;
> +    } ;

No need for space after ';'



Best regards,
Krzysztof
Srinivas Neeli Aug. 18, 2022, 2:52 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Thursday, August 18, 2022 7:09 PM
> To: Srinivas Neeli <srinivas.neeli@xilinx.com>; linux@roeck-us.net;
> krzysztof.kozlowski+dt@linaro.org; wim@linux-watchdog.org;
> michal.simek@xilinx.com; shubhrajyoti.datta@xilinx.com
> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> devicetree@vger.kernel.org; linux-watchdog@vger.kernel.org;
> git@xilinx.com; git (AMD-Xilinx) <git@amd.com>; sgoud@xilinx.com; Radhey
> Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> Subject: Re: [PATCH] dt-bindings: Convert Xilinx watchdog bindings to json-
> schema
> 
> On 18/08/2022 15:42, Srinivas Neeli wrote:
> > Convert Xilinx watchdog bindings to DT schema format using json-schema
> >
> > Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> > Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> 
> Use subject perfixes matching the subsystem (git log --oneline -- ...).
Will update in v2.

> 
> 
> > diff --git
> > a/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml
> > b/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml
> > new file mode 100644
> > index 000000000000..fd2e3f2df54c
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/watchdog/xlnx,xps-
> timebase.yam
> > +++ l
> 
> xlnx,xps-timebase-wdt.yaml
> (name should be matching compatibles)
Ok, Will update in V2.

> 
> > @@ -0,0 +1,71 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause %YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/watchdog/xlnx,xps-timebase.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Xilinx AXI/PLB softcore and window Watchdog Timer
> > +
> > +allOf:
> > +  - $ref: "watchdog.yaml#"
> 
> No need for quotes. Put the allOf just above "properties".
Ok, will update in V2.

> 
> > +
> > +maintainers:
> > +  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> > +  - Srinivas Neeli <srinivas.neeli@xilinx.com>
> > +
> > +description:
> > +  The Timebase watchdog timer(WDT) is a free-running 32 bit counter.
> > +  WDT uses a dual-expiration architecture. After one expiration of
> > +  the timeout interval, an interrupt is generated and the WDT state
> > +  bit is set to one in the status register. If the state bit is not
> > +  cleared (by writing a one to the state bit) before the next
> > +  expiration of the timeout interval, a WDT reset is generated.
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> 
> There is no other option, so no need for oneOf.
> 
> > +      - items:
> 
> You do not have items, just one item. Drop items as well.
Ok, will update in V2.

> 
> > +          - enum:
> > +              - xlnx,xps-timebase-wdt-1.01.a
> > +              - xlnx,xps-timebase-wdt-1.00.a
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    minItems: 1
> 
> instead maxItems
Ok, will update in V2.

> 
> > +
> > +  clock-frequency:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> No need for ref. This is a standard property.
Ok, will update in V2.
> 
> > +    description: Frequency of clock in Hz
> 
> Would be useful to add constraints (minimum/maximum and default), but
> that's not a big deal.

There is no limit to minimum and maximum values. So not adding constraints.
> 
> > +
> > +  xlnx,wdt-interval:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: Watchdog timeout interval
> > +    minimum: 8
> > +    maximum: 32
> > +
> > +  xlnx,wdt-enable-once:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum: [0, 1]
> > +    description: If watchdog is configured as enable once,
> > +                 then the watchdog cannot be disabled after
> > +                 it has been enabled.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    watchdog@40100000 {
> > +      compatible = "xlnx,xps-timebase-wdt-1.00.a";
> > +      reg = <0x40100000 0x1000>;
> > +      clock-frequency = <50000000>;
> > +      clocks = <&clkc 15>;
> > +      xlnx,wdt-enable-once = <0x0>;
> > +      xlnx,wdt-interval = <0x1b>;
> > +    } ;
> 
> No need for space after ';'
Ok, will update in V2.

Thanks
Neeli Srinivas
> 
> 
> 
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt b/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt
deleted file mode 100644
index c6ae9c9d5e3e..000000000000
--- a/Documentation/devicetree/bindings/watchdog/of-xilinx-wdt.txt
+++ /dev/null
@@ -1,26 +0,0 @@ 
-Xilinx AXI/PLB soft-core watchdog Device Tree Bindings
----------------------------------------------------------
-
-Required properties:
-- compatible		: Should be "xlnx,xps-timebase-wdt-1.00.a" or
-			  "xlnx,xps-timebase-wdt-1.01.a".
-- reg			: Physical base address and size
-
-Optional properties:
-- clocks		: Input clock specifier. Refer to common clock
-			  bindings.
-- clock-frequency	: Frequency of clock in Hz
-- xlnx,wdt-enable-once	: 0 - Watchdog can be restarted
-			  1 - Watchdog can be enabled just once
-- xlnx,wdt-interval	: Watchdog timeout interval in 2^<val> clock cycles,
-			  <val> is integer from 8 to 31.
-
-Example:
-axi-timebase-wdt@40100000 {
-	clock-frequency = <50000000>;
-	compatible = "xlnx,xps-timebase-wdt-1.00.a";
-	clocks = <&clkc 15>;
-	reg = <0x40100000 0x10000>;
-	xlnx,wdt-enable-once = <0x0>;
-	xlnx,wdt-interval = <0x1b>;
-} ;
diff --git a/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml b/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml
new file mode 100644
index 000000000000..fd2e3f2df54c
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/xlnx,xps-timebase.yaml
@@ -0,0 +1,71 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/xlnx,xps-timebase.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx AXI/PLB softcore and window Watchdog Timer
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+maintainers:
+  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+  - Srinivas Neeli <srinivas.neeli@xilinx.com>
+
+description:
+  The Timebase watchdog timer(WDT) is a free-running 32 bit counter.
+  WDT uses a dual-expiration architecture. After one expiration of
+  the timeout interval, an interrupt is generated and the WDT state
+  bit is set to one in the status register. If the state bit is not
+  cleared (by writing a one to the state bit) before the next
+  expiration of the timeout interval, a WDT reset is generated.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - xlnx,xps-timebase-wdt-1.01.a
+              - xlnx,xps-timebase-wdt-1.00.a
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+
+  clock-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Frequency of clock in Hz
+
+  xlnx,wdt-interval:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Watchdog timeout interval
+    minimum: 8
+    maximum: 32
+
+  xlnx,wdt-enable-once:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description: If watchdog is configured as enable once,
+                 then the watchdog cannot be disabled after
+                 it has been enabled.
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    watchdog@40100000 {
+      compatible = "xlnx,xps-timebase-wdt-1.00.a";
+      reg = <0x40100000 0x1000>;
+      clock-frequency = <50000000>;
+      clocks = <&clkc 15>;
+      xlnx,wdt-enable-once = <0x0>;
+      xlnx,wdt-interval = <0x1b>;
+    } ;
+...