mbox series

[v3,0/6] Add support to retrieve the bootstatus from watchdog for RZ/V2H(P) SoC

Message ID 20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Headers show
Series Add support to retrieve the bootstatus from watchdog for RZ/V2H(P) SoC | expand

Message

Lad, Prabhakar Jan. 13, 2025, 11:23 a.m. UTC
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi All,

This patch series adds SYSCON support to retrieve boot status information
for RZ/V2H(P) SoC.
Summary of Changes,

    Clock:
        Add syscon compatible support to the CPG block in bindings and
        device trees.

    Watchdog:
        Document the renesas,r9a09g057-syscon-wdt-errorrst property.
        Update the watchdog driver to fetch and report boot status via
        Error Reset Registers (CPG_ERROR_RSTm).

    Device Tree:
        Add the syscon property to CPG and WDT nodes in R9A09G057 and
        R9A09G047 SoC DTSI.

These changes enable the watchdog driver to identify boot sources like
Power-on Reset and Watchdog Reset, improving system diagnostics.

v2->v3
- Updated comment section to mentione there arent any ABI breakages with
  this patch series.

Cheers,
Prabhakar

Lad Prabhakar (6):
  dt-bindings: clock: rzv2h-cpg: Add syscon compatible for CPG block
  arm64: dts: renesas: r9a09g047: Add `syscon` compatible for CPG node
  arm64: dts: renesas: r9a09g057: Add `syscon` compatible for CPG node
  dt-bindings: watchdog: renesas: Document
    `renesas,syscon-cpg-error-rst` property
  watchdog: rzv2h_wdt: Add support to retrieve the bootstatus
    information
  arm64: dts: renesas: r9a09g057: Add `renesas,syscon-cpg-error-rst`
    property to WDT node

 .../bindings/clock/renesas,rzv2h-cpg.yaml     | 10 +++---
 .../bindings/watchdog/renesas,wdt.yaml        | 17 +++++++++
 arch/arm64/boot/dts/renesas/r9a09g047.dtsi    |  2 +-
 arch/arm64/boot/dts/renesas/r9a09g057.dtsi    |  6 +++-
 drivers/watchdog/rzv2h_wdt.c                  | 35 +++++++++++++++++++
 5 files changed, 64 insertions(+), 6 deletions(-)

Comments

Rob Herring (Arm) Jan. 14, 2025, 8:03 p.m. UTC | #1
On Mon, Jan 13, 2025 at 11:38:08AM +0000, Biju Das wrote:
> Hi Prabhakar,
> 
> > -----Original Message-----
> > From: Prabhakar <prabhakar.csengg@gmail.com>
> > Sent: 13 January 2025 11:24
> > Subject: [PATCH v3 0/6] Add support to retrieve the bootstatus from watchdog for RZ/V2H(P) SoC
> > 
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > 
> > Hi All,
> > 
> > This patch series adds SYSCON support to retrieve boot status information for RZ/V2H(P) SoC.
> > Summary of Changes,
> > 
> >     Clock:
> >         Add syscon compatible support to the CPG block in bindings and
> >         device trees.
> > 
> >     Watchdog:
> >         Document the renesas,r9a09g057-syscon-wdt-errorrst property.
> >         Update the watchdog driver to fetch and report boot status via
> >         Error Reset Registers (CPG_ERROR_RSTm).
> > 
> >     Device Tree:
> >         Add the syscon property to CPG and WDT nodes in R9A09G057 and
> >         R9A09G047 SoC DTSI.
> > 
> > These changes enable the watchdog driver to identify boot sources like Power-on Reset and Watchdog
> > Reset, improving system diagnostics.
> 
> This means that, we should assume U-boot/bootloader should not clear the WDT reset status bit.
> 
> If they clear it, there should be a way to propagate it from u-boot/bootloader to linux,
> otherwise, we get wrong bootstatus in linux.
> But the clearing of watchdog status by one of the cases: 
> 
> 1) u-boot identify the boot source and clear the status bit
> 2) u-boot identify the boot source and does not clear the status bit, but linux clear it.
> 3) u-boot does not touch WDT status bits, but linux clear it.

Sounds like the same problem as this[1]. If that works for you, please 
comment there. Always better if there is more than 1 user for something 
"common".

Rob

[1]https://lore.kernel.org/devicetree-spec/48defa98-9718-4997-86cb-b171187708a6@cherry.de/T/#u
Lad, Prabhakar Feb. 4, 2025, 10:48 a.m. UTC | #2
Hi Guenter and Rob,

On Tue, Jan 14, 2025 at 8:17 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 1/14/25 12:03, Rob Herring wrote:
> > On Mon, Jan 13, 2025 at 11:38:08AM +0000, Biju Das wrote:
> >> Hi Prabhakar,
> >>
> >>> -----Original Message-----
> >>> From: Prabhakar <prabhakar.csengg@gmail.com>
> >>> Sent: 13 January 2025 11:24
> >>> Subject: [PATCH v3 0/6] Add support to retrieve the bootstatus from watchdog for RZ/V2H(P) SoC
> >>>
> >>> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >>>
> >>> Hi All,
> >>>
> >>> This patch series adds SYSCON support to retrieve boot status information for RZ/V2H(P) SoC.
> >>> Summary of Changes,
> >>>
> >>>      Clock:
> >>>          Add syscon compatible support to the CPG block in bindings and
> >>>          device trees.
> >>>
> >>>      Watchdog:
> >>>          Document the renesas,r9a09g057-syscon-wdt-errorrst property.
> >>>          Update the watchdog driver to fetch and report boot status via
> >>>          Error Reset Registers (CPG_ERROR_RSTm).
> >>>
> >>>      Device Tree:
> >>>          Add the syscon property to CPG and WDT nodes in R9A09G057 and
> >>>          R9A09G047 SoC DTSI.
> >>>
> >>> These changes enable the watchdog driver to identify boot sources like Power-on Reset and Watchdog
> >>> Reset, improving system diagnostics.
> >>
> >> This means that, we should assume U-boot/bootloader should not clear the WDT reset status bit.
> >>
> >> If they clear it, there should be a way to propagate it from u-boot/bootloader to linux,
> >> otherwise, we get wrong bootstatus in linux.
> >> But the clearing of watchdog status by one of the cases:
> >>
> >> 1) u-boot identify the boot source and clear the status bit
> >> 2) u-boot identify the boot source and does not clear the status bit, but linux clear it.
> >> 3) u-boot does not touch WDT status bits, but linux clear it.
> >
> > Sounds like the same problem as this[1]. If that works for you, please
> > comment there. Always better if there is more than 1 user for something
> > "common".
> >
> > Rob
> >
> > [1]https://lore.kernel.org/devicetree-spec/48defa98-9718-4997-86cb-b171187708a6@cherry.de/T/#u
>
> If this ends up being provided through /chosen, it should probably be supported
> in the watchdog core.
>
There wasn't any conclusion on the thread [0]. Can you please
recommend how you want me to proceed on this series.

[0] https://lore.kernel.org/devicetree-spec/48defa98-9718-4997-86cb-b171187708a6@cherry.de/T/#m2f1c7f5c8166522982cecf9351903ab06ca4f9ee

Cheers,
Prabhakar