diff mbox series

[RESEND,1/2] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains

Message ID 20220225054345.2479565-1-bjorn.andersson@linaro.org
State Not Applicable, archived
Headers show
Series [RESEND,1/2] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains | expand

Checks

Context Check Description
robh/dtbs-check success
robh/dt-meta-schema success
robh/patch-applied success
robh/checkpatch success

Commit Message

Bjorn Andersson Feb. 25, 2022, 5:43 a.m. UTC
The sc8280xp has 8 power-domains controlled through the RPMh, document
the compatible and provide definitions for the power-domains - and their
active-only variants where applicable.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 .../devicetree/bindings/power/qcom,rpmpd.yaml       |  1 +
 include/dt-bindings/power/qcom-rpmpd.h              | 13 +++++++++++++
 2 files changed, 14 insertions(+)

Comments

Johan Hovold April 11, 2022, 1:30 p.m. UTC | #1
On Thu, Feb 24, 2022 at 09:43:45PM -0800, Bjorn Andersson wrote:
> The Qualcomm sc8280xp platform has 8 power-domains. Add these, and their
> relevant active-only variants, to the RPMh power-domain driver.

As we discussed off-list, the sc8280xp apparently has 13 domains. Guess
the commit message should be updated even if you don't expose all of
these to Linux.

> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/soc/qcom/rpmhpd.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> index 58f1dc9b9cb7..71602eb824f7 100644
> --- a/drivers/soc/qcom/rpmhpd.c
> +++ b/drivers/soc/qcom/rpmhpd.c
> @@ -180,6 +180,11 @@ static struct rpmhpd mxc_ao = {
>  	.res_name = "mxc.lvl",
>  };
>  
> +static struct rpmhpd nsp = {
> +	.pd = { .name = "nsp", },
> +	.res_name = "nsp.lvl",
> +};
> +
>  /* SDM845 RPMH powerdomains */
>  static struct rpmhpd *sdm845_rpmhpds[] = {
>  	[SDM845_CX] = &cx_w_mx_parent,
> @@ -363,10 +368,31 @@ static const struct rpmhpd_desc sc8180x_desc = {
>  	.num_pds = ARRAY_SIZE(sc8180x_rpmhpds),
>  };
>  
> +/* SC8280xp RPMH powerdomains */
> +static struct rpmhpd *sc8280xp_rpmhpds[] = {
> +	[SC8280XP_CX] = &cx,
> +	[SC8280XP_CX_AO] = &cx_ao,
> +	[SC8280XP_MX] = &mx,
> +	[SC8280XP_MX_AO] = &mx_ao,
> +	[SC8280XP_EBI] = &ebi,
> +	[SC8280XP_LCX] = &lcx,
> +	[SC8280XP_LMX] = &lmx,
> +	[SC8280XP_GFX] = &gfx,
> +	[SC8280XP_MMCX] = &mmcx,
> +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> +	[SC8280XP_NSP] = &nsp,
> +};

Commit 90c74c1c2574 ("soc: qcom: rpmhpd: Sort power-domain definitions
and lists") recently sorted the other arrays. Sorting by address like
you've implicitly done here makes it easy to compare with the firmware
interface, but perhaps you want to sort alphabetically for consistency.

Since there apparently are no users for active-only domains in the tree,
perhaps they can also be added later.

> +
> +static const struct rpmhpd_desc sc8280xp_desc = {
> +	.rpmhpds = sc8280xp_rpmhpds,
> +	.num_pds = ARRAY_SIZE(sc8280xp_rpmhpds),
> +};
> +
>  static const struct of_device_id rpmhpd_match_table[] = {
>  	{ .compatible = "qcom,sc7180-rpmhpd", .data = &sc7180_desc },
>  	{ .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc },
>  	{ .compatible = "qcom,sc8180x-rpmhpd", .data = &sc8180x_desc },
> +	{ .compatible = "qcom,sc8280xp-rpmhpd", .data = &sc8280xp_desc },
>  	{ .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc },
>  	{ .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc},
>  	{ .compatible = "qcom,sm6350-rpmhpd", .data = &sm6350_desc },

Johan
Bjorn Andersson April 12, 2022, 3:16 p.m. UTC | #2
On Mon 11 Apr 08:30 CDT 2022, Johan Hovold wrote:

> On Thu, Feb 24, 2022 at 09:43:45PM -0800, Bjorn Andersson wrote:
> > The Qualcomm sc8280xp platform has 8 power-domains. Add these, and their
> > relevant active-only variants, to the RPMh power-domain driver.
> 
> As we discussed off-list, the sc8280xp apparently has 13 domains. Guess
> the commit message should be updated even if you don't expose all of
> these to Linux.
> 

Thanks for spotting that, I will update the patch and rewrite the commit
message accordingly.

> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >  drivers/soc/qcom/rpmhpd.c | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> > index 58f1dc9b9cb7..71602eb824f7 100644
> > --- a/drivers/soc/qcom/rpmhpd.c
> > +++ b/drivers/soc/qcom/rpmhpd.c
> > @@ -180,6 +180,11 @@ static struct rpmhpd mxc_ao = {
> >  	.res_name = "mxc.lvl",
> >  };
> >  
> > +static struct rpmhpd nsp = {
> > +	.pd = { .name = "nsp", },
> > +	.res_name = "nsp.lvl",
> > +};
> > +
> >  /* SDM845 RPMH powerdomains */
> >  static struct rpmhpd *sdm845_rpmhpds[] = {
> >  	[SDM845_CX] = &cx_w_mx_parent,
> > @@ -363,10 +368,31 @@ static const struct rpmhpd_desc sc8180x_desc = {
> >  	.num_pds = ARRAY_SIZE(sc8180x_rpmhpds),
> >  };
> >  
> > +/* SC8280xp RPMH powerdomains */
> > +static struct rpmhpd *sc8280xp_rpmhpds[] = {
> > +	[SC8280XP_CX] = &cx,
> > +	[SC8280XP_CX_AO] = &cx_ao,
> > +	[SC8280XP_MX] = &mx,
> > +	[SC8280XP_MX_AO] = &mx_ao,
> > +	[SC8280XP_EBI] = &ebi,
> > +	[SC8280XP_LCX] = &lcx,
> > +	[SC8280XP_LMX] = &lmx,
> > +	[SC8280XP_GFX] = &gfx,
> > +	[SC8280XP_MMCX] = &mmcx,
> > +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> > +	[SC8280XP_NSP] = &nsp,
> > +};
> 
> Commit 90c74c1c2574 ("soc: qcom: rpmhpd: Sort power-domain definitions
> and lists") recently sorted the other arrays. Sorting by address like
> you've implicitly done here makes it easy to compare with the firmware
> interface, but perhaps you want to sort alphabetically for consistency.
> 

I like consistency.

> Since there apparently are no users for active-only domains in the tree,
> perhaps they can also be added later.
> 

I'll take an extra look at this as well. Seems we do cx, mx and mmcx ao
on the other platforms, but question is if that's only because we do it
on previous platforms...

Thanks for the review,
Bjorn

> > +
> > +static const struct rpmhpd_desc sc8280xp_desc = {
> > +	.rpmhpds = sc8280xp_rpmhpds,
> > +	.num_pds = ARRAY_SIZE(sc8280xp_rpmhpds),
> > +};
> > +
> >  static const struct of_device_id rpmhpd_match_table[] = {
> >  	{ .compatible = "qcom,sc7180-rpmhpd", .data = &sc7180_desc },
> >  	{ .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc },
> >  	{ .compatible = "qcom,sc8180x-rpmhpd", .data = &sc8180x_desc },
> > +	{ .compatible = "qcom,sc8280xp-rpmhpd", .data = &sc8280xp_desc },
> >  	{ .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc },
> >  	{ .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc},
> >  	{ .compatible = "qcom,sm6350-rpmhpd", .data = &sm6350_desc },
> 
> Johan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
index f48bc41d81ec..377162279455 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
@@ -30,6 +30,7 @@  properties:
       - qcom,sc7180-rpmhpd
       - qcom,sc7280-rpmhpd
       - qcom,sc8180x-rpmhpd
+      - qcom,sc8280xp-rpmhpd
       - qcom,sdm845-rpmhpd
       - qcom,sdx55-rpmhpd
       - qcom,sm6115-rpmpd
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index edfc1ff2acb3..aea23b929f12 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -117,6 +117,19 @@ 
 #define SC8180X_MX	9
 #define SC8180X_MX_AO	10
 
+/* SC8280XP Power Domain Indexes */
+#define SC8280XP_CX	0
+#define SC8280XP_CX_AO	1
+#define SC8280XP_MX	2
+#define SC8280XP_MX_AO	3
+#define SC8280XP_EBI	4
+#define SC8280XP_LCX	5
+#define SC8280XP_LMX	6
+#define SC8280XP_GFX	7
+#define SC8280XP_MMCX	8
+#define SC8280XP_MMCX_AO 9
+#define SC8280XP_NSP	10
+
 /* SDM845 Power Domain performance levels */
 #define RPMH_REGULATOR_LEVEL_RETENTION	16
 #define RPMH_REGULATOR_LEVEL_MIN_SVS	48