From patchwork Tue May 18 19:40:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12265551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D1DAC433B4 for ; Tue, 18 May 2021 19:42:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F4058610CB for ; Tue, 18 May 2021 19:42:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F4058610CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=l+HKrdd0XiPa2oWVat4T5v7PdOm0+cy3wmxY5Ejr3jo=; b=HL5RBXBpdMzxZcFrrB3Kq/Hdh egW6plDCqGhgbKh3L8GvtCuPeMFfOeZ71fHRP57JZ2QRSszvkk6W2n7YC1BLvZ9YQ7zcYCnM9ZfBQ XQFLGSOUfgO+4JxKvz9YQ620Xe1sLX1rPeG6hniXkvqE/0LrupH7rogonDZzmneJ2nG6MjAjxzM0j wUhc1wd+WsRc3EK/jJKVSKBhSmnFWiJYPaqAGb8HaSsYHAyWMCxfsgwDEysUQhOjzo8px9+RNd3Lj X+K+2StHRYtCSFvwPMzzO0/U+oRRr1IONtP1YFbVIXoUGn2YfDiVHLJ56w34ctYNCSKGz1uncLoI3 w6Zx7amvA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj5aA-001ksk-4I; Tue, 18 May 2021 19:40:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj5Zh-001kp2-7i for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 19:40:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Kav2sISS6YUfpAfIMUuL/snESEkTzPWRiHLUpCAjbiM=; b=W4FqWzLyP9pofwzQh5m56Nw6dw dZ3zKh6zNn44EHxSwIe6Nh6r+QPt5kCRlSB2IwaWFZJG/Xae9ew1FwBvm8zzXa8vkFn+9xc/x4fWF 1ID9KtDQBC2eI1LJ4PwM+kzZfvd33c3ueK9EnuQHay4ZFSoX/WKhViokb6fRaR067DotHChtChTdJ n7SzF2OpUVEBmO4lT5E6winQY+FAUTgv0RB4NQ6A+YR7OGnwvu0SKRl8IlsZM1+2IvkySlvYuEpbi 7WeYlrsXyNuaL3zWHbb8j/8Lo2ofkU8WHEGXNBL6hXh/qyEMesmfbdreqKBbUQdA4owImJibxnfoT YZRhbd6Q==; Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj5Zd-00Ev4L-Na for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 19:40:15 +0000 Received: by mail-wm1-x334.google.com with SMTP id b19-20020a05600c06d3b029014258a636e8so2076775wmn.2 for ; Tue, 18 May 2021 12:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kav2sISS6YUfpAfIMUuL/snESEkTzPWRiHLUpCAjbiM=; b=svP8wwHMUCz6sMmkD1cSLDvah6qd2cTw7P7uxvTaTVitye+P74FGXSfcQwoOEBL/QD OlmRC2XIAIURpTNY0BnZLgKEBhONej6Vl1vnnoLc+NVTxkgj7tIvydNN4eRaNhrc0bkc vnIIcgCqEhHw/mazYOU86zIYMb3i6wCuOPAwEnYRDreLzLIFgS67PeDQjeJuglKHwpT/ PdbTwNJFqcMAQzVMQsDeJ6yrrdCs67LwPP0kv5oWu3Ttlujh2QJdGwy2zdIA+NXBRCIR 3ZNj/24H0R2JWHMeBop/J7vytrawl6wTU7K0jhP/h4Lsg8CWKl8WmTuVIfQnTcBLpkCf +O8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kav2sISS6YUfpAfIMUuL/snESEkTzPWRiHLUpCAjbiM=; b=C9ZKJ2c+b/8nwbBsFOeNDqHJgRmqK75pj+qP00wGY39T+yxEAcA71kWux2e81apr+Q h7GVQAYPTiRuQFNnwriqxsIdkxA5MmnM/JTAR9ebbFGCJh1YBGIklxMKgZFhr5Sf+OlY oCJ1SS9s/vi4mywvMoTOpXxyfuAiPGiHOmwLstf8/jJm/NaYxTOenGS8MEJ+OLAXummj xTywtFVUX1ReYTFO3ISjCztSqVUxJf3MJUlzWV/KsQwUvwIrf7TKNdszMGG4zQWF6kLv 0A90Ii7DTqgVYJosZZbn1NGfsbYxDpU+LVtCQBFgY1jFx+BdbwQ8jx+LgepahJlfIxBb 9lrw== X-Gm-Message-State: AOAM533JoNOmVAC4ArlOltW5/UeEI6wqXYeUlP2fZyDZPFUffcYuPsBT JZmHYL672YJ/c5Cml0aYqs9JsQ== X-Google-Smtp-Source: ABdhPJwYqopLI+Bb7aEMtJWH/hLReqeGPRgrs511JmhDMQwQaApEiCm1FcB7oStnAEbJd9w4ZFoDhw== X-Received: by 2002:a7b:cb96:: with SMTP id m22mr7079774wmi.59.1621366812330; Tue, 18 May 2021 12:40:12 -0700 (PDT) Received: from localhost.localdomain ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id q186sm5484407wme.20.2021.05.18.12.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 12:40:11 -0700 (PDT) From: Fabien Parent To: Matthias Brugger Cc: mkorpershoek@baylibre.com, Fabien Parent , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/2] soc: mediatek: pm-domains: Add support for MT8365 Date: Tue, 18 May 2021 21:40:08 +0200 Message-Id: <20210518194008.2921469-2-fparent@baylibre.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210518194008.2921469-1-fparent@baylibre.com> References: <20210518194008.2921469-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_124013_789153_2F9450A6 X-CRM114-Status: GOOD ( 18.06 ) 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 Add the needed board data to support MT8365 SoC. Signed-off-by: Fabien Parent --- drivers/soc/mediatek/mt8365-pm-domains.h | 129 +++++++++++++++++++++++ drivers/soc/mediatek/mtk-pm-domains.c | 5 + 2 files changed, 134 insertions(+) create mode 100644 drivers/soc/mediatek/mt8365-pm-domains.h diff --git a/drivers/soc/mediatek/mt8365-pm-domains.h b/drivers/soc/mediatek/mt8365-pm-domains.h new file mode 100644 index 000000000000..964387967888 --- /dev/null +++ b/drivers/soc/mediatek/mt8365-pm-domains.h @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __SOC_MEDIATEK_MT8365_PM_DOMAINS_H +#define __SOC_MEDIATEK_MT8365_PM_DOMAINS_H + +#include "mtk-pm-domains.h" +#include + +/* + * MT8365 power domain support + */ + +static const struct scpsys_domain_data scpsys_domain_data_mt8365[] = { + [MT8365_POWER_DOMAIN_DISP] = { + .name = "disp", + .sta_mask = PWR_STATUS_DISP, + .ctl_offs = 0x30c, + .sram_pdn_bits = GENMASK(8, 8), + .sram_pdn_ack_bits = GENMASK(12, 12), + .bp_infracfg = { + BUS_PROT_WR(BIT(16) | BIT(17), 0x2a8, 0x2ac, 0x258), + BUS_PROT_WR(BIT(1) | BIT(2) | BIT(10) | BIT(11), 0x2a0, 0x2a4, 0x228), + BUS_PROT_WR_IGN(BIT(5), 0x0, 0x234, 0x28), + BUS_PROT_WR(BIT(6), 0x2a0, 0x2a4, 0x228), + }, + }, + [MT8365_POWER_DOMAIN_VENC] = { + .name = "venc", + .sta_mask = PWR_STATUS_VENC, + .ctl_offs = 0x0304, + .sram_pdn_bits = GENMASK(8, 8), + .sram_pdn_ack_bits = GENMASK(12, 12), + .bp_smi = { + BUS_PROT_WR(BIT(1), 0x3c4, 0x3c8, 0x3c0), + }, + }, + [MT8365_POWER_DOMAIN_AUDIO] = { + .name = "audio", + .sta_mask = PWR_STATUS_AUDIO, + .ctl_offs = 0x0314, + .sram_pdn_bits = GENMASK(12, 8), + .sram_pdn_ack_bits = GENMASK(17, 13), + .bp_infracfg = { + BUS_PROT_WR(BIT(27) | BIT(28), 0x2a8, 0x2ac, 0x258), + }, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, + [MT8365_POWER_DOMAIN_CONN] = { + .name = "conn", + .sta_mask = PWR_STATUS_CONN, + .ctl_offs = 0x032c, + .sram_pdn_bits = 0, + .sram_pdn_ack_bits = 0, + .bp_infracfg = { + BUS_PROT_WR(BIT(13), 0x2a0, 0x2a4, 0x228), + BUS_PROT_WR(BIT(18), 0x2a8, 0x2ac, 0x258), + BUS_PROT_WR(BIT(14), 0x2a0, 0x2a4, 0x228), + BUS_PROT_WR(BIT(21), 0x2a8, 0x2ac, 0x258), + }, + .caps = MTK_SCPD_ACTIVE_WAKEUP | MTK_SCPD_KEEP_DEFAULT_OFF, + }, + [MT8365_POWER_DOMAIN_MFG] = { + .name = "mfg", + .sta_mask = PWR_STATUS_MFG, + .ctl_offs = 0x0338, + .sram_pdn_bits = GENMASK(9, 8), + .sram_pdn_ack_bits = GENMASK(13, 12), + .bp_infracfg = { + BUS_PROT_WR(BIT(25), 0x2a0, 0x2a4, 0x228), + BUS_PROT_WR(BIT(21) | BIT(22), 0x2a0, 0x2a4, 0x228), + }, + }, + [MT8365_POWER_DOMAIN_CAM] = { + .name = "cam", + .sta_mask = BIT(25), + .ctl_offs = 0x0344, + .sram_pdn_bits = GENMASK(9, 8), + .sram_pdn_ack_bits = GENMASK(13, 12), + .bp_infracfg = { + BUS_PROT_WR(BIT(19), 0x2a8, 0x2ac, 0x258), + }, + .bp_smi = { + BUS_PROT_WR(BIT(2), 0x3c4, 0x3c8, 0x3c0), + }, + }, + [MT8365_POWER_DOMAIN_VDEC] = { + .name = "vdec", + .sta_mask = BIT(31), + .ctl_offs = 0x0370, + .sram_pdn_bits = GENMASK(8, 8), + .sram_pdn_ack_bits = GENMASK(12, 12), + .bp_smi = { + BUS_PROT_WR(BIT(3), 0x3c4, 0x3c8, 0x3c0), + }, + }, + [MT8365_POWER_DOMAIN_APU] = { + .name = "apu", + .sta_mask = BIT(16), + .ctl_offs = 0x0378, + .sram_pdn_bits = GENMASK(14, 8), + .sram_pdn_ack_bits = GENMASK(21, 15), + .bp_infracfg = { + BUS_PROT_WR(BIT(2) | BIT(20), 0x2a8, 0x2ac, 0x258), + }, + .bp_smi = { + BUS_PROT_WR(BIT(4), 0x3c4, 0x3c8, 0x3c0), + }, + }, + [MT8365_POWER_DOMAIN_DSP] = { + .name = "dsp", + .sta_mask = BIT(17), + .ctl_offs = 0x037C, + .sram_pdn_bits = GENMASK(11, 8), + .sram_pdn_ack_bits = GENMASK(15, 12), + .bp_infracfg = { + BUS_PROT_WR(BIT(24) | BIT(30) | BIT(31), 0x2a8, 0x2ac, 0x258), + }, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, +}; + +static const struct scpsys_soc_data mt8365_scpsys_data = { + .domains_data = scpsys_domain_data_mt8365, + .num_domains = ARRAY_SIZE(scpsys_domain_data_mt8365), + .pwr_sta_offs = 0x0180, + .pwr_sta2nd_offs = 0x0184 +}; + +#endif /* __SOC_MEDIATEK_MT8365_PM_DOMAINS_H */ diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c index 0af00efa0ef8..4c8eecaace99 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.c +++ b/drivers/soc/mediatek/mtk-pm-domains.c @@ -20,6 +20,7 @@ #include "mt8173-pm-domains.h" #include "mt8183-pm-domains.h" #include "mt8192-pm-domains.h" +#include "mt8365-pm-domains.h" #define MTK_POLL_DELAY_US 10 #define MTK_POLL_TIMEOUT USEC_PER_SEC @@ -576,6 +577,10 @@ static const struct of_device_id scpsys_of_match[] = { .compatible = "mediatek,mt8192-power-controller", .data = &mt8192_scpsys_data, }, + { + .compatible = "mediatek,mt8365-power-controller", + .data = &mt8365_scpsys_data, + }, { } };