Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4227909rwb; Mon, 16 Jan 2023 20:33:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtbodyZdQkGtTo2fWAo7xX67Y1hFJ/JZ3s4lTGX93LddSSG919RMgXVJdll+nJSv0qPHlhx X-Received: by 2002:a17:907:6e05:b0:871:dd2:4afb with SMTP id sd5-20020a1709076e0500b008710dd24afbmr6227520ejc.42.1673929990707; Mon, 16 Jan 2023 20:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673929990; cv=none; d=google.com; s=arc-20160816; b=Fhhp9bOl200YXTgaMoV6hAB5A7Rtq5cDOK0+e2VSJmZigprdKl/xvkTvllE7x3pJcA Vh1g0S2rPvA6H9J60e9pFqy3iI8TYldWia4olZGTEIw03Oyv8ywLyTCQSywTCYEwvnlL 8xt2+ywWs5d0GdJdaBajlBhGVd7w6JMj+FSHw0A3oAXh5FOUQvlkiT/fO0p8aXT4KxDo yHOpkL0HE6kf5JlUuuuG7Z8L3Hek+7Wyo7s4YhDgqvACTz1uZuTENiJ5CYL6bU9K7XZ2 2TH7lEnqHuPDIK8uFXa9zcasmLCp6JR1amfUku0tm9m8LuGjoVUt9c2ziSO9VqMBg9Ft j5fA== 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=5C2D2S86cb16nMfLO4Diw2Eh4jJ4yT3vi26gK/otEzg=; b=eUuVhjEVy9cCx9vvJGh7QFBu2dhnM7jSt7aHLLspHm2pZQ4nOJ+WGBi95x0sJoOFdv yNjq3NqI1B80sqYEpbnnGFqfKW5DHEQqVAhb3osEvXzaRh/3Uv6vY2EtJXlZrkB2UuBg z+Tcc5qAEJNM96SNCpKHuZTtmL7CHcIocJbQ1NdyYFP1J2BEm6hiumEBqSacjAyPP5M1 +sB865h86RHnfBLtVDi2lIkVj6tYsl7VjHR8bNpy+OPaSL5gMj5CtvY4CHv0vXpsRU9h cNWg1NK1cs7shLBTP/em5GEXDToUYlS++ss8Xig3kQmRn49U1dl0Mh6HHjpAiPYaeqWQ umtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="rV/yfyKU"; 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 cz3-20020a0564021ca300b0049cfcf42722si10729100edb.449.2023.01.16.20.32.58; Mon, 16 Jan 2023 20:33:10 -0800 (PST) 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="rV/yfyKU"; 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 S235285AbjAQD1S (ORCPT + 50 others); Mon, 16 Jan 2023 22:27:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235337AbjAQD1B (ORCPT ); Mon, 16 Jan 2023 22:27:01 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D6922DEE for ; Mon, 16 Jan 2023 19:26:53 -0800 (PST) X-UUID: c6f171c6961611ed945fc101203acc17-20230117 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=5C2D2S86cb16nMfLO4Diw2Eh4jJ4yT3vi26gK/otEzg=; b=rV/yfyKU1u0fbaNhI0vN2X0ivRrqnQbb89mKpiXsFZWC0W4LiVSJ/ZbPG/QAIPhr6SJ8fLL5rd9uPjTF90sgdtNtwRsWY9BcgFFvtSSNIUmbkgQnXs23rY1Rnf0+EjVUo3oDZ/OWh4vfD3oe9z0Nns82IXbUlI0sC+5e1VYrZps=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.18,REQID:6a9e5795-77ff-4af4-acbf-23dcf273d8bf,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:3ca2d6b,CLOUDID:9769738c-8530-4eff-9f77-222cf6e2895b,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 X-CID-BVR: 0 X-UUID: c6f171c6961611ed945fc101203acc17-20230117 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 185448080; Tue, 17 Jan 2023 11:26:48 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Tue, 17 Jan 2023 11:26:47 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 17 Jan 2023 11:26:47 +0800 From: Allen-KH Cheng To: Matthias Brugger , Enric Balletbo i Serra CC: , , , , , Allen-KH Cheng Subject: [PATCH 2/2] soc: mediatek: pm-domains: Add buck isolation setting in power domain Date: Tue, 17 Jan 2023 11:26:40 +0800 Message-ID: <20230117032640.13504-3-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230117032640.13504-1-allen-kh.cheng@mediatek.com> References: <20230117032640.13504-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N 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,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 In some chipsets, we need to disable EXT_BUCK_ISO before turning on the specific power pm-domains (mtcmos), such as ADSP in MT8192 and CAM_VCORE in MT8188. Add the MTK_SCPD_EXT_BUCK_ISO flag to control the buck isolation setting in the mediatek power domain driver. Fixes: 59b644b01cf4 ("soc: mediatek: Add MediaTek SCPSYS power domains") Signed-off-by: Allen-KH Cheng --- drivers/soc/mediatek/mtk-pm-domains.c | 8 ++++++++ drivers/soc/mediatek/mtk-pm-domains.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c index 474b272f9b02..be972e35b26e 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.c +++ b/drivers/soc/mediatek/mtk-pm-domains.c @@ -218,6 +218,10 @@ static int scpsys_power_on(struct generic_pm_domain *genpd) if (ret) goto err_reg; + if (pd->data->ext_buck_iso_offs && MTK_SCPD_CAPS(pd, MTK_SCPD_EXT_BUCK_ISO)) + regmap_clear_bits(scpsys->base, pd->data->ext_buck_iso_offs, + pd->data->ext_buck_iso_mask); + /* subsys power on */ regmap_set_bits(scpsys->base, pd->data->ctl_offs, PWR_ON_BIT); regmap_set_bits(scpsys->base, pd->data->ctl_offs, PWR_ON_2ND_BIT); @@ -272,6 +276,10 @@ static int scpsys_power_off(struct generic_pm_domain *genpd) if (ret < 0) return ret; + if (pd->data->ext_buck_iso_offs && MTK_SCPD_CAPS(pd, MTK_SCPD_EXT_BUCK_ISO)) + regmap_set_bits(scpsys->base, pd->data->ext_buck_iso_offs, + pd->data->ext_buck_iso_mask); + clk_bulk_disable_unprepare(pd->num_subsys_clks, pd->subsys_clks); /* subsys power off */ diff --git a/drivers/soc/mediatek/mtk-pm-domains.h b/drivers/soc/mediatek/mtk-pm-domains.h index a5f24c58e35a..5ec53ee073c4 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.h +++ b/drivers/soc/mediatek/mtk-pm-domains.h @@ -10,6 +10,7 @@ #define MTK_SCPD_DOMAIN_SUPPLY BIT(4) /* can't set MTK_SCPD_KEEP_DEFAULT_OFF at the same time */ #define MTK_SCPD_ALWAYS_ON BIT(5) +#define MTK_SCPD_EXT_BUCK_ISO BIT(6) #define MTK_SCPD_CAPS(_scpd, _x) ((_scpd)->data->caps & (_x)) #define SPM_VDE_PWR_CON 0x0210 -- 2.18.0