Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AFB5C7EE32 for ; Thu, 2 Mar 2023 15:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229900AbjCBPPe (ORCPT ); Thu, 2 Mar 2023 10:15:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjCBPP3 (ORCPT ); Thu, 2 Mar 2023 10:15:29 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8CE38B52; Thu, 2 Mar 2023 07:15:27 -0800 (PST) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2FF8966018CA; Thu, 2 Mar 2023 15:15:25 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1677770125; bh=XDztbEfmSsWdhvyNwXpUvERVe2JxCB34x7YGEA1gAxQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hIWmhALVlRXTtzN+QFo5val3tRedI0IU+GM0t7eJZpQRWLt27+PIJs5zhXny57c56 nb3DIulazp6wc9jOoxwUoI6EKCIzZ/isv10f7oEDbfg5sFw/13ajH4fEiLbr37Z9Ak 7vfKqzVVq8vkuTkYKVpalIpsf0FRlxBdhCLcfaHZyPIytkFmCyqBQSwsSHIHlJO4J2 WExHtCvzGOMr7LNNJG7hOuw/jIRlF/Ic8cNNHohI/kcw+MJzOXzlqaQ0H+Ncck9j8/ v4X10skRDtTLXplMx3hzzr6o46n68XPc6N/8slULvetHRPziojT/ni9cIeMuXtPyD1 IPHdia+fnJMTw== Message-ID: <0398e95e-dbb8-2e41-7b36-12e36b8729f0@collabora.com> Date: Thu, 2 Mar 2023 16:15:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 2/2] watchdog: mtk_wdt: Add support for MT6735 WDT Content-Language: en-US To: Yassine Oudjana , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Philipp Zabel Cc: Yassine Oudjana , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230302124015.75546-1-y.oudjana@protonmail.com> <20230302124015.75546-3-y.oudjana@protonmail.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230302124015.75546-3-y.oudjana@protonmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 02/03/23 13:40, Yassine Oudjana ha scritto: > From: Yassine Oudjana > > Add support for the watchdog timer/top reset generation unit found on MT6735. > Disable WDT_MODE_IRQ_EN in mtk_wdt_restart in order to make TOPRGU assert > the SYSRST pin instead of issuing an IRQ. This change may be needed in other > SoCs as well. > > Signed-off-by: Yassine Oudjana > --- > drivers/watchdog/mtk_wdt.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c > index a9c437598e7e..5a7a7b2b3727 100644 > --- a/drivers/watchdog/mtk_wdt.c > +++ b/drivers/watchdog/mtk_wdt.c > @@ -10,6 +10,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -82,6 +83,10 @@ static const struct mtk_wdt_data mt2712_data = { > .toprgu_sw_rst_num = MT2712_TOPRGU_SW_RST_NUM, > }; > > +static const struct mtk_wdt_data mt6735_data = { > + .toprgu_sw_rst_num = MT6735_TOPRGU_RST_NUM, > +}; > + > static const struct mtk_wdt_data mt6795_data = { > .toprgu_sw_rst_num = MT6795_TOPRGU_SW_RST_NUM, > }; > @@ -187,9 +192,15 @@ static int mtk_wdt_restart(struct watchdog_device *wdt_dev, > { > struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); > void __iomem *wdt_base; > + u32 reg; > > wdt_base = mtk_wdt->wdt_base; > > + /* Enable reset in order to issue a system reset instead of an IRQ */ > + reg = readl(wdt_base + WDT_MODE); > + reg &= ~WDT_MODE_IRQ_EN; > + writel(reg | WDT_MODE_KEY, wdt_base + WDT_MODE); This is unnecessary and already done in mtk_wdt_start(). If you think you *require* this snippet, you most likely misconfigured the devicetree node for your device :-) Please remove this snippet. Regards, Angelo