2024-02-12 14:15:28

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 0/3] Add RPMPD support for MSM8974

Add driver support for the RPM power domains found on the different
MSM8974 devices.

Devicetree integration will come at a later point since also some
mostly remoteproc drivers need to be adjusted.

Also the MX power domains on this SoC seems to work quite a bit
differently, we'd need to send raw voltages to it, so these are ignored
in this series.

Signed-off-by: Luca Weiss <[email protected]>
---
Changes in v2:
- Drop MSM8974_VDDGFX_AO in all patches
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Luca Weiss (3):
dt-bindings: power: rpmpd: Add MSM8974 power domains
pmdomain: qcom: rpmpd: Add MSM8974+PM8841 power domains
pmdomain: qcom: rpmpd: Add MSM8974PRO+PMA8084 power domains

.../devicetree/bindings/power/qcom,rpmpd.yaml | 2 +
drivers/pmdomain/qcom/rpmpd.c | 83 ++++++++++++++++++++++
include/dt-bindings/power/qcom-rpmpd.h | 7 ++
3 files changed, 92 insertions(+)
---
base-commit: 6e3fa474051f3d276ea708bdb8e8e1f66d1d3ee5
change-id: 20240210-msm8974-rpmpd-6e48fe374275

Best regards,
--
Luca Weiss <[email protected]>



2024-02-12 14:36:29

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 2/3] pmdomain: qcom: rpmpd: Add MSM8974+PM8841 power domains

Add the power domains CX & GFX found on devices with MSM8974 and PM8841.

Signed-off-by: Luca Weiss <[email protected]>
---
drivers/pmdomain/qcom/rpmpd.c | 54 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 7796d65f96e8..3fa6a0325fc0 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -226,6 +226,31 @@ static struct rpmpd cx_s3a_vfl = {
.key = KEY_FLOOR_LEVEL,
};

+static struct rpmpd cx_s2b_corner_ao;
+static struct rpmpd cx_s2b_corner = {
+ .pd = { .name = "cx", },
+ .peer = &cx_s2b_corner_ao,
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_corner_ao = {
+ .pd = { .name = "cx_ao", },
+ .peer = &cx_s2b_corner,
+ .active_only = true,
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_vfc = {
+ .pd = { .name = "cx_vfc", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_FLOOR_CORNER,
+};
+
/* G(F)X */
static struct rpmpd gfx_s2b_corner = {
.pd = { .name = "gfx", },
@@ -241,6 +266,20 @@ static struct rpmpd gfx_s2b_vfc = {
.key = KEY_FLOOR_CORNER,
};

+static struct rpmpd gfx_s4b_corner = {
+ .pd = { .name = "gfx", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 4,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s4b_vfc = {
+ .pd = { .name = "gfx_vfc", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 4,
+ .key = KEY_FLOOR_CORNER,
+};
+
static struct rpmpd mx_rwmx0_lvl;
static struct rpmpd gx_rwgx0_lvl_ao;
static struct rpmpd gx_rwgx0_lvl = {
@@ -663,6 +702,20 @@ static const struct rpmpd_desc msm8953_desc = {
.max_state = RPM_SMD_LEVEL_TURBO,
};

+static struct rpmpd *msm8974_rpmpds[] = {
+ [MSM8974_VDDCX] = &cx_s2b_corner,
+ [MSM8974_VDDCX_AO] = &cx_s2b_corner_ao,
+ [MSM8974_VDDCX_VFC] = &cx_s2b_vfc,
+ [MSM8974_VDDGFX] = &gfx_s4b_corner,
+ [MSM8974_VDDGFX_VFC] = &gfx_s4b_vfc,
+};
+
+static const struct rpmpd_desc msm8974_desc = {
+ .rpmpds = msm8974_rpmpds,
+ .num_pds = ARRAY_SIZE(msm8974_rpmpds),
+ .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
static struct rpmpd *msm8976_rpmpds[] = {
[MSM8976_VDDCX] = &cx_s2a_lvl,
[MSM8976_VDDCX_AO] = &cx_s2a_lvl_ao,
@@ -856,6 +909,7 @@ static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8917-rpmpd", .data = &msm8917_desc },
{ .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc },
{ .compatible = "qcom,msm8953-rpmpd", .data = &msm8953_desc },
+ { .compatible = "qcom,msm8974-rpmpd", .data = &msm8974_desc },
{ .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc },
{ .compatible = "qcom,msm8994-rpmpd", .data = &msm8994_desc },
{ .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc },

--
2.43.0


2024-02-12 14:45:17

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 3/3] pmdomain: qcom: rpmpd: Add MSM8974PRO+PMA8084 power domains

Add the power domains CX & GFX found on MSM8974 devices that use PMA8084
instead of the standard PM8841+PM8941 combo.

Signed-off-by: Luca Weiss <[email protected]>
---
drivers/pmdomain/qcom/rpmpd.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 3fa6a0325fc0..2d47e3357f10 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -252,6 +252,20 @@ static struct rpmpd cx_s2b_vfc = {
};

/* G(F)X */
+static struct rpmpd gfx_s7a_corner = {
+ .pd = { .name = "gfx", },
+ .res_type = RPMPD_SMPA,
+ .res_id = 7,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s7a_vfc = {
+ .pd = { .name = "gfx_vfc", },
+ .res_type = RPMPD_SMPA,
+ .res_id = 7,
+ .key = KEY_FLOOR_CORNER,
+};
+
static struct rpmpd gfx_s2b_corner = {
.pd = { .name = "gfx", },
.res_type = RPMPD_SMPB,
@@ -716,6 +730,20 @@ static const struct rpmpd_desc msm8974_desc = {
.max_state = MAX_CORNER_RPMPD_STATE,
};

+static struct rpmpd *msm8974pro_pma8084_rpmpds[] = {
+ [MSM8974_VDDCX] = &cx_s2a_corner,
+ [MSM8974_VDDCX_AO] = &cx_s2a_corner_ao,
+ [MSM8974_VDDCX_VFC] = &cx_s2a_vfc,
+ [MSM8974_VDDGFX] = &gfx_s7a_corner,
+ [MSM8974_VDDGFX_VFC] = &gfx_s7a_vfc,
+};
+
+static const struct rpmpd_desc msm8974pro_pma8084_desc = {
+ .rpmpds = msm8974pro_pma8084_rpmpds,
+ .num_pds = ARRAY_SIZE(msm8974pro_pma8084_rpmpds),
+ .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
static struct rpmpd *msm8976_rpmpds[] = {
[MSM8976_VDDCX] = &cx_s2a_lvl,
[MSM8976_VDDCX_AO] = &cx_s2a_lvl_ao,
@@ -910,6 +938,7 @@ static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc },
{ .compatible = "qcom,msm8953-rpmpd", .data = &msm8953_desc },
{ .compatible = "qcom,msm8974-rpmpd", .data = &msm8974_desc },
+ { .compatible = "qcom,msm8974pro-pma8084-rpmpd", .data = &msm8974pro_pma8084_desc },
{ .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc },
{ .compatible = "qcom,msm8994-rpmpd", .data = &msm8994_desc },
{ .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc },

--
2.43.0


2024-02-13 12:34:13

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Add RPMPD support for MSM8974

On Sat, 10 Feb 2024 at 17:39, Luca Weiss <[email protected]> wrote:
>
> Add driver support for the RPM power domains found on the different
> MSM8974 devices.
>
> Devicetree integration will come at a later point since also some
> mostly remoteproc drivers need to be adjusted.
>
> Also the MX power domains on this SoC seems to work quite a bit
> differently, we'd need to send raw voltages to it, so these are ignored
> in this series.
>
> Signed-off-by: Luca Weiss <[email protected]>

Applied for next, thanks!

Note that patch1 is also available at the immutable dt branch, if soc
maintainers need to pull it in too.

Kind regards
Uffe


> ---
> Changes in v2:
> - Drop MSM8974_VDDGFX_AO in all patches
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> ---
> Luca Weiss (3):
> dt-bindings: power: rpmpd: Add MSM8974 power domains
> pmdomain: qcom: rpmpd: Add MSM8974+PM8841 power domains
> pmdomain: qcom: rpmpd: Add MSM8974PRO+PMA8084 power domains
>
> .../devicetree/bindings/power/qcom,rpmpd.yaml | 2 +
> drivers/pmdomain/qcom/rpmpd.c | 83 ++++++++++++++++++++++
> include/dt-bindings/power/qcom-rpmpd.h | 7 ++
> 3 files changed, 92 insertions(+)
> ---
> base-commit: 6e3fa474051f3d276ea708bdb8e8e1f66d1d3ee5
> change-id: 20240210-msm8974-rpmpd-6e48fe374275
>
> Best regards,
> --
> Luca Weiss <[email protected]>
>