* [PATCH 0/3] RPMPD for QCS404
@ 2019-02-21 6:44 Bjorn Andersson
2019-02-21 6:44 ` [PATCH 1/3] soc: qcom: rpmpd: Modify corner defining macros Bjorn Andersson
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Bjorn Andersson @ 2019-02-21 6:44 UTC (permalink / raw)
To: Andy Gross, David Brown, Rob Herring, Mark Rutland, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel
Reworkd the macros of the rpmpd driver and add qcs404 power domains, then add
this to the dts.
Bjorn Andersson (3):
soc: qcom: rpmpd: Modify corner defining macros
soc: qcom: rpmpd: Add QCS404 corners
arm64: dts: qcom: qcs404: Add rpmpd node
.../devicetree/bindings/power/qcom,rpmpd.txt | 1 +
arch/arm64/boot/dts/qcom/qcs404.dtsi | 35 +++++++++++
drivers/soc/qcom/rpmpd.c | 63 +++++++++++++------
include/dt-bindings/power/qcom-rpmpd.h | 9 +++
4 files changed, 88 insertions(+), 20 deletions(-)
--
2.18.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] soc: qcom: rpmpd: Modify corner defining macros
2019-02-21 6:44 [PATCH 0/3] RPMPD for QCS404 Bjorn Andersson
@ 2019-02-21 6:44 ` Bjorn Andersson
2019-02-21 6:44 ` [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners Bjorn Andersson
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2019-02-21 6:44 UTC (permalink / raw)
To: Andy Gross, David Brown, Rajendra Nayak
Cc: Rob Herring, Mark Rutland, linux-arm-msm, devicetree, linux-kernel
QCS404 uses individual resource type magic for each power-domain, so
adjust the macros slightly to make them reusable for this.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/soc/qcom/rpmpd.c | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index 005326050c23..74b2f001b9c6 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -17,8 +17,8 @@
#define domain_to_rpmpd(domain) container_of(domain, struct rpmpd, pd)
/* Resource types */
-#define RPMPD_SMPA 0x61706d73
-#define RPMPD_LDOA 0x616f646c
+#define RPMPD_SMPA 0x61706d73 /* smpa */
+#define RPMPD_LDOA 0x616f646c /* ldoa */
/* Operation Keys */
#define KEY_CORNER 0x6e726f63 /* corn */
@@ -27,12 +27,12 @@
#define MAX_RPMPD_STATE 6
-#define DEFINE_RPMPD_CORNER_SMPA(_platform, _name, _active, r_id) \
+#define DEFINE_RPMPD_CORNER_PAIR(_platform, _name, _active, r_type, r_id) \
static struct rpmpd _platform##_##_active; \
static struct rpmpd _platform##_##_name = { \
.pd = { .name = #_name, }, \
.peer = &_platform##_##_active, \
- .res_type = RPMPD_SMPA, \
+ .res_type = RPMPD_##r_type, \
.res_id = r_id, \
.key = KEY_CORNER, \
}; \
@@ -40,33 +40,27 @@
.pd = { .name = #_active, }, \
.peer = &_platform##_##_name, \
.active_only = true, \
- .res_type = RPMPD_SMPA, \
+ .res_type = RPMPD_##r_type, \
.res_id = r_id, \
.key = KEY_CORNER, \
}
-#define DEFINE_RPMPD_CORNER_LDOA(_platform, _name, r_id) \
+#define DEFINE_RPMPD_CORNER(_platform, _name, r_type, r_id) \
static struct rpmpd _platform##_##_name = { \
.pd = { .name = #_name, }, \
- .res_type = RPMPD_LDOA, \
+ .res_type = RPMPD_##r_type, \
.res_id = r_id, \
.key = KEY_CORNER, \
}
-#define DEFINE_RPMPD_VFC(_platform, _name, r_id, r_type) \
+#define DEFINE_RPMPD_VFC(_platform, _name, r_type, r_id) \
static struct rpmpd _platform##_##_name = { \
.pd = { .name = #_name, }, \
- .res_type = r_type, \
+ .res_type = RPMPD_##r_type, \
.res_id = r_id, \
.key = KEY_FLOOR_CORNER, \
}
-#define DEFINE_RPMPD_VFC_SMPA(_platform, _name, r_id) \
- DEFINE_RPMPD_VFC(_platform, _name, r_id, RPMPD_SMPA)
-
-#define DEFINE_RPMPD_VFC_LDOA(_platform, _name, r_id) \
- DEFINE_RPMPD_VFC(_platform, _name, r_id, RPMPD_LDOA)
-
struct rpmpd_req {
__le32 key;
__le32 nbytes;
@@ -94,12 +88,12 @@ struct rpmpd_desc {
static DEFINE_MUTEX(rpmpd_lock);
/* msm8996 RPM Power domains */
-DEFINE_RPMPD_CORNER_SMPA(msm8996, vddcx, vddcx_ao, 1);
-DEFINE_RPMPD_CORNER_SMPA(msm8996, vddmx, vddmx_ao, 2);
-DEFINE_RPMPD_CORNER_LDOA(msm8996, vddsscx, 26);
+DEFINE_RPMPD_CORNER_PAIR(msm8996, vddcx, vddcx_ao, SMPA, 1);
+DEFINE_RPMPD_CORNER_PAIR(msm8996, vddmx, vddmx_ao, SMPA, 2);
+DEFINE_RPMPD_CORNER(msm8996, vddsscx, LDOA, 26);
-DEFINE_RPMPD_VFC_SMPA(msm8996, vddcx_vfc, 1);
-DEFINE_RPMPD_VFC_LDOA(msm8996, vddsscx_vfc, 26);
+DEFINE_RPMPD_VFC(msm8996, vddcx_vfc, SMPA, 1);
+DEFINE_RPMPD_VFC(msm8996, vddsscx_vfc, LDOA, 26);
static struct rpmpd *msm8996_rpmpds[] = {
[MSM8996_VDDCX] = &msm8996_vddcx,
--
2.18.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners
2019-02-21 6:44 [PATCH 0/3] RPMPD for QCS404 Bjorn Andersson
2019-02-21 6:44 ` [PATCH 1/3] soc: qcom: rpmpd: Modify corner defining macros Bjorn Andersson
@ 2019-02-21 6:44 ` Bjorn Andersson
2019-03-25 22:33 ` Rob Herring
2019-02-21 6:44 ` [PATCH 3/3] arm64: dts: qcom: qcs404: Add rpmpd node Bjorn Andersson
2019-02-25 12:48 ` [PATCH 0/3] RPMPD for QCS404 Rajendra Nayak
3 siblings, 1 reply; 7+ messages in thread
From: Bjorn Andersson @ 2019-02-21 6:44 UTC (permalink / raw)
To: Andy Gross, David Brown, Rob Herring, Mark Rutland, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel
Add the shared cx/mx and the low-power-island's cx and mx power-domains
found on QCS404.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
.../devicetree/bindings/power/qcom,rpmpd.txt | 1 +
drivers/soc/qcom/rpmpd.c | 29 +++++++++++++++++++
include/dt-bindings/power/qcom-rpmpd.h | 9 ++++++
3 files changed, 39 insertions(+)
diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
index 980e5413d18f..b6c596883ea4 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
@@ -6,6 +6,7 @@ which then translates it into a corresponding voltage on a rail
Required Properties:
- compatible: Should be one of the following
* qcom,msm8996-rpmpd: RPM Power domain for the msm8996 family of SoC
+ * qcom,qcs404-rpmpd: RPM Power domain for the qcs404
* qcom,sdm845-rpmhpd: RPMh Power domain for the sdm845 family of SoC
- #power-domain-cells: number of cells in Power domain specifier
must be 1.
diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index 74b2f001b9c6..0001fcafaf97 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -19,6 +19,9 @@
/* Resource types */
#define RPMPD_SMPA 0x61706d73 /* smpa */
#define RPMPD_LDOA 0x616f646c /* ldoa */
+#define RPMPD_RWMX 0x786d7772 /* rwmx */
+#define RPMPD_RWLC 0x636c7772 /* rwlc */
+#define RPMPD_RWLM 0x6d6c7772 /* rwlm */
/* Operation Keys */
#define KEY_CORNER 0x6e726f63 /* corn */
@@ -110,8 +113,34 @@ static const struct rpmpd_desc msm8996_desc = {
.num_pds = ARRAY_SIZE(msm8996_rpmpds),
};
+/* qcs404 RPM Power domains */
+DEFINE_RPMPD_CORNER_PAIR(qcs404, vddmx, vddmx_ao, RWMX, 0);
+DEFINE_RPMPD_VFC(qcs404, vddmx_vfc, RWMX, 0);
+
+DEFINE_RPMPD_CORNER(qcs404, vdd_lpicx, RWLC, 0);
+DEFINE_RPMPD_VFC(qcs404, vdd_lpicx_vfc, RWLC, 0);
+
+DEFINE_RPMPD_CORNER(qcs404, vdd_lpimx, RWLM, 0);
+DEFINE_RPMPD_VFC(qcs404, vdd_lpimx_vfc, RWLM, 0);
+
+static struct rpmpd *qcs404_rpmpds[] = {
+ [QCS404_VDDMX] = &qcs404_vddmx,
+ [QCS404_VDDMX_AO] = &qcs404_vddmx_ao,
+ [QCS404_VDDMX_VFC] = &qcs404_vddmx_vfc,
+ [QCS404_LPICX] = &qcs404_vdd_lpicx,
+ [QCS404_LPICX_VFC] = &qcs404_vdd_lpicx_vfc,
+ [QCS404_LPIMX] = &qcs404_vdd_lpimx,
+ [QCS404_LPIMX_VFC] = &qcs404_vdd_lpimx_vfc,
+};
+
+static const struct rpmpd_desc qcs404_desc = {
+ .rpmpds = qcs404_rpmpds,
+ .num_pds = ARRAY_SIZE(qcs404_rpmpds),
+};
+
static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc },
+ { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc },
{ }
};
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 87d9c6611682..0b1b147292a3 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -36,4 +36,13 @@
#define MSM8996_VDDSSCX 5
#define MSM8996_VDDSSCX_VFC 6
+/* QCS404 Power Domains */
+#define QCS404_VDDMX 0
+#define QCS404_VDDMX_AO 1
+#define QCS404_VDDMX_VFC 2
+#define QCS404_LPICX 3
+#define QCS404_LPICX_VFC 4
+#define QCS404_LPIMX 5
+#define QCS404_LPIMX_VFC 6
+
#endif
--
2.18.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] arm64: dts: qcom: qcs404: Add rpmpd node
2019-02-21 6:44 [PATCH 0/3] RPMPD for QCS404 Bjorn Andersson
2019-02-21 6:44 ` [PATCH 1/3] soc: qcom: rpmpd: Modify corner defining macros Bjorn Andersson
2019-02-21 6:44 ` [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners Bjorn Andersson
@ 2019-02-21 6:44 ` Bjorn Andersson
2019-02-25 12:48 ` [PATCH 0/3] RPMPD for QCS404 Rajendra Nayak
3 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2019-02-21 6:44 UTC (permalink / raw)
To: Andy Gross, David Brown, Rajendra Nayak
Cc: Rob Herring, Mark Rutland, linux-arm-msm, devicetree, linux-kernel
Add the rpmpd node on the qcs404 and define the available levels.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
arch/arm64/boot/dts/qcom/qcs404.dtsi | 35 ++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 6c86b267da82..1ceb0432af55 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -4,6 +4,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,gcc-qcs404.h>
#include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/power/qcom-rpmpd.h>
/ {
interrupt-parent = <&intc>;
@@ -240,6 +241,40 @@
compatible = "qcom,rpmcc-qcs404";
#clock-cells = <1>;
};
+
+ rpmpd: power-controller {
+ compatible = "qcom,qcs404-rpmpd";
+ #power-domain-cells = <1>;
+ operating-points-v2 = <&rpmpd_opp_table>;
+
+ rpmpd_opp_table: opp-table {
+ compatible = "operating-points-v2";
+
+ rpmpd_opp1: opp1 {
+ opp-level = <1>;
+ };
+
+ rpmpd_opp2: opp2 {
+ opp-level = <2>;
+ };
+
+ rpmpd_opp3: opp3 {
+ opp-level = <3>;
+ };
+
+ rpmpd_opp4: opp4 {
+ opp-level = <4>;
+ };
+
+ rpmpd_opp5: opp5 {
+ opp-level = <5>;
+ };
+
+ rpmpd_opp6: opp6 {
+ opp-level = <6>;
+ };
+ };
+ };
};
};
--
2.18.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] RPMPD for QCS404
2019-02-21 6:44 [PATCH 0/3] RPMPD for QCS404 Bjorn Andersson
` (2 preceding siblings ...)
2019-02-21 6:44 ` [PATCH 3/3] arm64: dts: qcom: qcs404: Add rpmpd node Bjorn Andersson
@ 2019-02-25 12:48 ` Rajendra Nayak
2019-02-28 6:02 ` Sibi Sankar
3 siblings, 1 reply; 7+ messages in thread
From: Rajendra Nayak @ 2019-02-25 12:48 UTC (permalink / raw)
To: Bjorn Andersson, Andy Gross, David Brown, Rob Herring, Mark Rutland
Cc: linux-arm-msm, devicetree, linux-kernel
On 2/21/2019 12:14 PM, Bjorn Andersson wrote:
> Reworkd the macros of the rpmpd driver and add qcs404 power domains, then add
> this to the dts.
For the entire series,
Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org>
>
> Bjorn Andersson (3):
> soc: qcom: rpmpd: Modify corner defining macros
> soc: qcom: rpmpd: Add QCS404 corners
> arm64: dts: qcom: qcs404: Add rpmpd node
>
> .../devicetree/bindings/power/qcom,rpmpd.txt | 1 +
> arch/arm64/boot/dts/qcom/qcs404.dtsi | 35 +++++++++++
> drivers/soc/qcom/rpmpd.c | 63 +++++++++++++------
> include/dt-bindings/power/qcom-rpmpd.h | 9 +++
> 4 files changed, 88 insertions(+), 20 deletions(-)
>
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] RPMPD for QCS404
2019-02-25 12:48 ` [PATCH 0/3] RPMPD for QCS404 Rajendra Nayak
@ 2019-02-28 6:02 ` Sibi Sankar
0 siblings, 0 replies; 7+ messages in thread
From: Sibi Sankar @ 2019-02-28 6:02 UTC (permalink / raw)
To: Rajendra Nayak
Cc: Bjorn Andersson, Andy Gross, David Brown, Rob Herring,
Mark Rutland, linux-arm-msm, devicetree, linux-kernel,
linux-arm-msm-owner
On 2019-02-25 18:18, Rajendra Nayak wrote:
> On 2/21/2019 12:14 PM, Bjorn Andersson wrote:
>> Reworkd the macros of the rpmpd driver and add qcs404 power domains,
>> then add
>> this to the dts.
>
> For the entire series,
>
> Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org>
I'll post v2 of this series with support
for msm8998 and a few fixes.
>
>>
>> Bjorn Andersson (3):
>> soc: qcom: rpmpd: Modify corner defining macros
>> soc: qcom: rpmpd: Add QCS404 corners
>> arm64: dts: qcom: qcs404: Add rpmpd node
>>
>> .../devicetree/bindings/power/qcom,rpmpd.txt | 1 +
>> arch/arm64/boot/dts/qcom/qcs404.dtsi | 35 +++++++++++
>> drivers/soc/qcom/rpmpd.c | 63
>> +++++++++++++------
>> include/dt-bindings/power/qcom-rpmpd.h | 9 +++
>> 4 files changed, 88 insertions(+), 20 deletions(-)
>>
--
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners
2019-02-21 6:44 ` [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners Bjorn Andersson
@ 2019-03-25 22:33 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2019-03-25 22:33 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, David Brown, Mark Rutland, Rajendra Nayak,
linux-arm-msm, devicetree, linux-kernel
On Wed, 20 Feb 2019 22:44:33 -0800, Bjorn Andersson wrote:
> Add the shared cx/mx and the low-power-island's cx and mx power-domains
> found on QCS404.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> .../devicetree/bindings/power/qcom,rpmpd.txt | 1 +
> drivers/soc/qcom/rpmpd.c | 29 +++++++++++++++++++
> include/dt-bindings/power/qcom-rpmpd.h | 9 ++++++
> 3 files changed, 39 insertions(+)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-03-25 22:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 6:44 [PATCH 0/3] RPMPD for QCS404 Bjorn Andersson
2019-02-21 6:44 ` [PATCH 1/3] soc: qcom: rpmpd: Modify corner defining macros Bjorn Andersson
2019-02-21 6:44 ` [PATCH 2/3] soc: qcom: rpmpd: Add QCS404 corners Bjorn Andersson
2019-03-25 22:33 ` Rob Herring
2019-02-21 6:44 ` [PATCH 3/3] arm64: dts: qcom: qcs404: Add rpmpd node Bjorn Andersson
2019-02-25 12:48 ` [PATCH 0/3] RPMPD for QCS404 Rajendra Nayak
2019-02-28 6:02 ` Sibi Sankar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).