Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp768325ybg; Tue, 28 Jul 2020 19:25:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWZ7FqyJu6s7ZGcGa9WoW/VJNu7nKJWkvsqYNX0OYHoms1pRndxBOf/f07BlhKum/19mbZ X-Received: by 2002:a17:906:53c1:: with SMTP id p1mr22293308ejo.15.1595989529746; Tue, 28 Jul 2020 19:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595989529; cv=none; d=google.com; s=arc-20160816; b=qux/Ogov5ZH8zyaibx705UubeGbTD/BzgFrGMYlOEbVgUPf4nnAfYvgsMqKUhYh7iG iG8ieuy7Fk6Uyyrvo8/ua3i+Ulglh31PgStxahPP9IuwtKBMF+8L4GT+txX5mhcI3MCD TO2LR63wh/BKptMksSuvGnfV6Y9Kht9HYVNCaB+5Zfg0Z1LhIg4bNWZGyhOGLN4RnHh6 MmD+5+L4Le8Xkzf8F1WGxDjhThcJfepICl13xVYu/qAdAtLXlQgwv96rBMYGee16EYKl RvadHsURlip9I+QBgwxRSeNr7rzTKBpmRZQonkM9wPTAoQzJ4QhCh+oOQomy+O41QxCS 3LNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=F/yQI7WdNVonrsUl6HJp5Ckk1heiaUdK63hIaMdR4x4=; b=0ZdQ6J31Hl4Z/HlZX1v+oXO9M+YLgkVjmGPU9dkn0vu+DUVpIESj14lNgsXF9wXEcZ dADLdBFPOuvfaJmB6Ay53RLavLwbLBn6EzATbZtjJ/wNEg4PEZ+L08ps/M0BIUYykyFB 1nYBwjIkqC9l82tAykt9XmetZj91KaB6sPWT2RF6gHXapU6lpU/KN5rDKHx9vTV/pQaH IlmhOzNuKUSubfFd0j7lKvhiShv/06d4DX3ezo65x6uKh3yNUzONqX/EoREhazJHqIJ7 Tp/yxyX0uhC6M3VzOGL83cJAq3DYmYhSJcS/OYytm90gvKIw5xQ4cpcpGSGorH9+QLLr tYKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi20si195631ejb.365.2020.07.28.19.25.08; Tue, 28 Jul 2020 19:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731083AbgG2CYs (ORCPT + 99 others); Tue, 28 Jul 2020 22:24:48 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59862 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731004AbgG2CYr (ORCPT ); Tue, 28 Jul 2020 22:24:47 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B232F1A0975; Wed, 29 Jul 2020 04:24:45 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9BD771A0F93; Wed, 29 Jul 2020 04:24:41 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3E12940302; Wed, 29 Jul 2020 04:24:36 +0200 (CEST) From: Anson Huang To: wim@linux-watchdog.org, linux@roeck-us.net, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V2 2/2] watchdog: imx7ulp: Watchdog should continue running for wait/stop mode Date: Wed, 29 Jul 2020 10:20:27 +0800 Message-Id: <1595989227-24700-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595989227-24700-1-git-send-email-Anson.Huang@nxp.com> References: <1595989227-24700-1-git-send-email-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When kernel idle, system will enter wait/stop mode, wdog should continue running in this scenario, and the refresh thread can wake up system from wait/stop mode. Signed-off-by: Anson Huang --- no change. --- drivers/watchdog/imx7ulp_wdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index 7d2b12e..2b4ff43 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -22,6 +22,8 @@ #define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT) #define WDOG_CS_EN BIT(7) #define WDOG_CS_UPDATE BIT(5) +#define WDOG_CS_WAIT BIT(1) +#define WDOG_CS_STOP BIT(0) #define WDOG_CNT 0x4 #define WDOG_TOVAL 0x8 @@ -174,7 +176,8 @@ static void imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) /* set an initial timeout value in TOVAL */ writel(timeout, base + WDOG_TOVAL); /* enable 32bit command sequence and reconfigure */ - val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE; + val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE | + WDOG_CS_WAIT | WDOG_CS_STOP; writel(val, base + WDOG_CS); imx7ulp_wdt_wait(base, WDOG_CS_RCS); local_irq_enable(); -- 2.7.4