Skip to contentSkip to conversation

dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018

PATCH Applied Robert Marko 4 participants 8 messages Oct 16, 2023 – Oct 19, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018

Document IPQ6018 compatible for Qcom NVMEM CPUFreq driver.

---
 .../devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml          | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +1 -0
index 7391660a25ac9..f929892d654ea 100644
@@ -28,6 +28,7 @@ select:
           - qcom,apq8064
           - qcom,apq8096
           - qcom,ipq5332
+          - qcom,ipq6018
           - qcom,ipq8064
           - qcom,ipq8074
           - qcom,ipq9574
Signature · 1 line
2.41.0
#1 lore raw

PATCH 2/3 cpufreq: qcom-nvmem: add support for IPQ6018

IPQ6018 SoC series comes in multiple SKU-s, and not all of them support high frequency OPP points.

SoC itself does however have a single bit in QFPROM to indicate the CPU speed-bin.
That bit is used to indicate frequency limit of 1.5GHz, but that alone is not enough as IPQ6000 only goes up to 1.2GHz, but SMEM ID can be used to limit it further.

IPQ6018 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver.

---
 drivers/cpufreq/cpufreq-dt-platdev.c |  1 +
 drivers/cpufreq/qcom-cpufreq-nvmem.c | 58 ++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
index 675da7f368469..07181913448f4 100644
@@ -180,6 +180,7 @@ static const struct of_device_id blocklist[] __initconst = {
 	{ .compatible = "ti,am62a7", },
 	{ .compatible = "ti,am62p5", },
 
+	{ .compatible = "qcom,ipq6018", },
 	{ .compatible = "qcom,ipq8064", },
 	{ .compatible = "qcom,ipq8074", },
 	{ .compatible = "qcom,apq8064", },
drivers/cpufreq/qcom-cpufreq-nvmem.c +58 -0

82 lines not on this page · raw message

Signature · 1 line
2.41.0
maintainer Applied
#2 lore raw

Re: [PATCH 2/3] cpufreq: qcom-nvmem: add support for IPQ6018

Quoted 9 lines · Robert Marko

IPQ6018 SoC series comes in multiple SKU-s, and not all of them support high frequency OPP points.

SoC itself does however have a single bit in QFPROM to indicate the CPU speed-bin.
That bit is used to indicate frequency limit of 1.5GHz, but that alone is not enough as IPQ6000 only goes up to 1.2GHz, but SMEM ID can be used to limit it further.

Quoted 8 lines

IPQ6018 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver.

---
 drivers/cpufreq/cpufreq-dt-platdev.c |  1 +
 drivers/cpufreq/qcom-cpufreq-nvmem.c | 58 ++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

Applied. Thanks.

Signature · 1 line
viresh
#3 lore raw

PATCH 3/3 arm64: dts: qcom: ipq6018: use CPUFreq NVMEM

In reply to Robert Marko

IPQ6018 comes in multiple SKU-s and some of them dont support all of the OPP-s that are current set, so lets utilize CPUFreq NVMEM to allow only supported OPP-s based on the SoC dynamically.

As an example, IPQ6018 is generaly rated at 1.8GHz but some silicon only goes up to 1.5GHz and is marked as such via an eFuse.

---
 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +13 -1
index 9aec89d5e095b..49f0e6aa4b5bb 100644
@@ -96,42 +96,49 @@ scm {
 	};
 
 	cpu_opp_table: opp-table-cpu {
-		compatible = "operating-points-v2";
+		compatible = "operating-points-v2-kryo-cpu";
+		nvmem-cells = <&cpu_speed_bin>;
 		opp-shared;
 
 		opp-864000000 {
 			opp-hz = /bits/ 64 <864000000>;
 			opp-microvolt = <725000>;
+			opp-supported-hw = <0xf>;
 			clock-latency-ns = <200000>;
 		};
 
 		opp-1056000000 {
 			opp-hz = /bits/ 64 <1056000000>;
 			opp-microvolt = <787500>;
+			opp-supported-hw = <0xf>;
 			clock-latency-ns = <200000>;
 		};
 
 		opp-1320000000 {
 			opp-hz = /bits/ 64 <1320000000>;
 			opp-microvolt = <862500>;
+			opp-supported-hw = <0x3>;
 			clock-latency-ns = <200000>;
 		};
 
 		opp-1440000000 {
 			opp-hz = /bits/ 64 <1440000000>;
 			opp-microvolt = <925000>;
+			opp-supported-hw = <0x3>;
 			clock-latency-ns = <200000>;
 		};
 
 		opp-1608000000 {
 			opp-hz = /bits/ 64 <1608000000>;
 			opp-microvolt = <987500>;
+			opp-supported-hw = <0x1>;
 			clock-latency-ns = <200000>;
 		};
 
 		opp-1800000000 {
 			opp-hz = /bits/ 64 <1800000000>;
 			opp-microvolt = <1062500>;
+			opp-supported-hw = <0x1>;
 			clock-latency-ns = <200000>;
 		};
 	};
@@ -314,6 +321,11 @@ qfprom: efuse@a4000 {
 			reg = <0x0 0x000a4000 0x0 0x2000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			cpu_speed_bin: cpu_speed_bin@135 {
+				reg = <0x135 0x1>;
+				bits = <7 1>;
+			};
 		};
 
 		prng: qrng@e3000 {
Signature · 1 line
2.41.0
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] arm64: dts: qcom: ipq6018: use CPUFreq NVMEM

Quoted 19 lines · Robert Marko

IPQ6018 comes in multiple SKU-s and some of them dont support all of the OPP-s that are current set, so lets utilize CPUFreq NVMEM to allow only supported OPP-s based on the SoC dynamically.

As an example, IPQ6018 is generaly rated at 1.8GHz but some silicon only goes up to 1.5GHz and is marked as such via an eFuse.

---
  arch/arm64/boot/dts/qcom/ipq6018.dtsi | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +0 -0
index 9aec89d5e095b..49f0e6aa4b5bb 100644
@@ -96,42 +96,49 @@ scm {
  	};
 

[...]

arch/arm64/boot/dts/qcom/ipq6018.dtsi qfprom: efuse@a4000 { · line 325

Quoted 1 line
arch/arm64/boot/dts/qcom/ipq6018.dtsi +1 -0
+			cpu_speed_bin: cpu_speed_bin@135 {

underscore -> minus sign

Konrad

#5 lore raw

Re: [PATCH 3/3] arm64: dts: qcom: ipq6018: use CPUFreq NVMEM

Quoted 24 lines · Konrad Dybcio
Quoted 19 lines · Robert Marko

IPQ6018 comes in multiple SKU-s and some of them dont support all of the OPP-s that are current set, so lets utilize CPUFreq NVMEM to allow only supported OPP-s based on the SoC dynamically.

As an example, IPQ6018 is generaly rated at 1.8GHz but some silicon only goes up to 1.5GHz and is marked as such via an eFuse.

---
  arch/arm64/boot/dts/qcom/ipq6018.dtsi | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +0 -0
index 9aec89d5e095b..49f0e6aa4b5bb 100644
@@ -96,42 +96,49 @@ scm {
  	};
 

[...]

Quoted 4 lines

arch/arm64/boot/dts/qcom/ipq6018.dtsi qfprom: efuse@a4000 { · line 325

Quoted 1 line
arch/arm64/boot/dts/qcom/ipq6018.dtsi +1 -0
+			cpu_speed_bin: cpu_speed_bin@135 {

underscore -> minus sign

I think Bjorn does not read comments, so he just picks up such patches because they got review. Better to ask for fixing it, instead of giving conditional review tag, IMHO.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH 3/3] arm64: dts: qcom: ipq6018: use CPUFreq NVMEM

Quoted 26 lines · Krzysztof Kozlowski
Quoted 24 lines · Konrad Dybcio
Quoted 19 lines · Robert Marko

IPQ6018 comes in multiple SKU-s and some of them dont support all of the OPP-s that are current set, so lets utilize CPUFreq NVMEM to allow only supported OPP-s based on the SoC dynamically.

As an example, IPQ6018 is generaly rated at 1.8GHz but some silicon only goes up to 1.5GHz and is marked as such via an eFuse.

---
  arch/arm64/boot/dts/qcom/ipq6018.dtsi | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +0 -0
index 9aec89d5e095b..49f0e6aa4b5bb 100644
@@ -96,42 +96,49 @@ scm {
     };
 

[...]

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

+ cpu_speed_bin: cpu_speed_bin@135 {

underscore -> minus sign

I think Bjorn does not read comments, so he just picks up such patches because they got review. Better to ask for fixing it, instead of giving conditional review tag, IMHO.

I will fix it up in v2, I am just waiting to see if there are comments on the driver patch.

Regards,
Robert

Quoted 4 lines

Best regards,
Krzysztof

maintainer Applied
#7 lore raw
In reply to Robert Marko
Quoted 12 lines · Robert Marko

Document IPQ6018 compatible for Qcom NVMEM CPUFreq driver.

---
 .../devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml          | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +0 -0
index 7391660a25ac9..f929892d654ea 100644

Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml select: · line 34

Quoted 7 lines
Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +1 -0
@@ -28,6 +28,7 @@ select:
           - qcom,apq8064
           - qcom,apq8096
           - qcom,ipq5332
+          - qcom,ipq6018
           - qcom,ipq8064
           - qcom,ipq8074
           - qcom,ipq9574

Applied. Thanks.

Signature · 1 line
viresh