Skip to contentSkip to conversation

Add watchdog driver for Sunplus SP7021 SoC

PATCH In review Xiantao Hu 2 participants 4 messages Mar 24, 2022

Subsystems (3)
lore
Share & tools
lore

Xiantao Hu

author maintainer
#0 lore raw

v8 cover Add watchdog driver for Sunplus SP7021 SoC

This is a patch series for watchdog driver for Sunplus SP7021 SoC.

Sunplus SP7021 is an ARM Cortex A7 (4 cores) based SoC. It integrates many peripherals (ex: UART, I2C, SPI, SDIO, eMMC, USB, SD card and etc.) into a single chip. It is designed for industrial control.

Refer to:
https://sunplus-tibbo.atlassian.net/wiki/spaces/doc/overview
https://tibbo.com/store/plus1.html

Xiantao Hu (2):
dt-bindings: watchdog: Add watchdog yaml file for Sunplus SP7021
watchdog: Add watchdog driver for Sunplus SP7021

 .../bindings/watchdog/sunplus,sp7021-wdt.yaml |  47 ++++
 MAINTAINERS                                   |   7 +
 drivers/watchdog/Kconfig                      |  11 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/sunplus_wdt.c                | 220 ++++++++++++++++++
 5 files changed, 286 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
 create mode 100644 drivers/watchdog/sunplus_wdt.c
Signature · 1 line
2.33.1
author maintainer
#1 lore raw

PATCH v8 1/2 dt-bindings: watchdog: Add watchdog yaml file for Sunplus SP7021

This adds the documentation for the devicetree bindings of the Sunplus SP7021 watchdog driver, found from SP7021 SoCs and newer.

---
Changes in v8:
- Addressed all comments from Krzysztof Kozlowski. 1.fix the title.
2.fix the lowercase hex in examples.

 .../bindings/watchdog/sunplus,sp7021-wdt.yaml | 47 +++++++++++++++++++
 MAINTAINERS                                   |  6 +++
 2 files changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml new file +47 -0
new file mode 100644
index 000000000..d90271013
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/sunplus,sp7021-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SoCs Watchdog
+
+maintainers:
+  - XianTao Hu <[email protected]>
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    const: sunplus,sp7021-wdt
+
+  reg:
+    items:
+      - description: watchdog registers regions
+      - description: miscellaneous control registers regions
+
+  clocks:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    watchdog: watchdog@9c000630 {
+        compatible = "sunplus,sp7021-wdt";
+        reg = <0x9c000630 0x08>, <0x9c000274 0x04>;
+        clocks = <&clkc 0x24>;
+        resets = <&rstc 0x14>;
+    };
+...
MAINTAINERS +6 -0
index cd0f68d4a..efdc618a0 100644
@@ -18544,6 +18544,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/rtc/sunplus,sp7021-rtc.yaml
 F:	drivers/rtc/rtc-sunplus.c
 
+SUNPLUS WATCHDOG DRIVER
+M:	Xiantao Hu <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
+
 SUPERH
 M:	Yoshinori Sato <[email protected]>
 M:	Rich Felker <[email protected]>
Signature · 1 line
2.33.1
maintainer Reviewed-by on v8 1/2
#2 lore raw

Re: [PATCH v8 1/2] dt-bindings: watchdog: Add watchdog yaml file for Sunplus SP7021

Quoted 6 lines · Xiantao Hu

This adds the documentation for the devicetree bindings of the Sunplus SP7021 watchdog driver, found from SP7021 SoCs and newer.

Quoted 81 lines

---
Changes in v8:
- Addressed all comments from Krzysztof Kozlowski. 1.fix the title.
2.fix the lowercase hex in examples.

  .../bindings/watchdog/sunplus,sp7021-wdt.yaml | 47 +++++++++++++++++++
  MAINTAINERS                                   |  6 +++
  2 files changed, 53 insertions(+)

create mode 100644 Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml

Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml new file +47 -0
new file mode 100644
index 000000000..d90271013
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/sunplus,sp7021-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SoCs Watchdog
+
+maintainers:
+  - XianTao Hu <[email protected]>
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    const: sunplus,sp7021-wdt
+
+  reg:
+    items:
+      - description: watchdog registers regions
+      - description: miscellaneous control registers regions
+
+  clocks:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    watchdog: watchdog@9c000630 {
+        compatible = "sunplus,sp7021-wdt";
+        reg = <0x9c000630 0x08>, <0x9c000274 0x04>;
+        clocks = <&clkc 0x24>;
+        resets = <&rstc 0x14>;
+    };
+...
MAINTAINERS +6 -0
index cd0f68d4a..efdc618a0 100644
@@ -18544,6 +18544,12 @@ S:	Maintained
  F:	Documentation/devicetree/bindings/rtc/sunplus,sp7021-rtc.yaml
  F:	drivers/rtc/rtc-sunplus.c
 
+SUNPLUS WATCHDOG DRIVER
+M:	Xiantao Hu <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
+
  SUPERH
  M:	Yoshinori Sato <[email protected]>
  M:	Rich Felker <[email protected]>
author maintainer
#3 lore raw

PATCH v8 2/2 watchdog: Add watchdog driver for Sunplus SP7021

In reply to Xiantao Hu

Sunplus SP7021 requires watchdog timer support.
Add watchdog driver to enable this.

---
Changse in v8:
- no change.

 MAINTAINERS                    |   1 +
 drivers/watchdog/Kconfig       |  11 ++
 drivers/watchdog/Makefile      |   1 +
 drivers/watchdog/sunplus_wdt.c | 220 +++++++++++++++++++++++++++++++++
 4 files changed, 233 insertions(+)
 create mode 100644 drivers/watchdog/sunplus_wdt.c
MAINTAINERS +1 -0
index efdc618a0..0ba9e5495 100644
@@ -18549,6 +18549,7 @@ M:	Xiantao Hu <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
+F:	drivers/watchdog/sunplus_wdt.c
 
 SUPERH
 M:	Yoshinori Sato <[email protected]>
drivers/watchdog/Kconfig +11 -0
index c8fa79da2..0639a2dab 100644
@@ -1011,6 +1011,17 @@ config APPLE_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called apple_wdt.
 
+config SUNPLUS_WATCHDOG
+	tristate "Sunplus watchdog support"
+	depends on ARCH_SUNPLUS || COMPILE_TEST
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the watchdog timer
+	  in Sunplus SoCs.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called sunplus_wdt.
+
 # X86 (i386 + ia64 + x86_64) Architecture
 
 config ACQUIRE_WDT
drivers/watchdog/Makefile +1 -0
index f7da867e8..71c933a59 100644
@@ -95,6 +95,7 @@ obj-$(CONFIG_ARM_SMC_WATCHDOG) += arm_smc_wdt.o
 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
 
 # X86 (i386 + ia64 + x86_64) Architecture
 obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
drivers/watchdog/sunplus_wdt.c new file +220 -0

220 lines not on this page · raw message

Signature · 1 line
2.33.1