From patchwork Tue Jan 18 17:09:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12716719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41D53C3525B for ; Tue, 18 Jan 2022 17:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243375AbiARRJS (ORCPT ); Tue, 18 Jan 2022 12:09:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347017AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805B7C061751 for ; Tue, 18 Jan 2022 09:09:15 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:76d0:2bff:fec8:549]) by michel.telenet-ops.be with bizsmtp id kH992600E0kcUhD06H99lJ; Tue, 18 Jan 2022 18:09:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n9rym-00AH3A-Tf; Tue, 18 Jan 2022 18:09:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1n9rym-001BlM-CO; Tue, 18 Jan 2022 18:09:08 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Magnus Damm Cc: Wolfram Sang , LUU HOAI , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/5] clk: renesas: r8a779f0: Add WDT clock Date: Tue, 18 Jan 2022 18:09:01 +0100 Message-Id: <8d9b280065a663f2cf31db7b21a010aa781a0af1.1642525158.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org 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 Reviewed-by: Wolfram Sang Acked-by: Guenter Roeck --- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/renesas/r8a779f0-cpg-mssr.c b/drivers/clk/renesas/r8a779f0-cpg-mssr.c index 4100078406d67073..e48c5af7341454a7 100644 --- a/drivers/clk/renesas/r8a779f0-cpg-mssr.c +++ b/drivers/clk/renesas/r8a779f0-cpg-mssr.c @@ -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, From patchwork Tue Jan 18 17:09:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12716720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A59BC4707A for ; Tue, 18 Jan 2022 17:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347026AbiARRJS (ORCPT ); Tue, 18 Jan 2022 12:09:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347030AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6774C06175A for ; Tue, 18 Jan 2022 09:09:15 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:76d0:2bff:fec8:549]) by michel.telenet-ops.be with bizsmtp id kH992600B0kcUhD06H99lH; Tue, 18 Jan 2022 18:09:14 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n9rym-00AH3B-Qu; Tue, 18 Jan 2022 18:09:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1n9rym-001BlT-D6; Tue, 18 Jan 2022 18:09:08 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Magnus Damm Cc: Wolfram Sang , LUU HOAI , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Thanh Quan , Geert Uytterhoeven Subject: [PATCH 2/5] dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support Date: Tue, 18 Jan 2022 18:09:02 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org From: Thanh Quan Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC. Signed-off-by: Thanh Quan Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Acked-by: Rob Herring Reviewed-by: Guenter Roeck --- Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml index 91a98ccd4226f505..d060438e1402d502 100644 --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml @@ -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 From patchwork Tue Jan 18 17:09:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12716721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CCBAC3526B for ; Tue, 18 Jan 2022 17:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347030AbiARRJT (ORCPT ); Tue, 18 Jan 2022 12:09:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347046AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B292FC061760 for ; Tue, 18 Jan 2022 09:09:15 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:76d0:2bff:fec8:549]) by laurent.telenet-ops.be with bizsmtp id kH992600N0kcUhD01H99pN; Tue, 18 Jan 2022 18:09:14 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n9rym-00AH3C-S8; Tue, 18 Jan 2022 18:09:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1n9rym-001BlZ-Dq; Tue, 18 Jan 2022 18:09:08 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Magnus Damm Cc: Wolfram Sang , LUU HOAI , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Thanh Quan , Geert Uytterhoeven Subject: [PATCH 3/5] watchdog: renesas_wdt: Add R-Car Gen4 support Date: Tue, 18 Jan 2022 18:09:03 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org From: Thanh Quan Add the compatible string for the R-Car Gen4 family. No further driver changes are needed. Signed-off-by: Thanh Quan Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck --- drivers/watchdog/renesas_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c index 5791198960e6c5bf..41d58ea5eb2f40fd 100644 --- a/drivers/watchdog/renesas_wdt.c +++ b/drivers/watchdog/renesas_wdt.c @@ -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); From patchwork Tue Jan 18 17:09:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12716716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85877C433F5 for ; Tue, 18 Jan 2022 17:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347028AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbiARRJQ (ORCPT ); Tue, 18 Jan 2022 12:09:16 -0500 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A200C061401 for ; Tue, 18 Jan 2022 09:09:15 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:76d0:2bff:fec8:549]) by albert.telenet-ops.be with bizsmtp id kH992600H0kcUhD06H99m4; Tue, 18 Jan 2022 18:09:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n9ryn-00AH3D-4M; Tue, 18 Jan 2022 18:09:09 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1n9rym-001Bli-Er; Tue, 18 Jan 2022 18:09:08 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Magnus Damm Cc: Wolfram Sang , LUU HOAI , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 4/5] arm64: dts: renesas: r8a779f0: Add RWDT node Date: Tue, 18 Jan 2022 18:09:04 +0100 Message-Id: <556a7f41bdadceecbe8b59b79ac7e9f592ca17a2.1642525158.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org 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 Reviewed-by: Wolfram Sang Acked-by: Guenter Roeck --- arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi index 5426532d10e2a472..0ac8c345558efc17 100644 --- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi @@ -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>; From patchwork Tue Jan 18 17:09:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12716718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE441C4167E for ; Tue, 18 Jan 2022 17:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238352AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346260AbiARRJR (ORCPT ); Tue, 18 Jan 2022 12:09:17 -0500 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66923C061747 for ; Tue, 18 Jan 2022 09:09:15 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:76d0:2bff:fec8:549]) by laurent.telenet-ops.be with bizsmtp id kH992600T0kcUhD01H99pP; Tue, 18 Jan 2022 18:09:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n9ryn-00AH3E-35; Tue, 18 Jan 2022 18:09:09 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1n9rym-001Blq-GS; Tue, 18 Jan 2022 18:09:08 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Magnus Damm Cc: Wolfram Sang , LUU HOAI , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 5/5] arm64: dts: renesas: spider-cpu: Enable watchdog timer Date: Tue, 18 Jan 2022 18:09:05 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Enable the watchdog timer on the Spider board. Extracted from a larger patch in the BSP by LUU HOAI. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Acked-by: Guenter Roeck --- 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(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi index 156586532c844c41..3a90932fe85c8243 100644 --- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi @@ -31,6 +31,11 @@ &extalr_clk { clock-frequency = <32768>; }; +&rwdt { + timeout-sec = <60>; + status = "okay"; +}; + &scif3 { status = "okay"; };