All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Chris Paterson <chris.paterson2@renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH RESEND 5.10.y-cip 12/13] watchdog: rzg2l_wdt: Use force reset for WDT reset
Date: Fri, 15 Jul 2022 08:39:15 +0100	[thread overview]
Message-ID: <20220715073916.2321319-13-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20220715073916.2321319-1-biju.das.jz@bp.renesas.com>

commit f43e6ddbd7d7b63b9e71927a1f50860f8d55f9cc upstream.

This patch uses the force reset(WDTRSTB) for triggering WDT reset for
restart callback. This method(ie, Generate Reset (WDTRSTB) Signal on
parity error)is faster compared to the overflow method for triggering
watchdog reset.

Overflow method:
	reboot: Restarting system
	Reboot failed -- System halted
	NOTICE:  BL2: v2.5(release):v2.5/rzg2l-1.00-27-gf48f1440c

Parity error method:
	reboot: Restarting system
	NOTICE:  BL2: v2.5(release):v2.5/rzg2l-1.00-27-gf48f1440c

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220225175320.11041-7-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/watchdog/rzg2l_wdt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
index 73b667ed3e99..4e7107655cc2 100644
--- a/drivers/watchdog/rzg2l_wdt.c
+++ b/drivers/watchdog/rzg2l_wdt.c
@@ -21,8 +21,11 @@
 #define WDTSET		0x04
 #define WDTTIM		0x08
 #define WDTINT		0x0C
+#define PECR		0x10
+#define PEEN		0x14
 #define WDTCNT_WDTEN	BIT(0)
 #define WDTINT_INTDISP	BIT(0)
+#define PEEN_FORCE	BIT(0)
 
 #define WDT_DEFAULT_TIMEOUT		60U
 
@@ -117,17 +120,14 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev,
 {
 	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
 
-	/* Reset the module before we modify any register */
-	reset_control_reset(priv->rstc);
-
 	clk_prepare_enable(priv->pclk);
 	clk_prepare_enable(priv->osc_clk);
 
-	/* smallest counter value to reboot soon */
-	rzg2l_wdt_write(priv, WDTSET_COUNTER_VAL(1), WDTSET);
+	/* Generate Reset (WDTRSTB) Signal on parity error */
+	rzg2l_wdt_write(priv, 0, PECR);
 
-	/* Enable watchdog timer*/
-	rzg2l_wdt_write(priv, WDTCNT_WDTEN, WDTCNT);
+	/* Force parity error */
+	rzg2l_wdt_write(priv, PEEN_FORCE, PEEN);
 
 	return 0;
 }
-- 
2.25.1



  parent reply	other threads:[~2022-07-15  7:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  7:39 [PATCH RESEND 5.10.y-cip 00/13] Add thermal driver and watchdog driver enhancements Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 01/13] kernel.h: split out mathematical helpers Biju Das
2022-07-16  9:08   ` Pavel Machek
2022-07-16 14:16     ` Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 02/13] units: Add SI metric prefix definitions Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 03/13] thermal/drivers: Add TSU driver for RZ/G2L Biju Das
2022-07-16 10:53   ` [cip-dev] " Pavel Machek
2022-07-16 14:36     ` Biju Das
2022-07-18  5:44       ` Biju Das
2022-07-18  8:55         ` Pavel Machek
2022-07-18  9:01           ` Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 04/13] thermal/drivers/rz2gl: Add error check for reset_control_deassert() Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 05/13] thermal/drivers/rz2gl: Fix OTP Calibration Register values Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 06/13] arm64: defconfig: Enable additional support for Renesas platforms Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 07/13] watchdog: rzg2l_wdt: Fix 32bit overflow issue Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 08/13] watchdog: rzg2l_wdt: Fix Runtime PM usage Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 09/13] watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 10/13] watchdog: rzg2l_wdt: Fix reset control imbalance Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 11/13] watchdog: rzg2l_wdt: Add error check for reset_control_deassert Biju Das
2022-07-15  7:39 ` Biju Das [this message]
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 13/13] watchdog: rzg2l_wdt: Add set_timeout callback Biju Das
2022-07-16 11:13   ` Pavel Machek
2022-07-16 14:24     ` Biju Das
2022-07-15  7:46 ` [PATCH RESEND 5.10.y-cip 00/13] Add thermal driver and watchdog driver enhancements Biju Das
2022-07-15  9:28   ` nobuhiro1.iwamatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220715073916.2321319-13-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=chris.paterson2@renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.