Skip to contentSkip to conversation

Add Watchdog for H6

PATCH Superseded Clément Péron 2 participants 8 messages Apr 11, 2019 – Apr 25, 2019

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Watchdog for H6

Hi,

Allwinner H6 SoC has two watchdogs. The documented watchdog is identicaly the same reading the user manual as the one used in the A64.

After investigation it seems that on some SoC the first watchdog doesn't make the board reboot.
Some tests has been performed and it seems that first H6 version aren't affected only the latest one.

Chen-Yu Tsai's boards:
Pine H64 - H6 V200-AWIN H6448BA 7782 => OK
OrangePi Lite 2 - H6 V200-AWIN H8068BA 61C2 => KO

Clément Péron's board:
Beelink GS1 - H6 V200-AWIN H7309BA 6842 => KO

I think it could good to add it with a comment anyway. In case a user want to activate it and isn't aware of this issue.

The r_watchdog is still available and usable on all the H6 boards.

Thanks,
Clément

Clément Péron (3):
arm64: dts: allwinner: h6: add watchdog node
arm64: dts: allwinner: h6: add r_watchog node
arm64: defconfig: Enable Sunxi watchdog

 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 16 ++++++++++++++++
 arch/arm64/configs/defconfig                 |  1 +
 2 files changed, 17 insertions(+)
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/3 arm64: dts: allwinner: h6: add r_watchog node

Allwinner H6 has a r_watchdog similar to A64.

Declare it in the device-tree.

---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +7 -0
index 5c2f5451227b..66dc684a378e 100644
@@ -622,6 +622,13 @@
 			#reset-cells = <1>;
 		};
 
+		r_watchdog: watchdog@7020400 {
+			compatible = "allwinner,sun50i-a64-wdt",
+				     "allwinner,sun6i-a31-wdt";
+			reg = <0x07020400 0x20>;
+			interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		r_intc: interrupt-controller@7021000 {
 			compatible = "allwinner,sun50i-h6-r-intc",
 				     "allwinner,sun6i-a31-r-intc";
Signature · 1 line
2.17.1
#6 lore raw

PATCH v2 3/3 arm64: defconfig: Enable Sunxi watchdog

In reply to Clément Péron

The SUNXI_WATCHDOG option is required to make the
watchdog available on Allwinner H6.

Enable this option as a module.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 2d9c39033c1a..c266d6babbcc 100644
@@ -426,6 +426,7 @@ CONFIG_UNIPHIER_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_ARM_SP805_WATCHDOG=y
 CONFIG_S3C2410_WATCHDOG=y
+CONFIG_SUNXI_WATCHDOG=m
 CONFIG_IMX2_WDT=y
 CONFIG_MESON_GXBB_WATCHDOG=m
 CONFIG_MESON_WATCHDOG=m
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 arm64: dts: allwinner: h6: add watchdog node

In reply to Clément Péron

Allwinner H6 has a watchog identical to A64 one.

Declare it in the device tree but leave it disable with a comment as it is broken on some H6 revisions.

Test has been performs on 3 boards.

Chen-Yu Tsai boards:
Pine H64 - H6 V200-AWIN H6448BA 7782 => OK
OrangePi Lite 2 - H6 V200-AWIN H8068BA 61C2 => KO

Clément Péron board:
Beelink GS1 - H6 V200-AWIN H7309BA 6842 => KO

---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +9 -0
index e0dc4a05c1ba..5c2f5451227b 100644
@@ -208,6 +208,15 @@
 			reg = <0x03006000 0x400>;
 		};
 
+		watchdog: watchdog@30090a0 {
+			compatible = "allwinner,sun50i-a64-wdt",
+				     "allwinner,sun6i-a31-wdt";
+			reg = <0x030090a0 0x20>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+			/* Broken on some H6 rev */
+			status = "disabled";
+		};
+
 		pio: pinctrl@300b000 {
 			compatible = "allwinner,sun50i-h6-pinctrl";
 			reg = <0x0300b000 0x400>;
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#7 lore raw
In reply to Clément Péron
Quoted 15 lines · Clément Péron

Hi,

Allwinner H6 SoC has two watchdogs. The documented watchdog is identicaly the same reading the user manual as the one used in the A64.

After investigation it seems that on some SoC the first watchdog doesn't make the board reboot.
Some tests has been performed and it seems that first H6 version aren't affected only the latest one.

Chen-Yu Tsai's boards:
Pine H64 - H6 V200-AWIN H6448BA 7782 => OK
OrangePi Lite 2 - H6 V200-AWIN H8068BA 61C2 => KO

Quoted 7 lines

Clément Péron's board:
Beelink GS1 - H6 V200-AWIN H7309BA 6842 => KO

I think it could good to add it with a comment anyway. In case a user want to activate it and isn't aware of this issue.

The r_watchdog is still available and usable on all the H6 boards.

Changes since v1:
- Use A64 compatible instead of H6
- Remove dt-bindings patch
- Change watchdog status to disabled
- Add r_watchdog node patch
- Add enable sunxi watchdog patch

Quoted 16 lines

Thanks,
Clément

Clément Péron (3):
arm64: dts: allwinner: h6: add watchdog node
arm64: dts: allwinner: h6: add r_watchog node
arm64: defconfig: Enable Sunxi watchdog

 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 16 ++++++++++++++++
 arch/arm64/configs/defconfig                 |  1 +
 2 files changed, 17 insertions(+)

--
2.17.1

#3 lore raw

Re: [PATCH v2 2/3] arm64: dts: allwinner: h6: add r_watchog node

In reply to Clément Péron

Hi,

Quoted 15 lines · Clément Péron

Allwinner H6 has a r_watchdog similar to A64.

Declare it in the device-tree.

---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +0 -0
index 5c2f5451227b..66dc684a378e 100644

arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi line 630

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +6 -0
@@ -622,6 +622,13 @@
                        #reset-cells = <1>;
                };
 
+               r_watchdog: watchdog@7020400 {
+                       compatible = "allwinner,sun50i-a64-wdt",
+                                    "allwinner,sun6i-a31-wdt";
+                       reg = <0x07020400 0x20>;
+                       interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+               };

I have set the same compatible as A64 because regarding the User Manual they have exactly the same memory mapping.
However we don't know really if it's the same IP version, maybe there will be an errata one day.
So I would like to know if it's better to define the h6-wdt also
compatible = "allwinner,sun50i-h6-wdt", "allwinner,sun50i-a64-wdt",

                                 "allwinner,sun6i-a31-wdt";

I would say Yes, but with this logic we would have to had a new compatible each time there is a new SoC.

Thanks,
Clement

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +1 -1
+
                r_intc: interrupt-controller@7021000 {
                        compatible = "allwinner,sun50i-h6-r-intc",
                                     "allwinner,sun6i-a31-r-intc";
--

2.17.1

#4 lore raw

Re: [PATCH v2 2/3] arm64: dts: allwinner: h6: add r_watchog node

Quoted 34 lines · Clément Péron

Hi,

Quoted 15 lines · Clément Péron

Allwinner H6 has a r_watchdog similar to A64.

Declare it in the device-tree.

---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +0 -0
index 5c2f5451227b..66dc684a378e 100644

arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi line 630

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +6 -0
@@ -622,6 +622,13 @@
                        #reset-cells = <1>;
                };
 
+               r_watchdog: watchdog@7020400 {
+                       compatible = "allwinner,sun50i-a64-wdt",
+                                    "allwinner,sun6i-a31-wdt";
+                       reg = <0x07020400 0x20>;
+                       interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+               };

I have set the same compatible as A64 because regarding the User Manual they have exactly the same memory mapping.
However we don't know really if it's the same IP version, maybe there will be an errata one day.
So I would like to know if it's better to define the h6-wdt also
compatible = "allwinner,sun50i-h6-wdt", "allwinner,sun50i-a64-wdt",

Quoted 4 lines
                                 "allwinner,sun6i-a31-wdt";

I would say Yes, but with this logic we would have to had a new compatible each time there is a new SoC.

Why not just having the A31 compatible?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
#5 lore raw

Re: [PATCH v2 2/3] arm64: dts: allwinner: h6: add r_watchog node

Quoted 38 lines · Maxime Ripard
Quoted 36 lines · Clément Péron

Hi,

Quoted 15 lines · Clément Péron

Allwinner H6 has a r_watchdog similar to A64.

Declare it in the device-tree.

---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +0 -0
index 5c2f5451227b..66dc684a378e 100644

arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi line 630

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +6 -0
@@ -622,6 +622,13 @@
                        #reset-cells = <1>;
                };
 
+               r_watchdog: watchdog@7020400 {
+                       compatible = "allwinner,sun50i-a64-wdt",
+                                    "allwinner,sun6i-a31-wdt";
+                       reg = <0x07020400 0x20>;
+                       interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+               };

I have set the same compatible as A64 because regarding the User Manual they have exactly the same memory mapping.
However we don't know really if it's the same IP version, maybe there will be an errata one day.
So I would like to know if it's better to define the h6-wdt also
compatible = "allwinner,sun50i-h6-wdt", "allwinner,sun50i-a64-wdt",

                                 "allwinner,sun6i-a31-wdt";
Quoted 3 lines
Quoted 2 lines

I would say Yes, but with this logic we would have to had a new compatible each time there is a new SoC.

Hi,

Quoted 1 line

Why not just having the A31 compatible?

H6 has a lightly differences in registers with A31 but it's the same as 64 (WDOG_KEY_FIELD)

As the A64 is already introduced if think it's a good solution to reuse it.

Clément

Quoted 7 lines

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com