2023-04-07 15:58:30

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 0/5] Add regulator support for IPQ9574 SoC

IPQ9574 SoC uses the PMIC MP5496 and SMPA1 regulator for APSS voltage scaling.
This patch series adds support for the same and also enables the RPM
communication over the RPMSG framework.

DTS patch depends on the below series
https://lore.kernel.org/linux-arm-msm/[email protected]/

[V4]:
- Detailed change logs are added to the respective patches
[V3]:
https://lore.kernel.org/linux-arm-msm/[email protected]/
- Dropped PATCH [1/6] dt-bindings: soc: qcom: smd-rpm: Add IPQ9574 compatible
as it is available in linux-next/master
- Dropped PATCH [4/6] regulator: qcom_smd: Add support to define the bootup voltage
and updated the nominal voltage in the Board DT as discussed
- Splitted the board DT changes to a separate patch as suggested
- Detailed change logs are added to the respective patches
[V2]:
https://lore.kernel.org/linux-arm-msm/[email protected]/
- Reordered the patches to have the bindings and driver changes
in place before the device tree support
- Dropped the 'soc: qcom: smd-rpm: Add IPQ9574 compatible' since
it is already part of the linux-next/master
- Detailed change log is added to the respective patches
[V1]:
https://lore.kernel.org/linux-arm-msm/[email protected]/

Devi Priya (5):
regulator: qcom_smd: Add s1 sub-node to mp5496 regulator
regulator: qcom_smd: Add MP5496 S1 regulator
arm64: dts: qcom: ipq9574: Add RPM related nodes
arm64: dts: qcom: ipq9574: Add SMPA1 regulator node
arm64: dts: qcom: ipq9574: Add cpufreq support

.../regulator/qcom,smd-rpm-regulator.yaml | 2 +-
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 19 +++++
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 75 +++++++++++++++++++
drivers/regulator/qcom_smd-regulator.c | 5 +-
4 files changed, 98 insertions(+), 3 deletions(-)

--
2.17.1


2023-04-07 15:59:09

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 1/5] regulator: qcom_smd: Add s1 sub-node to mp5496 regulator

Adding s1 sub-node entry to mp5496 regulator node.

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Devi Priya <[email protected]>
---
Changes in V4:
- No change

.../devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml
index 8c45f53212b1..a8ca8e0b27f8 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml
@@ -22,7 +22,7 @@ description:
Each sub-node is identified using the node's name, with valid values listed
for each of the pmics below.

- For mp5496, s2
+ For mp5496, s1, s2

For pm2250, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22
--
2.17.1

2023-04-07 15:59:18

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 3/5] arm64: dts: qcom: ipq9574: Add RPM related nodes

Add RPM Glink & RPM message RAM nodes to support frequency scaling
on IPQ9574.

Reviewed-by: Konrad Dybcio <[email protected]>
Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Devi Priya <[email protected]>
---
Changes in V4:
- Picked up the R-b tag

arch/arm64/boot/dts/qcom/ipq9574.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 7c820463a79d..1f9b7529e7ed 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -110,12 +110,29 @@
};
};

+ rpm-glink {
+ compatible = "qcom,glink-rpm";
+ interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+ qcom,rpm-msg-ram = <&rpm_msg_ram>;
+ mboxes = <&apcs_glb 0>;
+
+ rpm_requests: rpm-requests {
+ compatible = "qcom,rpm-ipq9574";
+ qcom,glink-channels = "rpm_requests";
+ };
+ };
+
soc: soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0 0 0xffffffff>;

+ rpm_msg_ram: sram@60000 {
+ compatible = "qcom,rpm-msg-ram";
+ reg = <0x00060000 0x6000>;
+ };
+
pcie0_phy: phy@84000 {
compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy";
reg = <0x00084000 0x1000>;
--
2.17.1

2023-04-07 15:59:21

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 2/5] regulator: qcom_smd: Add MP5496 S1 regulator

Adding support for MP5496 S1 regulator on IPQ9574 SoC.

Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Devi Priya <[email protected]>
---
Changes in V4:
- Dropped struct mp5496_smpa1 which was the same as mp5496_smpa2
and renamed mp5496_smpa2 to mp5496_smps as suggested by Konrad

drivers/regulator/qcom_smd-regulator.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
index 6f722b2d682e..18189f35db68 100644
--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -749,7 +749,7 @@ static const struct regulator_desc pms405_pldo600 = {
.ops = &rpm_smps_ldo_ops,
};

-static const struct regulator_desc mp5496_smpa2 = {
+static const struct regulator_desc mp5496_smps = {
.linear_ranges = (struct linear_range[]) {
REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
},
@@ -794,7 +794,8 @@ struct rpm_regulator_data {
};

static const struct rpm_regulator_data rpm_mp5496_regulators[] = {
- { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" },
+ { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smps, "s1" },
+ { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smps, "s2" },
{ "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" },
{}
};
--
2.17.1

2023-04-07 15:59:41

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 5/5] arm64: dts: qcom: ipq9574: Add cpufreq support

Add cpu freq nodes in the device tree to bump cpu frequency above 800MHz.

Reviewed-by: Konrad Dybcio <[email protected]>
Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Devi Priya <[email protected]>
---
Changes in V4:
- Picked up the R-b tag

arch/arm64/boot/dts/qcom/ipq9574.dtsi | 58 +++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 1f9b7529e7ed..cfef87b5fd22 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -6,6 +6,7 @@
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/

+#include <dt-bindings/clock/qcom,apss-ipq.h>
#include <dt-bindings/clock/qcom,ipq9574-gcc.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset/qcom,ipq9574-gcc.h>
@@ -37,6 +38,10 @@
reg = <0x0>;
enable-method = "psci";
next-level-cache = <&L2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ clock-names = "cpu";
+ operating-points-v2 = <&cpu_opp_table>;
+ cpu-supply = <&ipq9574_s1>;
};

CPU1: cpu@1 {
@@ -45,6 +50,10 @@
reg = <0x1>;
enable-method = "psci";
next-level-cache = <&L2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ clock-names = "cpu";
+ operating-points-v2 = <&cpu_opp_table>;
+ cpu-supply = <&ipq9574_s1>;
};

CPU2: cpu@2 {
@@ -53,6 +62,10 @@
reg = <0x2>;
enable-method = "psci";
next-level-cache = <&L2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ clock-names = "cpu";
+ operating-points-v2 = <&cpu_opp_table>;
+ cpu-supply = <&ipq9574_s1>;
};

CPU3: cpu@3 {
@@ -61,6 +74,10 @@
reg = <0x3>;
enable-method = "psci";
next-level-cache = <&L2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ clock-names = "cpu";
+ operating-points-v2 = <&cpu_opp_table>;
+ cpu-supply = <&ipq9574_s1>;
};

L2_0: l2-cache {
@@ -75,6 +92,47 @@
reg = <0x0 0x40000000 0x0 0x0>;
};

+ cpu_opp_table: opp-table-cpu {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp-936000000 {
+ opp-hz = /bits/ 64 <936000000>;
+ opp-microvolt = <725000>;
+ clock-latency-ns = <200000>;
+ };
+
+ opp-1104000000 {
+ opp-hz = /bits/ 64 <1104000000>;
+ opp-microvolt = <787500>;
+ clock-latency-ns = <200000>;
+ };
+
+ opp-1416000000 {
+ opp-hz = /bits/ 64 <1416000000>;
+ opp-microvolt = <862500>;
+ clock-latency-ns = <200000>;
+ };
+
+ opp-1488000000 {
+ opp-hz = /bits/ 64 <1488000000>;
+ opp-microvolt = <925000>;
+ clock-latency-ns = <200000>;
+ };
+
+ opp-1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <987500>;
+ clock-latency-ns = <200000>;
+ };
+
+ opp-2208000000 {
+ opp-hz = /bits/ 64 <2208000000>;
+ opp-microvolt = <1062500>;
+ clock-latency-ns = <200000>;
+ };
+ };
+
firmware {
scm {
compatible = "qcom,scm-ipq9574", "qcom,scm";
--
2.17.1

2023-04-07 15:59:42

by Devi Priya

[permalink] [raw]
Subject: [PATCH V4 4/5] arm64: dts: qcom: ipq9574: Add SMPA1 regulator node

Add support for SMPA1 regulator node in IPQ9574.

Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Devi Priya <[email protected]>
---
Changes in V4:
- Updated the comment as suggested by konrad
s/Updating/Update
s/725000uV/725mV

arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
index 3ae38cf327ea..bdc1434fbe67 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
+++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
@@ -44,6 +44,25 @@
};
};

+&rpm_requests {
+ regulators {
+ compatible = "qcom,rpm-mp5496-regulators";
+
+ ipq9574_s1: s1 {
+ /*
+ * During kernel bootup, the SoC runs at 800MHz with 875mV set by the bootloaders.
+ * During regulator registration, kernel not knowing the initial voltage,
+ * considers it as zero and brings up the regulators with minimum supported voltage.
+ * Update the regulator-min-microvolt with SVS voltage of 725mV so that
+ * the regulators are brought up with 725mV which is sufficient for all the
+ * corner parts to operate at 800MHz
+ */
+ regulator-min-microvolt = <725000>;
+ regulator-max-microvolt = <1075000>;
+ };
+ };
+};
+
&pcie1_phy {
status = "okay";
};
--
2.17.1

2023-04-07 19:49:11

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V4 4/5] arm64: dts: qcom: ipq9574: Add SMPA1 regulator node



On 7.04.2023 17:57, Devi Priya wrote:
> Add support for SMPA1 regulator node in IPQ9574.
>
> Co-developed-by: Praveenkumar I <[email protected]>
> Signed-off-by: Praveenkumar I <[email protected]>
> Signed-off-by: Devi Priya <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> Changes in V4:
> - Updated the comment as suggested by konrad
> s/Updating/Update
> s/725000uV/725mV
>
> arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
> index 3ae38cf327ea..bdc1434fbe67 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
> +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts
> @@ -44,6 +44,25 @@
> };
> };
>
> +&rpm_requests {
> + regulators {
> + compatible = "qcom,rpm-mp5496-regulators";
> +
> + ipq9574_s1: s1 {
> + /*
> + * During kernel bootup, the SoC runs at 800MHz with 875mV set by the bootloaders.
> + * During regulator registration, kernel not knowing the initial voltage,
> + * considers it as zero and brings up the regulators with minimum supported voltage.
> + * Update the regulator-min-microvolt with SVS voltage of 725mV so that
> + * the regulators are brought up with 725mV which is sufficient for all the
> + * corner parts to operate at 800MHz
> + */
> + regulator-min-microvolt = <725000>;
> + regulator-max-microvolt = <1075000>;
> + };
> + };
> +};
> +
> &pcie1_phy {
> status = "okay";
> };

2023-04-07 19:49:56

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V4 2/5] regulator: qcom_smd: Add MP5496 S1 regulator



On 7.04.2023 17:57, Devi Priya wrote:
> Adding support for MP5496 S1 regulator on IPQ9574 SoC.
>
> Co-developed-by: Praveenkumar I <[email protected]>
> Signed-off-by: Praveenkumar I <[email protected]>
> Signed-off-by: Devi Priya <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> Changes in V4:
> - Dropped struct mp5496_smpa1 which was the same as mp5496_smpa2
> and renamed mp5496_smpa2 to mp5496_smps as suggested by Konrad
>
> drivers/regulator/qcom_smd-regulator.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
> index 6f722b2d682e..18189f35db68 100644
> --- a/drivers/regulator/qcom_smd-regulator.c
> +++ b/drivers/regulator/qcom_smd-regulator.c
> @@ -749,7 +749,7 @@ static const struct regulator_desc pms405_pldo600 = {
> .ops = &rpm_smps_ldo_ops,
> };
>
> -static const struct regulator_desc mp5496_smpa2 = {
> +static const struct regulator_desc mp5496_smps = {
> .linear_ranges = (struct linear_range[]) {
> REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
> },
> @@ -794,7 +794,8 @@ struct rpm_regulator_data {
> };
>
> static const struct rpm_regulator_data rpm_mp5496_regulators[] = {
> - { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" },
> + { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smps, "s1" },
> + { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smps, "s2" },
> { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" },
> {}
> };

2023-04-11 14:42:10

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH V4 0/5] Add regulator support for IPQ9574 SoC

On Fri, 07 Apr 2023 21:27:22 +0530, Devi Priya wrote:
> IPQ9574 SoC uses the PMIC MP5496 and SMPA1 regulator for APSS voltage scaling.
> This patch series adds support for the same and also enables the RPM
> communication over the RPMSG framework.
>
> DTS patch depends on the below series
> https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/5] regulator: qcom_smd: Add s1 sub-node to mp5496 regulator
commit: e953450cf0f622e3249202e985c79d3faf9a58f2
[2/5] regulator: qcom_smd: Add MP5496 S1 regulator
commit: 60bbee7db43b97bf8c0978cc91f78d1746351871

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

2023-05-26 19:38:48

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH V4 0/5] Add regulator support for IPQ9574 SoC

On Fri, 7 Apr 2023 21:27:22 +0530, Devi Priya wrote:
> IPQ9574 SoC uses the PMIC MP5496 and SMPA1 regulator for APSS voltage scaling.
> This patch series adds support for the same and also enables the RPM
> communication over the RPMSG framework.
>
> DTS patch depends on the below series
> https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> [...]

Applied, thanks!

[3/5] arm64: dts: qcom: ipq9574: Add RPM related nodes
commit: 8cc864a4375dd62023a2880050bf618a225cb907
[4/5] arm64: dts: qcom: ipq9574: Add SMPA1 regulator node
commit: 56ba2b3aeb4b76549a7759e79bd44330cd9b885a
[5/5] arm64: dts: qcom: ipq9574: Add cpufreq support
commit: 8f0ae6bc0098f63a008820f80c08b01ea2167da3

Best regards,
--
Bjorn Andersson <[email protected]>