arm64: renesas: Add R-Car S4-8 watchdog support on Spider
Subsystems (5)
Geert Uytterhoeven
maintainercover arm64: renesas: Add R-Car S4-8 watchdog support on Spider
Hi all,
This patch series adds support for the RCLK Watchdog Timer (RWDT) in the R-Car S4-8 SoC, and enables it on the Renesas Spider development board.
Patch 1 is to be queued in renesas-clk for v5.18. Patches 2 and 3 are intended for the watchdog tree. Patches 4 and 5 are to be queued in renesas-devel for v5.18.
Thanks for your comments!
Geert Uytterhoeven (3):
clk: renesas: r8a779f0: Add WDT clock
arm64: dts: renesas: r8a779f0: Add RWDT node
arm64: dts: renesas: spider-cpu: Enable watchdog timer
Thanh Quan (2):
dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support
watchdog: renesas_wdt: Add R-Car Gen4 support
.../devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 5 +++++ arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 10 ++++++++++ drivers/clk/renesas/r8a779f0-cpg-mssr.c | 9 +++++++++ drivers/watchdog/renesas_wdt.c | 1 + 5 files changed, 30 insertions(+)
Signature · 12 lines
2.25.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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 TorvaldsGeert Uytterhoeven
maintainerPATCH 1/5 clk: renesas: r8a779f0: Add WDT clock
Add the module clock used by the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (r8a779f0) SoC. Mark it as a critical clock, to ensure uninterrupted watchdog operation.
--- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/clk/renesas/r8a779f0-cpg-mssr.c +9 -0
@@ -121,6 +121,11 @@ static const struct mssr_mod_clk r8a779f0_mod_clks[] __initconst = {DEF_MOD ("scif4" ,705 ,R8A779F0_CLK_S0D12_PER ),DEF_MOD ("sys-dmac0" ,709 ,R8A779F0_CLK_S0D3_PER ),DEF_MOD ("sys-dmac1" ,710 ,R8A779F0_CLK_S0D3_PER ), + DEF_MOD("wdt", 907, R8A779F0_CLK_R), +}; + +static const unsigned int r8a779f0_crit_mod_clks[]__initconst = { +MOD_CLK_ID (907 ),/* WDT */ };/*
@@ -177,6 +182,10 @@ const struct cpg_mssr_info r8a779f0_cpg_mssr_info __initconst = { .num_mod_clks = ARRAY_SIZE(r8a779f0_mod_clks), .num_hw_mod_clks = 28 * 32, +/* Critical Module Clocks */ + .crit_mod_clks = r8a779f0_crit_mod_clks, + .num_crit_mod_clks = ARRAY_SIZE(r8a779f0_crit_mod_clks), +/* Callbacks */ .init = r8a779f0_cpg_mssr_init, .cpg_clk_register = rcar_gen4_cpg_clk_register,
Signature · 1 line
2.25.1
Re: [PATCH 1/5] clk: renesas: r8a779f0: Add WDT clock
Quoted 5 lines · Geert Uytterhoeven
Add the module clock used by the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (r8a779f0) SoC. Mark it as a critical clock, to ensure uninterrupted watchdog operation.
Signed-off-by Geert Uytterhoeven <[email protected]>
Re: [PATCH 1/5] clk: renesas: r8a779f0: Add WDT clock
In reply to Geert UytterhoevenQuoted 6 lines · Geert Uytterhoeven
Add the module clock used by the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (r8a779f0) SoC. Mark it as a critical clock, to ensure uninterrupted watchdog operation.
Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Wolfram Sang <[email protected]>
Quoted 31 lines
--- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/clk/renesas/r8a779f0-cpg-mssr.c +9
-0@@ -121,6 +121,11 @@ static const struct mssr_mod_clk r8a779f0_mod_clks[] __initconst = {DEF_MOD ("scif4" ,705 ,R8A779F0_CLK_S0D12_PER ),DEF_MOD ("sys-dmac0" ,709 ,R8A779F0_CLK_S0D3_PER ),DEF_MOD ("sys-dmac1" ,710 ,R8A779F0_CLK_S0D3_PER ), + DEF_MOD("wdt", 907, R8A779F0_CLK_R), +}; + +static const unsigned int r8a779f0_crit_mod_clks[]__initconst = { +MOD_CLK_ID (907 ),/* WDT */ };/* @@ -177,6 +182,10 @@ const struct cpg_mssr_info r8a779f0_cpg_mssr_info __initconst = { .num_mod_clks = ARRAY_SIZE(r8a779f0_mod_clks), .num_hw_mod_clks = 28 * 32, +/* Critical Module Clocks */ + .crit_mod_clks = r8a779f0_crit_mod_clks, + .num_crit_mod_clks = ARRAY_SIZE(r8a779f0_crit_mod_clks), +/* Callbacks */ .init = r8a779f0_cpg_mssr_init, .cpg_clk_register = rcar_gen4_cpg_clk_register,
Geert Uytterhoeven
maintainerPATCH 2/5 dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support
In reply to Geert UytterhoevenFrom: Thanh Quan <[email protected]>
Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC.
--- Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml +5 -0
@@ -55,6 +55,11 @@ properties: - renesas,r8a779a0-wdt # R-Car V3U - const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2 + - items: + - enum: + - renesas,r8a779f0-wdt # R-Car S4-8 + - const: renesas,rcar-gen4-wdt # R-Car Gen4 + reg: maxItems: 1
Signature · 1 line
2.25.1
Re: [PATCH 2/5] dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support
Quoted 7 lines · Geert Uytterhoeven
From: Thanh Quan <[email protected]>
Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC.
Signed-off-by Thanh Quan <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>
Re: [PATCH 2/5] dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support
In reply to Geert UytterhoevenQuoted 11 lines · Geert Uytterhoeven
From: Thanh Quan <[email protected]>
Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC.
Signed-off-by Thanh Quan <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>--- Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Re: [PATCH 2/5] dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support
In reply to Geert UytterhoevenQuoted 9 lines · Geert Uytterhoeven
From: Thanh Quan <[email protected]>
Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC.
Signed-off-by Thanh Quan <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Wolfram Sang <[email protected]>Acked-by Rob Herring <[email protected]>
Quoted 20 lines
--- Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml +5
-0@@ -55,6 +55,11 @@ properties: - renesas,r8a779a0-wdt # R-Car V3U - const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2 + - items: + - enum: + - renesas,r8a779f0-wdt # R-Car S4-8 + - const: renesas,rcar-gen4-wdt # R-Car Gen4 + reg: maxItems: 1
Geert Uytterhoeven
maintainerPATCH 3/5 watchdog: renesas_wdt: Add R-Car Gen4 support
In reply to Geert UytterhoevenFrom: Thanh Quan <[email protected]>
Add the compatible string for the R-Car Gen4 family. No further driver changes are needed.
--- drivers/watchdog/renesas_wdt.c | 1 + 1 file changed, 1 insertion(+)
drivers/watchdog/renesas_wdt.c +1 -0
@@ -327,6 +327,7 @@ static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);static const struct of_device_id rwdt_ids[] = { { .compatible ="renesas,rcar-gen2-wdt" , }, { .compatible ="renesas,rcar-gen3-wdt" , }, + { .compatible ="renesas,rcar-gen4-wdt" , }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, rwdt_ids);
Signature · 1 line
2.25.1
Re: [PATCH 3/5] watchdog: renesas_wdt: Add R-Car Gen4 support
Quoted 7 lines · Geert Uytterhoeven
From: Thanh Quan <[email protected]>
Add the compatible string for the R-Car Gen4 family. No further driver changes are needed.
Signed-off-by Thanh Quan <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>
Re: [PATCH 3/5] watchdog: renesas_wdt: Add R-Car Gen4 support
In reply to Geert UytterhoevenQuoted 8 lines · Geert Uytterhoeven
From: Thanh Quan <[email protected]>
Add the compatible string for the R-Car Gen4 family. No further driver changes are needed.
Signed-off-by Thanh Quan <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Wolfram Sang <[email protected]>
Quoted 16 lines
--- drivers/watchdog/renesas_wdt.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/renesas_wdt.c +1
-0@@ -327,6 +327,7 @@ static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);static const struct of_device_id rwdt_ids[] = { { .compatible ="renesas,rcar-gen2-wdt" , }, { .compatible ="renesas,rcar-gen3-wdt" , }, + { .compatible ="renesas,rcar-gen4-wdt" , }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, rwdt_ids);
Geert Uytterhoeven
maintainerPATCH 4/5 arm64: dts: renesas: r8a779f0: Add RWDT node
In reply to Geert UytterhoevenAdd a device node for the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (R8A779F0) SoC.
Extracted from a larger patch in the BSP by LUU HOAI.
--- arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0.dtsi +10 -0
@@ -59,6 +59,16 @@ soc: soc { #size-cells = <2>; ranges; + rwdt: watchdog@e6020000 { + compatible = "renesas,r8a779f0-wdt", + "renesas,rcar-gen4-wdt"; + reg = <0 0xe6020000 0 0x0c>; + clocks = <&cpg CPG_MOD 907>; + power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>; + resets = <&cpg 907>; + status = "disabled"; + }; + cpg: clock-controller@e6150000 { compatible = "renesas,r8a779f0-cpg-mssr"; reg = <0 0xe6150000 0 0x4000>;
Signature · 1 line
2.25.1
Re: [PATCH 4/5] arm64: dts: renesas: r8a779f0: Add RWDT node
Quoted 6 lines · Geert Uytterhoeven
Add a device node for the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (R8A779F0) SoC.
Extracted from a larger patch in the BSP by LUU HOAI.
Signed-off-by Geert Uytterhoeven <[email protected]>
Re: [PATCH 4/5] arm64: dts: renesas: r8a779f0: Add RWDT node
In reply to Geert UytterhoevenQuoted 7 lines · Geert Uytterhoeven
Add a device node for the RCLK Watchdog Timer (RWDT) on the Renesas R-Car S4-8 (R8A779F0) SoC.
Extracted from a larger patch in the BSP by LUU HOAI.
Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Wolfram Sang <[email protected]>
Quoted 25 lines
--- arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/arm64/boot/dts/renesas/r8a779f0.dtsi +10
-0@@ -59,6 +59,16 @@ soc: soc { #size-cells = <2>; ranges; + rwdt: watchdog@e6020000 { + compatible = "renesas,r8a779f0-wdt", + "renesas,rcar-gen4-wdt"; + reg = <0 0xe6020000 0 0x0c>; + clocks = <&cpg CPG_MOD 907>; + power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>; + resets = <&cpg 907>; + status = "disabled"; + }; + cpg: clock-controller@e6150000 { compatible = "renesas,r8a779f0-cpg-mssr"; reg = <0 0xe6150000 0 0x4000>;
Geert Uytterhoeven
maintainerPATCH 5/5 arm64: dts: renesas: spider-cpu: Enable watchdog timer
In reply to Geert UytterhoevenEnable the watchdog timer on the Spider board.
Extracted from a larger patch in the BSP by LUU HOAI.
---
For the watchdog to be able to actually reboot the system, this depends on proper configuration of the Watchdog Timer Reset Control Register (WDTRSTCR) in the Reset (RST) module, either by Linux[1], or by the firmware.
[1] "[PATCH LOCAL v2] soc: renesas: rcar-rst: Allow WDT reset on R-Car
Gen4"
https://lore.kernel.org/r/39005cf749a99afc6d3ba96ff155fd2a231418a8.1642524743.git.geert+renesas@glider.be
---
arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 5 +++++
1 file changed, 5 insertions(+)arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi +5 -0
@@ -31,6 +31,11 @@ &extalr_clk { clock-frequency = <32768>; }; +&rwdt { + timeout-sec = <60>; + status = "okay"; +}; + &scif3 { status = "okay"; };
Signature · 1 line
2.25.1
Re: [PATCH 5/5] arm64: dts: renesas: spider-cpu: Enable watchdog timer
Quoted 5 lines · Geert Uytterhoeven
Enable the watchdog timer on the Spider board.
Extracted from a larger patch in the BSP by LUU HOAI.
Signed-off-by Geert Uytterhoeven <[email protected]>
Re: [PATCH 5/5] arm64: dts: renesas: spider-cpu: Enable watchdog timer
In reply to Geert UytterhoevenQuoted 6 lines · Geert Uytterhoeven
Enable the watchdog timer on the Spider board.
Extracted from a larger patch in the BSP by LUU HOAI.
Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Wolfram Sang <[email protected]>
Quoted 29 lines
---
For the watchdog to be able to actually reboot the system, this depends on proper configuration of the Watchdog Timer Reset Control Register (WDTRSTCR) in the Reset (RST) module, either by Linux[1], or by the firmware.[1] "[PATCH LOCAL v2] soc: renesas: rcar-rst: Allow WDT reset on R-Car
Gen4" https://lore.kernel.org/r/39005cf749a99afc6d3ba96ff155fd2a231418a8.1642524743.git.geert+renesas@glider.be --- arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 5 +++++ 1 file changed, 5 insertions(+)arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi +5
-0@@ -31,6 +31,11 @@ &extalr_clk { clock-frequency = <32768>; }; +&rwdt { + timeout-sec = <60>; + status = "okay"; +}; + &scif3 { status = "okay"; };