From patchwork Fri Mar 29 04:38:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 13610073 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 CE425CD1283 for ; Fri, 29 Mar 2024 04:43:28 +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: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:In-Reply-To:References: List-Owner; bh=Q08knBurdoFn3I27MnpWa2K9k2hR2FXRtsdYBfCMVTA=; b=zRhg+8JyUU1mzG nreQk6/i7+cCHcZj9oJl7mB9tPYzRA62DiBFkPWIUlITwCaNw4XQn6ki8N0KY8ocGk3aTjW9S9IHJ 2+5t07fsKGKpM5j16zdMFjL029iFoO7x1WUchxOX42Td6SJ7eNbRdNbRD1VAE8hzz5dsYuL5l6IDB HBYCNf09O4dq7oQkYnmn31mCqiOJh18xfI7AlyQoW8oGqxKPx4GHa7rdaij/sNw6aZYiFkZlvjPMh IELf1SfpEOitbMQ3ShzVh+cBE1h9W0WkxylTvK8ly1FQwMb0bgGz9TytCQE/4c51tF3JstrqbXtSy cECWWZ0YGH3UUi8hq4Ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rq45B-0000000GmZn-3Ans; Fri, 29 Mar 2024 04:43:13 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rq458-0000000GmY3-38ld for linux-arm-kernel@lists.infradead.org; Fri, 29 Mar 2024 04:43:12 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1dff837d674so13808035ad.3 for ; Thu, 28 Mar 2024 21:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711687385; x=1712292185; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=T+F3MEmVUPzwWL0/FLP/CCB6bmOFJ8TO+NbHdWfRAjA=; b=llkcICXSTObbNAuF81bKKVoL9ki87mbBdxuMv8Den3vwDT9VU7qtTrUm24unt6P86K AVaLSvBigTnhJSfBApDo17BT0KEGlRSfUGj36Y72krL3v/VW6pzBnJupWoqELKXEtjcT /S/0IKO24S8pmOSZcY63tMGKCZLKlPes8K1dg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711687385; x=1712292185; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T+F3MEmVUPzwWL0/FLP/CCB6bmOFJ8TO+NbHdWfRAjA=; b=nBM69di+T8UdSurbUG43ASGurjWsnNG5SVwr1pGRHKfZ+0Ln0EmsNQkmtVLC6UGdTV Oh2J5p2nol9LM96eyIX8p4vimB5QgurYw08YYwHx6UfQ9JnI5pXuvdZajmJW9wYIJZGV D9+Eew3CyVUvwH8lfCsIerOm/SHKAoPs6LtQsGChLjiT7ObexJJxMKzuPfupKDNQ+DQ2 3tgHwhI3RS0G5bDm+r69GQsFKBf25mCoILo8IQO2zSBLW1NmWyvVN/yGIAJgw4f/cCPw 4S+q4RJPwIkN0qRMxFE8pCaTqBw3EjEFslAlbnfjNdFvGihj98fCifDKulNIUxeVtsBv G2yw== X-Forwarded-Encrypted: i=1; AJvYcCXA75y32No7FqibafzA7TNveE1gzeCw/PSJRnBe6WNu9UFlpT9SLHpU2UI/KR8NHsRF8TisF1BKcvElMwF+VOLFX2GkNkrI3v5lYLRRzQXqdm27AWY= X-Gm-Message-State: AOJu0YyktqnwQO4xp1mlrtxuMC/nqnLbNtBa5IwI4Rm5SA9V0PKSqYHe 1Qhbwzu4DWvyLIxnPo25fddaIUKV9m8fDUjUD76Fu3eEmrhuDKFwFoA61ugG+w== X-Google-Smtp-Source: AGHT+IHCedueif2FtQVSxLOhPhqWgRritaTfZsBJlDn+eEkw34EDb+pABQ0tVdwsWrtdeb23F+EOuQ== X-Received: by 2002:a17:903:2442:b0:1de:f18c:cdd with SMTP id l2-20020a170903244200b001def18c0cddmr1744816pls.3.1711687385018; Thu, 28 Mar 2024 21:43:05 -0700 (PDT) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:89c9:dcae:ddce:1350]) by smtp.gmail.com with ESMTPSA id q6-20020a17090311c600b001dd744f97d0sm2502345plh.273.2024.03.28.21.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 21:43:04 -0700 (PDT) From: Fei Shao To: Ulf Hansson Cc: Johnson Wang , Fei Shao , AngeloGioacchino Del Regno , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v2] pmdomain: mediatek: Add MT8188 buck isolation setting Date: Fri, 29 Mar 2024 12:38:40 +0800 Message-ID: <20240329044142.3095193-1-fshao@chromium.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_214310_900830_37D3B3E1 X-CRM114-Status: GOOD ( 12.88 ) 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: Johnson Wang From: Johnson Wang Add buck isolation setting to ADSP_AO, CAM_VCORE and IMG_VCORE power domains in MT8188 for proper buck isolation control in power domain on/off. Signed-off-by: Johnson Wang Signed-off-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno --- Changes in v2: [1] was reviewed but didn't get accepted at the time. This rebases [1] on next-20240327 with revised commit message. [1]: https://lore.kernel.org/all/20230315114505.25144-1-johnson.wang@mediatek.com/ drivers/pmdomain/mediatek/mt8188-pm-domains.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/mediatek/mt8188-pm-domains.h b/drivers/pmdomain/mediatek/mt8188-pm-domains.h index 06834ab6597c..007235be9efe 100644 --- a/drivers/pmdomain/mediatek/mt8188-pm-domains.h +++ b/drivers/pmdomain/mediatek/mt8188-pm-domains.h @@ -175,6 +175,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { .ctl_offs = 0x35C, .pwr_sta_offs = 0x16C, .pwr_sta2nd_offs = 0x170, + .ext_buck_iso_offs = 0x3EC, + .ext_buck_iso_mask = BIT(10), .bp_cfg = { BUS_PROT_WR(INFRA, MT8188_TOP_AXI_PROT_EN_2_ADSP_AO_STEP1, @@ -187,7 +189,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { MT8188_TOP_AXI_PROT_EN_2_CLR, MT8188_TOP_AXI_PROT_EN_2_STA), }, - .caps = MTK_SCPD_ALWAYS_ON, + .caps = MTK_SCPD_ALWAYS_ON | MTK_SCPD_EXT_BUCK_ISO, }, [MT8188_POWER_DOMAIN_ADSP_INFRA] = { .name = "adsp_infra", @@ -524,6 +526,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { .ctl_offs = 0x3A4, .pwr_sta_offs = 0x16C, .pwr_sta2nd_offs = 0x170, + .ext_buck_iso_offs = 0x3EC, + .ext_buck_iso_mask = BIT(12), .bp_cfg = { BUS_PROT_WR(INFRA, MT8188_TOP_AXI_PROT_EN_MM_IMG_VCORE_STEP1, @@ -541,7 +545,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { MT8188_TOP_AXI_PROT_EN_MM_2_CLR, MT8188_TOP_AXI_PROT_EN_MM_2_STA), }, - .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY, + .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY | + MTK_SCPD_EXT_BUCK_ISO, }, [MT8188_POWER_DOMAIN_IMG_MAIN] = { .name = "img_main", @@ -591,6 +596,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { .ctl_offs = 0x3A0, .pwr_sta_offs = 0x16C, .pwr_sta2nd_offs = 0x170, + .ext_buck_iso_offs = 0x3EC, + .ext_buck_iso_mask = BIT(11), .bp_cfg = { BUS_PROT_WR(INFRA, MT8188_TOP_AXI_PROT_EN_MM_CAM_VCORE_STEP1, @@ -618,7 +625,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = { MT8188_TOP_AXI_PROT_EN_MM_2_CLR, MT8188_TOP_AXI_PROT_EN_MM_2_STA), }, - .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY, + .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY | + MTK_SCPD_EXT_BUCK_ISO, }, [MT8188_POWER_DOMAIN_CAM_MAIN] = { .name = "cam_main",