Skip to contentSkip to conversation

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

PATCH Superseded Bharat Bhushan 1 participant 2 messages Apr 19, 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