Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp71393ybg; Mon, 27 Jul 2020 23:48:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyKddcvLywBir8MkycMAQBUCd+9IA0uFms8qrPwRktN+3y/nHp+2Ls0FNh30GqkaUm2D2 X-Received: by 2002:aa7:c98d:: with SMTP id c13mr24336676edt.188.1595918887751; Mon, 27 Jul 2020 23:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595918887; cv=none; d=google.com; s=arc-20160816; b=yCqQiGI7vIEo9e0DvQhH+xzfg8v9OBK5W7CQNwMOkAcSoM9KgKUeyOfIZgXBAuu9dz ouXGDi59CkvBtNUIHFpR3VwdR981mI7H2XZ7caMCCkseOh0GM2lsovqc+4sx+8JO0MId JHmniMRJjnfOjvLeeL1El81B4Jxmi0zURJHNG3tc64dpLiIYWo5k+twwW93/gRmNPL79 pul4qs5KfkROuUxP+dFSIwA/9LkQor7Ogsjer6L2xybQVXt/64OlKLHHh9a7OslH9Oq6 aCRmuu4bko0PzMymb6Lbz3nC4aoeVusXNzI0fYsFfreGzImAOCw9ONrlrh3oY+uE9YbD n7xg== 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=pW495nxDIklT2tHJ2rk4j3n47xrIST3PCzs1RvsHzg4=; b=YeNTcLFLnMWynYVx5CA4n+jvlCRefPybDsEzF7FneEvRPdoLWg7LBP5eBwPsPYwpZc CIYWvSwQryWTYDc03e7YqLSFtS2ZLK4dyosag09Hty5fSZHCAtNy64TOO6TKtyeY/LOz 0b5GgYCeYE27m9xb3sB45lZnJaE9oFiq/uUNXTwGePukdjJcUCmTDR4x0+Bzmsd8qDjZ tQ9eDKMyV0/SQbvwUPjVKExSzZy/zIJUkCs1B6ZRN/eP0v4bRmQ2ok3XEgucIaqu00dZ 7E7Hyg922rR0FA8FbrlWJ0fX6LROTX4Tm6b29g8L2ND15EHHqtmrCtOUEuAxDYZYahxG TCug== 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 dp1si10668916ejc.708.2020.07.27.23.47.44; Mon, 27 Jul 2020 23:48: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 S1727855AbgG1GrJ (ORCPT + 99 others); Tue, 28 Jul 2020 02:47:09 -0400 Received: from inva021.nxp.com ([92.121.34.21]:49264 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgG1GrG (ORCPT ); Tue, 28 Jul 2020 02:47:06 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3511D200AF9; Tue, 28 Jul 2020 08:47:04 +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 1E9E6200B56; Tue, 28 Jul 2020 08:47:00 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C66DC4030E; Tue, 28 Jul 2020 08:46:54 +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 2/2] watchdog: imx7ulp: Watchdog should continue running for wait/stop mode Date: Tue, 28 Jul 2020 14:42:47 +0800 Message-Id: <1595918567-2017-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595918567-2017-1-git-send-email-Anson.Huang@nxp.com> References: <1595918567-2017-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 --- 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 b414ecf..271a2e4 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