Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp99493pxm; Fri, 25 Feb 2022 04:48:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3SEx3VDrM6gM/O6u5X6lWF4Z6OCQBlMBSOSU68AtnD5m0/oIqTmsRw7eWP/WYw+/xd8OF X-Received: by 2002:a17:906:2b1b:b0:6b9:bcf:191f with SMTP id a27-20020a1709062b1b00b006b90bcf191fmr6028915ejg.600.1645793333697; Fri, 25 Feb 2022 04:48:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645793333; cv=none; d=google.com; s=arc-20160816; b=q2G3RdUNjuKfHa/6TkhqDiZp0zO1pZ31OWAcCiJ/pJsEYopoLbnOSYO0UfTSPfsapv JJ0w3XUEcSkamraSNpUtQ5d3pi3jH9K1wRmSEyz1vyQnBxqL7EaVaNQ4iY+bAMGQ8Kvj boCzVmEhmX0gTgbn4beyvrciaS68nyXlBDRsL1/1taBj3uw3iwZkqwIDtwoxV6Hyp4kF sGvoCjbTbvHMpcHSLuAd/EstFumUv+IVMBxMxQv0o9tNmNUXSoEsXwCqP+nAMDz6/YDf mFVT0mYNTbNGOtsVMXvpG1ZBQjDHRwStfRu49zM3J06xDqCuw+J4CmzdjDqGiTuZ+4cQ hD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6d9NuJ8AexYlePBO6MQUq8gmveRqOUtY+03+b1iB0gY=; b=MmUKYqrV00UmLxtSUyL8W3JR0VAzkDwov7LDWEnrooy1xOyrHSf2tR258b6zVizuHe /IPuoFUJG5nJzKLcXF//+/h2T1nDGsuIdR2L1XFEzUC32eKBADUikh3l2vXMPSBwNwnu dHASh7xs9zFlxJft5/0mahxFC68vE/SI9nNd1QULn1XPRCR+tfu7fVOToL6aeCY6OzVH BYFHWak0M6h1mlXiHHU5Rm7uduEC4i/RcICdnZvAwhB0yHuxygSVwuL276wMxkWHmuVr 8G53glsf83T2WHpa8Vfpc8Mpgv64MBYmc1jesYXD/hwdXFGYlJtjzuZdjnusCejvPp+p DVFw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l26-20020aa7c3da000000b00412e48e0063si1613680edr.171.2022.02.25.04.48.30; Fri, 25 Feb 2022 04:48:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237928AbiBYGpl (ORCPT + 99 others); Fri, 25 Feb 2022 01:45:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237924AbiBYGpk (ORCPT ); Fri, 25 Feb 2022 01:45:40 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D05E2763F1 for ; Thu, 24 Feb 2022 22:45:08 -0800 (PST) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2176.14; Fri, 25 Feb 2022 14:45:05 +0800 From: Shunzhou Jiang To: , , CC: , , , , , Subject: [PATCH V4 2/2] soc: s4: Add support for power domains controller Date: Fri, 25 Feb 2022 14:44:55 +0800 Message-ID: <20220225064455.1369197-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225064455.1369197-1-shunzhou.jiang@amlogic.com> References: <20220225064455.1369197-1-shunzhou.jiang@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.98.11.200] X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Add support s4 Power controller. In s4, power control registers are in secure domain, and should be accessed by smc. Signed-off-by: Shunzhou Jiang --- drivers/soc/amlogic/meson-secure-pwrc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c index 59bd195fa9c9..a10a417a87db 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,18 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = { SEC_PD(RSA, 0), }; +static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = { + SEC_PD(S4_DOS_HEVC, 0), + SEC_PD(S4_DOS_VDEC, 0), + SEC_PD(S4_VPU_HDMI, 0), + SEC_PD(S4_USB_COMB, 0), + SEC_PD(S4_GE2D, 0), + /* ETH is for ethernet online wakeup, and should be always on */ + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), + SEC_PD(S4_DEMOD, 0), + SEC_PD(S4_AUDIO, 0), +}; + static int meson_secure_pwrc_probe(struct platform_device *pdev) { int i; @@ -187,11 +200,20 @@ static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = { .count = ARRAY_SIZE(a1_pwrc_domains), }; +static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = { + .domains = s4_pwrc_domains, + .count = ARRAY_SIZE(s4_pwrc_domains), +}; + static const struct of_device_id meson_secure_pwrc_match_table[] = { { .compatible = "amlogic,meson-a1-pwrc", .data = &meson_secure_a1_pwrc_data, }, + { + .compatible = "amlogic,meson-s4-pwrc", + .data = &meson_secure_s4_pwrc_data, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, meson_secure_pwrc_match_table); -- 2.34.1