Skip to contentSkip to conversation

dt-bindings: watchdog: marvell octeonTX2 GTI system watchdog driver

PATCH Superseded Bharat Bhushan 2 participants 4 messages Apr 19, 2023 – Apr 21, 2023

Subsystems (2)

v2 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dt-bindings: watchdog: marvell octeonTX2 GTI system watchdog driver

Add binding documentation for the Marvell octeonTX2 GTI system watchdog driver.

---
v2:
- compatible changed from marvell-octeontx2-wdt to marvell,octeontx2-wdt
- corrected type atchdog to watchdog
- Replaced hardcoding to use IRQ_TYPE_EDGE_RISING flag

 .../watchdog/marvell,octeontx2-wdt.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml new file +46 -0
new file mode 100644
index 000000000000..96a979c4082d
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/marvell,octeontx2-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell OcteonTX2 GTI system watchdog
+
+allOf:
+  - $ref: watchdog.yaml#
+
+maintainers:
+  - Bharat Bhushan <[email protected]>
+
+properties:
+  compatible:
+    const: marvell,octeontx2-wdt
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        watchdog@802000040000 {
+          compatible = "marvell,octeontx2-wdt";
+          reg = <0x00008020 0x00040000 0x00000000 0x00020000>;
+          interrupts = <0 38 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+
+...
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/2 Watchdog: Add marvell octeontx2 watchdog driver

This patch add support for Marvell OcteonTX2 watchdog. OcteonTX2 Global timer unit (GTI) support hardware watchdog timer. Software programs watchdog timer to generate interrupt on first timeout, second timeout is configured to be ignored and system reboots on third timeout.

---
v2:
- Using pretimout
- using devm_request_irq()
- Removed extra header files
- dev_err() to dev_err_probe()
- Kconfig and patch description changed

 drivers/watchdog/Kconfig         |  11 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/octeontx2_wdt.c | 271 +++++++++++++++++++++++++++++++
 3 files changed, 283 insertions(+)
 create mode 100644 drivers/watchdog/octeontx2_wdt.c
drivers/watchdog/Kconfig +11 -0
index f0872970daf9..bd52461a19f2 100644
@@ -1779,6 +1779,17 @@ config OCTEON_WDT
 	  from the first interrupt, it is then only poked when the
 	  device is written.
 
+config OCTEONTX2_WATCHDOG
+	tristate "OCTEONTX2 Watchdog driver"
+	depends on ARCH_THUNDER || COMPILE_TEST
+	help
+	 OCTEONTX2 GTI hardware supports watchdog timer. First timeout
+	 works as watchdog pretimeout and installed interrupt handler
+	 will be called on first timeout. Hardware can generate interrupt
+	 to SCP on second timeout but it is not enabled, So second
+	 timeout is ignored. If device poke does not happen then system
+	 will reboot on third timeout.
+
 config BCM2835_WDT
 	tristate "Broadcom BCM2835 hardware watchdog"
 	depends on ARCH_BCM2835 || (OF && COMPILE_TEST)
drivers/watchdog/Makefile +1 -0
index 9cbf6580f16c..aabe1afb0007 100644
@@ -98,6 +98,7 @@ obj-$(CONFIG_VISCONTI_WATCHDOG) += visconti_wdt.o
 obj-$(CONFIG_MSC313E_WATCHDOG) += msc313e_wdt.o
 obj-$(CONFIG_APPLE_WATCHDOG) += apple_wdt.o
 obj-$(CONFIG_SUNPLUS_WATCHDOG) += sunplus_wdt.o
+obj-$(CONFIG_OCTEONTX2_WATCHDOG) += octeontx2_wdt.o
 
 # X86 (i386 + ia64 + x86_64) Architecture
 obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
drivers/watchdog/octeontx2_wdt.c new file +271 -0

271 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw
In reply to Bharat Bhushan
Quoted 50 lines · Bharat Bhushan

Add binding documentation for the Marvell octeonTX2 GTI system watchdog driver.

---
v2:
- compatible changed from marvell-octeontx2-wdt to marvell,octeontx2-wdt
- corrected type atchdog to watchdog
- Replaced hardcoding to use IRQ_TYPE_EDGE_RISING flag

 .../watchdog/marvell,octeontx2-wdt.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml new file +30 -0
new file mode 100644
index 000000000000..96a979c4082d
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/marvell,octeontx2-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell OcteonTX2 GTI system watchdog
+
+allOf:
+  - $ref: watchdog.yaml#
+
+maintainers:
+  - Bharat Bhushan <[email protected]>
+
+properties:
+  compatible:
+    const: marvell,octeontx2-wdt
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        watchdog@802000040000 {
+          compatible = "marvell,octeontx2-wdt";

Mixed indentation. Use 4 spaces for entire DTS example (or 2 spaces, but 4 is preferred).

Best regards,
Krzysztof

#3 lore raw

Please see inline

Quoted 92 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Thursday, April 20, 2023 1:48 AM
To: Bharat Bhushan <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; Sunil Kovvuri Goutham <[email protected]>
Subject: [EXT] Re: [PATCH 1/2 v2] dt-bindings: watchdog: marvell octeonTX2 GTI system watchdog driver

External Email

----------------------------------------------------------------------

Quoted 27 lines · Bharat Bhushan

Add binding documentation for the Marvell octeonTX2 GTI system watchdog driver.

---
v2:
- compatible changed from marvell-octeontx2-wdt to
marvell,octeontx2-wdt
- corrected type atchdog to watchdog
- Replaced hardcoding to use IRQ_TYPE_EDGE_RISING flag

 .../watchdog/marvell,octeontx2-wdt.yaml       | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yam l b/Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt.yam l
new file mode 100644
index 000000000000..96a979c4082d

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt new file +1 -0
+++ .yaml

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt line 5

Quoted 5 lines
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt new file +5 -0
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+https://urldefense.proofpoint.com/v2/url?u=http-3A__devicetree.org_sc
+hemas_watchdog_marvell-2Cocteontx2-2Dwdt.yaml-

23&d=DwICaQ&c=nKjWec2b6

Quoted 1 line

+R0mOyPaz7xtfQ&r=PAAlWswPe7d8gHlGbCLmy2YezyK7O3Hv_t2heGnouBw&m =hfb7o-i

Quoted 1 line

+4kbdpZCZqCfL3wODwKTKYMqbBAjxBKX-

85IvuNz7570vucV6zfDurB06Q&s=OyBAJhs9o

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt

Quoted 4 lines
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt new file +4 -0
+rlzygpBvz9_J9QqbMvx4VStrLu1v4bz09Y&e=
+$schema:
+https://urldefense.proofpoint.com/v2/url?u=http-3A__devicetree.org_me
+ta-2Dschemas_core.yaml-

23&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=PAAlWsw

Quoted 1 line

+Pe7d8gHlGbCLmy2YezyK7O3Hv_t2heGnouBw&m=hfb7o-

i4kbdpZCZqCfL3wODwKTKYMq

Quoted 1 line

+bBAjxBKX-85IvuNz7570vucV6zfDurB06Q&s=nkEezAESMoQl-

1jXRbNmHRErNfyKicAz

Quoted 31 lines
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt new file +31 -0
+DzwdtKiN6Y0&e=
+
+title: Marvell OcteonTX2 GTI system watchdog
+
+allOf:
+  - $ref: watchdog.yaml#
+
+maintainers:
+  - Bharat Bhushan <[email protected]>
+
+properties:
+  compatible:
+    const: marvell,octeontx2-wdt
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
Quoted 8 lines

Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt

Quoted 5 lines
Documentation/devicetree/bindings/watchdog/marvell,octeontx2-wdt new file +5 -0
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        watchdog@802000040000 {
+          compatible = "marvell,octeontx2-wdt";

Mixed indentation. Use 4 spaces for entire DTS example (or 2 spaces, but 4 is preferred).

Will fix in next version.

Thanks
-Bharat

Quoted 3 lines

Best regards,
Krzysztof