diff mbox

[2/3] dt-bindings: power: reset: add document for renesas-reset driver

Message ID 20170213182532.4042-3-chris.brandt@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Chris Brandt Feb. 13, 2017, 6:25 p.m. UTC
Add device tree bindings document for renesas-reset driver.
This driver uses the WDT hardware to issue an immediate reset.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 .../devicetree/bindings/power/reset/renesas-reset.txt     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/reset/renesas-reset.txt

Comments

Geert Uytterhoeven Feb. 14, 2017, 5:18 p.m. UTC | #1
Hi Chris,

On Mon, Feb 13, 2017 at 7:25 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Add device tree bindings document for renesas-reset driver.
> This driver uses the WDT hardware to issue an immediate reset.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  .../devicetree/bindings/power/reset/renesas-reset.txt     | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/power/reset/renesas-reset.txt
>
> diff --git a/Documentation/devicetree/bindings/power/reset/renesas-reset.txt b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt
> new file mode 100644
> index 0000000..241722d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt
> @@ -0,0 +1,15 @@
> +Device-Tree bindings for Renesas WDT reset functionality

Please drop "reset", as this is a watchdog device.

> +Required properties:
> +  - compatible: must be one or more of the following:
> +    - "renesas,r7s72100-reset" for the r7s72100 SoC
> +    - "renesas,wdt-reset"
> +                This is a fallback for the above renesas,*-reset entries

Please use "renesas,r7s72100-wdt". DT describes the hardware (watchdog),
not the software policy (use it for reset only, as a max. timeout of 125 ms is
too short for a usable watchdog).

> +  - reg: base address and length of the WDT register block
> +
> +Example node:
> +       wdt: timer@fcfe0000 {
> +               compatible = "renesas,r7s72100-reset", "renesas,wdt-reset";
> +               reg = <0xfcfe0000 0x6>;
> +       };

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Chris Brandt Feb. 14, 2017, 5:51 p.m. UTC | #2
Hi Geert,

Thank you for your review!


Chris



On Tuesday, February 14, 2017, Geert Uytterhoeven wrote:
> On Mon, Feb 13, 2017 at 7:25 PM, Chris Brandt <chris.brandt@renesas.com>

> wrote:

> > Add device tree bindings document for renesas-reset driver.

> > This driver uses the WDT hardware to issue an immediate reset.

> >

> > Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

> > ---

> >  .../devicetree/bindings/power/reset/renesas-reset.txt     | 15

> +++++++++++++++

> >  1 file changed, 15 insertions(+)

> >  create mode 100644

> > Documentation/devicetree/bindings/power/reset/renesas-reset.txt

> >

> > diff --git

> > a/Documentation/devicetree/bindings/power/reset/renesas-reset.txt

> > b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt

> > new file mode 100644

> > index 0000000..241722d

> > --- /dev/null

> > +++ b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt

> > @@ -0,0 +1,15 @@

> > +Device-Tree bindings for Renesas WDT reset functionality

> 

> Please drop "reset", as this is a watchdog device.

> 

> > +Required properties:

> > +  - compatible: must be one or more of the following:

> > +    - "renesas,r7s72100-reset" for the r7s72100 SoC

> > +    - "renesas,wdt-reset"

> > +                This is a fallback for the above renesas,*-reset

> > +entries

> 

> Please use "renesas,r7s72100-wdt". DT describes the hardware (watchdog),

> not the software policy (use it for reset only, as a max. timeout of 125

> ms is too short for a usable watchdog).

> 

> > +  - reg: base address and length of the WDT register block

> > +

> > +Example node:

> > +       wdt: timer@fcfe0000 {

> > +               compatible = "renesas,r7s72100-reset", "renesas,wdt-

> reset";

> > +               reg = <0xfcfe0000 0x6>;

> > +       };

> 

> Gr{oetje,eeting}s,

> 

>                         Geert

> 

> --

> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-

> m68k.org

> 

> In personal conversations with technical people, I call myself a hacker.

> But when I'm talking to journalists I just say "programmer" or something

> like that.

>                                 -- Linus Torvalds
Chris Brandt Feb. 15, 2017, 5:33 p.m. UTC | #3
Hi Geert,

On Tuesday, February 14, 2017, Geert Uytterhoeven wrote:
> > +Required properties:

> > +  - compatible: must be one or more of the following:

> > +    - "renesas,r7s72100-reset" for the r7s72100 SoC

> > +    - "renesas,wdt-reset"

> > +                This is a fallback for the above renesas,*-reset

> > +entries

> 

> Please use "renesas,r7s72100-wdt". DT describes the hardware (watchdog),

> not the software policy (use it for reset only, as a max. timeout of 125

> ms is too short for a usable watchdog).



I had a look at:

  Documentation/devicetree/bindings/watchdog/renesas-wdt.txt

Which has:

Required properties:
- compatible : Should be "renesas,<soctype>-wdt", and
	       "renesas,rcar-gen3-wdt" as fallback.
	       Examples with soctypes are:
	         - "renesas,r8a7795-wdt" (R-Car H3)
	         - "renesas,r8a7796-wdt" (R-Car M3-W)


So in my 'renesas-reset.txt' should I do:

A. "renesas,r7s72100-wdt", "renesas,rz-wdt"

  or just: 

B. "renesas,r7s72100-wdt"   (no fallback, change the driver to add new SoCs)


Thoughts????


Thank you,
Chris
Geert Uytterhoeven Feb. 16, 2017, 1:51 p.m. UTC | #4
Hi Chris,

On Wed, Feb 15, 2017 at 6:33 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Tuesday, February 14, 2017, Geert Uytterhoeven wrote:
>> > +Required properties:
>> > +  - compatible: must be one or more of the following:
>> > +    - "renesas,r7s72100-reset" for the r7s72100 SoC
>> > +    - "renesas,wdt-reset"
>> > +                This is a fallback for the above renesas,*-reset
>> > +entries
>>
>> Please use "renesas,r7s72100-wdt". DT describes the hardware (watchdog),
>> not the software policy (use it for reset only, as a max. timeout of 125
>> ms is too short for a usable watchdog).
>
> I had a look at:
>
>   Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
>
> Which has:
>
> Required properties:
> - compatible : Should be "renesas,<soctype>-wdt", and
>                "renesas,rcar-gen3-wdt" as fallback.
>                Examples with soctypes are:
>                  - "renesas,r8a7795-wdt" (R-Car H3)
>                  - "renesas,r8a7796-wdt" (R-Car M3-W)
>
>
> So in my 'renesas-reset.txt' should I do:

As "reset" is software policy, perhaps you should instead extend the existing
binding document Documentation/devicetree/bindings/watchdog/renesas-wdt.txt?

Nothing says you have to use the same Linux driver for R-Car Gen3 and
RZ/A1.

> A. "renesas,r7s72100-wdt", "renesas,rz-wdt"

Please don't use plain "rz", as RZ/A, RZ/G, and RZ/T are completely different
beasts.

>
>   or just:
>
> B. "renesas,r7s72100-wdt"   (no fallback, change the driver to add new SoCs)

Do you know if future RZ/A SoCs will use the exact same type of WDT?
If yes, you can document both "renesas,r7s72100-wdt" and "renesas,rza-wdt",
and let the driver match against the latter.
Else I'd just document and match against "renesas,r7s72100-wdt".

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Chris Brandt Feb. 16, 2017, 2:25 p.m. UTC | #5
Hi Geert,

On Thursday, February 16, 2017, Geert Uytterhoeven wrote:
> On Wed, Feb 15, 2017 at 6:33 PM, Chris Brandt <Chris.Brandt@renesas.com>

> wrote:

> > On Tuesday, February 14, 2017, Geert Uytterhoeven wrote:

> >> > +Required properties:

> >> > +  - compatible: must be one or more of the following:

> >> > +    - "renesas,r7s72100-reset" for the r7s72100 SoC

> >> > +    - "renesas,wdt-reset"

> >> > +                This is a fallback for the above renesas,*-reset

> >> > +entries

> >>

> >> Please use "renesas,r7s72100-wdt". DT describes the hardware

> >> (watchdog), not the software policy (use it for reset only, as a max.

> >> timeout of 125 ms is too short for a usable watchdog).

> >

> > I had a look at:

> >

> >   Documentation/devicetree/bindings/watchdog/renesas-wdt.txt

> >

> > Which has:

> >

> > Required properties:

> > - compatible : Should be "renesas,<soctype>-wdt", and

> >                "renesas,rcar-gen3-wdt" as fallback.

> >                Examples with soctypes are:

> >                  - "renesas,r8a7795-wdt" (R-Car H3)

> >                  - "renesas,r8a7796-wdt" (R-Car M3-W)

> >

> >

> > So in my 'renesas-reset.txt' should I do:

> 

> As "reset" is software policy, perhaps you should instead extend the

> existing binding document

> Documentation/devicetree/bindings/watchdog/renesas-wdt.txt?

> 

> Nothing says you have to use the same Linux driver for R-Car Gen3 and

> RZ/A1.


That is what I was thinking as well. If I'm just supposed to document hardware,
I might as well group it in the same file...but then in SW use it for something
completely different (reset instead of its WDT functionality)

> > A. "renesas,r7s72100-wdt", "renesas,rz-wdt"

> 

> Please don't use plain "rz", as RZ/A, RZ/G, and RZ/T are completely

> different beasts.


Ya, I'm stuck on a name here. Internally, they don't really have defined IP block
name for the "8-bit WDT that can also be used as a simple timer". I know this
WDT was also used in SH4A devices like SH7757 and SH7758.

> >   or just:

> >

> > B. "renesas,r7s72100-wdt"   (no fallback, change the driver to add new

> SoCs)

> 

> Do you know if future RZ/A SoCs will use the exact same type of WDT?


Yes, RZ/A2 will for sure. I assume it would also be used for any RZ/A3+ because
it's easy to hook up from a HW perspective (if I remember correctly). Although,
I want them to extend the counter from 8-bit to 16-bit. 125ms is ridiculously
too short!

> If yes, you can document both "renesas,r7s72100-wdt" and "renesas,rza-wdt",

> and let the driver match against the latter.


I'm going to go with that.
If the timeout does ever get extended and it does become useful to be used
as an actual watchdog, I'll create a new driver or something.


As always, thank you for your replies!


Chris
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/renesas-reset.txt b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt
new file mode 100644
index 0000000..241722d
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/renesas-reset.txt
@@ -0,0 +1,15 @@ 
+Device-Tree bindings for Renesas WDT reset functionality
+
+Required properties:
+  - compatible: must be one or more of the following:
+    - "renesas,r7s72100-reset" for the r7s72100 SoC
+    - "renesas,wdt-reset"
+                This is a fallback for the above renesas,*-reset entries
+
+  - reg: base address and length of the WDT register block
+
+Example node:
+	wdt: timer@fcfe0000 {
+		compatible = "renesas,r7s72100-reset", "renesas,wdt-reset";
+		reg = <0xfcfe0000 0x6>;
+	};