Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp612573rwd; Thu, 25 May 2023 01:05:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kjCLtNdsaXhWe5SDXMkspg2G+EH6KMt8L8K9X8/+K92TeeaNeF+W25V2Z8JwDE8rvtNyg X-Received: by 2002:aa7:8894:0:b0:64d:7225:cfff with SMTP id z20-20020aa78894000000b0064d7225cfffmr7040251pfe.8.1685001943051; Thu, 25 May 2023 01:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685001943; cv=none; d=google.com; s=arc-20160816; b=rCWA/fXxVLlhpI8sv6lhFF+IPL/76RVoqEX0VpNEET9wddPEjyjFBZoJbxV94w5zyB OQKlDimL5brp9SP7Vke98LDLUoi2szSnwxRtzdbGC3s16ErFubGpxLdPtYXC/cCjhZbd RYNFzw3f2o2UrbKAugGaFqxkDLqxY7PkBzlUEEFwYwYWIl48heYZviJWRJLToyxq26nm S46h5OAnqSbQrSAndolRKOZCTGWCHTpFwnFYnnjrtwOO6faJzD4vT++WnYKFmS/CrUJw 3AFsaZ79yEWRkVVA4CO8mst+SP7dn+7H7TolUhXQyBU5oxTVG1+J6LZEnEMVnpj9oBmV 2oZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+/PT1g6QlwpXN2nAdR0WgUNtqQaT3dNJ82IueyTB+Kg=; b=q8jfXGVUunEnmax4xoF9jcaQ2WFbe6rsplPp7r9TEXy91CpMu/Os8V9s4wAw1f6R87 +FimaxrXm45UMiS1Y8Do3e4aDQmLFQpEMvmy1U2vvZlVScxXBsnZ+rFt2Y80ZvMUIYkv sJdWuUvBWNJZUScFCimZHVle4+jRg3TUejd+XzVTtY5mSlfwsp/mxeN2XI5j2IjaprQC gv+A5GjMjifOxix5sBkdEdhP/ys1A01w06lEytyhe+BDI7uhjQKEW5Kr1oUAaZR6wvEj ZfyuFGytcHp9faE06E1nCwb8eJWslyHHIWVEvPCsLy7ERgEgp/TIn0Bsy0f+8ihZdbgg iNBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Wlk3oFP4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020aa7972e000000b0063473a51539si852015pfg.398.2023.05.25.01.05.26; Thu, 25 May 2023 01:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Wlk3oFP4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238509AbjEYHux (ORCPT + 99 others); Thu, 25 May 2023 03:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238327AbjEYHu1 (ORCPT ); Thu, 25 May 2023 03:50:27 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E535DE44; Thu, 25 May 2023 00:50:25 -0700 (PDT) X-UUID: cc77dc7efad011edb20a276fd37b9834-20230525 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=+/PT1g6QlwpXN2nAdR0WgUNtqQaT3dNJ82IueyTB+Kg=; b=Wlk3oFP48zfpJ6sZ/7yPdv23r5e/Baqg/bRY5o8em5Oc14/NaTV6SrBpo8HMHEjaGSMv+30L7BEvSgH4KQ1MpFMQTDt0OPlvdPspmHLPgp5Hjouy/IdTSKVz4vcKm81HhUXZnPZv3+PayAbCsFrd3dP4xRYHnyfNBXtzt6Rs9cE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:91c0a840-2f9f-4c66-bc80-5c8548da692b,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.25,REQID:91c0a840-2f9f-4c66-bc80-5c8548da692b,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:d5b0ae3,CLOUDID:9f05833c-7aa7-41f3-a6bd-0433bee822f3,B ulkID:230525155021GNV4CWZT,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: cc77dc7efad011edb20a276fd37b9834-20230525 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 950351365; Thu, 25 May 2023 15:50:20 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 25 May 2023 15:50:19 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 25 May 2023 15:50:19 +0800 From: Runyang Chen To: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , "Philipp Zabel" , Rob Herring , "Krzysztof Kozlowski" CC: , , , , , Runyang Chen Subject: [PATCH v4 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Date: Thu, 25 May 2023 15:50:11 +0800 Message-ID: <20230525075011.7032-3-runyang.chen@mediatek.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20230525075011.7032-1-runyang.chen@mediatek.com> References: <20230525075011.7032-1-runyang.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The infra_ao reset is needed for MT8188. - Add mtk_clk_rst_desc for MT8188. - Add register reset controller function for MT8188 infra_ao. - Add infra_ao_idx_map for MT8188. Signed-off-by: Runyang Chen Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305242320.AZzmINEa-lkp@intel.com/ --- drivers/clk/mediatek/clk-mt8188-infra_ao.c | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/clk/mediatek/clk-mt8188-infra_ao.c b/drivers/clk/mediatek/clk-mt8188-infra_ao.c index a38ddc7b6a88..f590178737cb 100644 --- a/drivers/clk/mediatek/clk-mt8188-infra_ao.c +++ b/drivers/clk/mediatek/clk-mt8188-infra_ao.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -176,9 +177,32 @@ static const struct mtk_gate infra_ao_clks[] = { "infra_ao_aes_msdcfde_0p", "top_aes_msdcfde", 18), }; +static u16 infra_ao_rst_ofs[] = { + INFRA_RST0_SET_OFFSET, + INFRA_RST1_SET_OFFSET, + INFRA_RST2_SET_OFFSET, + INFRA_RST3_SET_OFFSET, + INFRA_RST4_SET_OFFSET, +}; + +static u16 infra_ao_idx_map[] = { + [MT8188_INFRA_RST1_THERMAL_MCU_RST] = 1 * RST_NR_PER_BANK + 2, + [MT8188_INFRA_RST1_THERMAL_CTRL_RST] = 1 * RST_NR_PER_BANK + 4, + [MT8188_INFRA_RST3_PTP_CTRL_RST] = 3 * RST_NR_PER_BANK + 5, +}; + +static const struct mtk_clk_rst_desc infra_ao_rst_desc = { + .version = MTK_RST_SET_CLR, + .rst_bank_ofs = infra_ao_rst_ofs, + .rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs), + .rst_idx_map = infra_ao_idx_map, + .rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map), +}; + static const struct mtk_clk_desc infra_ao_desc = { .clks = infra_ao_clks, .num_clks = ARRAY_SIZE(infra_ao_clks), + .rst_desc = &infra_ao_rst_desc, }; static const struct of_device_id of_match_clk_mt8188_infra_ao[] = { -- 2.18.0