Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp786442rwr; Fri, 5 May 2023 05:10:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7qKQM/muqygSj6LhncNr2+QKESP1SRVK+VJ3HhheQhFF2qrJWCCmKT+hs/l9CroAhEhhjQ X-Received: by 2002:a17:902:dacb:b0:1aa:d545:4624 with SMTP id q11-20020a170902dacb00b001aad5454624mr1354693plx.41.1683288637304; Fri, 05 May 2023 05:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683288637; cv=none; d=google.com; s=arc-20160816; b=ZSRmOXpl+Oy2wMwbdQLe4jD6pBbmPpUr922aqXNoeXYdsrhp3xlbvoXhiPmN4TtS4x O3S90yJNC2CY9XDv2f1JZJYgcGXFh4/iN1CagWXgai3N8PqARdSPLBGsN7nhzu3+RaE9 /euUiNqpRoNpRfaLvPJLE7guLxAdsmfzjKDlBhaoZzBiaVT6WppjI5GwgyARCjSu/xhe cMunHXHcvEz9F1Oh4Xo9ifVQNCiRkZM5iOrMMl6/rjlKlZNn2rUkPXDzJjgtVLdIsHEh l/pM1TWfvWBZXj8Alk28D2Sg2AvquerLjE2/meyd3MrNYK5V3XRCpPZ4ov3SgFQaRiwf /Cgg== 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=WENEAGI81W/kSnUcxhlJRn72rPH1x58Xnf1xu4O5Qs4=; b=Rb9BJi9vJ3traI7/oTOEHGdpDlfksTlESruze5RKdTMvZwH1hRxxyzV6XNpwqNuVDI EFqKlcTx87TOCpzjMZYSdqiL4kcdfHSuL+hS8Qds/MLdncS6DiNKkz30t082VXfIaBoe LI7XwdqVQ1b069VuHeG+pgb2a0O6YlRmpcVXW+85OPCjtA8XBzaVKMKlgnr5QnoY7cxn OtWX7cxwGYKiraIKE+XBfnz0xD6B/9m2LxO62yd0Kg24SCm0KN7ch5qY45L+mB/KYklL F3gab0kSQOiuGhqWOJs29a+K92T0CYWoif7+SbIeQPegxcvRhTdItGV57cswE2sJcKA5 8B4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=HU7UaHYi; 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 n7-20020a170903110700b0019fe9a63cf2si1567009plh.609.2023.05.05.05.10.22; Fri, 05 May 2023 05:10:37 -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=HU7UaHYi; 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 S232054AbjEEMBn (ORCPT + 99 others); Fri, 5 May 2023 08:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232023AbjEEMB0 (ORCPT ); Fri, 5 May 2023 08:01:26 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB921AEDD; Fri, 5 May 2023 05:01:23 -0700 (PDT) X-UUID: 8b846f32eb3c11ed9cb5633481061a41-20230505 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=WENEAGI81W/kSnUcxhlJRn72rPH1x58Xnf1xu4O5Qs4=; b=HU7UaHYiHYiAURa7HkRomZyDaSa5i1wkhLuzO3VQZm538+A43c8W3SMubU8uW37+qXbEq6i6vkE1RgjOkiJv43z5+gndHiK3aDLICsnQpjm++sbJG2YoQSXT/DpgWcKsdIR8rg6qFuNpwfKA2CgUzD3G9lxtPmHjopwUxaora2U=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.23,REQID:8e385da2-741f-4c69-9e00-536aa3ff802e,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:697ab71,CLOUDID:40afdd30-6935-4eab-a959-f84f8da15543,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,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: 8b846f32eb3c11ed9cb5633481061a41-20230505 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 877711924; Fri, 05 May 2023 20:01:18 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Fri, 5 May 2023 20:01:17 +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.25 via Frontend Transport; Fri, 5 May 2023 20:01:16 +0800 From: Runyang Chen To: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel , Rob Herring , Krzysztof Kozlowski CC: , , , , , Runyang Chen , Runyang Chen Subject: [PATCH 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Date: Fri, 5 May 2023 20:01:08 +0800 Message-ID: <20230505120108.26603-3-runyang.chen@mediatek.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20230505120108.26603-1-runyang.chen@mediatek.com> References: <20230505120108.26603-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 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 --- 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 91c35db40b4e..1d4b27ba06be 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 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