From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47052C433F5 for ; Tue, 1 Feb 2022 19:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aIH1ja8+9k1BA3uv2rlAggzF4XCQ2/Et//UNT5VTvcw=; b=4u4EIZGwrfoEoM RALvqPMwzJ8JPDUGW2XDETjk4Iv/va1r7fnoR8OfmRkNnrGyGJYOTDR+9s9BqcMc5A6PFFNmbIA3i 4qwCpLj//17u5d7zms0xImbOclJzbb23InM0L5x1ivpUs+oXI/mGIU/Edu58bLPI8AQgJHulhZzxR lB7G3gRF5zOXTVVTacu+Mz7OVJIZBYdqFsntkSOO/56z8C2qpT5wyAwbYeDUa8O4wgDD8fQANPakx L9Fhm3dFb8SCrqgbRfXwpn5KhqP40NndlQpVd/E57sFeskpQ/5hYKI1jjgrt8GVf4VwTMW2drvQuI tcCjb+LDjwvE6Z+rNpIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEzCp-00DZwd-VR; Tue, 01 Feb 2022 19:52:47 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEzCm-00DZvf-1k for linux-amlogic@lists.infradead.org; Tue, 01 Feb 2022 19:52:45 +0000 Received: by mail-pj1-x1034.google.com with SMTP id d5so18117035pjk.5 for ; Tue, 01 Feb 2022 11:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=AmoyYeqbKB/J8fBT7GwIIJ7MSBxGiJfI2bIvKcMrbC+8uTYNUByMbB8cYdjalZvuts bP6OB7nUJPZui4YHm54PBmVv7wrUBYuw0pn5eCsGBooT/y1iZuq2Nq4kJMFX23Af5xLs ZgW8DJqQhPejR+1y+MZ/pJnNZW7sov/QVgx+fYolLnuvq9xgAFwQM2Nd8NySe2e85265 RrX41sx6lcvoEaYfIsJKTukQVAQFLtmEL4p29xx9uAzi+tp8SbEkvsaQTQJXLCKnMx60 uXYbxXaVHaMeSiJkSrY4eiD3j6k1Ug94P86epF/+FQkxVKs6B1Pm6E1IgxDdlcapSKVo 4uMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=Lxn8RHxs7PuxNBTQrWMhCie8qqjt/bh3Qk/hc35cvIhcHEWzcNaUmEBxHQJK/08a1H 2reYN/2O6Y5ITrP8EOgQ9kzoKD1rxmYyGeD/6Mj5kt0K5p64UiBVpdIS/5KnyCkYsKWj Gr0FXbsznLcaJWU13xhKos8VsteGHoymjJXrqBxaS0IkNarsAEViLEWtIppMLRIaFFCM d11BcLY0EHTPzIYPKSRROZcfAEXd/4MT6kJ6DaXPx9Bwlrp5UwNKD07WgMUgQzJsRRK1 /iAQ/pd1SHUK4AwbxLaRYkXcznXRXo9eGL4DbHeJjcmVjdUF3ANOzUYeO4Qf7jwBLfBe qf+w== X-Gm-Message-State: AOAM531oEyjis0fYw4eHkE9nkU7u4oB5I/qLxA32yAqvAwicYktNcmYe yvF/hBSCOcHI8Jga0qVo+I+Dzw== X-Google-Smtp-Source: ABdhPJwtPqHYQaAKewNFNpgmL8T0HaZwSGxAAwv38AZO435BSJ6NiP/4SeR7D33i2armAziRPFCdFg== X-Received: by 2002:a17:902:db01:: with SMTP id m1mr27538672plx.126.1643745163074; Tue, 01 Feb 2022 11:52:43 -0800 (PST) Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net. [71.197.186.152]) by smtp.gmail.com with ESMTPSA id b6sm23620829pfl.126.2022.02.01.11.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:52:42 -0800 (PST) From: Kevin Hilman To: Shunzhou Jiang , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: narmstrong@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, jianxin.pan@amlogic.com, shunzhou.jiang@amlogic.com Subject: Re: [PATCH 2/2] soc: s4: Add support for power domains controller In-Reply-To: <20220126061018.705338-3-shunzhou.jiang@amlogic.com> References: <20220126061018.705338-1-shunzhou.jiang@amlogic.com> <20220126061018.705338-3-shunzhou.jiang@amlogic.com> Date: Tue, 01 Feb 2022 11:52:41 -0800 Message-ID: <7hzgnal5yu.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220201_115244_103653_86DCD0CC X-CRM114-Status: GOOD ( 16.64 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Hi Shunzhou, Shunzhou Jiang writes: > 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 Thank you for adding support for S4 power domains. > --- > drivers/soc/amlogic/meson-secure-pwrc.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c > index 59bd195fa9c9..8fee01aabab6 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,17 @@ 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, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_USB_COMB, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_GE2D, 0), > + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_DEMOD, 0), > + SEC_PD(S4_AUDIO, 0), > +}; We should avoid the GENPD_FLAG_ALWAYS_ON unless strictly necessary. If you look at a1_pwrc_domains[] in this same driver, any use of this flag has a comment for why it's needed, and it's usually because the domain is used by low-level SoC/PM code not controlled by linux. All of these appear to be domains that linux should have driver control, so should not be set to always on. Kevin _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98B91C433F5 for ; Tue, 1 Feb 2022 19:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X8G7uKcMD3cIp+apY54NppggMDZyALnolKeo6gmUoJE=; b=m8JLXoFunP6r6j R2yME9r/KJeY6R7dwWouQJhJ7L8wVLoiYo0r34UJ/Df7MUp7+Ua+jw86j2NFY9TwD6owIg+/64R2p pFy65YJne3BusfROMBCO2K3Msw+qS5riq+WOPfc4mw7mHt4MGb9Rp1JypfssElcgJmtMR9E6PLVXX dfP+uv6/7wPCA4iyD4aRlayeOnGDYurh5HzWIF394aFo71HvyoZfjiNWi245NPrMw+QkbWmF6lIQg /Wyj+mRUzdUV65HCpQRpvI/0Nsd5EckWqX2MX+WapSw0LWTB6CqgRSMCbd5fuEVu/nIVxOmZyf5xR GJ7krAdTm7eaz5DMbyQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEzCr-00DZwm-Ce; Tue, 01 Feb 2022 19:52:49 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEzCl-00DZvg-Sd for linux-arm-kernel@lists.infradead.org; Tue, 01 Feb 2022 19:52:45 +0000 Received: by mail-pj1-x102c.google.com with SMTP id o64so18151729pjo.2 for ; Tue, 01 Feb 2022 11:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=AmoyYeqbKB/J8fBT7GwIIJ7MSBxGiJfI2bIvKcMrbC+8uTYNUByMbB8cYdjalZvuts bP6OB7nUJPZui4YHm54PBmVv7wrUBYuw0pn5eCsGBooT/y1iZuq2Nq4kJMFX23Af5xLs ZgW8DJqQhPejR+1y+MZ/pJnNZW7sov/QVgx+fYolLnuvq9xgAFwQM2Nd8NySe2e85265 RrX41sx6lcvoEaYfIsJKTukQVAQFLtmEL4p29xx9uAzi+tp8SbEkvsaQTQJXLCKnMx60 uXYbxXaVHaMeSiJkSrY4eiD3j6k1Ug94P86epF/+FQkxVKs6B1Pm6E1IgxDdlcapSKVo 4uMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=GUVSvmn1S164cdoUDE9RU6KPN+nWyv7leV0cKxlfn0XzOJfLS63HgZZgXGhHGncaaz /N2yw1aKaS8E3cusZgg2w3YUoIqKenciH2vVfWmnjj+qugod7vVmpNBRaoDFUg0EN3tF NNxWDzA6Lin/ksJctR3kRbw+4oJcJtSUMu+fL0Du+8jtIswEuP1zLD4swuCRBIKyvT33 thv3ktfncfkTeJ5Ms/qlFx/EHZjsyCRF5NPVu2DuZC5PhuBrY38iFcHiCUa93CwFRYIu xqoxzq3E3MIPUUI4KOiueBBn3AYR7Qcr0+EpFomlMiwUHM8dh0m9jVeaFy/eQydyElTE WL3A== X-Gm-Message-State: AOAM5301jA+7XR6RXVfUCiRIZMbxc5k3cwojZY0AAfgi7KXLdv7KDFJF IprXsvpxwa2v7iN/Q1/PHToa6Q== X-Google-Smtp-Source: ABdhPJwtPqHYQaAKewNFNpgmL8T0HaZwSGxAAwv38AZO435BSJ6NiP/4SeR7D33i2armAziRPFCdFg== X-Received: by 2002:a17:902:db01:: with SMTP id m1mr27538672plx.126.1643745163074; Tue, 01 Feb 2022 11:52:43 -0800 (PST) Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net. [71.197.186.152]) by smtp.gmail.com with ESMTPSA id b6sm23620829pfl.126.2022.02.01.11.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:52:42 -0800 (PST) From: Kevin Hilman To: Shunzhou Jiang , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: narmstrong@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, jianxin.pan@amlogic.com, shunzhou.jiang@amlogic.com Subject: Re: [PATCH 2/2] soc: s4: Add support for power domains controller In-Reply-To: <20220126061018.705338-3-shunzhou.jiang@amlogic.com> References: <20220126061018.705338-1-shunzhou.jiang@amlogic.com> <20220126061018.705338-3-shunzhou.jiang@amlogic.com> Date: Tue, 01 Feb 2022 11:52:41 -0800 Message-ID: <7hzgnal5yu.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220201_115244_047722_E757942D X-CRM114-Status: GOOD ( 18.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Shunzhou, Shunzhou Jiang writes: > 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 Thank you for adding support for S4 power domains. > --- > drivers/soc/amlogic/meson-secure-pwrc.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c > index 59bd195fa9c9..8fee01aabab6 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,17 @@ 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, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_USB_COMB, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_GE2D, 0), > + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_DEMOD, 0), > + SEC_PD(S4_AUDIO, 0), > +}; We should avoid the GENPD_FLAG_ALWAYS_ON unless strictly necessary. If you look at a1_pwrc_domains[] in this same driver, any use of this flag has a comment for why it's needed, and it's usually because the domain is used by low-level SoC/PM code not controlled by linux. All of these appear to be domains that linux should have driver control, so should not be set to always on. Kevin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 227BEC433EF for ; Tue, 1 Feb 2022 19:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233505AbiBATwp (ORCPT ); Tue, 1 Feb 2022 14:52:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231716AbiBATwo (ORCPT ); Tue, 1 Feb 2022 14:52:44 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A24C2C061714 for ; Tue, 1 Feb 2022 11:52:43 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id cq9-20020a17090af98900b001b8262fe2d5so526905pjb.0 for ; Tue, 01 Feb 2022 11:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=AmoyYeqbKB/J8fBT7GwIIJ7MSBxGiJfI2bIvKcMrbC+8uTYNUByMbB8cYdjalZvuts bP6OB7nUJPZui4YHm54PBmVv7wrUBYuw0pn5eCsGBooT/y1iZuq2Nq4kJMFX23Af5xLs ZgW8DJqQhPejR+1y+MZ/pJnNZW7sov/QVgx+fYolLnuvq9xgAFwQM2Nd8NySe2e85265 RrX41sx6lcvoEaYfIsJKTukQVAQFLtmEL4p29xx9uAzi+tp8SbEkvsaQTQJXLCKnMx60 uXYbxXaVHaMeSiJkSrY4eiD3j6k1Ug94P86epF/+FQkxVKs6B1Pm6E1IgxDdlcapSKVo 4uMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=K0G1SY2wwrY+W9SNB4oFMtfetHq3vq9RQ2FLNyl/UiI=; b=zJAuZSdATOmt5uir/OD4Wt2Q2aOi9O7Bx8PK8nHnUpGJJPb+/DeAK6ToqeZAK/a0kN mbqWeyrIy4s8QdEiE8FHMAB4bmLeOQci6Y6IAKQG6dhzn4A2niEksoeRrSqaiq96JGW7 suRhgTyZbSBtVDIBevRjDFGac640pM7I2Nd1RUZBQTe+3it8nwGin2TNRySfDP0yMNSv 7oBZiG5alDimekZ5qxVBEUqGIw5FgQHzAm3uelYnQU3DYBvoinhBPu19Zng5Sh6q6rxe +m0xoUH89R5woZ3vb/CQor+utUaGKNQqrkEbdUsNxYd2u2PMpAB8z6WEYG624sF3gdLY Q7jA== X-Gm-Message-State: AOAM533kzMaTCXnwC6/mTp1hFWH2Wx6ibGWvw5KyP6QIhHjT+XN2S2UH 8h0j8Lj1v55HAlmsVUxceKrd+A== X-Google-Smtp-Source: ABdhPJwtPqHYQaAKewNFNpgmL8T0HaZwSGxAAwv38AZO435BSJ6NiP/4SeR7D33i2armAziRPFCdFg== X-Received: by 2002:a17:902:db01:: with SMTP id m1mr27538672plx.126.1643745163074; Tue, 01 Feb 2022 11:52:43 -0800 (PST) Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net. [71.197.186.152]) by smtp.gmail.com with ESMTPSA id b6sm23620829pfl.126.2022.02.01.11.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:52:42 -0800 (PST) From: Kevin Hilman To: Shunzhou Jiang , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: narmstrong@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, jianxin.pan@amlogic.com, shunzhou.jiang@amlogic.com Subject: Re: [PATCH 2/2] soc: s4: Add support for power domains controller In-Reply-To: <20220126061018.705338-3-shunzhou.jiang@amlogic.com> References: <20220126061018.705338-1-shunzhou.jiang@amlogic.com> <20220126061018.705338-3-shunzhou.jiang@amlogic.com> Date: Tue, 01 Feb 2022 11:52:41 -0800 Message-ID: <7hzgnal5yu.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shunzhou, Shunzhou Jiang writes: > 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 Thank you for adding support for S4 power domains. > --- > drivers/soc/amlogic/meson-secure-pwrc.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c > index 59bd195fa9c9..8fee01aabab6 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,17 @@ 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, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_USB_COMB, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_GE2D, 0), > + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), > + SEC_PD(S4_DEMOD, 0), > + SEC_PD(S4_AUDIO, 0), > +}; We should avoid the GENPD_FLAG_ALWAYS_ON unless strictly necessary. If you look at a1_pwrc_domains[] in this same driver, any use of this flag has a comment for why it's needed, and it's usually because the domain is used by low-level SoC/PM code not controlled by linux. All of these appear to be domains that linux should have driver control, so should not be set to always on. Kevin