Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3382322pxm; Mon, 28 Feb 2022 19:07:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUrqW7tcJFNsx8Gc1S7eMc0QVNvNoMDW3NwDGYgWozyLfU4xDIEBWXH8e4FJ2LLhbKkitc X-Received: by 2002:a17:90a:fe81:b0:1bd:3bad:a312 with SMTP id co1-20020a17090afe8100b001bd3bada312mr9883335pjb.183.1646104043713; Mon, 28 Feb 2022 19:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646104043; cv=none; d=google.com; s=arc-20160816; b=Z3mRK5cyVdCiuCeUGo5g9+dP2F63FkNKTUK1D7osWSrXa6kzhqKwMt/Knd+YzxxfnX 5LnRU9lJp88hy3LjiYNJJz64dZ/1SxFQMDydPK77TWpA3ebx+71DXH2t+z6vLTjtiEqt TPzSHyVILiVfsIwxMZd8PiyF1fo89MeEPahVIeoT9TXPQctvj1GU1jeO3xzs0xmWa6hq t762uywWEFUj5gUdO8+oeY8Ig+Sfmoiee+uxJMERe8m37yLiu3wg35R5OhkfRjm+iKSl jHcF+Jj37W5pJM+Hnxd4B+QnskR+OjmCRWvV6TzU6/SIbxQiZ78/UnjQpYJFoEzoMJ59 LzMw== 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=dVHnRR/W57ZgzCv8opPvcos9xRw0wwutrS6oPZPqqog=; b=xpdkv1l83A4B5W0zNkmXTVEfb0P5du8zPF/YHjNiJQLjehmQ0Sj+IOmj9IvMHE9PTa fvU9INdYw53AVNfHmylmx8jrUQTbRpZ/BMyR5FdryrDVahhQZeIlxuK4XWAMxyu3t/84 ngvdcHGyIXQAlcgPBG1K5WlTgu80ZAu2fto4FDcFj86ho36WWXAd4m1yiNG8YKxhUcMH ZEUqY5zgypO2Qi2Y3olqKGtYb7DGQOZg9T38UPaPSjjHd2kDr+soQEj8L14zw8lk+1P7 S7T2y2XRu/Yaoldv8j/KeiGcCKcYZ6P2YS6NkZwVDSPcIyE91r59He90uEhKzBfk52NI 1ETw== 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 r12-20020a17090a940c00b001bc424027fdsi1154746pjo.147.2022.02.28.19.07.01; Mon, 28 Feb 2022 19:07:23 -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 S232147AbiCACAB (ORCPT + 99 others); Mon, 28 Feb 2022 21:00:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232052AbiCAB7w (ORCPT ); Mon, 28 Feb 2022 20:59:52 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E06D2D1C6; Mon, 28 Feb 2022 17:59:02 -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; Tue, 1 Mar 2022 09:58:55 +0800 From: Shunzhou Jiang To: CC: , , , , , , , , Subject: [PATCH V5 2/2] soc: s4: Add support for power domains controller Date: Tue, 1 Mar 2022 09:58:49 +0800 Message-ID: <20220301015849.827634-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220301015849.827634-1-shunzhou.jiang@amlogic.com> References: <20220301015849.827634-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 --- V1->V2: fix spelling error, patchset use cover-letter V2->V3: add power domain always on reason V3->V4: clear vpu and usb power domaon always on V4->V5: add reviewed owner in patchset --- 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