All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] genpd: qcom: rpmpd: Add MSM8917 and similar SoCs
@ 2023-09-11 13:16 Otto Pflüger
  2023-09-11 13:16 ` [PATCH 1/2] dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 Otto Pflüger
  2023-09-11 13:16 ` [PATCH 2/2] genpd: qcom: " Otto Pflüger
  0 siblings, 2 replies; 4+ messages in thread
From: Otto Pflüger @ 2023-09-11 13:16 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Ulf Hansson, devicetree,
	linux-pm, Otto Pflüger

Add RPM power domain definitions for the Qualcomm MSM8917, MSM8937 and
QM215 SoCs. These SoCs all have the same power domains (VDDCX and VDDMD
in voltage level mode), but different regulators are needed for QM215
because it is used with a PM8916 PMIC instead of a PM8937 PMIC.

Otto Pflüger (2):
  dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215
  genpd: qcom: rpmpd: Add MSM8917, MSM8937 and QM215

 .../devicetree/bindings/power/qcom,rpmpd.yaml |  3 +
 drivers/genpd/qcom/rpmpd.c                    | 92 +++++++++++++++++++
 include/dt-bindings/power/qcom-rpmpd.h        | 21 +++++
 3 files changed, 116 insertions(+)


base-commit: 7bc675554773f09d88101bf1ccfc8537dc7c0be9
-- 
2.39.1

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

* [PATCH 1/2] dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215
  2023-09-11 13:16 [PATCH 0/2] genpd: qcom: rpmpd: Add MSM8917 and similar SoCs Otto Pflüger
@ 2023-09-11 13:16 ` Otto Pflüger
  2023-09-11 13:16 ` [PATCH 2/2] genpd: qcom: " Otto Pflüger
  1 sibling, 0 replies; 4+ messages in thread
From: Otto Pflüger @ 2023-09-11 13:16 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Ulf Hansson, devicetree,
	linux-pm, Otto Pflüger

The MSM8917, MSM8937 and QM215 SoCs have VDDCX and VDDMD power domains
controlled in voltage level mode. Define the MSM8937 and QM215 power
domains as aliases because these SoCs are similar to MSM8917 and may
share some parts of the device tree.

Also add the compatibles for these SoCs to the documentation.

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
---
 .../devicetree/bindings/power/qcom,rpmpd.yaml |  3 +++
 include/dt-bindings/power/qcom-rpmpd.h        | 21 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
index 9b03c41d3604..2c58abe958f7 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
@@ -20,6 +20,8 @@ properties:
       - qcom,msm8226-rpmpd
       - qcom,msm8909-rpmpd
       - qcom,msm8916-rpmpd
+      - qcom,msm8917-rpmpd
+      - qcom,msm8937-rpmpd
       - qcom,msm8939-rpmpd
       - qcom,msm8953-rpmpd
       - qcom,msm8976-rpmpd
@@ -29,6 +31,7 @@ properties:
       - qcom,qcm2290-rpmpd
       - qcom,qcs404-rpmpd
       - qcom,qdu1000-rpmhpd
+      - qcom,qm215-rpmpd
       - qcom,sa8155p-rpmhpd
       - qcom,sa8540p-rpmhpd
       - qcom,sa8775p-rpmhpd
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 83be996cb5eb..7f4e2983a4c5 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -278,6 +278,27 @@
 #define MSM8909_VDDMX		MSM8916_VDDMX
 #define MSM8909_VDDMX_AO	MSM8916_VDDMX_AO
 
+/* MSM8917 Power Domain Indexes */
+#define MSM8917_VDDCX		0
+#define MSM8917_VDDCX_AO	1
+#define MSM8917_VDDCX_VFL	2
+#define MSM8917_VDDMX		3
+#define MSM8917_VDDMX_AO	4
+
+/* MSM8937 Power Domain Indexes */
+#define MSM8937_VDDCX		MSM8917_VDDCX
+#define MSM8937_VDDCX_AO	MSM8917_VDDCX_AO
+#define MSM8937_VDDCX_VFL	MSM8917_VDDCX_VFL
+#define MSM8937_VDDMX		MSM8917_VDDMX
+#define MSM8937_VDDMX_AO	MSM8917_VDDMX_AO
+
+/* QM215 Power Domain Indexes */
+#define QM215_VDDCX		MSM8917_VDDCX
+#define QM215_VDDCX_AO		MSM8917_VDDCX_AO
+#define QM215_VDDCX_VFL		MSM8917_VDDCX_VFL
+#define QM215_VDDMX		MSM8917_VDDMX
+#define QM215_VDDMX_AO		MSM8917_VDDMX_AO
+
 /* MSM8953 Power Domain Indexes */
 #define MSM8953_VDDMD		0
 #define MSM8953_VDDMD_AO	1
-- 
2.39.1

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

* [PATCH 2/2] genpd: qcom: rpmpd: Add MSM8917, MSM8937 and QM215
  2023-09-11 13:16 [PATCH 0/2] genpd: qcom: rpmpd: Add MSM8917 and similar SoCs Otto Pflüger
  2023-09-11 13:16 ` [PATCH 1/2] dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 Otto Pflüger
@ 2023-09-11 13:16 ` Otto Pflüger
  2023-09-11 13:20   ` Konrad Dybcio
  1 sibling, 1 reply; 4+ messages in thread
From: Otto Pflüger @ 2023-09-11 13:16 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Ulf Hansson, devicetree,
	linux-pm, Otto Pflüger

MSM8917 uses the SMPA2 and LDOA3 regulators provided by the PM8937 PMIC
for the VDDCX and VDDMX power domains in voltage level mode,
respectively. MSM8937 also uses this PMIC and the same regulators.

QM215 is typically paired with a PM8916 PMIC and uses its SMPA1 and
LDOA2 regulators in voltage level mode.

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
---
 drivers/genpd/qcom/rpmpd.c | 92 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/drivers/genpd/qcom/rpmpd.c b/drivers/genpd/qcom/rpmpd.c
index 3135dd1dafe0..d97f9642fc17 100644
--- a/drivers/genpd/qcom/rpmpd.c
+++ b/drivers/genpd/qcom/rpmpd.c
@@ -105,6 +105,24 @@ static struct rpmpd cx_s1a_corner_ao = {
 	.key = KEY_CORNER,
 };
 
+static struct rpmpd cx_s1a_lvl_ao;
+static struct rpmpd cx_s1a_lvl = {
+	.pd = { .name = "cx", },
+	.peer = &cx_s1a_lvl_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd cx_s1a_lvl_ao = {
+	.pd = { .name = "cx_ao", },
+	.peer = &cx_s1a_lvl,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_LEVEL,
+};
+
 static struct rpmpd cx_s2a_corner_ao;
 static struct rpmpd cx_s2a_corner = {
 	.pd = { .name = "cx", },
@@ -180,6 +198,13 @@ static struct rpmpd cx_s1a_vfc = {
 	.key = KEY_FLOOR_CORNER,
 };
 
+static struct rpmpd cx_s1a_vfl = {
+	.pd = { .name = "cx_vfl", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_LEVEL,
+};
+
 static struct rpmpd cx_s2a_vfc = {
 	.pd = { .name = "cx_vfc", },
 	.res_type = RPMPD_SMPA,
@@ -239,6 +264,24 @@ static struct rpmpd gx_rwgx0_lvl_ao = {
 };
 
 /* MX */
+static struct rpmpd mx_l2a_lvl_ao;
+static struct rpmpd mx_l2a_lvl = {
+	.pd = { .name = "mx", },
+	.peer = &mx_l2a_lvl_ao,
+	.res_type = RPMPD_LDOA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mx_l2a_lvl_ao = {
+	.pd = { .name = "mx_ao", },
+	.peer = &mx_l2a_lvl,
+	.active_only = true,
+	.res_type = RPMPD_LDOA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
+
 static struct rpmpd mx_l3a_corner_ao;
 static struct rpmpd mx_l3a_corner = {
 	.pd = { .name = "mx", },
@@ -257,6 +300,24 @@ static struct rpmpd mx_l3a_corner_ao = {
 	.key = KEY_CORNER,
 };
 
+static struct rpmpd mx_l3a_lvl_ao;
+static struct rpmpd mx_l3a_lvl = {
+	.pd = { .name = "mx", },
+	.peer = &mx_l3a_lvl_ao,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mx_l3a_lvl_ao = {
+	.pd = { .name = "mx_ao", },
+	.peer = &mx_l3a_lvl,
+	.active_only = true,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_LEVEL,
+};
+
 static struct rpmpd mx_l12a_lvl_ao;
 static struct rpmpd mx_l12a_lvl = {
 	.pd = { .name = "mx", },
@@ -572,6 +633,20 @@ static const struct rpmpd_desc msm8916_desc = {
 	.max_state = MAX_CORNER_RPMPD_STATE,
 };
 
+static struct rpmpd *msm8917_rpmpds[] = {
+	[MSM8917_VDDCX] =	&cx_s2a_lvl,
+	[MSM8917_VDDCX_AO] =	&cx_s2a_lvl_ao,
+	[MSM8917_VDDCX_VFL] =	&cx_s2a_vfl,
+	[MSM8917_VDDMX] =	&mx_l3a_lvl,
+	[MSM8917_VDDMX_AO] =	&mx_l3a_lvl_ao,
+};
+
+static const struct rpmpd_desc msm8917_desc = {
+	.rpmpds = msm8917_rpmpds,
+	.num_pds = ARRAY_SIZE(msm8917_rpmpds),
+	.max_state = RPM_SMD_LEVEL_TURBO,
+};
+
 static struct rpmpd *msm8953_rpmpds[] = {
 	[MSM8953_VDDMD] =	&md_s1a_lvl,
 	[MSM8953_VDDMD_AO] =	&md_s1a_lvl_ao,
@@ -672,6 +747,20 @@ static const struct rpmpd_desc qcs404_desc = {
 	.max_state = RPM_SMD_LEVEL_BINNING,
 };
 
+static struct rpmpd *qm215_rpmpds[] = {
+	[QM215_VDDCX] =		&cx_s1a_lvl,
+	[QM215_VDDCX_AO] =	&cx_s1a_lvl_ao,
+	[QM215_VDDCX_VFL] =	&cx_s1a_vfl,
+	[QM215_VDDMX] =		&mx_l2a_lvl,
+	[QM215_VDDMX_AO] =	&mx_l2a_lvl_ao,
+};
+
+static const struct rpmpd_desc qm215_desc = {
+	.rpmpds = qm215_rpmpds,
+	.num_pds = ARRAY_SIZE(qm215_rpmpds),
+	.max_state = RPM_SMD_LEVEL_TURBO,
+};
+
 static struct rpmpd *sdm660_rpmpds[] = {
 	[SDM660_VDDCX] =	&cx_rwcx0_lvl,
 	[SDM660_VDDCX_AO] =	&cx_rwcx0_lvl_ao,
@@ -764,6 +853,8 @@ static const struct of_device_id rpmpd_match_table[] = {
 	{ .compatible = "qcom,msm8226-rpmpd", .data = &msm8226_desc },
 	{ .compatible = "qcom,msm8909-rpmpd", .data = &msm8916_desc },
 	{ .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc },
+	{ .compatible = "qcom,msm8917-rpmpd", .data = &msm8917_desc },
+	{ .compatible = "qcom,msm8937-rpmpd", .data = &msm8917_desc },
 	{ .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc },
 	{ .compatible = "qcom,msm8953-rpmpd", .data = &msm8953_desc },
 	{ .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc },
@@ -772,6 +863,7 @@ static const struct of_device_id rpmpd_match_table[] = {
 	{ .compatible = "qcom,msm8998-rpmpd", .data = &msm8998_desc },
 	{ .compatible = "qcom,qcm2290-rpmpd", .data = &qcm2290_desc },
 	{ .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc },
+	{ .compatible = "qcom,qm215-rpmpd", .data = &qm215_desc },
 	{ .compatible = "qcom,sdm660-rpmpd", .data = &sdm660_desc },
 	{ .compatible = "qcom,sm6115-rpmpd", .data = &sm6115_desc },
 	{ .compatible = "qcom,sm6125-rpmpd", .data = &sm6125_desc },
-- 
2.39.1

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

* Re: [PATCH 2/2] genpd: qcom: rpmpd: Add MSM8917, MSM8937 and QM215
  2023-09-11 13:16 ` [PATCH 2/2] genpd: qcom: " Otto Pflüger
@ 2023-09-11 13:20   ` Konrad Dybcio
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2023-09-11 13:20 UTC (permalink / raw)
  To: Otto Pflüger, linux-arm-msm
  Cc: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Ulf Hansson, devicetree, linux-pm

On 11.09.2023 15:16, Otto Pflüger wrote:
> MSM8917 uses the SMPA2 and LDOA3 regulators provided by the PM8937 PMIC
> for the VDDCX and VDDMX power domains in voltage level mode,
> respectively. MSM8937 also uses this PMIC and the same regulators.
> 
> QM215 is typically paired with a PM8916 PMIC and uses its SMPA1 and
> LDOA2 regulators in voltage level mode.
> 
> Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
> ---
Generally one-per-commit is the consensus.

> +
>  static struct rpmpd *sdm660_rpmpds[] = {
>  	[SDM660_VDDCX] =	&cx_rwcx0_lvl,
>  	[SDM660_VDDCX_AO] =	&cx_rwcx0_lvl_ao,
> @@ -764,6 +853,8 @@ static const struct of_device_id rpmpd_match_table[] = {
>  	{ .compatible = "qcom,msm8226-rpmpd", .data = &msm8226_desc },
>  	{ .compatible = "qcom,msm8909-rpmpd", .data = &msm8916_desc },
>  	{ .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc },
> +	{ .compatible = "qcom,msm8917-rpmpd", .data = &msm8917_desc },
> +	{ .compatible = "qcom,msm8937-rpmpd", .data = &msm8917_desc },
Don't add two compatibles pointing to the same thing, or you'll
get an angry response from Krzysztof :D

You can do:

compatible = "qcom,msm8937-rpmpd", "qcom,msm8917-rpmpd";

and document the fallback in bindings

Konrad

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

end of thread, other threads:[~2023-09-11 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11 13:16 [PATCH 0/2] genpd: qcom: rpmpd: Add MSM8917 and similar SoCs Otto Pflüger
2023-09-11 13:16 ` [PATCH 1/2] dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 Otto Pflüger
2023-09-11 13:16 ` [PATCH 2/2] genpd: qcom: " Otto Pflüger
2023-09-11 13:20   ` Konrad Dybcio

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.