2021-06-11 20:12:12

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 0/3] Add watchdog for Mstar SoCs

This patches series adds a new driver for the watchdog found in the Mstar
MSC313e SoCs and newer. It adds a basic watchdog driver, the
corresponding devicetree bindings and its documentation.

This work has been co-developed with Daniel Palmer.

Changes since v3:
- Rebased onto v5.13-rc5
- Added Reviewed-by tags

Changes since v2:
- Renamed the dt-bindings documentation to mstar,msc313e-wdt.yaml
- Fixed the subject of the first commit
- Dropped unused dt labels

Changes since v1:
- Dropped "depends OF" from Kconfig (not required)
- Dropped unneeded include files
- Re-ordered include files
- Compute timeout_max dynamically from the probe function to avoid
an overflow in _start().

Daniel Palmer (1):
watchdog: Add Mstar MSC313e WDT driver

Romain Perier (2):
dt-bindings: watchdog: Add Mstar MSC313e WDT devicetree bindings
documentation
ARM: dts: mstar: Add watchdog device_node definition

.../bindings/watchdog/mstar,msc313e-wdt.yaml | 40 +++++
MAINTAINERS | 1 +
arch/arm/boot/dts/mstar-v7.dtsi | 14 ++
drivers/watchdog/Kconfig | 12 ++
drivers/watchdog/Makefile | 1 +
drivers/watchdog/msc313e_wdt.c | 166 ++++++++++++++++++
6 files changed, 234 insertions(+)
create mode 100644 Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml
create mode 100644 drivers/watchdog/msc313e_wdt.c

--
2.30.2


2021-06-11 20:12:30

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 3/3] ARM: dts: mstar: Add watchdog device_node definition

This adds the definition of both an oscillator at 12Mhz required by the
the watchdog and the watchdog device_node.

Signed-off-by: Romain Perier <[email protected]>
---
arch/arm/boot/dts/mstar-v7.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi
index 075d583d6f40..2273295e140f 100644
--- a/arch/arm/boot/dts/mstar-v7.dtsi
+++ b/arch/arm/boot/dts/mstar-v7.dtsi
@@ -60,6 +60,14 @@ rtc_xtal: rtc_xtal {
clock-frequency = <32768>;
status = "disabled";
};
+
+ xtal_div2: xtal_div2 {
+ #clock-cells = <0>;
+ compatible = "fixed-factor-clock";
+ clocks = <&xtal>;
+ clock-div = <2>;
+ clock-mult = <1>;
+ };
};

soc: soc {
@@ -101,6 +109,12 @@ reboot {
mask = <0x79>;
};

+ watchdog@6000 {
+ compatible = "mstar,msc313e-wdt";
+ reg = <0x6000 0x1f>;
+ clocks = <&xtal_div2>;
+ };
+
intc_fiq: interrupt-controller@201310 {
compatible = "mstar,mst-intc";
reg = <0x201310 0x40>;
--
2.30.2

2021-06-11 20:12:47

by Romain Perier

[permalink] [raw]
Subject: [PATCH v4 1/3] dt-bindings: watchdog: Add Mstar MSC313e WDT devicetree bindings documentation

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

Signed-off-by: Romain Perier <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
.../bindings/watchdog/mstar,msc313e-wdt.yaml | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml
new file mode 100644
index 000000000000..e3e8b86dbf63
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/mstar,msc313e-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar Watchdog Device Tree Bindings
+
+maintainers:
+ - Daniel Palmer <[email protected]>
+ - Romain Perier <[email protected]>
+
+allOf:
+ - $ref: watchdog.yaml#
+
+properties:
+ compatible:
+ enum:
+ - mstar,msc313e-wdt
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - clocks
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ watchdog@6000 {
+ compatible = "mstar,msc313e-wdt";
+ reg = <0x6000 0x1f>;
+ clocks = <&xtal_div2>;
+ };
--
2.30.2

2021-06-12 13:02:34

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v4 0/3] Add watchdog for Mstar SoCs

On Fri, Jun 11, 2021 at 10:07:58PM +0200, Romain Perier wrote:
> This patches series adds a new driver for the watchdog found in the Mstar
> MSC313e SoCs and newer. It adds a basic watchdog driver, the
> corresponding devicetree bindings and its documentation.
>
> This work has been co-developed with Daniel Palmer.
>
> Changes since v3:
> - Rebased onto v5.13-rc5
> - Added Reviewed-by tags

This works better. I applied patches 1 & 2 to my watchdog-next branch for
hand-off to Wim. Note that the arm dts patch needs to be pushed through the
arm tree.

Thanks,
Guenter

>
> Changes since v2:
> - Renamed the dt-bindings documentation to mstar,msc313e-wdt.yaml
> - Fixed the subject of the first commit
> - Dropped unused dt labels
>
> Changes since v1:
> - Dropped "depends OF" from Kconfig (not required)
> - Dropped unneeded include files
> - Re-ordered include files
> - Compute timeout_max dynamically from the probe function to avoid
> an overflow in _start().
>
> Daniel Palmer (1):
> watchdog: Add Mstar MSC313e WDT driver
>
> Romain Perier (2):
> dt-bindings: watchdog: Add Mstar MSC313e WDT devicetree bindings
> documentation
> ARM: dts: mstar: Add watchdog device_node definition
>
> .../bindings/watchdog/mstar,msc313e-wdt.yaml | 40 +++++
> MAINTAINERS | 1 +
> arch/arm/boot/dts/mstar-v7.dtsi | 14 ++
> drivers/watchdog/Kconfig | 12 ++
> drivers/watchdog/Makefile | 1 +
> drivers/watchdog/msc313e_wdt.c | 166 ++++++++++++++++++
> 6 files changed, 234 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/watchdog/mstar,msc313e-wdt.yaml
> create mode 100644 drivers/watchdog/msc313e_wdt.c
>
> --
> 2.30.2
>

2021-06-12 17:11:09

by Daniel Palmer

[permalink] [raw]
Subject: Re: [PATCH v4 0/3] Add watchdog for Mstar SoCs

Hi Guenter, Romain,

On Sat, 12 Jun 2021 at 21:59, Guenter Roeck <[email protected]> wrote:
> This works better. I applied patches 1 & 2 to my watchdog-next branch for
> hand-off to Wim. Note that the arm dts patch needs to be pushed through the
> arm tree.

I will take the dts patch and send a PR with it to the arm tree.

Cheers,

Daniel