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: 185108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5767723dyb; Thu, 4 Jan 2024 09:56:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn70+W3lSboj2uGZ76EjwA/FbM3e84MKs+7pGJ8CaJygQqH2MH/K95HVgPSXiSlbGpyXJ3 X-Received: by 2002:a05:651c:1a23:b0:2cc:d4cd:18a3 with SMTP id by35-20020a05651c1a2300b002ccd4cd18a3mr584633ljb.89.1704390962150; Thu, 04 Jan 2024 09:56:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704390962; cv=none; d=google.com; s=arc-20160816; b=GPkXXa3IM3gb7ywJchns4fbE+NYVF7CEiIyFF1EVGFbs/OQ4nA05Kcpy7ngcXrOt5N 18auYgjxgBlA+dysr9IbrOGW24rzBPj5DgamT89ekFby06W6xX7tLAn4AhnVa055G3Bf 1oGLhZXR4kkmGjV52lgJ2PqJ48Vd5/XXdhHtI240JoCPqv0LNfxyV1yx7dvk5fWqFn+n I0HH8uZBDOxsloaz282Wj5uhRWJYPhmQLInEuwKD2VWlypdt0fQ2g6L6EJpoAeXXW08Q q8+/BcGWdOo2l704vB98YvWcWbQpCltJmdvArloCSFvHmOPMtNPfLnaoTAkdy8pXxdVS mLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=u31vqb832iBo503aU0D4rkKh2sGRkH9JUeHiMN+G1mE=; fh=L3mDZOwNyKKHiHRMVtDJkV8iuFRPURJKz0bfZqqzP14=; b=LB2y0CKPptoHHyowBYvneR0UoJ0WBdxB+GGuCi3YAK1OUBr+CEhVmVEgU+7jhp+22c uSSEjUw3uk76Sh+nX4kX3XC4O8kfhZXw+WMUmSEZDu5EF7HbDVbfSj4N174ecsjCkrWY sKZE7NKs3hkR4+6g57ePV2Q6XHK6MAIa5J48ksiA1diCaTJuFbNQqYyqP46hDSU8P8uC mO6b3MpjmZzrad+yPHN2dLshg86L5t0/PRflFl8uxAf/elfCgpVOTI9FJL1rNSxZPIDN PZXqmTgGy70jKRnns/1Avu6XnPWlMk3w4B1JWtdZHP2uuvKKc6Q3i8czdefkP9hDWCgq MkOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=HJKUGDYh; spf=pass (google.com: domain of linux-kernel+bounces-17053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17053-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h10-20020a50cdca000000b0055351ec4a2dsi13045046edj.386.2024.01.04.09.56.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:56:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=HJKUGDYh; spf=pass (google.com: domain of linux-kernel+bounces-17053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17053-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B1751F257D9 for ; Thu, 4 Jan 2024 17:45:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 237F328DBA; Thu, 4 Jan 2024 17:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mailerdienst.de header.i=@mailerdienst.de header.b="HJKUGDYh" X-Original-To: linux-kernel@vger.kernel.org Received: from mxout2.routing.net (mxout2.routing.net [134.0.28.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F871286BB; Thu, 4 Jan 2024 17:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fw-web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fw-web.de 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mail-ID: d6c2a594-df4e-40d7-80ec-fbc130c01098 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787183457525474913 X-GMAIL-MSGID: 1787183457525474913 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: 185106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5763453dyb; Thu, 4 Jan 2024 09:46:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiMOi9Ep9r/KVFFbhcJ5Mnh5tUPPfkkt1uY0VLhrlHom+9B2HG9ltoBCCXxXF1Vgv2A4Vr X-Received: by 2002:a17:903:453:b0:1d4:d350:7932 with SMTP id iw19-20020a170903045300b001d4d3507932mr784432plb.75.1704390412673; Thu, 04 Jan 2024 09:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704390412; cv=none; d=google.com; s=arc-20160816; b=ur/05IYG3H/HJC6EKoB4L0iP5SDegbUxWhWU4/SkxA/rnbfaLN+Iah+AYh/BaTkdcz DKSS+BPH0wt7W4VW0h28uFJsUfFHHPNR9iFTEWjK/YetT2GE5QtShs69RappZpBeYWMj y7K7TXXogC/FA1bVa9GOY08NIQTmGtWGmO5wm7BRgz+C9eIaz1c4jCaNXNG7ifUzhREQ C0bH4lIMkGSVbKJVAAji7sK0wevNEs8vkEYql+591X7Ews3DZVDyWefmJIcdpAlD7AZh KK+ok5F7TdshsfRT4YTAPM3Ing1E3UcH41mQu/+RZ/R7vOfm9zfdnPlSaA6P+uE+fCPw M2zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vJWaZdp7vwDloIQ8UP6qzcfjDSiX0CaWYDKppc3KgpY=; fh=L3mDZOwNyKKHiHRMVtDJkV8iuFRPURJKz0bfZqqzP14=; b=MkH9pL6QfCmeqjKMsjwypnn7JE12I86kY5ryYDAjKrCZACO26qHNpeCIq0lEPgov2x rV4Z825c93l0+CmzCyKapWQlLZlZVj+D2wGgnyAYOTdeMPXXw03zmlDV912oIh3Zak3q 4q7ZYCZHhRdOLd/PgFOv6DCI1ePOK/8g/mfECLv2t2U34cIeSF6/uNr4k00vDUvenY8I F+BcNub587NFI1JVwaV5gMfdnLnwoH+iGWGJvkDowQ8UPeQIdHnmangxifmHUMnOOzLv fRCRbx5N3fIMmbMlD5GaIrPWzd9qbqFI0N/75ucyMss8DqpFowgz0E5HIAywXCnDcbVm vFOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=NvhAQ6ZO; spf=pass (google.com: domain of linux-kernel+bounces-17055-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17055-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a67-20020a624d46000000b006d99c6cbaedsi20432681pfb.340.2024.01.04.09.46.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:46:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17055-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=NvhAQ6ZO; spf=pass (google.com: domain of linux-kernel+bounces-17055-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17055-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 74F11286610 for ; Thu, 4 Jan 2024 17:46:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D308C28E07; Thu, 4 Jan 2024 17:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mailerdienst.de header.i=@mailerdienst.de header.b="NvhAQ6ZO" X-Original-To: linux-kernel@vger.kernel.org Received: from mxout4.routing.net (mxout4.routing.net [134.0.28.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11FE6288A7; Thu, 4 Jan 2024 17:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fw-web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fw-web.de 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mail-ID: 6d201640-91c2-4ac9-a649-d071cf765a5b X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787182881218790099 X-GMAIL-MSGID: 1787182881218790099 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[] = {