2021-06-23 12:41:13

by Christine Zhu

[permalink] [raw]
Subject: [v4,0/3] watchdog: mt8195: add wdt support

Supports MT8195 watchdog device. Supports MT8195 watchdog reset-controller feature.

Change since v3:
-fix name formatting in Signed-off-bys and author for all the patches.

Change since v2:
-fix typos in [v2,0/3] [v2,1/3] [v2,2/3].

Change since v1:
-Remove the unneeded tag in [v1,1/3] [v1,2/3] [v1,3/3]
-Add of_device_id of MT8195 in [v1,3/3]
-use more proper prefixes, such as "dt-bindings: mediatek: mt8195:"
-provide more information in the cover letter

Christine Zhu (3):
dt-bindings: mediatek: mt8195: update mtk-wdt document
dt-bindings: reset: mt8195: add toprgu reset-controller head file
watchdog: mediatek: mt8195: add wdt support

.../devicetree/bindings/watchdog/mtk-wdt.txt | 1 +
drivers/watchdog/mtk_wdt.c | 6 ++++
.../reset-controller/mt8195-resets.h | 29 +++++++++++++++++++
3 files changed, 36 insertions(+)
create mode 100644 include/dt-bindings/reset-controller/mt8195-resets.h



2021-06-23 12:42:03

by Christine Zhu

[permalink] [raw]
Subject: [v4,2/3] dt-bindings: reset: mt8195: add toprgu reset-controller head file

From: "Christine Zhu" <[email protected]>

Add toprgu reset-controller head file for MT8195 platform.

Signed-off-by: Christine Zhu <[email protected]>
---
.../reset-controller/mt8195-resets.h | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 include/dt-bindings/reset-controller/mt8195-resets.h

diff --git a/include/dt-bindings/reset-controller/mt8195-resets.h b/include/dt-bindings/reset-controller/mt8195-resets.h
new file mode 100644
index 000000000000..7ec27a64afc7
--- /dev/null
+++ b/include/dt-bindings/reset-controller/mt8195-resets.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+ * Author: Crystal Guo <[email protected]>
+ */
+
+#ifndef _DT_BINDINGS_RESET_CONTROLLER_MT8195
+#define _DT_BINDINGS_RESET_CONTROLLER_MT8195
+
+#define MT8195_TOPRGU_CONN_MCU_SW_RST 0
+#define MT8195_TOPRGU_INFRA_GRST_SW_RST 1
+#define MT8195_TOPRGU_APU_SW_RST 2
+#define MT8195_TOPRGU_INFRA_AO_GRST_SW_RST 6
+#define MT8195_TOPRGU_MMSYS_SW_RST 7
+#define MT8195_TOPRGU_MFG_SW_RST 8
+#define MT8195_TOPRGU_VENC_SW_RST 9
+#define MT8195_TOPRGU_VDEC_SW_RST 10
+#define MT8195_TOPRGU_IMG_SW_RST 11
+#define MT8195_TOPRGU_APMIXEDSYS_SW_RST 13
+#define MT8195_TOPRGU_AUDIO_SW_RST 14
+#define MT8195_TOPRGU_CAMSYS_SW_RST 15
+#define MT8195_TOPRGU_EDPTX_SW_RST 16
+#define MT8195_TOPRGU_ADSPSYS_SW_RST 21
+#define MT8195_TOPRGU_DPTX_SW_RST 22
+#define MT8195_TOPRGU_SPMI_MST_SW_RST 23
+
+#define MT8195_TOPRGU_SW_RST_NUM 16
+
+#endif /* _DT_BINDINGS_RESET_CONTROLLER_MT8195 */
--
2.18.0

2021-06-23 12:44:20

by Christine Zhu

[permalink] [raw]
Subject: [v4,3/3] watchdog: mediatek: mt8195: add wdt support

From: "Christine Zhu" <[email protected]>

Support MT8195 watchdog device.

Signed-off-by: christine.zhu <[email protected]>
---
drivers/watchdog/mtk_wdt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
index 97ca993bd009..8231cb9cf5f9 100644
--- a/drivers/watchdog/mtk_wdt.c
+++ b/drivers/watchdog/mtk_wdt.c
@@ -12,6 +12,7 @@
#include <dt-bindings/reset-controller/mt2712-resets.h>
#include <dt-bindings/reset-controller/mt8183-resets.h>
#include <dt-bindings/reset-controller/mt8192-resets.h>
+#include <dt-bindings/reset-controller/mt8195-resets.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
@@ -81,6 +82,10 @@ static const struct mtk_wdt_data mt8192_data = {
.toprgu_sw_rst_num = MT8192_TOPRGU_SW_RST_NUM,
};

+static const struct mtk_wdt_data mt8195_data = {
+ .toprgu_sw_rst_num = MT8195_TOPRGU_SW_RST_NUM,
+};
+
static int toprgu_reset_update(struct reset_controller_dev *rcdev,
unsigned long id, bool assert)
{
@@ -341,6 +346,7 @@ static const struct of_device_id mtk_wdt_dt_ids[] = {
{ .compatible = "mediatek,mt6589-wdt" },
{ .compatible = "mediatek,mt8183-wdt", .data = &mt8183_data },
{ .compatible = "mediatek,mt8192-wdt", .data = &mt8192_data },
+ { .compatible = "mediatek,mt8195-wdt", .data = &mt8195_data },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mtk_wdt_dt_ids);
--
2.18.0

2021-06-25 05:14:38

by Tzung-Bi Shih

[permalink] [raw]
Subject: Re: [v4,3/3] watchdog: mediatek: mt8195: add wdt support

On Wed, Jun 23, 2021 at 8:44 PM Christine Zhu
<[email protected]> wrote:
> From: "Christine Zhu" <[email protected]>
>
> Support MT8195 watchdog device.
>
> Signed-off-by: christine.zhu <[email protected]>
Still missed this part per suggestion in [1].

[1]: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/#24270619

2021-06-28 12:03:17

by Christine Zhu

[permalink] [raw]
Subject: Re: [v4,3/3] watchdog: mediatek: mt8195: add wdt support

On Fri, 2021-06-25 at 13:11 +0800, Tzung-Bi Shih wrote:
> On Wed, Jun 23, 2021 at 8:44 PM Christine Zhu
> <[email protected]> wrote:
> > From: "Christine Zhu" <[email protected]>
> >
> > Support MT8195 watchdog device.
> >
> > Signed-off-by: christine.zhu <[email protected]>
> Still missed this part per suggestion in [1].
>
> [1]: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/#24270619

Thx for your advice,I have uploaded v5 to fix it.