From: Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: Ben Grisdale <bengris32@protonmail.ch>,
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,
Roman Vivchar <rva333@protonmail.com>
Subject: [PATCH 2/3] watchdog: mediatek: add mt6797 support
Date: Tue, 10 Nov 2026 21:22:22 +0200 [thread overview]
Message-ID: <20261110-6797-wdt-v1-2-7f07755b6074@protonmail.com> (raw)
In-Reply-To: <20261110-6797-wdt-v1-0-7f07755b6074@protonmail.com>
From: Roman Vivchar <rva333@protonmail.com>
Add support for mt6797 SoC watchdog, which provides 17 software resets.
The mapping table uses bits from the datasheet [1].
Link: https://www.96boards.org/documentation/consumer/mediatekx20/additional-docs/docs/MT6797_Register_Table_Part_1.pdf [1]
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
drivers/watchdog/mtk_wdt.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
index a210fe1569e4..56341f746704 100644
--- a/drivers/watchdog/mtk_wdt.c
+++ b/drivers/watchdog/mtk_wdt.c
@@ -12,6 +12,7 @@
#include <dt-bindings/reset/mt2712-resets.h>
#include <dt-bindings/reset/mediatek,mt6735-wdt.h>
#include <dt-bindings/reset/mediatek,mt6795-resets.h>
+#include <dt-bindings/reset/mediatek,mt6797-wdt.h>
#include <dt-bindings/reset/mediatek,mt8167-wdt.h>
#include <dt-bindings/reset/mt7986-resets.h>
#include <dt-bindings/reset/mt8183-resets.h>
@@ -110,6 +111,31 @@ static const struct mtk_wdt_data mt6795_data = {
.toprgu_sw_rst_num = MT6795_TOPRGU_SW_RST_NUM,
};
+static const u8 mt6797_toprgu_sw_rst_tb[] = {
+ [MT6797_TOPRGU_INFRA_RST] = 0,
+ [MT6797_TOPRGU_MM_RST] = 1,
+ [MT6797_TOPRGU_MFG_RST] = 2,
+ [MT6797_TOPRGU_VENC_RST] = 3,
+ [MT6797_TOPRGU_VDEC_RST] = 4,
+ [MT6797_TOPRGU_IMG_RST] = 5,
+ [MT6797_TOPRGU_DDRPHY_RST] = 6,
+ [MT6797_TOPRGU_MD_RST] = 7,
+ [MT6797_TOPRGU_INFRA_AO_RST] = 8,
+ [MT6797_TOPRGU_CONN_RST] = 9,
+ [MT6797_TOPRGU_APMIXED_RST] = 10,
+ [MT6797_TOPRGU_PWRAP_SPICTL_RST] = 11,
+ [MT6797_TOPRGU_CONN_MCU_RST] = 12,
+ [MT6797_TOPRGU_MJC_RST] = 13,
+ [MT6797_TOPRGU_AUDIO_RST] = 15,
+ [MT6797_TOPRGU_C2K_SYS_RST] = 16,
+ [MT6797_TOPRGU_C2K_WDT_RST] = 17,
+};
+
+static const struct mtk_wdt_data mt6797_data = {
+ .toprgu_sw_rst_tb = mt6797_toprgu_sw_rst_tb,
+ .toprgu_sw_rst_num = ARRAY_SIZE(mt6797_toprgu_sw_rst_tb),
+};
+
static const struct mtk_wdt_data mt7629_data = {
.toprgu_sw_rst_num = MT7629_TOPRGU_SW_RST_NUM,
};
@@ -607,6 +633,7 @@ static const struct of_device_id mtk_wdt_dt_ids[] = {
{ .compatible = "mediatek,mt6589-wdt", .data = &mt6589_data },
{ .compatible = "mediatek,mt6735-wdt", .data = &mt6735_data },
{ .compatible = "mediatek,mt6795-wdt", .data = &mt6795_data },
+ { .compatible = "mediatek,mt6797-wdt", .data = &mt6797_data },
{ .compatible = "mediatek,mt7629-wdt", .data = &mt7629_data },
{ .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data },
{ .compatible = "mediatek,mt7988-wdt", .data = &mt7988_data },
--
2.56.0
next prev parent reply other threads:[~2026-11-10 19:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 19:22 [PATCH 0/3] watchdog: mediatek: fix mt6797 Roman Vivchar via B4 Relay
2026-11-10 19:22 ` [PATCH 1/3] dt-bindings: watchdog: mediatek,mtk-wdt: fix mt6797 compatible Roman Vivchar via B4 Relay
2026-11-19 23:17 ` Rob Herring (Arm)
2026-11-10 19:22 ` Roman Vivchar via B4 Relay [this message]
2026-11-10 19:22 ` [PATCH 3/3] arm64: dts: mediatek: mt6797: fix wdt compatible and add reset-cells Roman Vivchar via B4 Relay
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=20261110-6797-wdt-v1-2-7f07755b6074@protonmail.com \
--to=devnull+rva333.protonmail.com@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bengris32@protonmail.ch \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.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=linux@roeck-us.net \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=rva333@protonmail.com \
--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®