From patchwork Wed Aug 2 03:32:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huqiang Qin X-Patchwork-Id: 13337576 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08881C04A6A for ; Wed, 2 Aug 2023 03:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LoJpuaERW8TDdztdP+3BmEyIe46eY7bBYa8WB9/c6Ck=; b=AMlDL73y3xfOZb /CT9F8bHpSEeg1FhO4cohBRKCn/IaBmJ6hCqe9TlonBgN7F+oyUZWs2a6izmEp3chWgMj8DuPVeWA nyIGoVPB/rCgRvacCCQd1HtK2bg5JqtkzgvO3wdOxE4DrKw5wnehVysxvWQD4GPaeKuy2nMhieSO0 XFX2pFA043k+woWyW5hgV3x7CiUV5F1pw25sU+AIRSyPdmRp2+YhYDBwUcg2z7R1/p7bKdDg6aXS2 ib8BVzry8oovS75LeuEN3xpPkLlNFvzTkxhnDaibD95Sg2jEZDAqI1/rPlHDUDyF7Wy1S+lbnb0lq Fi7UCpxc0dtywO/BK5rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR2ba-003sWI-2A; Wed, 02 Aug 2023 03:32:58 +0000 Received: from mail-sh.amlogic.com ([58.32.228.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bY-003sUl-03; Wed, 02 Aug 2023 03:32:57 +0000 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, 2 Aug 2023 11:32:28 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin , "Conor Dooley" Subject: [PATCH V2 1/4] dt-bindings: watchdog: Add support for Amlogic-T7 SoCs Date: Wed, 2 Aug 2023 11:32:19 +0800 Message-ID: <20230802033222.4024946-2-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230802033222.4024946-1-huqiang.qin@amlogic.com> References: <20230802033222.4024946-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.28.11.83] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_203256_054299_FE09DEA3 X-CRM114-Status: UNSURE ( 5.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Update dt-binding document for watchdog of Amlogic-T7 SoCs. Signed-off-by: Huqiang Qin Acked-by: Conor Dooley Reviewed-by: Dmitry Rokosov Reviewed-by: Guenter Roeck --- V1 -> V2: Unchanged. .../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-wdt.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 reg: maxItems: 1 From patchwork Wed Aug 2 03:32:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huqiang Qin X-Patchwork-Id: 13337575 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E29EDC001DF for ; Wed, 2 Aug 2023 03:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sT2yZEioEsewyQfqcCPON8nlO4st4blgfEFrbFjXH24=; b=2qn23cS0KHEk4K FAnTXNH2/GA2jwlg9NbXga0dZ+a++iH54rnlRvK+P4RkmRlTVieZ8lSFiVUlu5t0XC+hMoash0Z4P tZhxolGf+DmvWRoIlloLDJId5Y0oM5aDLzadvdj/7bLoOGdZnMYsop+ylV07NAT+e/SElPVUhzXZb IVxzJB4w0WxzG2lvsZey4/f7Vb1naXetxAZ2jncgvBMTU6hT+LWTKpj/kxc0Md4OzkZSi/CP3TMwZ erVJ1jFsnZsC1nnB2RRK/OgtjlhBlVFBYCz//445URcpEyzoIbqo1lxPI/q3d9MziVjsGJEJXy+wg Ck1ELAtXJeOlxQt0OWdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bc-003sXD-1k; Wed, 02 Aug 2023 03:33:00 +0000 Received: from mail-sh.amlogic.com ([58.32.228.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bZ-003sUl-1w; Wed, 02 Aug 2023 03:32:58 +0000 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, 2 Aug 2023 11:32:29 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH V2 2/4] watchdog: Add a new struct for Amlogic-GXBB driver Date: Wed, 2 Aug 2023 11:32:20 +0800 Message-ID: <20230802033222.4024946-3-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230802033222.4024946-1-huqiang.qin@amlogic.com> References: <20230802033222.4024946-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.28.11.83] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_203257_636459_80896831 X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Add a new structure wdt_params to describe the watchdog difference of different chips. Signed-off-by: Huqiang Qin Reviewed-by: Dmitry Rokosov Reviewed-by: Guenter Roeck --- V1 -> V2: Rename rst_shift to rst and use the BIT() macro to build its initial value. 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_gxbb_wdt.c index 35d80cb39856..18180d91543e 100644 --- a/drivers/watchdog/meson_gxbb_wdt.c +++ b/drivers/watchdog/meson_gxbb_wdt.c @@ -22,7 +22,6 @@ #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) @@ -45,6 +44,10 @@ struct meson_gxbb_wdt { struct clk *clk; }; +struct wdt_params { + u32 rst; +}; + static int meson_gxbb_wdt_start(struct watchdog_device *wdt_dev) { struct meson_gxbb_wdt *data = watchdog_get_drvdata(wdt_dev); @@ -140,8 +143,12 @@ static const struct dev_pm_ops meson_gxbb_wdt_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(meson_gxbb_wdt_suspend, meson_gxbb_wdt_resume) }; +static const struct wdt_params gxbb_params = { + .rst = BIT(21), +}; + static const struct of_device_id meson_gxbb_wdt_dt_ids[] = { - { .compatible = "amlogic,meson-gxbb-wdt", }, + { .compatible = "amlogic,meson-gxbb-wdt", .data = &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 = &pdev->dev; struct meson_gxbb_wdt *data; + struct wdt_params *params; u32 ctrl_reg; data = 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); + params = (struct wdt_params *)of_device_get_match_data(dev); + platform_set_drvdata(pdev, data); data->wdt_dev.parent = dev; @@ -191,7 +201,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev) /* Setup with 1ms timebase */ ctrl_reg |= ((clk_get_rate(data->clk) / 1000) & GXBB_WDT_CTRL_DIV_MASK) | - GXBB_WDT_CTRL_EE_RESET | + params->rst | GXBB_WDT_CTRL_CLK_EN | GXBB_WDT_CTRL_CLKDIV_EN; From patchwork Wed Aug 2 03:32:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huqiang Qin X-Patchwork-Id: 13337578 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACD8FC001DF for ; Wed, 2 Aug 2023 03:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fTtFa8vU98sRxBPNKLXK2DQVt5IhcgIIDlvh3DdItUE=; b=L6h7ecN1XBnTuK N/AL52SQMF62H+ghT/akKjkTXSoOF/6gezg7vvNASKYtcC+0YzE5oT8QHfDRt4woHE/SOT0t0PFXQ 4pHzfaJphxWy2SE3MlgcJ2m43izDmKMCwuYLrGbzz3mPbK6EnYBfRUgvsKEbrnVT7+Hs1c7IYBteD Df/Dgb6prbcGfzHkDDNsXWSZMZmLm+GglzkAZ/nVbzb8vsHQTMa5SVUa9n9tO1zeTkKs8wFzU4RNo /QrpTqgOQu5FqhYaJx3OOjUegqrecn1OB9WivcrMZLQcURFzF54lk4nkhgzSS1Zyg6ivYoAC3udZU EgHAFfM+A2SHIkabQ/JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR2be-003sYg-1p; Wed, 02 Aug 2023 03:33:02 +0000 Received: from mail-sh.amlogic.com ([58.32.228.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bb-003sUl-10; Wed, 02 Aug 2023 03:33:00 +0000 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, 2 Aug 2023 11:32:30 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH V2 3/4] watchdog: Add support for Amlogic-T7 SoCs Date: Wed, 2 Aug 2023 11:32:21 +0800 Message-ID: <20230802033222.4024946-4-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230802033222.4024946-1-huqiang.qin@amlogic.com> References: <20230802033222.4024946-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.28.11.83] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_203259_348195_3804A79D X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Compared with the previous Amlogic-GXBB, the watchdog of Amlogic-T7 has a different reset enable bit. Signed-off-by: Huqiang Qin Reviewed-by: Dmitry Rokosov Reviewed-by: Guenter Roeck --- V1 -> V2: Use the BIT() macro to build rst initial value. 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_gxbb_wdt.c index 18180d91543e..a48622d11ad7 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 = { .rst = BIT(21), }; +static const struct wdt_params t7_params = { + .rst = BIT(22), +}; + static const struct of_device_id meson_gxbb_wdt_dt_ids[] = { { .compatible = "amlogic,meson-gxbb-wdt", .data = &gxbb_params, }, + { .compatible = "amlogic,t7-wdt", .data = &t7_params, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, meson_gxbb_wdt_dt_ids); From patchwork Wed Aug 2 03:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huqiang Qin X-Patchwork-Id: 13337574 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDCDBC001E0 for ; Wed, 2 Aug 2023 03:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R76LH5iqCjsZ6ZOud97Ga259ZTC8eXiVeWKxQQdcHGI=; b=oq8AVuOaZ1zMNY c4ujjK7zG7/MIhpjVOqgYnKsBK3gvTIZfNFJvCvi0WKya7YRP4eHZ0Pu0tydOfmlOm2Vq54Jq1s8Z p05ca98GjHNMVzRNy5oiuQksYptOaJICrGY9mDjGmLgqhf3Di6DnN08udMAaWCrAk/mfrbCbZM5Vk kmaGjNiHw9rvTpWgVnvD5rHfOIy4aEdIEIUQUCW1JYvnRFeDa1Tv1dK/uFgqqks8gwac651QIjiU3 bCJx/XBwQdrn+He004qLJfuUtJrLKztjFxwMF0/cYk/4sF1FTWBCQrsPNM3pZXnOkKXyiJvnKwGQN M/SLIDUbUu00483Bg8sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bg-003sZc-1W; Wed, 02 Aug 2023 03:33:04 +0000 Received: from mail-sh.amlogic.com ([58.32.228.43]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR2bc-003sUl-2z; Wed, 02 Aug 2023 03:33:02 +0000 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, 2 Aug 2023 11:32:30 +0800 From: Huqiang Qin To: , , , , , , , , CC: , , , , , Huqiang Qin , "Dmitry Rokosov" Subject: [PATCH V2 4/4] arm64: dts: Add watchdog node for Amlogic-T7 SoCs Date: Wed, 2 Aug 2023 11:32:22 +0800 Message-ID: <20230802033222.4024946-5-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230802033222.4024946-1-huqiang.qin@amlogic.com> References: <20230802033222.4024946-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.28.11.83] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_203300_959559_ED8873E0 X-CRM114-Status: UNSURE ( 6.32 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Add watchdog device. Signed-off-by: Huqiang Qin Reviewed-by: Dmitry Rokosov --- V1 -> V2: Unchanged. 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 = <2>; ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>; + watchdog@2100 { + compatible = "amlogic,t7-wdt"; + reg = <0x0 0x2100 0x0 0x10>; + clocks = <&xtal>; + }; + uart_a: serial@78000 { compatible = "amlogic,t7-uart", "amlogic,meson-s4-uart"; reg = <0x0 0x78000 0x0 0x18>;