All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p
@ 2022-04-26 23:35 Bjorn Andersson
  2022-04-26 23:35 ` [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains Bjorn Andersson
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Bjorn Andersson @ 2022-04-26 23:35 UTC (permalink / raw)
  To: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Johan Hovold
  Cc: linux-arm-msm, devicetree, linux-kernel

Add compatibles and power-domain definitions for the sc8280xp and sa8540p
platforms.

Bjorn Andersson (3):
  dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
  soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays
  soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains

 .../devicetree/bindings/power/qcom,rpmpd.yaml |  2 +
 drivers/soc/qcom/rpmhpd.c                     | 57 ++++++++++++++++++-
 include/dt-bindings/power/qcom-rpmpd.h        | 18 ++++++
 3 files changed, 74 insertions(+), 3 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
  2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
@ 2022-04-26 23:35 ` Bjorn Andersson
  2022-04-28  6:42   ` Krzysztof Kozlowski
  2022-04-26 23:35 ` [PATCH v2 2/3] soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays Bjorn Andersson
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Bjorn Andersson @ 2022-04-26 23:35 UTC (permalink / raw)
  To: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Johan Hovold
  Cc: linux-arm-msm, devicetree, linux-kernel

The sc8280xp has 13 power-domains controlled through the RPMh, document
the compatible and provide definitions for the power-domains - and their
active-only variants where applicable.

The SA8540p differs slightly in the power domains exposed, so add a
separate compatible for this, but reuse the constants to allow sharing
the DeviceTree source.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v1:
- Added sa8540p compatible

 .../devicetree/bindings/power/qcom,rpmpd.yaml  |  2 ++
 include/dt-bindings/power/qcom-rpmpd.h         | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
index b90c4427beec..ad77a6380f38 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
@@ -27,10 +27,12 @@ properties:
       - qcom,msm8998-rpmpd
       - qcom,qcm2290-rpmpd
       - qcom,qcs404-rpmpd
+      - qcom,sa8540p-rpmhpd
       - qcom,sdm660-rpmpd
       - qcom,sc7180-rpmhpd
       - qcom,sc7280-rpmhpd
       - qcom,sc8180x-rpmhpd
+      - qcom,sc8280xp-rpmhpd
       - qcom,sdm845-rpmhpd
       - qcom,sdx55-rpmhpd
       - qcom,sdx65-rpmhpd
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 0a8978d0c78c..6cce5b7aa940 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -125,6 +125,24 @@
 #define SC8180X_MX	9
 #define SC8180X_MX_AO	10
 
+/* SC8280XP Power Domain Indexes */
+#define SC8280XP_CX		0
+#define SC8280XP_CX_AO		1
+#define SC8280XP_DDR		2
+#define SC8280XP_EBI		3
+#define SC8280XP_GFX		4
+#define SC8280XP_LCX		5
+#define SC8280XP_LMX		6
+#define SC8280XP_MMCX		7
+#define SC8280XP_MMCX_AO	8
+#define SC8280XP_MSS		9
+#define SC8280XP_MX		10
+#define SC8280XP_MXC		12
+#define SC8280XP_MX_AO		11
+#define SC8280XP_NSP		13
+#define SC8280XP_QPHY		14
+#define SC8280XP_XO		15
+
 /* SDM845 Power Domain performance levels */
 #define RPMH_REGULATOR_LEVEL_RETENTION	16
 #define RPMH_REGULATOR_LEVEL_MIN_SVS	48
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays
  2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
  2022-04-26 23:35 ` [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains Bjorn Andersson
@ 2022-04-26 23:35 ` Bjorn Andersson
  2022-04-26 23:35 ` [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains Bjorn Andersson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Bjorn Andersson @ 2022-04-26 23:35 UTC (permalink / raw)
  To: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Johan Hovold
  Cc: linux-arm-msm, devicetree, linux-kernel

In some cases the DT binding will fully describe the set of available
RPMh power-domains, but there is no reason for exposing them all in the
implementation.

Omitting individual data->domains is handle gracefully by
of_genpd_add_provider_onecell(), so there's no reason for printing a
warning when this occurs.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v1:
- New patch

 drivers/soc/qcom/rpmhpd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
index 11102ac47769..f8d28e902942 100644
--- a/drivers/soc/qcom/rpmhpd.c
+++ b/drivers/soc/qcom/rpmhpd.c
@@ -613,10 +613,8 @@ static int rpmhpd_probe(struct platform_device *pdev)
 	data->num_domains = num_pds;
 
 	for (i = 0; i < num_pds; i++) {
-		if (!rpmhpds[i]) {
-			dev_warn(dev, "rpmhpds[%d] is empty\n", i);
+		if (!rpmhpds[i])
 			continue;
-		}
 
 		rpmhpds[i]->dev = dev;
 		rpmhpds[i]->addr = cmd_db_read_addr(rpmhpds[i]->res_name);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
  2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
  2022-04-26 23:35 ` [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains Bjorn Andersson
  2022-04-26 23:35 ` [PATCH v2 2/3] soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays Bjorn Andersson
@ 2022-04-26 23:35 ` Bjorn Andersson
  2022-04-27 12:38   ` Andrew Halaney
  2022-04-27  8:49 ` [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Johan Hovold
  2022-05-04 17:21 ` Bjorn Andersson
  4 siblings, 1 reply; 10+ messages in thread
From: Bjorn Andersson @ 2022-04-26 23:35 UTC (permalink / raw)
  To: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Johan Hovold
  Cc: linux-arm-msm, devicetree, linux-kernel

The Qualcomm sc8280xp platform has 13 and the sa8540p platform has 11
power-domains. Add compatibles, the typically used ones power-domains
and their relevant active-only variants, to the RPMh power-domain
driver.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v1:
- Added QPHY
- Split out sa8540
- Sorted the entries alphabetically

 drivers/soc/qcom/rpmhpd.c | 53 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
index f8d28e902942..05fff8691ee3 100644
--- a/drivers/soc/qcom/rpmhpd.c
+++ b/drivers/soc/qcom/rpmhpd.c
@@ -180,6 +180,36 @@ static struct rpmhpd mxc_ao = {
 	.res_name = "mxc.lvl",
 };
 
+static struct rpmhpd nsp = {
+	.pd = { .name = "nsp", },
+	.res_name = "nsp.lvl",
+};
+
+static struct rpmhpd qphy = {
+	.pd = { .name = "qphy", },
+	.res_name = "qphy.lvl",
+};
+
+/* SA8540P RPMH powerdomains */
+static struct rpmhpd *sa8540p_rpmhpds[] = {
+	[SC8280XP_CX] = &cx,
+	[SC8280XP_CX_AO] = &cx_ao,
+	[SC8280XP_EBI] = &ebi,
+	[SC8280XP_GFX] = &gfx,
+	[SC8280XP_LCX] = &lcx,
+	[SC8280XP_LMX] = &lmx,
+	[SC8280XP_MMCX] = &mmcx,
+	[SC8280XP_MMCX_AO] = &mmcx_ao,
+	[SC8280XP_MX] = &mx,
+	[SC8280XP_MX_AO] = &mx_ao,
+	[SC8280XP_NSP] = &nsp,
+};
+
+static const struct rpmhpd_desc sa8540p_desc = {
+	.rpmhpds = sa8540p_rpmhpds,
+	.num_pds = ARRAY_SIZE(sa8540p_rpmhpds),
+};
+
 /* SDM845 RPMH powerdomains */
 static struct rpmhpd *sdm845_rpmhpds[] = {
 	[SDM845_CX] = &cx_w_mx_parent,
@@ -378,10 +408,33 @@ 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_EBI] = &ebi,
+	[SC8280XP_GFX] = &gfx,
+	[SC8280XP_LCX] = &lcx,
+	[SC8280XP_LMX] = &lmx,
+	[SC8280XP_MMCX] = &mmcx,
+	[SC8280XP_MMCX_AO] = &mmcx_ao,
+	[SC8280XP_MX] = &mx,
+	[SC8280XP_MX_AO] = &mx_ao,
+	[SC8280XP_NSP] = &nsp,
+	[SC8280XP_QPHY] = &qphy,
+};
+
+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,sa8540p-rpmhpd", .data = &sa8540p_desc },
 	{ .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,sdx65-rpmhpd", .data = &sdx65_desc},
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p
  2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
                   ` (2 preceding siblings ...)
  2022-04-26 23:35 ` [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains Bjorn Andersson
@ 2022-04-27  8:49 ` Johan Hovold
  2022-05-04 17:21 ` Bjorn Andersson
  4 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2022-04-27  8:49 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Johan Hovold, linux-arm-msm,
	devicetree, linux-kernel

On Tue, Apr 26, 2022 at 04:35:05PM -0700, Bjorn Andersson wrote:
> Add compatibles and power-domain definitions for the sc8280xp and sa8540p
> platforms.
> 
> Bjorn Andersson (3):
>   dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
>   soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays
>   soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains

Looks good. For the series:

Reviewed-by: Johan Hovold <johan+linaro@kernel.org>

Johan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
  2022-04-26 23:35 ` [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains Bjorn Andersson
@ 2022-04-27 12:38   ` Andrew Halaney
  2022-04-28 15:48     ` Bjorn Andersson
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Halaney @ 2022-04-27 12:38 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Johan Hovold, linux-arm-msm,
	devicetree, linux-kernel

On Tue, Apr 26, 2022 at 04:35:08PM -0700, Bjorn Andersson wrote:
> The Qualcomm sc8280xp platform has 13 and the sa8540p platform has 11
> power-domains. Add compatibles, the typically used ones power-domains
> and their relevant active-only variants, to the RPMh power-domain
> driver.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v1:
> - Added QPHY
> - Split out sa8540
> - Sorted the entries alphabetically
> 
>  drivers/soc/qcom/rpmhpd.c | 53 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)
> 
> diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> index f8d28e902942..05fff8691ee3 100644
> --- a/drivers/soc/qcom/rpmhpd.c
> +++ b/drivers/soc/qcom/rpmhpd.c
> @@ -180,6 +180,36 @@ static struct rpmhpd mxc_ao = {
>  	.res_name = "mxc.lvl",
>  };
>  
> +static struct rpmhpd nsp = {
> +	.pd = { .name = "nsp", },
> +	.res_name = "nsp.lvl",
> +};
> +
> +static struct rpmhpd qphy = {
> +	.pd = { .name = "qphy", },
> +	.res_name = "qphy.lvl",
> +};
> +
> +/* SA8540P RPMH powerdomains */
> +static struct rpmhpd *sa8540p_rpmhpds[] = {
> +	[SC8280XP_CX] = &cx,
> +	[SC8280XP_CX_AO] = &cx_ao,
> +	[SC8280XP_EBI] = &ebi,
> +	[SC8280XP_GFX] = &gfx,
> +	[SC8280XP_LCX] = &lcx,
> +	[SC8280XP_LMX] = &lmx,
> +	[SC8280XP_MMCX] = &mmcx,
> +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> +	[SC8280XP_MX] = &mx,
> +	[SC8280XP_MX_AO] = &mx_ao,
> +	[SC8280XP_NSP] = &nsp,
> +};
> +
> +static const struct rpmhpd_desc sa8540p_desc = {
> +	.rpmhpds = sa8540p_rpmhpds,
> +	.num_pds = ARRAY_SIZE(sa8540p_rpmhpds),
> +};
> +
>  /* SDM845 RPMH powerdomains */
>  static struct rpmhpd *sdm845_rpmhpds[] = {
>  	[SDM845_CX] = &cx_w_mx_parent,
> @@ -378,10 +408,33 @@ 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_EBI] = &ebi,
> +	[SC8280XP_GFX] = &gfx,
> +	[SC8280XP_LCX] = &lcx,
> +	[SC8280XP_LMX] = &lmx,
> +	[SC8280XP_MMCX] = &mmcx,
> +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> +	[SC8280XP_MX] = &mx,
> +	[SC8280XP_MX_AO] = &mx_ao,
> +	[SC8280XP_NSP] = &nsp,
> +	[SC8280XP_QPHY] = &qphy,
> +};

The commit messages mention sc8280xp having 13 power domains, but here I
only count 12. Good chance I'm just missing something obvious (not
familiar with using power domains or rpmh) but I thought I should
highlight it in case that was an error.

I attempted to find where this sort of thing is defined downstream, but
failed :(

Thanks,
Andrew

> +
> +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,sa8540p-rpmhpd", .data = &sa8540p_desc },
>  	{ .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,sdx65-rpmhpd", .data = &sdx65_desc},
> -- 
> 2.35.1
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
  2022-04-26 23:35 ` [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains Bjorn Andersson
@ 2022-04-28  6:42   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-28  6:42 UTC (permalink / raw)
  To: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Johan Hovold
  Cc: linux-arm-msm, devicetree, linux-kernel

On 27/04/2022 01:35, Bjorn Andersson wrote:
> The sc8280xp has 13 power-domains controlled through the RPMh, document
> the compatible and provide definitions for the power-domains - and their
> active-only variants where applicable.
> 
> The SA8540p differs slightly in the power domains exposed, so add a
> separate compatible for this, but reuse the constants to allow sharing
> the DeviceTree source.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
  2022-04-27 12:38   ` Andrew Halaney
@ 2022-04-28 15:48     ` Bjorn Andersson
  2022-04-28 16:19       ` Andrew Halaney
  0 siblings, 1 reply; 10+ messages in thread
From: Bjorn Andersson @ 2022-04-28 15:48 UTC (permalink / raw)
  To: Andrew Halaney
  Cc: Rob Herring, Krzysztof Kozlowski, Johan Hovold, linux-arm-msm,
	devicetree, linux-kernel

On Wed 27 Apr 05:38 PDT 2022, Andrew Halaney wrote:

> On Tue, Apr 26, 2022 at 04:35:08PM -0700, Bjorn Andersson wrote:
> > The Qualcomm sc8280xp platform has 13 and the sa8540p platform has 11
> > power-domains. Add compatibles, the typically used ones power-domains
> > and their relevant active-only variants, to the RPMh power-domain
> > driver.
> > 
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> > 
> > Changes since v1:
> > - Added QPHY
> > - Split out sa8540
> > - Sorted the entries alphabetically
> > 
> >  drivers/soc/qcom/rpmhpd.c | 53 +++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> > 
> > diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> > index f8d28e902942..05fff8691ee3 100644
> > --- a/drivers/soc/qcom/rpmhpd.c
> > +++ b/drivers/soc/qcom/rpmhpd.c
> > @@ -180,6 +180,36 @@ static struct rpmhpd mxc_ao = {
> >  	.res_name = "mxc.lvl",
> >  };
> >  
> > +static struct rpmhpd nsp = {
> > +	.pd = { .name = "nsp", },
> > +	.res_name = "nsp.lvl",
> > +};
> > +
> > +static struct rpmhpd qphy = {
> > +	.pd = { .name = "qphy", },
> > +	.res_name = "qphy.lvl",
> > +};
> > +
> > +/* SA8540P RPMH powerdomains */
> > +static struct rpmhpd *sa8540p_rpmhpds[] = {
> > +	[SC8280XP_CX] = &cx,
> > +	[SC8280XP_CX_AO] = &cx_ao,
> > +	[SC8280XP_EBI] = &ebi,
> > +	[SC8280XP_GFX] = &gfx,
> > +	[SC8280XP_LCX] = &lcx,
> > +	[SC8280XP_LMX] = &lmx,
> > +	[SC8280XP_MMCX] = &mmcx,
> > +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> > +	[SC8280XP_MX] = &mx,
> > +	[SC8280XP_MX_AO] = &mx_ao,
> > +	[SC8280XP_NSP] = &nsp,
> > +};
> > +
> > +static const struct rpmhpd_desc sa8540p_desc = {
> > +	.rpmhpds = sa8540p_rpmhpds,
> > +	.num_pds = ARRAY_SIZE(sa8540p_rpmhpds),
> > +};
> > +
> >  /* SDM845 RPMH powerdomains */
> >  static struct rpmhpd *sdm845_rpmhpds[] = {
> >  	[SDM845_CX] = &cx_w_mx_parent,
> > @@ -378,10 +408,33 @@ 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_EBI] = &ebi,
> > +	[SC8280XP_GFX] = &gfx,
> > +	[SC8280XP_LCX] = &lcx,
> > +	[SC8280XP_LMX] = &lmx,
> > +	[SC8280XP_MMCX] = &mmcx,
> > +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> > +	[SC8280XP_MX] = &mx,
> > +	[SC8280XP_MX_AO] = &mx_ao,
> > +	[SC8280XP_NSP] = &nsp,
> > +	[SC8280XP_QPHY] = &qphy,
> > +};
> 
> The commit messages mention sc8280xp having 13 power domains, but here I
> only count 12. Good chance I'm just missing something obvious (not
> familiar with using power domains or rpmh) but I thought I should
> highlight it in case that was an error.
> 

The "typically used ones" in the commit message "captures" that. Further
more _AO is just a variant of the non-_AO resources, referring to votes
that should only apply when the CPU subsystem is not power collapsed.

So what you have in this list is 10 power domains.

I added defines for all 13 in the DT binding, so comparing with that
you'll see that the missing ones are DDR, MSS and XO. I don't see how we
would use these from Linux today. So let's postpone adding them until we
have a use case.

> I attempted to find where this sort of thing is defined downstream, but
> failed :(
> 

In direwolf-regulators.dtsi you'll find entries with qcom,resource-name
of "*.lvl". These resource names are matches against the Command DB
registry, which you can dump using the cmd-db file in debugfs.

Regards,
Bjorn

> Thanks,
> Andrew
> 
> > +
> > +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,sa8540p-rpmhpd", .data = &sa8540p_desc },
> >  	{ .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,sdx65-rpmhpd", .data = &sdx65_desc},
> > -- 
> > 2.35.1
> > 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
  2022-04-28 15:48     ` Bjorn Andersson
@ 2022-04-28 16:19       ` Andrew Halaney
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Halaney @ 2022-04-28 16:19 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Johan Hovold, linux-arm-msm,
	devicetree, linux-kernel

On Thu, Apr 28, 2022 at 08:48:17AM -0700, Bjorn Andersson wrote:
> On Wed 27 Apr 05:38 PDT 2022, Andrew Halaney wrote:
> 
> > On Tue, Apr 26, 2022 at 04:35:08PM -0700, Bjorn Andersson wrote:
> > > The Qualcomm sc8280xp platform has 13 and the sa8540p platform has 11
> > > power-domains. Add compatibles, the typically used ones power-domains
> > > and their relevant active-only variants, to the RPMh power-domain
> > > driver.
> > > 
> > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > ---
> > > 
> > > Changes since v1:
> > > - Added QPHY
> > > - Split out sa8540
> > > - Sorted the entries alphabetically
> > > 
> > >  drivers/soc/qcom/rpmhpd.c | 53 +++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 53 insertions(+)
> > > 
> > > diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> > > index f8d28e902942..05fff8691ee3 100644
> > > --- a/drivers/soc/qcom/rpmhpd.c
> > > +++ b/drivers/soc/qcom/rpmhpd.c
> > > @@ -180,6 +180,36 @@ static struct rpmhpd mxc_ao = {
> > >  	.res_name = "mxc.lvl",
> > >  };
> > >  
> > > +static struct rpmhpd nsp = {
> > > +	.pd = { .name = "nsp", },
> > > +	.res_name = "nsp.lvl",
> > > +};
> > > +
> > > +static struct rpmhpd qphy = {
> > > +	.pd = { .name = "qphy", },
> > > +	.res_name = "qphy.lvl",
> > > +};
> > > +
> > > +/* SA8540P RPMH powerdomains */
> > > +static struct rpmhpd *sa8540p_rpmhpds[] = {
> > > +	[SC8280XP_CX] = &cx,
> > > +	[SC8280XP_CX_AO] = &cx_ao,
> > > +	[SC8280XP_EBI] = &ebi,
> > > +	[SC8280XP_GFX] = &gfx,
> > > +	[SC8280XP_LCX] = &lcx,
> > > +	[SC8280XP_LMX] = &lmx,
> > > +	[SC8280XP_MMCX] = &mmcx,
> > > +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> > > +	[SC8280XP_MX] = &mx,
> > > +	[SC8280XP_MX_AO] = &mx_ao,
> > > +	[SC8280XP_NSP] = &nsp,
> > > +};
> > > +
> > > +static const struct rpmhpd_desc sa8540p_desc = {
> > > +	.rpmhpds = sa8540p_rpmhpds,
> > > +	.num_pds = ARRAY_SIZE(sa8540p_rpmhpds),
> > > +};
> > > +
> > >  /* SDM845 RPMH powerdomains */
> > >  static struct rpmhpd *sdm845_rpmhpds[] = {
> > >  	[SDM845_CX] = &cx_w_mx_parent,
> > > @@ -378,10 +408,33 @@ 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_EBI] = &ebi,
> > > +	[SC8280XP_GFX] = &gfx,
> > > +	[SC8280XP_LCX] = &lcx,
> > > +	[SC8280XP_LMX] = &lmx,
> > > +	[SC8280XP_MMCX] = &mmcx,
> > > +	[SC8280XP_MMCX_AO] = &mmcx_ao,
> > > +	[SC8280XP_MX] = &mx,
> > > +	[SC8280XP_MX_AO] = &mx_ao,
> > > +	[SC8280XP_NSP] = &nsp,
> > > +	[SC8280XP_QPHY] = &qphy,
> > > +};
> > 
> > The commit messages mention sc8280xp having 13 power domains, but here I
> > only count 12. Good chance I'm just missing something obvious (not
> > familiar with using power domains or rpmh) but I thought I should
> > highlight it in case that was an error.
> > 
> 
> The "typically used ones" in the commit message "captures" that. Further
> more _AO is just a variant of the non-_AO resources, referring to votes
> that should only apply when the CPU subsystem is not power collapsed.
> 
> So what you have in this list is 10 power domains.
> 
> I added defines for all 13 in the DT binding, so comparing with that
> you'll see that the missing ones are DDR, MSS and XO. I don't see how we
> would use these from Linux today. So let's postpone adding them until we
> have a use case.
> 
> > I attempted to find where this sort of thing is defined downstream, but
> > failed :(
> > 
> 
> In direwolf-regulators.dtsi you'll find entries with qcom,resource-name
> of "*.lvl". These resource names are matches against the Command DB
> registry, which you can dump using the cmd-db file in debugfs.
> 
> Regards,
> Bjorn

Thanks, I really appreciate the explanation. This makes sense to me.

> 
> > Thanks,
> > Andrew
> > 
> > > +
> > > +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,sa8540p-rpmhpd", .data = &sa8540p_desc },
> > >  	{ .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,sdx65-rpmhpd", .data = &sdx65_desc},
> > > -- 
> > > 2.35.1
> > > 
> > 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p
  2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
                   ` (3 preceding siblings ...)
  2022-04-27  8:49 ` [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Johan Hovold
@ 2022-05-04 17:21 ` Bjorn Andersson
  4 siblings, 0 replies; 10+ messages in thread
From: Bjorn Andersson @ 2022-05-04 17:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Johan Hovold, Rob Herring
  Cc: devicetree, linux-kernel, linux-arm-msm

On Tue, 26 Apr 2022 16:35:05 -0700, Bjorn Andersson wrote:
> Add compatibles and power-domain definitions for the sc8280xp and sa8540p
> platforms.
> 
> Bjorn Andersson (3):
>   dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
>   soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays
>   soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
> 
> [...]

Applied, thanks!

[1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains
      commit: dbfb5f94e084287f0a3f23d14ef6692c43c98855
[2/3] soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays
      commit: af77132e9d2bc8ca477003fef15e2c677ae958b1
[3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains
      commit: f68f1cb3437d338ee88a9fc05acd19dacdb9aabd

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-04 18:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 23:35 [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Bjorn Andersson
2022-04-26 23:35 ` [PATCH v2 1/3] dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains Bjorn Andersson
2022-04-28  6:42   ` Krzysztof Kozlowski
2022-04-26 23:35 ` [PATCH v2 2/3] soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays Bjorn Andersson
2022-04-26 23:35 ` [PATCH v2 3/3] soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains Bjorn Andersson
2022-04-27 12:38   ` Andrew Halaney
2022-04-28 15:48     ` Bjorn Andersson
2022-04-28 16:19       ` Andrew Halaney
2022-04-27  8:49 ` [PATCH v2 0/3] soc: qcom: rpmhpd: Add sc8280xp and sa8540p Johan Hovold
2022-05-04 17:21 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.