From patchwork Thu Jan 4 17:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13511401 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 649F7C47073 for ; Thu, 4 Jan 2024 17:40: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=ZT3DUErtcK4n2LBhtm9mgm5j4XTVbD2GZo9c1QhdFz0=; b=JRTJjoSq5i1kI3 YfrKtwj8BRUm2zGYeb8hBRz1wHnFvRlmkL7mLlW3DqXVT4c2SkZ31bqAl1KH3Kpjpl9Rlr8MQ1ugq +i/KOJAMyte1rmDcVaIq7wD4a6dgJgAIBdDps7U+VDeJCQvzjt9VVQ1kXehTzF2bZQR1RDaTS1lHs C42CvMlK3fDjFRUxRybwZc+51m+SGNchytcP8VKDwfPQw252xLsDXmGpLelwobPwajr57IdJcnujQ BjxfpvA5hxnl7D8rkb54e7mVbzvqP0tBi+1XjzrfoTgD/vzT84eSWYiDiobRkF9Y2BDVwBNa3yqI0 iPoMAgeP2IShjAjXiVlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLRhF-00EreY-0C; Thu, 04 Jan 2024 17:39:57 +0000 Received: from mxout2.routing.net ([2a03:2900:1:a::b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLRh9-00Erbm-15; Thu, 04 Jan 2024 17:39:53 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout2.routing.net (Postfix) with ESMTP id 97F7B5FF8F; Thu, 4 Jan 2024 17:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1704389986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u31vqb832iBo503aU0D4rkKh2sGRkH9JUeHiMN+G1mE=; b=HJKUGDYhE03OgtP34sIwOijceDMSih37DZxiGdTGjoRC6DSEuYCZJZalZv/0hv2/AF2UdM PJpPtswhQMBQwdshvoWrOxUHwgznbLGVSQCnA/bfkR9LPlrQjRjD7sgOSnZbAnVyhptJAa F26E5mR9V7cLPGIYmpgXC2RB3I/hQbc= Received: from frank-G5.. (fttx-pool-157.180.226.237.bambit.de [157.180.226.237]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id BF7BB100738; Thu, 4 Jan 2024 17:39:45 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sam Shih , Daniel Golle , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID Date: Thu, 4 Jan 2024 18:39:29 +0100 Message-Id: <20240104173930.13907-2-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240104173930.13907-1-linux@fw-web.de> References: <20240104173930.13907-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: d6c2a594-df4e-40d7-80ec-fbc130c01098 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_093951_543192_D9293001 X-CRM114-Status: UNSURE ( 8.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich --- include/dt-bindings/reset/mediatek,mt7988-resets.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h index 493301971367..3f1e4ec07ad5 100644 --- a/include/dt-bindings/reset/mediatek,mt7988-resets.h +++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h @@ -10,4 +10,8 @@ /* ETHWARP resets */ #define MT7988_ETHWARP_RST_SWITCH 0 +/* INFRA resets */ +#define MT7988_INFRA_RST0_THERM_CTRL_SWRST 9 + #endif /* _DT_BINDINGS_RESET_CONTROLLER_MT7988 */ + From patchwork Thu Jan 4 17:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13511403 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 5A1E2C47073 for ; Thu, 4 Jan 2024 17:40:26 +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=qDSEmqIlkBAMQCas4lVP6qQD22Go6L8ad9T+UniyOXg=; b=C50TDzTgEGHkR/ T4uBlQCXItWlIhUO4WqzzhEW9j0wwEXWi+2v1xxdH+N7FKgNBI1GWL5+OcS0OpV23UaAb1QvrFal6 TOlNDsuGOJ6k7K6xxUUVc5rgCrT6PV7fDtGWZttoRGzuNaBOvK6/tcMU9QAzb0oanJMeAI99iaPQ/ 4VyWTxjuZ1B+MNnGXzmkx8fnfmAjDjNcASRNMOjvI7zFcnuO/zqexsN1S53JhkP9v5e7x6pZilCnj +B5+5wn8YODuHMulHlb8QUqhRJEnebPPTNhIsIpotnMxB59N0mzT3ezRL8DY8mTGJI6usC6z1W7cK M4O6oLXv2a983dKuz27g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLRhC-00ErdG-1G; Thu, 04 Jan 2024 17:39:54 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLRh9-00Erbq-0d; Thu, 04 Jan 2024 17:39:52 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout4.routing.net (Postfix) with ESMTP id 5C8881014EB; Thu, 4 Jan 2024 17:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1704389987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vJWaZdp7vwDloIQ8UP6qzcfjDSiX0CaWYDKppc3KgpY=; b=NvhAQ6ZOI6M8JUzhvDf4RvVCKfWSYjD15qznp2SPDjcWdq7TsDIXYlReV3VWMVEo0J9X4K KYGG8+GjSnE/h0uO8GqdjFzcdlCjFeCiGem+5ZEljgUluVK42sghQ9yJnNEjJBnOmwdYyp ehIsdsN6oU73vmetAaSAL9BXpTTdd5Y= Received: from frank-G5.. (fttx-pool-157.180.226.237.bambit.de [157.180.226.237]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 8391B1007EB; Thu, 4 Jan 2024 17:39:46 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sam Shih , Daniel Golle , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 2/2] clk: mediatek: add infracfg reset controller for mt7988 Date: Thu, 4 Jan 2024 18:39:30 +0100 Message-Id: <20240104173930.13907-3-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240104173930.13907-1-linux@fw-web.de> References: <20240104173930.13907-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 6d201640-91c2-4ac9-a649-d071cf765a5b X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_093951_392172_105DB1E5 X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Infracfg can also operate as reset controller, add support for it. Signed-off-by: Frank Wunderlich --- drivers/clk/mediatek/clk-mt7988-infracfg.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/mediatek/clk-mt7988-infracfg.c b/drivers/clk/mediatek/clk-mt7988-infracfg.c index 8011ef278bea..1660a45349ff 100644 --- a/drivers/clk/mediatek/clk-mt7988-infracfg.c +++ b/drivers/clk/mediatek/clk-mt7988-infracfg.c @@ -14,6 +14,9 @@ #include "clk-gate.h" #include "clk-mux.h" #include +#include + +#define INFRA_RST_SET_OFFSET 0x80 static DEFINE_SPINLOCK(mt7988_clk_lock); @@ -249,12 +252,29 @@ static const struct mtk_gate infra_clks[] = { GATE_INFRA3(CLK_INFRA_133M_PCIE_CK_P3, "infra_133m_pcie_ck_p3", "sysaxi_sel", 31), }; +static u16 infra_rst_ofs[] = { + INFRA_RST_SET_OFFSET, +}; + +static u16 infra_idx_map[] = { + [MT7988_INFRA_RST0_THERM_CTRL_SWRST] = 0 * RST_NR_PER_BANK + 9, +}; + +static struct mtk_clk_rst_desc infra_rst_desc = { + .version = MTK_RST_SET_CLR, + .rst_bank_ofs = infra_rst_ofs, + .rst_bank_nr = ARRAY_SIZE(infra_rst_ofs), + .rst_idx_map = infra_idx_map, + .rst_idx_map_nr = ARRAY_SIZE(infra_idx_map), +}; + static const struct mtk_clk_desc infra_desc = { .clks = infra_clks, .num_clks = ARRAY_SIZE(infra_clks), .mux_clks = infra_muxes, .num_mux_clks = ARRAY_SIZE(infra_muxes), .clk_lock = &mt7988_clk_lock, + .rst_desc = &infra_rst_desc, }; static const struct of_device_id of_match_clk_mt7988_infracfg[] = {