Devicetree
 help / color / mirror / Atom feed
From: Dmitry Rokosov <ddrokosov@sberdevices.ru>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	=Xianwei Zhao <xianwei.zhao@amlogic.com>
Cc: <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-amlogic@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>
Subject: Re: [PATCH 2/3] soc: c3: Add support for power domains controller
Date: Mon, 3 Jul 2023 22:37:36 +0300	[thread overview]
Message-ID: <20230703193736.7teaaovalia3g3ml@CAB-WSD-L081021> (raw)
In-Reply-To: <e85f6dee-d62c-9f2f-b1de-8c38bb5aeb14@linaro.org>

On Mon, Jul 03, 2023 at 03:29:31PM +0200, Neil Armstrong wrote:
> Hi,
> 
> On 03/07/2023 11:31, =Xianwei Zhao wrote:
> > From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> > 
> > Add support for C3 Power controller. C3 power control
> > registers are in secure domain, and should be accessed by SMC.
> > 
> > Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> > ---
> >   drivers/soc/amlogic/meson-secure-pwrc.c | 28 ++++++++++++++++++++++++-
> >   1 file changed, 27 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> > index 25b4b71df9b8..39ccc8f2e630 100644
> > --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> > +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> > @@ -12,6 +12,7 @@
> >   #include <linux/pm_domain.h>
> >   #include <dt-bindings/power/meson-a1-power.h>
> >   #include <dt-bindings/power/meson-s4-power.h>
> > +#include <dt-bindings/power/amlogic-c3-power.h>
> >   #include <linux/arm-smccc.h>
> >   #include <linux/firmware/meson/meson_sm.h>
> >   #include <linux/module.h>
> > @@ -132,6 +133,22 @@ static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
> >   	SEC_PD(S4_AUDIO,	0),
> >   };
> > +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
> > +	SEC_PD(C3_NNA,	0),
> > +	SEC_PD(C3_AUDIO,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_SDIOA,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_EMMC,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_USB_COMB, GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_SDCARD,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_ETH,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_GE2D,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_CVE,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_GDC_WRAP,	GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_ISP_TOP,		GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_MIPI_ISP_WRAP, GENPD_FLAG_ALWAYS_ON),
> > +	SEC_PD(C3_VCODEC,	0),
> > +};
> 
> Please move this struct before _s4_
> 
> > +
> >   static int meson_secure_pwrc_probe(struct platform_device *pdev)
> >   {
> >   	int i;
> > @@ -179,7 +196,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
> >   	for (i = 0 ; i < match->count ; ++i) {
> >   		struct meson_secure_pwrc_domain *dom = &pwrc->domains[i];
> > -		if (!match->domains[i].index)
> > +		if (!match->domains[i].name)
> 
> Is this change necessary ? If yes please move it to another patch
> and explain it's purpose. If it fixes something, add a Fixes tag so
> it can be backported.
> 
> Thanks,
> Neil
> 

I suppose, this change fixes the situation with SEC_PD(C3_NNA, 0)
domain, because it has index == 0.
May be it's better to introduce the separate struct member for that? For
example, 'present' (true or false).
I think code would be more readable and clean.

[...]

-- 
Thank you,
Dmitry

  reply	other threads:[~2023-07-03 19:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03  9:31 [PATCH 0/3] Power: C3: add power domain driver =Xianwei Zhao
2023-07-03  9:31 ` [PATCH 1/3] dt-bindings: power: add Amlogic C3 power domains =Xianwei Zhao
2023-07-03 13:12   ` Krzysztof Kozlowski
2023-07-04  2:09     ` Xianwei Zhao
2023-07-03  9:31 ` [PATCH 2/3] soc: c3: Add support for power domains controller =Xianwei Zhao
2023-07-03 13:29   ` Neil Armstrong
2023-07-03 19:37     ` Dmitry Rokosov [this message]
2023-07-04  2:43       ` Xianwei Zhao
2023-07-04  2:20     ` Xianwei Zhao
2023-07-03  9:31 ` [PATCH 3/3] arm64: dts: add support for C3 power domain controller =Xianwei Zhao
2023-07-03 13:12   ` Krzysztof Kozlowski
2023-07-04  2:23     ` Xianwei Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230703193736.7teaaovalia3g3ml@CAB-WSD-L081021 \
    --to=ddrokosov@sberdevices.ru \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=xianwei.zhao@amlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox