Skip to contentSkip to conversation

dt-bindings: watchdog: alphascale-asm9260: convert to DT schema

PATCH NAK Om Parikh 3 participants 8 messages Apr 3, 2023 – Apr 6, 2023

Subsystems (2)
lore
Share & tools
lore

Om Parikh

author
#0 lore raw

PATCH 1/1 dt-bindings: watchdog: alphascale-asm9260: convert to DT schema

this patch replaces the txt file and adds YAML bindings file adhering to the json-schema for alphascale-asm9260. It is a demo patch for potential further contributions to the GSOC project.

(see: https://wiki.linuxfoundation.org/gsoc/2023-gsoc-device-tree-bindings)

---
 .../watchdog/alphascale,asm9260-wdt.yaml      | 76 +++++++++++++++++++
 .../bindings/watchdog/alphascale-asm9260.txt  | 35 ---------
 2 files changed, 76 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +76 -0
new file mode 100644
index 000000000000..1f7baaf6b0f3
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/alphascale,asm9260-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Alphascale asm9260 Watchdog timer
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+maintainers:
+  - Oleksij Rempel <[email protected]>
+  - Olof Johansson <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - alphascale,asm9260
+      - alphascale,asm9260devkit
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: source clock, used for tick counter
+      - description: ahb gate
+
+  clock-names:
+    items:
+      - const: mod
+      - const: ahb
+
+  interrupts:
+    maxItems: 1
+
+  resets:
+    items:
+      - description: phandle pointing to the system reset controller with line
+                     index for the watchdog.
+
+  reset-names:
+    items:
+      - const: wdt_rst
+
+  timeout-sec: true
+
+  alphascale,mode:
+    description: to specify the reset mode of operation
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [hw, sw, debug]
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - resets
+  - reset-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/alphascale,asm9260.h>
+    watchdog0: watchdog@80048000 {
+      compatible = "alphascale,asm9260-wdt";
+      reg = <0x80048000 0x10>;
+      clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
+      clock-names = "mod", "ahb";
+      interrupts = <55>;
+      timeout-sec = <30>;
+      alphascale,mode = "hw";
+    };
Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt deleted +0 -35
deleted file mode 100644
index 75b265a04047..000000000000
@@ -1,35 +0,0 @@
-Alphascale asm9260 Watchdog timer
-
-Required properties:
-
-- compatible : should be "alphascale,asm9260-wdt".
-- reg : Specifies base physical address and size of the registers.
-- clocks : the clocks feeding the watchdog timer. See clock-bindings.txt
-- clock-names : should be set to
-	"mod" - source for tick counter.
-	"ahb" - ahb gate.
-- resets : phandle pointing to the system reset controller with
-	line index for the watchdog.
-- reset-names : should be set to "wdt_rst".
-
-Optional properties:
-- timeout-sec : shall contain the default watchdog timeout in seconds,
-	if unset, the default timeout is 30 seconds.
-- alphascale,mode : three modes are supported
-	"hw" - hw reset (default).
-	"sw" - sw reset.
-	"debug" - no action is taken.
-
-Example:
-
-watchdog0: watchdog@80048000 {
-	compatible = "alphascale,asm9260-wdt";
-	reg = <0x80048000 0x10>;
-	clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
-	clock-names = "mod", "ahb";
-	interrupts = <55>;
-	resets = <&rst WDT_RESET>;
-	reset-names = "wdt_rst";
-	timeout-sec = <30>;
-	alphascale,mode = "hw";
-};
Signature · 1 line
2.40.0
#1 lore raw
Quoted 1 line · Om Parikh

this patch replaces the txt file and adds YAML bindings file

Do not use "This commit/patch", but imperative mood. See:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Use full sentences, so start with capital letter.

Quoted 3 lines

adhering to the json-schema for alphascale-asm9260. It is a demo patch for potential further contributions to the GSOC project.

Drop unrelated messages.

Quoted 2 lines

(see: https://wiki.linuxfoundation.org/gsoc/2023-gsoc-device-tree-bindings)

Drop, not related to Linux kernel.

Anyway, send your patches first through you mentor, so we won't have to comment on trivial things.

Daniel,
Are you doing a review of your mentees?

Quoted 15 lines
---
 .../watchdog/alphascale,asm9260-wdt.yaml      | 76 +++++++++++++++++++
 .../bindings/watchdog/alphascale-asm9260.txt  | 35 ---------
 2 files changed, 76 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +0 -0
new file mode 100644
index 000000000000..1f7baaf6b0f3

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +10 -0
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/alphascale,asm9260-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Alphascale asm9260 Watchdog timer
+
+allOf:
+  - $ref: "watchdog.yaml#"

Drop quotes.

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml line 20

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +10 -0
+
+maintainers:
+  - Oleksij Rempel <[email protected]>
+  - Olof Johansson <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - alphascale,asm9260
+      - alphascale,asm9260devkit

NAK, this does not make any sense. I don't understand what do you want to document here. These are boards.

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to Om Parikh
Quoted 7 lines · Om Parikh

this patch replaces the txt file and adds YAML bindings file adhering to the json-schema for alphascale-asm9260. It is a demo patch for potential further contributions to the GSOC project.

(see: https://wiki.linuxfoundation.org/gsoc/2023-gsoc-device-tree-bindings)

Quoted 8 lines
---
 .../watchdog/alphascale,asm9260-wdt.yaml      | 76 +++++++++++++++++++
 .../bindings/watchdog/alphascale-asm9260.txt  | 35 ---------
 2 files changed, 76 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.example.dtb: /example-0/watchdog@80048000: failed to match any schema with compatible: ['alphascale,asm9260-wdt']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

author
#3 lore raw

PATCH 1/1 dt-bindings: watchdog: alphascale-asm9260: convert to DT schema

In reply to Om Parikh

Makes alphascale-asm9260 dt bindings adhere to the dt json-schema by replacing txt file with yaml file.

---
 .../watchdog/alphascale,asm9260-wdt.yaml      | 73 +++++++++++++++++++
 .../bindings/watchdog/alphascale-asm9260.txt  | 35 ---------
 2 files changed, 73 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +73 -0
new file mode 100644
index 000000000000..ceee5f086e4a
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/alphascale,asm9260-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Alphascale asm9260 Watchdog timer
+
+allOf:
+  - $ref: watchdog.yaml#
+
+maintainers:
+  - Oleksij Rempel <[email protected]>
+  - Olof Johansson <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - alphascale,asm9260-wdt
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: source clock, used for tick counter
+      - description: ahb gate
+
+  clock-names:
+    items:
+      - const: mod
+      - const: ahb
+
+  interrupts:
+    maxItems: 1
+
+  resets:
+    items:
+      - description: phandle pointing to the system reset controller with line
+                     index for the watchdog.
+
+  reset-names:
+    items:
+      - const: wdt_rst
+
+  timeout-sec: true
+
+  alphascale,mode:
+    description: to specify the reset mode of operation
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [hw, sw, debug]
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/alphascale,asm9260.h>
+    watchdog0: watchdog@80048000 {
+      compatible = "alphascale,asm9260-wdt";
+      reg = <0x80048000 0x10>;
+      clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
+      clock-names = "mod", "ahb";
+      interrupts = <55>;
+      timeout-sec = <30>;
+      alphascale,mode = "hw";
+    };
Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt deleted +0 -35
deleted file mode 100644
index 75b265a04047..000000000000
@@ -1,35 +0,0 @@
-Alphascale asm9260 Watchdog timer
-
-Required properties:
-
-- compatible : should be "alphascale,asm9260-wdt".
-- reg : Specifies base physical address and size of the registers.
-- clocks : the clocks feeding the watchdog timer. See clock-bindings.txt
-- clock-names : should be set to
-	"mod" - source for tick counter.
-	"ahb" - ahb gate.
-- resets : phandle pointing to the system reset controller with
-	line index for the watchdog.
-- reset-names : should be set to "wdt_rst".
-
-Optional properties:
-- timeout-sec : shall contain the default watchdog timeout in seconds,
-	if unset, the default timeout is 30 seconds.
-- alphascale,mode : three modes are supported
-	"hw" - hw reset (default).
-	"sw" - sw reset.
-	"debug" - no action is taken.
-
-Example:
-
-watchdog0: watchdog@80048000 {
-	compatible = "alphascale,asm9260-wdt";
-	reg = <0x80048000 0x10>;
-	clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
-	clock-names = "mod", "ahb";
-	interrupts = <55>;
-	resets = <&rst WDT_RESET>;
-	reset-names = "wdt_rst";
-	timeout-sec = <30>;
-	alphascale,mode = "hw";
-};
Signature · 1 line
2.40.0
author
#4 lore raw

Thanks for the feedback, I have incorporated the fixes in the patch. Warnings generated from checkpatch.pl script seems to be false positive in this case.

------- Original Message -------

Quoted 146 lines · Om Parikh

Makes alphascale-asm9260 dt bindings adhere to the dt json-schema by replacing txt file with yaml file.

---
.../watchdog/alphascale,asm9260-wdt.yaml | 73 +++++++++++++++++++ .../bindings/watchdog/alphascale-asm9260.txt | 35 ---------

2 files changed, 73 insertions(+), 35 deletions(-)

create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +73 -0
new file mode 100644
index 000000000000..ceee5f086e4a
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/alphascale,asm9260-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Alphascale asm9260 Watchdog timer
+
+allOf:
+ - $ref: watchdog.yaml#
+
+maintainers:
+ - Oleksij Rempel [email protected]
 
+ - Olof Johansson [email protected]
 
+
+properties:
+ compatible:
+ enum:
+ - alphascale,asm9260-wdt
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: source clock, used for tick counter
+ - description: ahb gate
+
+ clock-names:
+ items:
+ - const: mod
+ - const: ahb
+
+ interrupts:
+ maxItems: 1
+
+ resets:
+ items:
+ - description: phandle pointing to the system reset controller with line
+ index for the watchdog.
+
+ reset-names:
+ items:
+ - const: wdt_rst
+
+ timeout-sec: true
+
+ alphascale,mode:
+ description: to specify the reset mode of operation
+ $ref: /schemas/types.yaml#/definitions/string
+ enum: [hw, sw, debug]
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - interrupts
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/alphascale,asm9260.h>
 
+ watchdog0: watchdog@80048000 {
+ compatible = "alphascale,asm9260-wdt";
+ reg = <0x80048000 0x10>;
 
+ clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
 
+ clock-names = "mod", "ahb";
+ interrupts = <55>;
 
+ timeout-sec = <30>;
 
+ alphascale,mode = "hw";
+ };
Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt deleted +0 -36
deleted file mode 100644
index 75b265a04047..000000000000
@@ -1,35 +0,0 @@
-Alphascale asm9260 Watchdog timer
-
-Required properties:
-
-- compatible : should be "alphascale,asm9260-wdt".
-- reg : Specifies base physical address and size of the registers.
-- clocks : the clocks feeding the watchdog timer. See clock-bindings.txt
-- clock-names : should be set to
- "mod" - source for tick counter.
- "ahb" - ahb gate.
-- resets : phandle pointing to the system reset controller with
- line index for the watchdog.
-- reset-names : should be set to "wdt_rst".
-
-Optional properties:
-- timeout-sec : shall contain the default watchdog timeout in seconds,
- if unset, the default timeout is 30 seconds.
-- alphascale,mode : three modes are supported
- "hw" - hw reset (default).
- "sw" - sw reset.
- "debug" - no action is taken.
-
-Example:
-
-watchdog0: watchdog@80048000 {
- compatible = "alphascale,asm9260-wdt";
- reg = <0x80048000 0x10>;
 
- clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
 
- clock-names = "mod", "ahb";
- interrupts = <55>;
 
- resets = <&rst WDT_RESET>;
 
- reset-names = "wdt_rst";
- timeout-sec = <30>;
 
- alphascale,mode = "hw";
-};
--

2.40.0

#5 lore raw
Quoted 2 lines · On 04/04/2023 04:32, hack3r-0m wrote:

Thanks for the feedback, I have incorporated the fixes in the patch. Warnings generated from checkpatch.pl script seems to be false positive in this case.

I don't know what do you refer to. You top posted and answered to duplicated email?

Best regards,
Krzysztof

#6 lore raw
In reply to Om Parikh
Quoted 5 lines · Om Parikh

Makes alphascale-asm9260 dt bindings adhere to the dt json-schema by replacing txt file with yaml file.

---

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets.

This is the same patch you already sent, so a resend? Sorry, I am not going to review again. You got comments. If this is v2, then send a v2 with changelog.

Best regards,
Krzysztof

maintainer
#7 lore raw
In reply to Om Parikh
Quoted 21 lines · Om Parikh

Makes alphascale-asm9260 dt bindings adhere to the dt json-schema by replacing txt file with yaml file.

---
 .../watchdog/alphascale,asm9260-wdt.yaml      | 73 +++++++++++++++++++
 .../bindings/watchdog/alphascale-asm9260.txt  | 35 ---------
 2 files changed, 73 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +4 -0
new file mode 100644
index 000000000000..ceee5f086e4a
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/alphascale,asm9260-wdt.yaml#

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Alphascale asm9260 Watchdog timer
+
+allOf:
+  - $ref: watchdog.yaml#
+
+maintainers:
+  - Oleksij Rempel <[email protected]>
+  - Olof Johansson <[email protected]>

I'm not sure how you came up with Olof for this, but you should drop him.

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml line 19

Quoted 5 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +5 -0
+
+properties:
+  compatible:
+    enum:
+      - alphascale,asm9260-wdt

const: alphascale,asm9260-wdt

Quoted 11 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +11 -0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: source clock, used for tick counter
+      - description: ahb gate
+
+  clock-names:
+    items:

Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +10 -0
+      - const: mod
+      - const: ahb
+
+  interrupts:
+    maxItems: 1
+
+  resets:
+    items:
+      - description: phandle pointing to the system reset controller with line
+                     index for the watchdog.

Not really a useful description. Just 'maxItems: 1' is fine.

Quoted 78 lines
Documentation/devicetree/bindings/watchdog/alphascale,asm9260-wdt.yaml new file +33 -0
+
+  reset-names:
+    items:
+      - const: wdt_rst
+
+  timeout-sec: true
+
+  alphascale,mode:
+    description: to specify the reset mode of operation
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: [hw, sw, debug]
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/alphascale,asm9260.h>
+    watchdog0: watchdog@80048000 {
+      compatible = "alphascale,asm9260-wdt";
+      reg = <0x80048000 0x10>;
+      clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
+      clock-names = "mod", "ahb";
+      interrupts = <55>;
+      timeout-sec = <30>;
+      alphascale,mode = "hw";
+    };
Documentation/devicetree/bindings/watchdog/alphascale-asm9260.txt deleted +0 -35
deleted file mode 100644
index 75b265a04047..000000000000
@@ -1,35 +0,0 @@
-Alphascale asm9260 Watchdog timer
-
-Required properties:
-
-- compatible : should be "alphascale,asm9260-wdt".
-- reg : Specifies base physical address and size of the registers.
-- clocks : the clocks feeding the watchdog timer. See clock-bindings.txt
-- clock-names : should be set to
-	"mod" - source for tick counter.
-	"ahb" - ahb gate.
-- resets : phandle pointing to the system reset controller with
-	line index for the watchdog.
-- reset-names : should be set to "wdt_rst".
-
-Optional properties:
-- timeout-sec : shall contain the default watchdog timeout in seconds,
-	if unset, the default timeout is 30 seconds.
-- alphascale,mode : three modes are supported
-	"hw" - hw reset (default).
-	"sw" - sw reset.
-	"debug" - no action is taken.
-
-Example:
-
-watchdog0: watchdog@80048000 {
-	compatible = "alphascale,asm9260-wdt";
-	reg = <0x80048000 0x10>;
-	clocks = <&acc CLKID_SYS_WDT>, <&acc CLKID_AHB_WDT>;
-	clock-names = "mod", "ahb";
-	interrupts = <55>;
-	resets = <&rst WDT_RESET>;
-	reset-names = "wdt_rst";
-	timeout-sec = <30>;
-	alphascale,mode = "hw";
-};
Signature · 1 line
2.40.0