diff mbox series

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

Message ID 20190411154534.25563-3-peron.clem@gmail.com
State New
Headers show
Series Add Watchdog for H6 | expand

Commit Message

Clément Péron April 11, 2019, 3:45 p.m. UTC
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(+)

Comments

Clément Péron April 19, 2019, 7 p.m. UTC | #1
Hi,

On Thu, 11 Apr 2019 at 17:34, Clément Péron <peron.clem@gmail.com> wrote:
>
> 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 5c2f5451227b..66dc684a378e 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> @@ -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

> +
>                 r_intc: interrupt-controller@7021000 {
>                         compatible = "allwinner,sun50i-h6-r-intc",
>                                      "allwinner,sun6i-a31-r-intc";
> --
> 2.17.1
>
Maxime Ripard April 23, 2019, 4:05 p.m. UTC | #2
On Fri, Apr 19, 2019 at 09:00:42PM +0200, Clément Péron wrote:
> Hi,
>
> On Thu, 11 Apr 2019 at 17:34, Clément Péron <peron.clem@gmail.com> wrote:
> >
> > 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 5c2f5451227b..66dc684a378e 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> > @@ -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.

Why not just having the A31 compatible?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Clément Péron April 25, 2019, 7:34 a.m. UTC | #3
On Tue, 23 Apr 2019 at 18:05, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
>
> On Fri, Apr 19, 2019 at 09:00:42PM +0200, Clément Péron wrote:
> > Hi,
> >
> > On Thu, 11 Apr 2019 at 17:34, Clément Péron <peron.clem@gmail.com> wrote:
> > >
> > > 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 5c2f5451227b..66dc684a378e 100644
> > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> > > @@ -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.
>
Hi,

> 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

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

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 5c2f5451227b..66dc684a378e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -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";