devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] Add WDT driver for RZ/G2L
@ 2021-11-04 16:08 Biju Das
  2021-11-04 16:08 ` [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support " Biju Das
  0 siblings, 1 reply; 4+ messages in thread
From: Biju Das @ 2021-11-04 16:08 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring
  Cc: Biju Das, Wolfram Sang, Geert Uytterhoeven, linux-watchdog,
	devicetree, Chris Paterson, Biju Das, Prabhakar Mahadev Lad,
	linux-renesas-soc

This patch series aims to add WDT driver support for RZ/G2L SoC's.

WDT has 3 channels
1) CH0 to check the operation of Cortex-A55-CPU Core0
2) CH1 to check the operation of Cortex-A55-CPU Core1
3) CH2 to check the operation of Cortex-M33 CPU

WDT IP supports 
1) Normal Watchdog Timer Function
2) Reset Request Function due to CPU Parity Error

Once the software activates the watchdog timer, the watchdog timer does
not stop until it is reset.

The WDT Overflow System Reset Register (CPG_WDTOVF_RST) and 
WDT Reset Selector Register (CPG_WDTRST_SEL) are in CPG IP
block.

Current driver support is basic normal Watchdog Timer Function.

Later will extend support to identify the WDT channel that generated
the reset request using CPG_WDTOVF_RST. Need to figure out how to expose
this to WDT driver from CPG driver?

and also Reset Request Function due to CPU Parity Error.

Tested WDT driver with selftests tool and reboot command

All 3 channels tested with below command.

cat /dev/watchdog  & for i in {1..60}; do sleep 1; echo $i; devmem2 0x12800808; done
cat /dev/watchdog1  & for i in {1..60}; do sleep 1; echo $i; devmem2 0x12800c08; done
cat /dev/watchdog2 & for i in {1..60}; do sleep 1; echo $i; devmem2 0x12800408; done

Please share your valuable comments.

Biju Das (4):
  clk: renesas: rzg2l: Add support for watchdog reset selection
  dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L
  clk: renesas: r9a07g044: Add WDT clock and reset entries
  watchdog: Add Watchdog Timer driver for RZ/G2L

 .../bindings/watchdog/renesas,wdt.yaml        |  72 +++--
 drivers/clk/renesas/r9a07g044-cpg.c           |  37 +++
 drivers/clk/renesas/rzg2l-cpg.c               |   6 +
 drivers/clk/renesas/rzg2l-cpg.h               |  14 +
 drivers/watchdog/Kconfig                      |   8 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/rzg2l_wdt.c                  | 281 ++++++++++++++++++
 7 files changed, 401 insertions(+), 18 deletions(-)
 create mode 100644 drivers/watchdog/rzg2l_wdt.c

-- 
2.17.1


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

* [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L
  2021-11-04 16:08 [RFC 0/4] Add WDT driver for RZ/G2L Biju Das
@ 2021-11-04 16:08 ` Biju Das
  2021-11-08 16:04   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Biju Das @ 2021-11-04 16:08 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring
  Cc: Biju Das, Wolfram Sang, Geert Uytterhoeven, linux-watchdog,
	devicetree, Chris Paterson, Biju Das, Prabhakar Mahadev Lad,
	linux-renesas-soc

Describe the WDT hardware in the RZ/G2L series.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 .../bindings/watchdog/renesas,wdt.yaml        | 72 ++++++++++++++-----
 1 file changed, 54 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index ab66d3f0c476..f9f7f7207d6d 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -10,9 +10,6 @@ maintainers:
   - Wolfram Sang <wsa+renesas@sang-engineering.com>
   - Geert Uytterhoeven <geert+renesas@glider.be>
 
-allOf:
-  - $ref: "watchdog.yaml#"
-
 properties:
   compatible:
     oneOf:
@@ -22,6 +19,11 @@ properties:
               - renesas,r7s9210-wdt      # RZ/A2
           - const: renesas,rza-wdt       # RZ/A
 
+      - items:
+          - enum:
+              - renesas,r9a07g044-wdt    # RZ/G2{L,LC}
+          - const: renesas,rzg2l-wdt     # RZ/G2L
+
       - items:
           - enum:
               - renesas,r8a7742-wdt      # RZ/G1H
@@ -56,11 +58,13 @@ properties:
   reg:
     maxItems: 1
 
-  interrupts:
-    maxItems: 1
+  interrupts: true
 
-  clocks:
-    maxItems: 1
+  interrupt-names: true
+
+  clocks: true
+
+  clock-names: true
 
   power-domains:
     maxItems: 1
@@ -75,17 +79,49 @@ required:
   - reg
   - clocks
 
-if:
-  not:
-    properties:
-      compatible:
-        contains:
-          enum:
-            - renesas,rza-wdt
-then:
-  required:
-    - power-domains
-    - resets
+allOf:
+  - $ref: "watchdog.yaml#"
+
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - renesas,rza-wdt
+    then:
+      required:
+        - power-domains
+        - resets
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,rzg2l-wdt
+    then:
+      properties:
+        interrupts:
+          maxItems: 2
+        interrupt-names:
+          items:
+            - const: wdt
+            - const: perrout
+        clocks:
+          items:
+            - description: Main clock
+            - description: Register access clock
+        clock-names:
+          items:
+            - const: oscclk
+            - const: pclk
+    else:
+      properties:
+        interrupts:
+          maxItems: 1
+        clocks:
+          maxItems: 1
 
 additionalProperties: false
 
-- 
2.17.1


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

* Re: [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L
  2021-11-04 16:08 ` [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support " Biju Das
@ 2021-11-08 16:04   ` Geert Uytterhoeven
  2021-11-08 16:33     ` Biju Das
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-11-08 16:04 UTC (permalink / raw)
  To: Biju Das
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Wolfram Sang,
	Linux Watchdog Mailing List,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Prabhakar Mahadev Lad, Linux-Renesas

Hi Biju,

On Thu, Nov 4, 2021 at 5:09 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Describe the WDT hardware in the RZ/G2L series.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml

> @@ -75,17 +79,49 @@ required:
>    - reg
>    - clocks
>
> -if:
> -  not:
> -    properties:
> -      compatible:
> -        contains:
> -          enum:
> -            - renesas,rza-wdt
> -then:
> -  required:
> -    - power-domains
> -    - resets
> +allOf:
> +  - $ref: "watchdog.yaml#"
> +
> +  - if:
> +      not:
> +        properties:
> +          compatible:
> +            contains:
> +              enum:
> +                - renesas,rza-wdt
> +    then:
> +      required:
> +        - power-domains
> +        - resets
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - renesas,rzg2l-wdt
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 2
> +        interrupt-names:
> +          items:
> +            - const: wdt
> +            - const: perrout
> +        clocks:
> +          items:
> +            - description: Main clock
> +            - description: Register access clock
> +        clock-names:
> +          items:
> +            - const: oscclk
> +            - const: pclk

Usually we put the internal module clock first.

Please add (at least the first one):

     required:
       - clock-names
       - interrupt-names

> +    else:
> +      properties:
> +        interrupts:
> +          maxItems: 1
> +        clocks:
> +          maxItems: 1
>
>  additionalProperties: false

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

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

* RE: [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L
  2021-11-08 16:04   ` Geert Uytterhoeven
@ 2021-11-08 16:33     ` Biju Das
  0 siblings, 0 replies; 4+ messages in thread
From: Biju Das @ 2021-11-08 16:33 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Wolfram Sang,
	Linux Watchdog Mailing List,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Prabhakar Mahadev Lad, Linux-Renesas

Hi Geert,

Thanks for the feedback.

> Subject: Re: [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support for
> RZ/G2L
> 
> Hi Biju,
> 
> On Thu, Nov 4, 2021 at 5:09 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > Describe the WDT hardware in the RZ/G2L series.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> > +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> 
> > @@ -75,17 +79,49 @@ required:
> >    - reg
> >    - clocks
> >
> > -if:
> > -  not:
> > -    properties:
> > -      compatible:
> > -        contains:
> > -          enum:
> > -            - renesas,rza-wdt
> > -then:
> > -  required:
> > -    - power-domains
> > -    - resets
> > +allOf:
> > +  - $ref: "watchdog.yaml#"
> > +
> > +  - if:
> > +      not:
> > +        properties:
> > +          compatible:
> > +            contains:
> > +              enum:
> > +                - renesas,rza-wdt
> > +    then:
> > +      required:
> > +        - power-domains
> > +        - resets
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - renesas,rzg2l-wdt
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 2
> > +        interrupt-names:
> > +          items:
> > +            - const: wdt
> > +            - const: perrout
> > +        clocks:
> > +          items:
> > +            - description: Main clock
> > +            - description: Register access clock
> > +        clock-names:
> > +          items:
> > +            - const: oscclk
> > +            - const: pclk
> 
> Usually we put the internal module clock first.
OK. Will put internal module clock first.
> 
> Please add (at least the first one):
> 
>      required:
>        - clock-names
>        - interrupt-names

Ok, will add the same.

Regards,
Biju

> 
> > +    else:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 1
> > +        clocks:
> > +          maxItems: 1
> >
> >  additionalProperties: false
> 
> 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

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

end of thread, other threads:[~2021-11-08 16:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04 16:08 [RFC 0/4] Add WDT driver for RZ/G2L Biju Das
2021-11-04 16:08 ` [RFC 2/4] dt-bindings: watchdog: renesas,wdt: Add support " Biju Das
2021-11-08 16:04   ` Geert Uytterhoeven
2021-11-08 16:33     ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).