Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp442741pxm; Wed, 2 Mar 2022 01:28:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWwa/BBXLRUW6tS9cy3eQgulpmciGZ9jTe2rGcMHH3SC4E1wD03G6D5jPds4f5FzGAlCAl X-Received: by 2002:a17:90a:7d14:b0:1be:ec4c:e68d with SMTP id g20-20020a17090a7d1400b001beec4ce68dmr4777380pjl.89.1646213336041; Wed, 02 Mar 2022 01:28:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646213336; cv=none; d=google.com; s=arc-20160816; b=BjWG8NiIXQ8/v9J3YlKADxvv+vUl1FB7LG17R7k0qnvdDdz4A9OLxXm6vnbn/THTUA hRBGBKzqx25zWUPjwGPfbnLrRvy60JvMJA2aVeq6Q8gm/cxfhwt5MKwiktesnHiAVogy wg3aFbbY0C8X2O7om0dGOlOqK8HvQnQOGjQiHJIp7wbHLfg51MC9ZAA9pTtGMSjQbMeq aJdnBxm3OpRed8YV97rCf+r1WzdKHzrRmMKuCrv13Wv8dVpL+FLGSIT7eit9pf0xj0Ov 0ijwX5cIw04b2FSy/ey+pigIw+6cX1+TWq69/BL3jBYa7bZ6HhegEuTwgUK5jkQvfgse fRiw== 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=fgUzbQp821b+lSjuoUp/VLeC4IeR0sJcoRLPttWm3Z9ap70r2N16san/eJxRwPyPTe kUITnr0UT7gCiiQxEiz8IwlNmml7oz9nUrn/8SsseNGvSjDmzJVXjh27246FUhAvY5Ng QUJThVjHn4UlVuu4f9R27QI/ZCZik716x6WYwghU8glzuPlxOEIhhI5TDdxQcRR55SPO EnLZy2xwwj7Ny/38KAp3mZxsv++UmsOlXLQPOCy5CGaYCt1BSxUbBvWo42m3ddw+O+cp rrtDdJjlTYBS1vT1MMuXsTJPLBjoLx7WEtAvRAnXYsEvBTr88UcMCxzji1VQ8HAejSNe V5Hw== 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 l16-20020a170902f69000b001518ae41098si3523665plg.40.2022.03.02.01.28.41; Wed, 02 Mar 2022 01:28:56 -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 S239279AbiCBDKy (ORCPT + 99 others); Tue, 1 Mar 2022 22:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239272AbiCBDKw (ORCPT ); Tue, 1 Mar 2022 22:10:52 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0731AF1C4; Tue, 1 Mar 2022 19:10:09 -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; Wed, 2 Mar 2022 11:10:04 +0800 From: Shunzhou Jiang To: , CC: , , , , , , Shunzhou Jiang Subject: [PATCH V5 2/2] soc: s4: Add support for power domains controller Date: Wed, 2 Mar 2022 11:09:59 +0800 Message-ID: <20220302030959.823693-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220302030959.823693-1-shunzhou.jiang@amlogic.com> References: <20220302030959.823693-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