Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2453396pxm; Sun, 27 Feb 2022 22:15:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwskFcpKwKNx6GAzis6QwGv3F5Lf7MsU/cBLoOAP9UBHm1W4wdZ+miq8PCWp3ujiDCZGRox X-Received: by 2002:a17:907:971b:b0:6cf:d2cf:d867 with SMTP id jg27-20020a170907971b00b006cfd2cfd867mr13961839ejc.669.1646028942107; Sun, 27 Feb 2022 22:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646028942; cv=none; d=google.com; s=arc-20160816; b=dw64MMG/hv5YyL63pjP6UINterZGfRPHG+bLCCkEPUEBDlXMUhqll502laPrcEm/np pAb3GIsqUyki2yl4XaT6oQ8k4hycoGv3y6VvoV6I55QTVptcLbj4AVpsHxgq4RpkMWSD 14OUv06M5m/nZg+Fu9aZWlJS7SyHcq6ukkNPgZoUdaZdG0PHrVvvd0iLNR+aCHC4eltj 60d1H8PJeQCOJgV2K7oj9WYRKnHg2jC4Z5BdXEwRcjRJ2XuWk2EpSfLrRXr7RRfj8voc owDXK8L9THdhGqoGJhyMnU3cxnjYgkjgfKfKB4hcdI6KRmVLDQ7jswPtZZA/VbOl8uCE NFRQ== 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=qXGeT7p9YGSa5UHf2vc7fWt6wVImpnLufLo6WLL1Y3csb0yZ086rizekB7H6OrLgSA uUL4jsu5XJN/qELobOPSzhqk0slJ16YrpTTPH32JkCbpv8zD3yfNw0d0K9otupiGdJEz iOQC6wG+Bn1bBhv0jfWaGm1Tykf11ms/TfWaghUXN1Q2NV+I85jvFbPg8KEjwgPRjFaO mOM95mDayQdYq3C8kLwnaNdQQVD5HPbZSCrTIlSGv8RABHnymcqfSC8M67LmJY+XYDWb t3Vwe4jnzC3xdOxqocv9mxG1ZMbdXZO4Pr0tPQ2cWet/4PyTlCnsO90JHLptsBrTw6u0 phmQ== 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 ez1-20020a1709070bc100b006cd6ae28e97si5017520ejc.984.2022.02.27.22.15.19; Sun, 27 Feb 2022 22:15:42 -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 S232948AbiB1Dgb (ORCPT + 99 others); Sun, 27 Feb 2022 22:36:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232933AbiB1Dg3 (ORCPT ); Sun, 27 Feb 2022 22:36:29 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C295B8A8 for ; Sun, 27 Feb 2022 19:35:51 -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; Mon, 28 Feb 2022 11:35:48 +0800 From: Shunzhou Jiang To: CC: , , , , , , , , Subject: [PATCH V5 2/2] soc: s4: Add support for power domains controller Date: Mon, 28 Feb 2022 11:35:42 +0800 Message-ID: <20220228033542.3594861-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228033542.3594861-1-shunzhou.jiang@amlogic.com> References: <20220228033542.3594861-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