Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2402112pxm; Fri, 25 Feb 2022 00:58:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyb+i74tJEib0z/Cz8PHiIlxcaOokxmw1ntzgbMARFS1e4EezIR8oB59FTjVL1b0Qeg0s/6 X-Received: by 2002:a17:902:8a96:b0:150:1756:b1ff with SMTP id p22-20020a1709028a9600b001501756b1ffmr5770318plo.157.1645779515634; Fri, 25 Feb 2022 00:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645779515; cv=none; d=google.com; s=arc-20160816; b=iqMq97SjgXYn3jVRqyib6BEVmu6nj1XdF3Qbjvq/t71p/2HiVm+ZsizDr6str0Di/f nQNDb6/jDQiJP7opZ3UCaa8sRB+8POaq8fvlNpL644RKy+HqzEBuiFI7zkSn7d/K7EzO v1+ZLfvZWVqIsohbuftJxyoxJSD7eqXdVeX92lFaMjs0GEJ3WfLRhvO3eG+UWEz7a02b I6e1U+h092DR3B4oTuVSI/EIXXyWBY+R0KregUpiYWkl0XZ70GLrP6MvzsREc04VRH9B mbvWzcAlFXTNnfN3ccrO6tE935/jhbb675IJ37cIdcg0rg6U8EtMzClwlr43/s2OJqK6 Cteg== 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=WAQ8JU/gIFBQJGa0Lc3qZJXhLZdPOyukCvMAeRx++WHkNRQl0FS46haxCV2ahBJwGG 4YRT+hHn8jhzdVUPJEIDiIiuTqC3Kt4Q4x3Cyn2jkMR2luNS1pnzL4NiHPVn9QHQ6I+d eSjh70mk70dnkvorg9QNkruVamwMqLwtk8Yz8RUXiUQZCzCZQ5GBB+GmrXtu9UrEwA3I yE3Odk0tkq8IIUmCE9KxIVzYG7lEVqqiA6tEw8pONfMNEN2sQKYy+0kOLrLMxQuEo81g SelBBjpAeLcuSqD5BQ34HC4VF6J7WCrhYQ60KPC+HUzIDm2kHp9krocT9XwS9gqstZpV QSlQ== 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 d11-20020a056a0024cb00b004e1cf0822b4si1353249pfv.46.2022.02.25.00.58.21; Fri, 25 Feb 2022 00:58:35 -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 S237868AbiBYGhb (ORCPT + 99 others); Fri, 25 Feb 2022 01:37:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237863AbiBYGha (ORCPT ); Fri, 25 Feb 2022 01:37:30 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32AFB0D30 for ; Thu, 24 Feb 2022 22:36:56 -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:36:53 +0800 From: Shunzhou Jiang To: , , CC: , , , , , Subject: [PATCH V4-C 2/2] soc: s4: Add support for power domains controller Date: Fri, 25 Feb 2022 14:36:42 +0800 Message-ID: <20220225063642.1343797-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225063642.1343797-1-shunzhou.jiang@amlogic.com> References: <20220225063642.1343797-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