Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1582675ybg; Wed, 29 Jul 2020 19:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz692ITQCeYTtGScVmy3GcEqU7TYxMGMMM3h2B6KvlYdSf88EdWLfRoiQ4srYhs+gyxApL3 X-Received: by 2002:a05:6402:21e6:: with SMTP id ce6mr564680edb.275.1596074887786; Wed, 29 Jul 2020 19:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596074887; cv=none; d=google.com; s=arc-20160816; b=RncXpDmr7+87zNP+ay0sKZ8qbKj3bOGwTpZtTAbxkuY1s061pFg5KvZfwSzbZ61/Ma a3lCsqkaK+f+BYyPwAfiihp/rzBxf3aYDLRZjA2aNveqQW+PlzZfQcdvPHrqELQD0L3g 7y76EVZiSmy7CSb++ApNZ9McxJxy5ciJ+Kx/wxvUQFyXt2wDfYX2MW0EqXosrgjzDhjd Sy+rKqJOplyXsWgn+++LVq1hANGMPEHpg9FGhRc7Mztt0xtNtLCJlVaDwGDwhVgGk/z5 MGrW8UovrlR8pAB42cyA/sHPcx1j1cWlHMG63bX/aQu4N1/vUqzZgjVpEcxf8tsiqGtP KXKQ== 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=BHahKxQK4ZoabpRNU6V1saKF+jg65a9KncbKa3S7VbY=; b=bIjV4Vmht4FLgwOO9+E/3sAZ2ko11tRqIKSgrrTVNiNv6mS6IGl26v501xoLFZCQgS ZuP5FSOM3G/eQKPBmF45jmkFnhCEutfYRD8GaL957AEqreM2So0eITpJMFnTh8aqMbVe 1nC2l4HqH+v0kS/GLxYxYGsW8WNOe/Lu6lVrjIJhLDGMu8lbhQx89iUDKXmouBKyJF5p UtdHgZ6jAeFfoUBh6D12t2hwCX/HTze2d59UgwWW7Y1UQHxDAmak2Mq9z0roZdDDvZnV H7LDtUZ8OU0QfVckPPVq6eqdtOwklrn0eWBlBd/I8lKFuHUrrwPyIAyhqzmkmE3D2MjT EtZw== 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 f1si2272745edr.11.2020.07.29.19.07.45; Wed, 29 Jul 2020 19:08:07 -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 S1728368AbgG3CHe (ORCPT + 99 others); Wed, 29 Jul 2020 22:07:34 -0400 Received: from inva021.nxp.com ([92.121.34.21]:57388 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgG3CHd (ORCPT ); Wed, 29 Jul 2020 22:07:33 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F018E201144; Thu, 30 Jul 2020 04:07:31 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DADA8201145; Thu, 30 Jul 2020 04:07:27 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7BECB40310; Thu, 30 Jul 2020 04:07:22 +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 V3 2/2] watchdog: imx7ulp: Watchdog should continue running for wait/stop mode Date: Thu, 30 Jul 2020 10:03:11 +0800 Message-Id: <1596074591-4207-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596074591-4207-1-git-send-email-Anson.Huang@nxp.com> References: <1596074591-4207-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 010ddd1..77773b0 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 @@ -187,7 +189,8 @@ static int 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); -- 2.7.4