Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2688999pxm; Mon, 28 Feb 2022 04:23:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxb/sFRSmL9/z+HWWg2GCOT+S/ReDQEAJog7WhoCupP5tC9PLELhnGadI+BLhbHZwoY66h4 X-Received: by 2002:a17:90b:3ce:b0:1bc:7783:4ce0 with SMTP id go14-20020a17090b03ce00b001bc77834ce0mr16494339pjb.60.1646050996636; Mon, 28 Feb 2022 04:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646050996; cv=none; d=google.com; s=arc-20160816; b=r5ntAhaDyG8j1idsMvNVIVYFF2hm7MquSK01IytVpS3o6wKjxZCROeiQX6otJ6q4Gi gouFPBGw95W2TU+hUmBem/IrD2QRyY7H4qKXIjX9Lh6FRK9Zm+LXIMXnKEr+8MhF/Srx 9q9beidCxmfDWU9MazZ0r6cObY2tZiEh4DMaMRJDG46QHSoIsFlvvptPfN/mXGzFfEQY P3JXDLLYT96QYupvYOpTZw0CGwTMIPWfLfUzLOCyungkEQFLP8RiwjOy9Oxq7IdIqfcx gwqcn1naFuACAlI/hPAHuBma8njOqtSm4+lifvC4pXa74dljMotTO4VLvmETRZDSkQEY uh8Q== 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=F95ZUEE17POPUBLCeIP7+camph1y+zf15ggDSYrjDoLV5bgxrP0bXZDIzy2S7QRxZo E0oIgaUGzAqOb9VpMXS7oL6pNt8JI9hdyyPVThbUa8pGa5Y1P54dfuqAAf82jE+0nu1V W3Lo9PdyxcuNCNes3O+A4o1KCp0h2T8UXoAaLvgHqz72sWUQpfgWSDbKRnCxwzUIdwTO M054iwgzN44Yw7eGPsZK5nx6jDFo+DB2bWMGipoa+BkVYAeXO1wyYn1k5NFI/iRH8jft boRbgwKRDT+aTTQvcEM9t+SKtTnpW+nN1Ah6BvgBy76GnnH7VXeXha5nPNCx8EdQa5Do ITgg== 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 y7-20020a636407000000b003657cf836basi8428156pgb.596.2022.02.28.04.23.02; Mon, 28 Feb 2022 04:23:16 -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 S232927AbiB1D2y (ORCPT + 99 others); Sun, 27 Feb 2022 22:28:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232910AbiB1D2u (ORCPT ); Sun, 27 Feb 2022 22:28:50 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086D14A3EB for ; Sun, 27 Feb 2022 19:28:11 -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:28:10 +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:28:03 +0800 Message-ID: <20220228032803.3305649-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228032803.3305649-1-shunzhou.jiang@amlogic.com> References: <20220228032803.3305649-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