Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2294733ybg; Thu, 30 Jul 2020 16:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFfNpZtlLF4Ld3aPA3o0smbKrBKDmQUEry/LC5XHOeP88vc46SfPyoS9OnURi3H0zmXHdh X-Received: by 2002:a05:6402:1f8:: with SMTP id i24mr1238429edy.251.1596150567353; Thu, 30 Jul 2020 16:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596150567; cv=none; d=google.com; s=arc-20160816; b=trtt0ZkmF06wO+3JOwxv/3yTKsNPAANa7LQH6fiKHqUD9TXOQ+u+3TA0upfaR4+Quo 0SknZjB+/GwGEGr1f2AT/i1AxN2sdIOnIPwP+pourhkMLNBD5jeWzhJ6nHAi3V5j6pLA tzJH9kQrwumeuDln1NhQfj7T9gX1qsRsYIskamT5EkjDJ88D7sIBNBjvcijBhETM8+dV pxXqPpSy8QsatYpnk/UjiYWk2hEGsAg0oQXSHu4iROj4g7vYC6mq3wENObZLlTdW7sAT DYKdYU/BhUhX6cE+uRlWkQ1SUSXQi28taxxZ8s7Y9lT2rsk+32KWGbpzkRC7boWKdeo2 6knQ== 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=ZDmUAnc6s+1Tbh5Dz6EXjh+I7/jS7BK+VvuK0JExmFs=; b=IvxLpywe/mhjygMpyTUW+Civ4IoY7+4mmqYNevqNSsZoK61W+eOzjQjITtfLvLpd2q KFgpQEsChK47F3kLnFfv8nBUerWN3HvzKjjw44+9S4EJJFxrDwjuFfspsV3tjRFNxWez 8M8agmPsqNWDHliKMoA5hUUe9Jgczbur7MKj9Sixop4nVWvos53kvH9GgoGN94Mk7DW6 b/J0rJ0OIUE/pvm7x1z2D+vayR6kUAySV5V3aZsQLuPSV5/Ejoi4VmK4XXvUxAGh9VI/ 4MqhQPGZfO5PAKiW+bYhS7Zz0BaZQr23+PwSjXZQSeyDujy10SF28wVsB9t8Q1A0OxeH Fcqg== 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 v8si4924051edl.307.2020.07.30.16.08.52; Thu, 30 Jul 2020 16:09:27 -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 S1730743AbgG3XIQ (ORCPT + 99 others); Thu, 30 Jul 2020 19:08:16 -0400 Received: from inva020.nxp.com ([92.121.34.13]:42746 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730724AbgG3XIO (ORCPT ); Thu, 30 Jul 2020 19:08:14 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EF4F11A1498; Fri, 31 Jul 2020 01:08:05 +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 BBE2F1A0767; Fri, 31 Jul 2020 01:08:01 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3A73F4031E; Fri, 31 Jul 2020 01:07:56 +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 V4 2/2] watchdog: imx7ulp: Watchdog should continue running for wait/stop mode Date: Fri, 31 Jul 2020 07:03:33 +0800 Message-Id: <1596150213-31638-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596150213-31638-1-git-send-email-Anson.Huang@nxp.com> References: <1596150213-31638-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 badfc0b..922b603 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