From nobody Wed Apr 8 04:25:12 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF3883A168B for ; Tue, 10 Mar 2026 17:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163994; cv=none; b=uk53IcZMnaMRCYZYBAyus5H1BSGnB96C0VBJc9KK4DR52Y2Oo6Z2gGD6Xhg/ymm8AEffAE/MEqLzQTEQCC00lf95JJLcfCZJQkrwxIePuGIyQDVqBDU4V03MVzIBOW5yANq/gzTMVfCMP3Ff0Tq2PM9NN5fHQ1ndHf9dh8/V0MY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163994; c=relaxed/simple; bh=qkCssjwQ6xHfILIG/0YeecVw+n9kEcmrQqoPICmcohU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xgem768339BhQ2RgA/Sj/M5cKQ1d9cqKfsFsgW+6ZhpRcZjxNgUyfr73fqzDuGyXkkCBhELxIPonB4sZrE4adVHfQo5uerWNa1BDDC9gIuCe5XZCpXK10Jz6AsGTCCPgcfR14XbL3EpRG1j56rqgy6j2Sha/RYFe4CsNpkk2NZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Atm8u8oU; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Atm8u8oU" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 4DF1CC40416; Tue, 10 Mar 2026 17:33:32 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 68C0C60002; Tue, 10 Mar 2026 17:33:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 804231036891C; Tue, 10 Mar 2026 18:33:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773163990; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=HeFNpkruOmIcHovjLW+aFCk9gvji8MHWFyaMG1utC/c=; b=Atm8u8oU2ud9vUuVBB2OuoRZEV62E6YjAb3YcmHkF71JQaiEj1jyetrHwdNV4iKJjw4Mv6 +rMQ8q5rH69Vk65Ijze/WTnWIzSOfC836FtbP4Af6D3UfuZgjAfAoKa7VetIy+tTT9Rn71 vI/9vcfqHhG1MlNZpyTYnbHWb8Ks/eU/EZ2MnYci8L4TbISGGcoMKK+jPGQDUFrT67w3sL 5sDCA4fmocIZ5C6ZtVk7+mkEu501gs9gTob60IYFBBGRYZL50PE/LDhhN0J7f4wS4G8eXG SzfA5NbKF2HKcX6c7HH38/1grMnLjNVlLBJYXiTivmV1+ZLiiPlABZ2Lor45vg== From: "Herve Codina (Schneider Electric)" To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni , "Herve Codina (Schneider Electric)" Subject: [PATCH 1/5] watchdog: rzn1: Fix reverse xmas tree declaration Date: Tue, 10 Mar 2026 18:32:42 +0100 Message-ID: <20260310173249.161354-2-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310173249.161354-1-herve.codina@bootlin.com> References: <20260310173249.161354-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" Variables declared in probe() don't follow the reverse xmas tree convention. Fix the declaration in order to follow the convention. Signed-off-by: Herve Codina (Schneider Electric) --- drivers/watchdog/rzn1_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c index 96fd04fbc2a2..b7034eac91d0 100644 --- a/drivers/watchdog/rzn1_wdt.c +++ b/drivers/watchdog/rzn1_wdt.c @@ -101,10 +101,10 @@ static const struct watchdog_ops rzn1_wdt_ops =3D { static int rzn1_wdt_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct rzn1_watchdog *wdt; struct device_node *np =3D dev->of_node; - struct clk *clk; + struct rzn1_watchdog *wdt; unsigned long clk_rate; + struct clk *clk; int ret; int irq; =20 --=20 2.53.0 From nobody Wed Apr 8 04:25:12 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B3D43D47BE; Tue, 10 Mar 2026 17:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163997; cv=none; b=MnlE0tgucVoeOdzgIdDytD6uw3089iqwc7qmNZyMsPR7QwTPO1x2YRFBNSQAxLeLF5b2zTNrO4uyzfP3itHXyVYit3B6qcANYuX9wgjCdTxDp2IVTgJ+fPLt9Xv1xy4Z6KjUD2Frg74hykEnp31AlSkuJs3yIuir3+jrkeGD6m0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163997; c=relaxed/simple; bh=Qt3ZDT/2XZ2Gk5tU2c5HYGzHYX+19Rtxn+0VOyRn2mM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G+qia/YkmSCwqsdLIXai/tAbLsiZXC+815//cpR9+YJu6wYFzHmvHgch9tf6KPfgm2YNCSCZepCF62bT6OCE3aw+I3pI/DnLAWVq3z1OW5/QtxCQD1RfOJT1hY03wQyL+H1ddaRGPvP6/rDzA3bJs0OARKN8TRLb4TwokWdJwS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JHHCNXwP; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JHHCNXwP" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 0C644C4043F; Tue, 10 Mar 2026 17:33:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2799E60002; Tue, 10 Mar 2026 17:33:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C72A71036983C; Tue, 10 Mar 2026 18:33:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773163992; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=EMW5EU8HgoMFqKlp2Z2bzKPzG2PRYsuDMfOvCVxf+io=; b=JHHCNXwPvRVQqFET52VaxN6WmFGZh2Tfg/X0rkNp9sF3d96OMxg6XSLClEKp3e5Goeklrb XhD18V430qhJAOJk4Ms5+zjme3zyl4wNFl5UiKr91YhcwZT8dlVWSmEaX24t+LKBO4euXM JaheL5MoCEAN6cwaPgV2DY9xV1repbq6eXLv95zAElwmkxKiHxO5giLwJds1VPZkg+wJvO Iiv2jZBYAaqywOdyjmuScscQ9SUlBjZXRYn7KF0yaZbapJY3c5kTIUG6lBCmNXf70dHZXy ICQnVeUpEqmhbIMU4xjgApjawK96MFi/dN1XGDkCha3TYRG6KkdE9oNAKkz/zA== From: "Herve Codina (Schneider Electric)" To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni , "Herve Codina (Schneider Electric)" Subject: [PATCH 2/5] watchdog: rzn1: Use dev_err_probe() Date: Tue, 10 Mar 2026 18:32:43 +0100 Message-ID: <20260310173249.161354-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310173249.161354-1-herve.codina@bootlin.com> References: <20260310173249.161354-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" In the probe() function the following pattern is present several times: if (err) { dev_err(dev, ...); return err; } Replace them by dev_err_probe() calls. Signed-off-by: Herve Codina (Schneider Electric) --- drivers/watchdog/rzn1_wdt.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c index b7034eac91d0..98978b5cc5b4 100644 --- a/drivers/watchdog/rzn1_wdt.c +++ b/drivers/watchdog/rzn1_wdt.c @@ -122,22 +122,16 @@ static int rzn1_wdt_probe(struct platform_device *pde= v) =20 ret =3D devm_request_irq(dev, irq, rzn1_wdt_irq, 0, np->name, wdt); - if (ret) { - dev_err(dev, "failed to request irq %d\n", irq); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to request irq %d\n", irq); =20 clk =3D devm_clk_get_enabled(dev, NULL); - if (IS_ERR(clk)) { - dev_err(dev, "failed to get the clock\n"); - return PTR_ERR(clk); - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n"); =20 clk_rate =3D clk_get_rate(clk); - if (!clk_rate) { - dev_err(dev, "failed to get the clock rate\n"); - return -EINVAL; - } + if (!clk_rate) + return dev_err_probe(dev, -EINVAL, "failed to get the clock\n"); =20 wdt->clk_rate_khz =3D clk_rate / 1000; wdt->wdtdev.info =3D &rzn1_wdt_info; --=20 2.53.0 From nobody Wed Apr 8 04:25:12 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFCC43D47A7; Tue, 10 Mar 2026 17:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163999; cv=none; b=DX9cy7ERiDCfu5EMX6zuhyh5p2dy9Pks4H++QDhrSTOrMiHbpbNEBnux0cRLB7ValDP+2VPmCv5Z5AaM6jsIEyBEFPCflw53hiTFX3hVw0PWN3QLzUar1ay8z2FYyYMaJL9M8Nt4FcYHyk7NtWA7oM+dHIGLfNjhRDrUAyYtUIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163999; c=relaxed/simple; bh=rw5CNRLMFys610e++cev4bsw0a7rDV7XO3NZVgUWgWw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fvy0eVvrd/SvUx0hX6Jl5HiIoQZdAf5jf8KQw8UiZYun4qAwrnJa9eUITL3M+b7r1BCl7vGbYus8mjfh1LzrxzmW6TukVc7h6RIYOjQvgdwJ6f1Vfi/1l8VQ/YsODee/r90eUyZgPnfDcVsKxakMra+wMXbZtpkGXMOw2W9WFyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Bn3la5Pf; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Bn3la5Pf" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 7885AC143E9; Tue, 10 Mar 2026 17:33:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 929F060002; Tue, 10 Mar 2026 17:33:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 403AE103695CB; Tue, 10 Mar 2026 18:33:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773163995; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=feEz3+qO75OIwcAuVbGFyb0mGQaBJCrWpdr0PhToImM=; b=Bn3la5PfE6o3tJHQ1hGEyUQpPSAc3ByQsVmOdAEgF72hukTli+LkUi2j8gPLKe08z7T8CK j/RbyaX2Ms2omTEcNsXpO5j4AbHO/QBqx/osiAkYUHnbMYKttGM/W3zBMy74sDjB/fZ7JH JD9OFk/uwQ/HkY4GFV2cjdSHAhKgH9qPyIkAzFCiUq2BZh2ilHBYRObSF0MFm1obCMtMMz IJffiIa6WuQ81BuOuD8tg0r5QIPR3kzNrDfZ3aE+2448/YclQLWoCSclFKHFjlIoR1sogG 33tz4phwdUpYIZb2j9+NelWDBzYD1NpR+j5CTzfACpnD6nsl+dmp5T+YrlDZsQ== From: "Herve Codina (Schneider Electric)" To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni , "Herve Codina (Schneider Electric)" Subject: [PATCH 3/5] dt-bindings: watchdog: renesas,rzn1-wdt: Document the reset line Date: Tue, 10 Mar 2026 18:32:44 +0100 Message-ID: <20260310173249.161354-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310173249.161354-1-herve.codina@bootlin.com> References: <20260310173249.161354-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" Watchdogs available in the RZ/N1 SoC can use their specific hardware reset line to reset the system on watchdog timeout. This line is not documented in the current binding. Fill this lack and describe this per watchdog reset line. Signed-off-by: Herve Codina (Schneider Electric) --- .../bindings/watchdog/renesas,rzn1-wdt.yaml | 22 +++++++++++++++++++ .../dt-bindings/watchdog/renesas,rzn1-wdt.h | 16 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 include/dt-bindings/watchdog/renesas,rzn1-wdt.h diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.ya= ml b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml index 7e3ee533cd56..40a9a4ebc716 100644 --- a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml @@ -26,6 +26,26 @@ properties: =20 timeout-sec: true =20 + renesas,reset-line: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + description: | + The watchdog reset line (dt-bindings/watchdog/renesas,rzn1-wdt.h def= ines + these values). A wachdog timeout asserts this reset line to perform a + hardware system reset. Two watchdogs are present in the RZ/N1 SoC and + each of them has a dedicated reset line. + + - 0: RZN1_WDT_A7_0 + This reset line can be asserted only by the A7 0 watchdog. This + watchdog is the one mapped at 0x40008000 on RZ/N1 SoCs. + + - 1: RZN1_WDT_A7_1 + This reset line can be asserted only by the A7 1 watchdog. This + watchdog is the one mapped at 0x40009000 on RZ/N1 SoCs. + + If the renesas,reset-line property is not present, the watchdog time= out + only triggers an interrupt. + required: - compatible - reg @@ -41,10 +61,12 @@ examples: - | #include #include + #include =20 watchdog@40008000 { compatible =3D "renesas,r9a06g032-wdt", "renesas,rzn1-wdt"; reg =3D <0x40008000 0x1000>; interrupts =3D ; clocks =3D <&sysctrl R9A06G032_CLK_WATCHDOG>; + renesas,reset-line =3D ; }; diff --git a/include/dt-bindings/watchdog/renesas,rzn1-wdt.h b/include/dt-b= indings/watchdog/renesas,rzn1-wdt.h new file mode 100644 index 000000000000..fe534aff0609 --- /dev/null +++ b/include/dt-bindings/watchdog/renesas,rzn1-wdt.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * RZ/N1 watchdog reset lines + * + * Copyright (C) 2026 Bootlin + * + * Herve Codina + */ + +#ifndef __DT_BINDINGS_RZN1_WDT_H__ +#define __DT_BINDINGS_RZN1_WDT_H__ + +#define RZN1_WDT_A7_0 0 +#define RZN1_WDT_A7_1 1 + +#endif /* __DT_BINDINGS_RZN1_WDT_H__ */ --=20 2.53.0 From nobody Wed Apr 8 04:25:12 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70AE13D47BC for ; Tue, 10 Mar 2026 17:33:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164001; cv=none; b=nKI4sch/USMVkbfawKEjAb3CWRpyJS7jCiBENuF+moMpqyrvh3cqQcst9oAOkosYpZnplxWrRucJirqdX41sc3LXtIsSzl22m/Gff8E1l/gDQ+4PZspKh43+afQfyB7VcHVRJP4wSRAlQAbW48lr4Dl9HSDqz42x3RrOiwOr9nM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164001; c=relaxed/simple; bh=uTxcEX9dtGW13fmgVaUG0TJvPmOSE3Up0iusG94HGDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQY7IBq8wbK5vC0aeqMujssQqOJZCBhqrIrtZ5OvKLNPYiWF1Zz0+ZDXZutqN71Dvjzi7tUj4RnayuG2SqAapLXW+tDv3gVt3hmwYoEhV92YGxlb0igZDDy0nqT+6Th8BGvnoOY0u7c3GfwWr6wAA42aAGdJV753zo9zxG5zdPs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=kVKvo+Zm; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="kVKvo+Zm" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 0DC34C4043F; Tue, 10 Mar 2026 17:33:40 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2848D60002; Tue, 10 Mar 2026 17:33:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EE2C61036987B; Tue, 10 Mar 2026 18:33:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773163997; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=QMk4xKL7rwkuDzgFTLggs6bTGets20VvaMmysYufXCE=; b=kVKvo+ZmV7YIFp+k4mo4GdYzH11QVgENz5yaPJhCW6d1hvMyvr7pvybDtMT2eGfWY2+aQu YJbwZs1Ro/7nShbvmvqB0h69b07vzVHxNgQtusxPxLNDYytA1PJbH06GcLkqbgzStTfIYe vPOPXjc9S70LSYK/dTB/OmX9lgesrcXOmePFF2Iu2gRehDgNuIzB15qqoBClvolIZkMLF3 FyNDSzWPyYm07cQp4pNJOzMfUeKV/fEq7vj1JS8Cdvo4nOagL7HGA9uwDM+lS4HPk+2zbG kQYdOOL9hs9+j4nHWsrOFqFOsNpZYU3AHCWSwJ3fs9vo6oB5Wq+UentaTjN+xA== From: "Herve Codina (Schneider Electric)" To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni , "Herve Codina (Schneider Electric)" Subject: [PATCH 4/5] clk: renesas: r9a06g032: Introduce a helper to set rsten register Date: Tue, 10 Mar 2026 18:32:45 +0100 Message-ID: <20260310173249.161354-5-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310173249.161354-1-herve.codina@bootlin.com> References: <20260310173249.161354-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The rsten register is part of the system controller address range. This register controls the reset sources allowed to reset the system. Among them, watchdogs can be configured to be able to perform this reset. Introduce a new helper r9a06g032_sysctrl_enable_rst() in order to set specific sources in the rsten register from the watchdog driver. Signed-off-by: Herve Codina (Schneider Electric) --- drivers/clk/renesas/r9a06g032-clocks.c | 32 +++++++++++++++++++ include/linux/soc/renesas/r9a06g032-sysctrl.h | 12 +++++++ 2 files changed, 44 insertions(+) diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r= 9a06g032-clocks.c index 7407a4183a6c..517d46ff150e 100644 --- a/drivers/clk/renesas/r9a06g032-clocks.c +++ b/drivers/clk/renesas/r9a06g032-clocks.c @@ -705,6 +705,38 @@ int r9a06g032_sysctrl_set_dmamux(u32 mask, u32 val) } EXPORT_SYMBOL_GPL(r9a06g032_sysctrl_set_dmamux); =20 +int r9a06g032_sysctrl_enable_rst(enum r9a06g032_sysctrl_rst_src rst_src) +{ + unsigned long flags; + u32 rsten; + u32 val; + + switch (rst_src) { + case R9A06G032_RST_WATCHDOG_CA7_0: + val =3D R9A06G032_SYSCTRL_WDA7RST_0; + break; + + case R9A06G032_RST_WATCHDOG_CA7_1: + val =3D R9A06G032_SYSCTRL_WDA7RST_1; + break; + default: + return -EINVAL; + } + + if (!sysctrl_priv) + return -EPROBE_DEFER; + + spin_lock_irqsave(&sysctrl_priv->lock, flags); + + rsten =3D readl(sysctrl_priv->reg + R9A06G032_SYSCTRL_RSTEN); + writel(rsten | val, sysctrl_priv->reg + R9A06G032_SYSCTRL_RSTEN); + + spin_unlock_irqrestore(&sysctrl_priv->lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(r9a06g032_sysctrl_enable_rst); + static void clk_rdesc_set(struct r9a06g032_priv *clocks, struct regbit rb, unsigned int on) { diff --git a/include/linux/soc/renesas/r9a06g032-sysctrl.h b/include/linux/= soc/renesas/r9a06g032-sysctrl.h index 066dfb15cbdd..25542b49eb55 100644 --- a/include/linux/soc/renesas/r9a06g032-sysctrl.h +++ b/include/linux/soc/renesas/r9a06g032-sysctrl.h @@ -4,8 +4,20 @@ =20 #ifdef CONFIG_CLK_R9A06G032 int r9a06g032_sysctrl_set_dmamux(u32 mask, u32 val); + +enum r9a06g032_sysctrl_rst_src { + R9A06G032_RST_WATCHDOG_CA7_0, + R9A06G032_RST_WATCHDOG_CA7_1, +}; + +int r9a06g032_sysctrl_enable_rst(enum r9a06g032_sysctrl_rst_src rst_src); + #else static inline int r9a06g032_sysctrl_set_dmamux(u32 mask, u32 val) { return= -ENODEV; } +static inline int r9a06g032_sysctrl_enable_rst(enum r9a06g032_sysctrl_rst_= src rst_src) +{ + return -ENODEV; +} #endif =20 #endif /* __LINUX_SOC_RENESAS_R9A06G032_SYSCTRL_H__ */ --=20 2.53.0 From nobody Wed Apr 8 04:25:12 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 325873D47B7; Tue, 10 Mar 2026 17:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164004; cv=none; b=fVUmIOEVXNde6GXFe0sn9xxVAr+dRfHN6iNKzOvYgfff/TpzwlVjk1i6IBnuFdYSQSDKEvMcL6Qh5PixNBY6tjyaSb4ToHBNZ1g8iCcKABgrj/hxPoqO7dCnomXRrqy+PNdN3OPm+eeJBoHkW/vQmXhs1vbpQzqmPPYVIOwCNJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164004; c=relaxed/simple; bh=1T6p5KsN1pwB4Ol/pVJRcapshgNGqQS39CqJTyy02ZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jxDK4x0iLonEzW8moYfQ0eTC1ye/rHpeIQZsNWi5FVU0NmeAUFsY2kSQ2U/5eBl1X5EeSK4AEfnXQGHubhh23ErSpWtfGB1zr1j6/k+FuEliC65FB/iPFBYqDnNcPaH/iUVJtN42k7Yl9n2d6bHKWItxDlQFkttbIPQ4/pOTYWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=xi0hJaKR; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="xi0hJaKR" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id DD30F4E425F7; Tue, 10 Mar 2026 17:33:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B207B60002; Tue, 10 Mar 2026 17:33:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 49381103698A1; Tue, 10 Mar 2026 18:33:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773164000; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=J9cp/78Fdro1XhRiY6Ly7bl3/c4mvPbQyBM9B+ojKn8=; b=xi0hJaKRKzm5xF49hPsj8rlOmQqoFdCP4Q6LjhoI7YvQHmDUZE4aNTDfxDnV2px4Q4BVeE NNVsZ3Hb+rgMIafsSchpXwnrV4/hzJWRwkutQe8AwPON0Pv6j8yW0A7bjgmDktTQ0xwZ9V 1usfhYsfg+CH1g5ELzodj6PtCYdkljsGWjiRuZFnK3K4A4CfFbyRb86YLVRphy+pEoWty0 eHyfAbvxakggqxX/AVEW3xd8AUC5KQENP/0jEeOKsPe94w6mh6XA5CC/2RzIv+OoVXJseq N5S6dbGwy/gQmusDcHAOh7sW0wForrQoZVon9slnB/oFbrNg4ytVqyhaygvdSg== From: "Herve Codina (Schneider Electric)" To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni , "Herve Codina (Schneider Electric)" Subject: [PATCH 5/5] watchdog: rzn1: Add support for direct hardware reset Date: Tue, 10 Mar 2026 18:32:46 +0100 Message-ID: <20260310173249.161354-6-herve.codina@bootlin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260310173249.161354-1-herve.codina@bootlin.com> References: <20260310173249.161354-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The watchdog timeout is signaled using an interrupt and, on this interrupt, a software initiated reset is performed. The watchdog is able to control directly the hardware reset without any operation done by the interrupt handler. This feature allows the watchdog to not depend on the software to reset the system when the watchdog timeout occurs. The 'renesas,reset-line' device-tree property has been recently introduced in order to describe the hardware reset line used by the watchdog on its timeout. Handle this property in the driver and add support for the related direct hardware reset. Signed-off-by: Herve Codina (Schneider Electric) --- drivers/watchdog/rzn1_wdt.c | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c index 98978b5cc5b4..bf623ea31be1 100644 --- a/drivers/watchdog/rzn1_wdt.c +++ b/drivers/watchdog/rzn1_wdt.c @@ -17,7 +17,9 @@ #include #include #include +#include #include +#include =20 #define DEFAULT_TIMEOUT 60 =20 @@ -98,6 +100,41 @@ static const struct watchdog_ops rzn1_wdt_ops =3D { .ping =3D rzn1_wdt_ping, }; =20 +static int rzn1_wdt_setup_rst_line(struct device *dev) +{ + enum r9a06g032_sysctrl_rst_src rst_src; + u32 reset_line; + int ret; + + ret =3D of_property_read_u32(dev->of_node, "renesas,reset-line", &reset_l= ine); + if (ret) { + if (ret =3D=3D -EINVAL) + return 0; /* Property not present -> Ok, nothing to do */ + + return dev_err_probe(dev, ret, "Read 'renesas,reset-line' failed\n"); + } + + switch (reset_line) { + case RZN1_WDT_A7_0: + rst_src =3D R9A06G032_RST_WATCHDOG_CA7_0; + break; + case RZN1_WDT_A7_1: + rst_src =3D R9A06G032_RST_WATCHDOG_CA7_1; + break; + + default: + return dev_err_probe(dev, -EINVAL, + "Invalid 'renesas,reset-line' (%u)\n", + reset_line); + } + + ret =3D r9a06g032_sysctrl_enable_rst(rst_src); + if (ret) + return dev_err_probe(dev, ret, "Failed to enable reset\n"); + + return 0; +} + static int rzn1_wdt_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -116,6 +153,10 @@ static int rzn1_wdt_probe(struct platform_device *pdev) if (IS_ERR(wdt->base)) return PTR_ERR(wdt->base); =20 + ret =3D rzn1_wdt_setup_rst_line(dev); + if (ret) + return ret; + irq =3D platform_get_irq(pdev, 0); if (irq < 0) return irq; --=20 2.53.0