Skip to contentSkip to conversation

dt-bindings: watchdog: marvell GTI system watchdog driver

PATCH Superseded Bharat Bhushan 2 participants 3 messages Aug 1, 2023

Subsystems (2)

v10 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

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

Add binding documentation for the Marvell GTI system watchdog driver.

---
v10:
- Added Reviewed by Krzysztof Kozlowski

v9:
- Rename binding file name from marvell,octeontx2-wdt.yaml to marvell,cn10624-wdt.yaml
- "allOf: - $ref: watchdog.yaml#" moved after maintainers
- clocks have maxItems rather than minItems
- Added "clock-names" name defination
- Added Fallback to compatible

v8:
- Compatible name as per soc name

 .../watchdog/marvell,cn10624-wdt.yaml         | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/marvell,cn10624-wdt.yaml
Documentation/devicetree/bindings/watchdog/marvell,cn10624-wdt.yaml new file +83 -0
new file mode 100644
index 000000000000..1b583f232e53
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/marvell,cn10624-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Global Timer (GTI) system watchdog
+
+maintainers:
+  - Bharat Bhushan <[email protected]>
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - marvell,cn9670-wdt
+          - marvell,cn10624-wdt
+
+      - items:
+          - enum:
+              - marvell,cn9880-wdt
+              - marvell,cnf9535-wdt
+          - const: marvell,cn9670-wdt
+
+      - items:
+          - enum:
+              - marvell,cn10308-wdt
+              - marvell,cnf10518-wdt
+          - const: marvell,cn10624-wdt
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: refclk
+
+  marvell,wdt-timer-index:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 63
+    description:
+      An SoC have many timers (up to 64), firmware can reserve one or more timer
+      for some other use case and configures one of the global timer as watchdog
+      timer. Firmware will update this field with the timer number configured
+      as watchdog timer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        watchdog@802000040000 {
+            compatible = "marvell,cn9670-wdt";
+            reg = <0x00008020 0x00040000 0x00000000 0x00020000>;
+            interrupts = <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
+            clocks = <&sclk>;
+            clock-names = "refclk";
+            marvell,wdt-timer-index = <63>;
+        };
+    };
+
+...
Signature · 1 line
2.17.1
#1 lore raw

PATCH v10 2/2 Watchdog: Add marvell GTI watchdog driver

This patch add support for Marvell GTI watchdog. 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.

---
v10:
- Added MODULE_LICENSE

v9:
- include header files is alphabetic order
- using BIT_ULL for bit shifts in macros
- using devm_clk_get_enabled() rather than
devm_clk_get() and clk_prepare_enable()
- compatibles as per dt-binding changes

v8:
- Compatible names as per soc names
- This driver run on ARM64 based architecture, Added 64BIT config dependency to avoid compilation error related to readq/writeq on 32 as platform (Hexagon)

 drivers/watchdog/Kconfig           |  13 ++
 drivers/watchdog/Makefile          |   1 +
 drivers/watchdog/marvell_gti_wdt.c | 340 +++++++++++++++++++++++++++++
 3 files changed, 354 insertions(+)
 create mode 100644 drivers/watchdog/marvell_gti_wdt.c
drivers/watchdog/Kconfig +13 -0
index ee97d89dfc11..87ac222b436e 100644
@@ -1797,6 +1797,19 @@ config OCTEON_WDT
 	  from the first interrupt, it is then only poked when the
 	  device is written.
 
+config MARVELL_GTI_WDT
+	tristate "Marvell GTI Watchdog driver"
+	depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT)
+	default y
+	select WATCHDOG_CORE
+	help
+	 Marvell 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 3633f5b98236..7eab9de311cb 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_MARVELL_GTI_WDT) += marvell_gti_wdt.o
 
 # X86 (i386 + ia64 + x86_64) Architecture
 obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
drivers/watchdog/marvell_gti_wdt.c new file +340 -0

340 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 2/2 v10] Watchdog: Add marvell GTI watchdog driver

Quoted 8 lines · Bharat Bhushan
drivers/watchdog/Kconfig +0 -0
index ee97d89dfc11..87ac222b436e 100644
@@ -1797,6 +1797,19 @@ config OCTEON_WDT
 	  from the first interrupt, it is then only poked when the
 	  device is written.
 

drivers/watchdog/Kconfig config OCTEON_WDT · line 1809

Quoted 10 lines
drivers/watchdog/Kconfig +10 -0
+config MARVELL_GTI_WDT
+	tristate "Marvell GTI Watchdog driver"
+	depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT)
+	default y
+	select WATCHDOG_CORE
+	help
+	 Marvell 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

enabled, so second

drivers/watchdog/Kconfig config OCTEON_WDT · line 1811

Quoted 2 lines
drivers/watchdog/Kconfig +2 -0
+	 timeout is ignored. If device poke does not happen then system
+	 will reboot on third timeout.

All Kconfig help text should be indented with one tab + 2 spaces according to coding-style.rst.

Signature · 1 line
~Randy