From patchwork Tue May 18 19:40:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12265549 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 7DB20C433ED for ; Tue, 18 May 2021 19:42:31 +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 0F38D610CB for ; Tue, 18 May 2021 19:42:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F38D610CB 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: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=Jk+wToOoMy+o+gS7SJZYS8O4vVwCuTkSmJmho2gKB+s=; b=D0b4fzZdHr91+yQojAsNDDL3Pt Vj9je/tSpDhFD7aFjrwsbmJMPttNR/WitjNAEGFai7xaYAWPXqPUnz5qncW0MogxvopS1ECIi8Mvl Is9oBWY7W8GcpRa0Yz0FWaA6YpL0WUeI151TbAoXTd8gcoiKdFrYhw7b7B0QTkI6QOu/0tLjGT9TE tXt7lIQOs6NS3/Rmm+EGE85FCJ9XIlp53IgYeVEBBgXRkR0aK6CWDSS/kYUyqzI77lcoCWTW4j/wC qVCFwVXshnGE9F3PslonNHBdPmkVcytaFSx9OnkpZ9+Qp5mw2siXPOb52xw2b/7i2zA+FMDqYudFp xrU392XQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj5Zw-001kqT-Bl; Tue, 18 May 2021 19:40:32 +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 1lj5Zg-001kp0-Ry 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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=w916I/0sjB8ZeTLALSSIwoUKwmWfEbuQ72Hpwd3NOu0=; b=qoyJ4njonAQAvPIz9p7iAIXkX+ 6oaiNk2JfMocI0YM0XghtBHgFDONHPYHNYDBNN4DkmLC0fkvz11WYDtmANpwVyezun1bVDbhjMt+G TsDm5AJ6IYvonfQFiE3k/3Y/wujTXeH+tGmzTtnlcwKsFU6uC2lcgDPEcVE1kSRE4+8HvWWLz8tCw 6zchi3StOyKPZf6rcmUhlBHTR/0y1aG6I1MXR12tzX0nVp/CtKhudAvSONme9C3H41bH1LE5FhAp6 aFMhzMN0amrIescXy5c1i1c5EiRzhMhB0SL1MZ8bVRbrpA39n1nBVLui7aeX+YvY6OJyYCyR0GFgc BLE23nMQ==; Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj5Zc-00Ev3s-I1 for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 19:40:15 +0000 Received: by mail-wr1-x435.google.com with SMTP id p7so7759113wru.10 for ; Tue, 18 May 2021 12:40:12 -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:mime-version :content-transfer-encoding; bh=w916I/0sjB8ZeTLALSSIwoUKwmWfEbuQ72Hpwd3NOu0=; b=imtv0CYo96W3t7tK4e2c0G+asBQh3MxUV4zhTePtdhickz6yO6CV/Uxe+0mDylMgKa OOYFukZKU+SLyEhPO2dNddst9TRtn4XyBfw5Uvip/dl4tP8yOMZQV4lMiwa/xVGksInt v90XyXqT6Pys9EfGXyaUGJMiUtRKeYPjmY1TMvSBllAsJkypu1reDAprpqraATtzspaZ vPutGVyjLKQSsXtkLqeHIlJMXri05RvfeRYYYgBCaDwD3eRCTORRRimvb+/PO6pC3hIk DOYLDfuZ3k+SSsFnV/EQXzaa0W2uphkDUjbwX0Ws0leGltYP9wLnVn5/SSF4v3ZeajkG nagg== 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:mime-version :content-transfer-encoding; bh=w916I/0sjB8ZeTLALSSIwoUKwmWfEbuQ72Hpwd3NOu0=; b=IS9C5GN2q1L/BCOEBp9fkvbvHuoyhH/MJCLRbFuChSd5lBMjN9ny2iW8sVBTCRjJeb 557jvS2p7V9j3Hq8w33DRrKR5b6UTQ9Ce4ZdJGjPxdGX6BXjgQwcKBlp1lpcgt+Aru00 0B5WiI1DsfEvpsuR26HiyvFGFzks2OeGiT9JjYeGnimPAp/trrJK1cPeqz/Xj/ho1Jmm tWrf/34I2FCEhYgJ2jws0GzwrAdoSs/lQBC6ftpK9Zqpa7+YlKahXG72QW73l8sWOv0R y6nlpc/efzjRyWsTS5RRRSF+23UnPtJF6v2gCPSeLPGOpZrvGIE4sCRzuSDDcHS0acYA l49A== X-Gm-Message-State: AOAM531rWg5dpJ6R3WQLLL9t9Jn+WRZKrp+njUmtMCshqSyriqmPNpYU GjrbgfhcBGVfWPk9ImOumYjlYQ== X-Google-Smtp-Source: ABdhPJxqBvFdPKeDHOE6hCEivMK6rdREhcDBBFaoT/XGgJgqhulDWVhyvbfztJUlEUSOEXnTWAQJKA== X-Received: by 2002:adf:f788:: with SMTP id q8mr9020066wrp.205.1621366810997; Tue, 18 May 2021 12:40:10 -0700 (PDT) Received: from localhost.localdomain ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id q186sm5484407wme.20.2021.05.18.12.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 12:40:10 -0700 (PDT) From: Fabien Parent To: Rob Herring , Matthias Brugger , Weiyi Lu Cc: mkorpershoek@baylibre.com, Fabien Parent , Matthias Brugger , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: power: Add MT8365 power domains Date: Tue, 18 May 2021 21:40:07 +0200 Message-Id: <20210518194008.2921469-1-fparent@baylibre.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_124012_616612_1F269EE6 X-CRM114-Status: GOOD ( 14.75 ) 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 power domains dt-bindings for MT8365. Signed-off-by: Fabien Parent --- .../power/mediatek,power-controller.yaml | 2 ++ include/dt-bindings/power/mt8365-power.h | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 include/dt-bindings/power/mt8365-power.h diff --git a/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml b/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml index f234a756c193..9a26a2cee7fb 100644 --- a/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml +++ b/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml @@ -27,6 +27,7 @@ properties: - mediatek,mt8173-power-controller - mediatek,mt8183-power-controller - mediatek,mt8192-power-controller + - mediatek,mt8365-power-controller '#power-domain-cells': const: 1 @@ -64,6 +65,7 @@ patternProperties: "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain. "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain. "include/dt-bindings/power/mt8192-power.h" - for MT8192 type power domain. + "include/dt-bindings/power/mt8365-power.h" - for MT8365 type power domain. maxItems: 1 clocks: diff --git a/include/dt-bindings/power/mt8365-power.h b/include/dt-bindings/power/mt8365-power.h new file mode 100644 index 000000000000..352440c4b5dd --- /dev/null +++ b/include/dt-bindings/power/mt8365-power.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2021 MediaTek Inc. + */ + +#ifndef _DT_BINDINGS_POWER_MT8365_POWER_H +#define _DT_BINDINGS_POWER_MT8365_POWER_H + +#define MT8365_POWER_DOMAIN_DISP 0 +#define MT8365_POWER_DOMAIN_CONN 1 +#define MT8365_POWER_DOMAIN_MFG 2 +#define MT8365_POWER_DOMAIN_AUDIO 3 +#define MT8365_POWER_DOMAIN_CAM 4 +#define MT8365_POWER_DOMAIN_DSP 5 +#define MT8365_POWER_DOMAIN_VDEC 6 +#define MT8365_POWER_DOMAIN_VENC 7 +#define MT8365_POWER_DOMAIN_APU 8 + +#endif /* _DT_BINDINGS_POWER_MT8365_POWER_H */ + 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, + }, { } };