Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v4 0/5] Allwinner H6 watchdog support
@ 2019-05-21 16:03 Clément Péron
  2019-05-21 16:03 ` [PATCH v4 1/5] dt-bindings: watchdog: add Allwinner H6 watchdog Clément Péron
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

Hi,

Allwinner H6 SoC has two watchdogs.

As we are not sure that both A64 and H6 are stricly identical, I have
introduced the H6 bindings.

After investigation it seems that on some boards the first watchdog doesn't
make it properly reboot. Please see details in the commit log.

I think it's proper to add it with a comment anyway.

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

Thanks,
Clément

Changes since v3:
 - Remove A64 compatible
 - Introduce specific bindings for r-wdt

Changes since v2:
 - Reintroduce H6 bindings
 - Add watchdog Maintainters / ML
 - Add Martin Ayotte test results

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

Clément Péron (5):
  dt-bindings: watchdog: add Allwinner H6 watchdog
  arm64: dts: allwinner: h6: add watchdog node
  dt-bindings: watchdog: add Allwinner H6 r_watchdog
  arm64: dts: allwinner: h6: add r_watchog node
  arm64: defconfig: enable sunxi watchdog

 .../devicetree/bindings/watchdog/sunxi-wdt.txt   |  2 ++
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi     | 16 ++++++++++++++++
 arch/arm64/configs/defconfig                     |  1 +
 3 files changed, 19 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v4 1/5] dt-bindings: watchdog: add Allwinner H6 watchdog
  2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
@ 2019-05-21 16:03 ` Clément Péron
  2019-05-21 16:03 ` [PATCH v4 2/5] arm64: dts: allwinner: h6: add watchdog node Clément Péron
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

Allwinner H6 has a similar watchdog as the A64 which is already
a compatible of the A31.

This commit add the H6 compatible.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
index 46055254e8dd..e65198d82a2b 100644
--- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
@@ -6,6 +6,7 @@ Required properties:
 	"allwinner,sun4i-a10-wdt"
 	"allwinner,sun6i-a31-wdt"
 	"allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt"
+	"allwinner,sun50i-h6-wdt","allwinner,sun6i-a31-wdt"
 	"allwinner,suniv-f1c100s-wdt", "allwinner,sun4i-a10-wdt"
 - reg : Specifies base physical address and size of the registers.
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v4 2/5] arm64: dts: allwinner: h6: add watchdog node
  2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
  2019-05-21 16:03 ` [PATCH v4 1/5] dt-bindings: watchdog: add Allwinner H6 watchdog Clément Péron
@ 2019-05-21 16:03 ` Clément Péron
  2019-05-21 16:03 ` [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog Clément Péron
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

Allwinner H6 has a watchog node which seems broken
on some boards.

Test has been performed on several boards.

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

Martin Ayotte boards:
Pine H64 - H8069BA 6892 => OK
OrangePi 3 - HA047BA 69W2 => KO
OrangePi One Plus - H7310BA 6842 => KO
OrangePi Lite2 - H6448BA 6662 => KO

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

As it seems not fixable for now, declare the node
but leave it disable with a comment.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 16c5c3d0fd81..13e70aebddbe 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -208,6 +208,15 @@
 			reg = <0x03006000 0x400>;
 		};
 
+		watchdog: watchdog@30090a0 {
+			compatible = "allwinner,sun50i-h6-wdt",
+				     "allwinner,sun6i-a31-wdt";
+			reg = <0x030090a0 0x20>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+			/* Broken on some H6 boards */
+			status = "disabled";
+		};
+
 		pio: pinctrl@300b000 {
 			compatible = "allwinner,sun50i-h6-pinctrl";
 			reg = <0x0300b000 0x400>;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog
  2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
  2019-05-21 16:03 ` [PATCH v4 1/5] dt-bindings: watchdog: add Allwinner H6 watchdog Clément Péron
  2019-05-21 16:03 ` [PATCH v4 2/5] arm64: dts: allwinner: h6: add watchdog node Clément Péron
@ 2019-05-21 16:03 ` Clément Péron
  2019-05-22 10:32   ` Maxime Ripard
  2019-05-21 16:03 ` [PATCH v4 4/5] arm64: dts: allwinner: h6: add r_watchog node Clément Péron
  2019-05-21 16:03 ` [PATCH v4 5/5] arm64: defconfig: enable sunxi watchdog Clément Péron
  4 siblings, 1 reply; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

Allwinner H6 has a second watchdog on the r-blocks which is
compatible with the A31.

This commit add the H6 compatible for the r_watchdog.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
index e65198d82a2b..c5bef3dd43d0 100644
--- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
@@ -6,6 +6,7 @@ Required properties:
 	"allwinner,sun4i-a10-wdt"
 	"allwinner,sun6i-a31-wdt"
 	"allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt"
+	"allwinner,sun50i-h6-r-wdt","allwinner,sun6i-a31-wdt"
 	"allwinner,sun50i-h6-wdt","allwinner,sun6i-a31-wdt"
 	"allwinner,suniv-f1c100s-wdt", "allwinner,sun4i-a10-wdt"
 - reg : Specifies base physical address and size of the registers.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v4 4/5] arm64: dts: allwinner: h6: add r_watchog node
  2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
                   ` (2 preceding siblings ...)
  2019-05-21 16:03 ` [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog Clément Péron
@ 2019-05-21 16:03 ` Clément Péron
  2019-05-21 16:03 ` [PATCH v4 5/5] arm64: defconfig: enable sunxi watchdog Clément Péron
  4 siblings, 0 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

Allwinner H6 has a r_watchdog similar to A64.

Declare it in the device-tree.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 13e70aebddbe..66897880c722 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -631,6 +631,13 @@
 			#reset-cells = <1>;
 		};
 
+		r_watchdog: watchdog@7020400 {
+			compatible = "allwinner,sun50i-h6-r-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";
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v4 5/5] arm64: defconfig: enable sunxi watchdog
  2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
                   ` (3 preceding siblings ...)
  2019-05-21 16:03 ` [PATCH v4 4/5] arm64: dts: allwinner: h6: add r_watchog node Clément Péron
@ 2019-05-21 16:03 ` Clément Péron
  4 siblings, 0 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-21 16:03 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Maxime Ripard, Chen-Yu Tsai
  Cc: linux-watchdog, devicetree, linux-arm-kernel, linux-kernel,
	Clément Péron

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

Enable this option as a module.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 4d583514258c..fc51dd4decb1 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -420,6 +420,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
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog
  2019-05-21 16:03 ` [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog Clément Péron
@ 2019-05-22 10:32   ` Maxime Ripard
  2019-05-22 16:15     ` Clément Péron
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2019-05-22 10:32 UTC (permalink / raw)
  To: Clément Péron
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Chen-Yu Tsai, linux-watchdog, devicetree, linux-arm-kernel,
	linux-kernel

On Tue, May 21, 2019 at 06:03:28PM +0200, Clément Péron wrote:
> Allwinner H6 has a second watchdog on the r-blocks which is
> compatible with the A31.
>
> This commit add the H6 compatible for the r_watchdog.
>
> Signed-off-by: Clément Péron <peron.clem@gmail.com>

Unless you have some evidence that the two blocks are different, then
you should just reuse the same one.

Maxime

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog
  2019-05-22 10:32   ` Maxime Ripard
@ 2019-05-22 16:15     ` Clément Péron
  2019-05-23 12:57       ` Maxime Ripard
  0 siblings, 1 reply; 10+ messages in thread
From: Clément Péron @ 2019-05-22 16:15 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Chen-Yu Tsai, linux-watchdog, devicetree, linux-arm-kernel,
	linux-kernel

Hi Maxime,

On Wed, 22 May 2019 at 12:32, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
>
> On Tue, May 21, 2019 at 06:03:28PM +0200, Clément Péron wrote:
> > Allwinner H6 has a second watchdog on the r-blocks which is
> > compatible with the A31.
> >
> > This commit add the H6 compatible for the r_watchdog.
> >
> > Signed-off-by: Clément Péron <peron.clem@gmail.com>
>
> Unless you have some evidence that the two blocks are different, then
> you should just reuse the same one.

I have no evidence it's different nor identical, it's not documented
in the user manual.
I thought it would better to have separate bindings in case there is a
difference.
Than don't have and find later that we have to introduce one.

But as you prefer.

Regards,
Clément



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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog
  2019-05-22 16:15     ` Clément Péron
@ 2019-05-23 12:57       ` Maxime Ripard
  2019-05-23 14:02         ` Clément Péron
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2019-05-23 12:57 UTC (permalink / raw)
  To: Clément Péron
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Chen-Yu Tsai, linux-watchdog, devicetree, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

On Wed, May 22, 2019 at 06:15:26PM +0200, Clément Péron wrote:
> Hi Maxime,
>
> On Wed, 22 May 2019 at 12:32, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> >
> > On Tue, May 21, 2019 at 06:03:28PM +0200, Clément Péron wrote:
> > > Allwinner H6 has a second watchdog on the r-blocks which is
> > > compatible with the A31.
> > >
> > > This commit add the H6 compatible for the r_watchdog.
> > >
> > > Signed-off-by: Clément Péron <peron.clem@gmail.com>
> >
> > Unless you have some evidence that the two blocks are different, then
> > you should just reuse the same one.
>
> I have no evidence it's different nor identical, it's not documented
> in the user manual.
> I thought it would better to have separate bindings in case there is a
> difference.
> Than don't have and find later that we have to introduce one.

It's a tradeoff. Pushing your logic to the limit, we would have a
compatible for each controller embedded in an SoC.

This would be unmaintainable, and slightly useless since that case is
very unlikely.

However, having differences between SoCs is quite common, hence why we
have different compatibles for each SoC.

Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog
  2019-05-23 12:57       ` Maxime Ripard
@ 2019-05-23 14:02         ` Clément Péron
  0 siblings, 0 replies; 10+ messages in thread
From: Clément Péron @ 2019-05-23 14:02 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Mark Rutland,
	Chen-Yu Tsai, linux-watchdog, devicetree, linux-arm-kernel,
	linux-kernel

On Thu, 23 May 2019 at 14:57, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
>
> On Wed, May 22, 2019 at 06:15:26PM +0200, Clément Péron wrote:
> > Hi Maxime,
> >
> > On Wed, 22 May 2019 at 12:32, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> > >
> > > On Tue, May 21, 2019 at 06:03:28PM +0200, Clément Péron wrote:
> > > > Allwinner H6 has a second watchdog on the r-blocks which is
> > > > compatible with the A31.
> > > >
> > > > This commit add the H6 compatible for the r_watchdog.
> > > >
> > > > Signed-off-by: Clément Péron <peron.clem@gmail.com>
> > >
> > > Unless you have some evidence that the two blocks are different, then
> > > you should just reuse the same one.
> >
> > I have no evidence it's different nor identical, it's not documented
> > in the user manual.
> > I thought it would better to have separate bindings in case there is a
> > difference.
> > Than don't have and find later that we have to introduce one.
>
> It's a tradeoff. Pushing your logic to the limit, we would have a
> compatible for each controller embedded in an SoC.
>
> This would be unmaintainable, and slightly useless since that case is
> very unlikely.
>
> However, having differences between SoCs is quite common, hence why we
> have different compatibles for each SoC.
Yes, that make sense, I will send a new version soon,

Thanks for the review,
Clément

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 16:03 [PATCH v4 0/5] Allwinner H6 watchdog support Clément Péron
2019-05-21 16:03 ` [PATCH v4 1/5] dt-bindings: watchdog: add Allwinner H6 watchdog Clément Péron
2019-05-21 16:03 ` [PATCH v4 2/5] arm64: dts: allwinner: h6: add watchdog node Clément Péron
2019-05-21 16:03 ` [PATCH v4 3/5] dt-bindings: watchdog: add Allwinner H6 r_watchdog Clément Péron
2019-05-22 10:32   ` Maxime Ripard
2019-05-22 16:15     ` Clément Péron
2019-05-23 12:57       ` Maxime Ripard
2019-05-23 14:02         ` Clément Péron
2019-05-21 16:03 ` [PATCH v4 4/5] arm64: dts: allwinner: h6: add r_watchog node Clément Péron
2019-05-21 16:03 ` [PATCH v4 5/5] arm64: defconfig: enable sunxi watchdog Clément Péron

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox