From: Guenter Roeck <linux@roeck-us.net>
To: Allen-KH Cheng <allen-kh.cheng@mediatek.com>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
linux-watchdog@vger.kernel.org
Cc: Project_Global_Chrome_Upstream_Group@mediatek.com,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2 2/2] watchdog: mtk_wdt: Add reset_by_toprgu support
Date: Mon, 16 Jan 2023 07:27:06 -0800 [thread overview]
Message-ID: <bfcac231-682d-8b2c-6c3a-e3a5a04ca5bf@roeck-us.net> (raw)
In-Reply-To: <20230116105305.31818-3-allen-kh.cheng@mediatek.com>
On 1/16/23 02:53, Allen-KH Cheng wrote:
> In some cases, the MediaTek watchdog requires the toprgu to reset
> timer after system resets.
>
> Provide a reset_by_toprgu parameter for configuration.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/mtk_wdt.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
> index 3e6212591e69..a9c437598e7e 100644
> --- a/drivers/watchdog/mtk_wdt.c
> +++ b/drivers/watchdog/mtk_wdt.c
> @@ -50,6 +50,7 @@
> #define WDT_MODE_IRQ_EN (1 << 3)
> #define WDT_MODE_AUTO_START (1 << 4)
> #define WDT_MODE_DUAL_EN (1 << 6)
> +#define WDT_MODE_CNT_SEL (1 << 8)
> #define WDT_MODE_KEY 0x22000000
>
> #define WDT_SWRST 0x14
> @@ -70,6 +71,7 @@ struct mtk_wdt_dev {
> spinlock_t lock; /* protects WDT_SWSYSRST reg */
> struct reset_controller_dev rcdev;
> bool disable_wdt_extrst;
> + bool reset_by_toprgu;
> };
>
> struct mtk_wdt_data {
> @@ -279,6 +281,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev)
> reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
> if (mtk_wdt->disable_wdt_extrst)
> reg &= ~WDT_MODE_EXRST_EN;
> + if (mtk_wdt->reset_by_toprgu)
> + reg |= WDT_MODE_CNT_SEL;
> reg |= (WDT_MODE_EN | WDT_MODE_KEY);
> iowrite32(reg, wdt_base + WDT_MODE);
>
> @@ -408,6 +412,9 @@ static int mtk_wdt_probe(struct platform_device *pdev)
> mtk_wdt->disable_wdt_extrst =
> of_property_read_bool(dev->of_node, "mediatek,disable-extrst");
>
> + mtk_wdt->reset_by_toprgu =
> + of_property_read_bool(dev->of_node, "mediatek,reset-by-toprgu");
> +
> return 0;
> }
>
prev parent reply other threads:[~2023-01-16 15:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 10:53 [PATCH v2 0/2] mtk-wdt: Add reset-by-toprgu support Allen-KH Cheng
2023-01-16 10:53 ` [PATCH v2 1/2] dt-bindings: watchdog: " Allen-KH Cheng
2023-01-16 12:06 ` AngeloGioacchino Del Regno
2023-01-16 10:53 ` [PATCH v2 2/2] watchdog: mtk_wdt: Add reset_by_toprgu support Allen-KH Cheng
2023-01-16 12:06 ` AngeloGioacchino Del Regno
2023-01-16 15:27 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bfcac231-682d-8b2c-6c3a-e3a5a04ca5bf@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=allen-kh.cheng@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®