From nobody Sun Feb 8 22:21:57 2026 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 C2F15C001B0 for ; Wed, 26 Jul 2023 11:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232882AbjGZLXU (ORCPT ); Wed, 26 Jul 2023 07:23:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjGZLXQ (ORCPT ); Wed, 26 Jul 2023 07:23:16 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194A4FD; Wed, 26 Jul 2023 04:22:31 -0700 (PDT) Received: from rd02-sz.amlogic.software (10.28.11.83) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Wed, 26 Jul 2023 19:22:07 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH 1/4] dt-bindings: watchdog: Add support for Amlogic-T7 SoCs Date: Wed, 26 Jul 2023 19:21:43 +0800 Message-ID: <20230726112146.1127145-2-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230726112146.1127145-1-huqiang.qin@amlogic.com> References: <20230726112146.1127145-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.28.11.83] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Update dt-binding document for watchdog of Amlogic-T7 SoCs. Signed-off-by: Huqiang Qin Acked-by: Conor Dooley --- .../devicetree/bindings/watchdog/amlogic,meson-gxbb-wdt.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/watchdog/amlogic,meson-gxbb-= wdt.yaml b/Documentation/devicetree/bindings/watchdog/amlogic,meson-gxbb-wd= t.yaml index f5cc7aa1b93b..443e2e7ab467 100644 --- a/Documentation/devicetree/bindings/watchdog/amlogic,meson-gxbb-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/amlogic,meson-gxbb-wdt.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - amlogic,meson-gxbb-wdt + - amlogic,t7-wdt =20 reg: maxItems: 1 --=20 2.37.1 From nobody Sun Feb 8 22:21:57 2026 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 AB291C001DC for ; Wed, 26 Jul 2023 11:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232569AbjGZLWg (ORCPT ); Wed, 26 Jul 2023 07:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjGZLWe (ORCPT ); Wed, 26 Jul 2023 07:22:34 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91C2D116; Wed, 26 Jul 2023 04:22:32 -0700 (PDT) Received: from rd02-sz.amlogic.software (10.28.11.83) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Wed, 26 Jul 2023 19:22:08 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH 2/4] watchdog: Add a new struct for Amlogic-GXBB driver Date: Wed, 26 Jul 2023 19:21:44 +0800 Message-ID: <20230726112146.1127145-3-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230726112146.1127145-1-huqiang.qin@amlogic.com> References: <20230726112146.1127145-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.28.11.83] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a new structure wdt_params to describe the watchdog difference of different chips. Signed-off-by: Huqiang Qin --- drivers/watchdog/meson_gxbb_wdt.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxb= b_wdt.c index 35d80cb39856..a6c0d743b607 100644 --- a/drivers/watchdog/meson_gxbb_wdt.c +++ b/drivers/watchdog/meson_gxbb_wdt.c @@ -22,7 +22,6 @@ =20 #define GXBB_WDT_CTRL_CLKDIV_EN BIT(25) #define GXBB_WDT_CTRL_CLK_EN BIT(24) -#define GXBB_WDT_CTRL_EE_RESET BIT(21) #define GXBB_WDT_CTRL_EN BIT(18) #define GXBB_WDT_CTRL_DIV_MASK (BIT(18) - 1) =20 @@ -45,6 +44,10 @@ struct meson_gxbb_wdt { struct clk *clk; }; =20 +struct wdt_params { + u8 rst_shift; +}; + static int meson_gxbb_wdt_start(struct watchdog_device *wdt_dev) { struct meson_gxbb_wdt *data =3D watchdog_get_drvdata(wdt_dev); @@ -140,8 +143,12 @@ static const struct dev_pm_ops meson_gxbb_wdt_pm_ops = =3D { SET_SYSTEM_SLEEP_PM_OPS(meson_gxbb_wdt_suspend, meson_gxbb_wdt_resume) }; =20 +static const struct wdt_params gxbb_params =3D { + .rst_shift =3D 21, +}; + static const struct of_device_id meson_gxbb_wdt_dt_ids[] =3D { - { .compatible =3D "amlogic,meson-gxbb-wdt", }, + { .compatible =3D "amlogic,meson-gxbb-wdt", .data =3D &gxbb_params, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, meson_gxbb_wdt_dt_ids); @@ -150,6 +157,7 @@ static int meson_gxbb_wdt_probe(struct platform_device = *pdev) { struct device *dev =3D &pdev->dev; struct meson_gxbb_wdt *data; + struct wdt_params *params; u32 ctrl_reg; =20 data =3D devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); @@ -164,6 +172,8 @@ static int meson_gxbb_wdt_probe(struct platform_device = *pdev) if (IS_ERR(data->clk)) return PTR_ERR(data->clk); =20 + params =3D (struct wdt_params *)of_device_get_match_data(dev); + platform_set_drvdata(pdev, data); =20 data->wdt_dev.parent =3D dev; @@ -191,7 +201,7 @@ static int meson_gxbb_wdt_probe(struct platform_device = *pdev) /* Setup with 1ms timebase */ ctrl_reg |=3D ((clk_get_rate(data->clk) / 1000) & GXBB_WDT_CTRL_DIV_MASK) | - GXBB_WDT_CTRL_EE_RESET | + BIT(params->rst_shift) | GXBB_WDT_CTRL_CLK_EN | GXBB_WDT_CTRL_CLKDIV_EN; =20 --=20 2.37.1 From nobody Sun Feb 8 22:21:57 2026 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 C732EC001DE for ; Wed, 26 Jul 2023 11:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232909AbjGZLX0 (ORCPT ); Wed, 26 Jul 2023 07:23:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233222AbjGZLXW (ORCPT ); Wed, 26 Jul 2023 07:23:22 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 377A3131; Wed, 26 Jul 2023 04:22:34 -0700 (PDT) Received: from rd02-sz.amlogic.software (10.28.11.83) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Wed, 26 Jul 2023 19:22:09 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH 3/4] watchdog: Add support for Amlogic-T7 SoCs Date: Wed, 26 Jul 2023 19:21:45 +0800 Message-ID: <20230726112146.1127145-4-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230726112146.1127145-1-huqiang.qin@amlogic.com> References: <20230726112146.1127145-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.28.11.83] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Compared with the previous Amlogic-GXBB, the watchdog of Amlogic-T7 has a different reset enable bit. Signed-off-by: Huqiang Qin --- drivers/watchdog/meson_gxbb_wdt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxb= b_wdt.c index a6c0d743b607..dc48b0a332c3 100644 --- a/drivers/watchdog/meson_gxbb_wdt.c +++ b/drivers/watchdog/meson_gxbb_wdt.c @@ -147,8 +147,13 @@ static const struct wdt_params gxbb_params =3D { .rst_shift =3D 21, }; =20 +static const struct wdt_params t7_params =3D { + .rst_shift =3D 22, +}; + static const struct of_device_id meson_gxbb_wdt_dt_ids[] =3D { { .compatible =3D "amlogic,meson-gxbb-wdt", .data =3D &gxbb_params, }, + { .compatible =3D "amlogic,t7-wdt", .data =3D &t7_params, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, meson_gxbb_wdt_dt_ids); --=20 2.37.1 From nobody Sun Feb 8 22:21:57 2026 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 06192C001B0 for ; Wed, 26 Jul 2023 11:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233126AbjGZLWk (ORCPT ); Wed, 26 Jul 2023 07:22:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjGZLWh (ORCPT ); Wed, 26 Jul 2023 07:22:37 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA8AE1FC4; Wed, 26 Jul 2023 04:22:35 -0700 (PDT) Received: from rd02-sz.amlogic.software (10.28.11.83) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Wed, 26 Jul 2023 19:22:10 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH 4/4] arm64: dts: Add watchdog node for Amlogic-T7 SoCs Date: Wed, 26 Jul 2023 19:21:46 +0800 Message-ID: <20230726112146.1127145-5-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230726112146.1127145-1-huqiang.qin@amlogic.com> References: <20230726112146.1127145-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.28.11.83] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add watchdog device. Signed-off-by: Huqiang Qin Reviewed-by: Dmitry Rokosov --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 1423d4a79156..6e34d11214b7 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -143,6 +143,12 @@ apb4: bus@fe000000 { #size-cells =3D <2>; ranges =3D <0x0 0x0 0x0 0xfe000000 0x0 0x480000>; =20 + watchdog@2100 { + compatible =3D "amlogic,t7-wdt"; + reg =3D <0x0 0x2100 0x0 0x10>; + clocks =3D <&xtal>; + }; + uart_a: serial@78000 { compatible =3D "amlogic,t7-uart", "amlogic,meson-s4-uart"; reg =3D <0x0 0x78000 0x0 0x18>; --=20 2.37.1