Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/5] DTS changes to support cpufreq on QCS404
@ 2019-11-25 14:25 Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 1/5] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Niklas Cassel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: amit.kucheria, bjorn.andersson, Niklas Cassel, devicetree,
	linux-kernel, linux-arm-kernel

The following DTS changes are required to enable cpufreq support on
the QCS404.

Changes since v1:
-Added a cover-letter.
-Swapped order of "pll" and "aux" clocks, in order to not break DT
backwards compatibility. (In case no clock-names are given, "pll" still
has to be the first clock).
-Removed incorrect newline in the middle of the cpu0 DT node.
(This extra newline must have been added by mistake, since no other
cpuX node in the same cluster had this extra newline added.)

Jorge Ramirez-Ortiz (5):
  arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider
  arm64: dts: qcom: qcs404: Add HFPLL node
  arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider
  arm64: dts: qcom: qcs404: Add DVFS support
  arm64: defconfig: Enable HFPLL

 arch/arm64/boot/dts/qcom/msm8916.dtsi |  3 +-
 arch/arm64/boot/dts/qcom/qcs404.dtsi  | 42 +++++++++++++++++++++++++++
 arch/arm64/configs/defconfig          |  1 +
 3 files changed, 45 insertions(+), 1 deletion(-)

-- 
2.23.0


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

* [PATCH v2 1/5] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider
  2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
@ 2019-11-25 14:25 ` Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 2/5] arm64: dts: qcom: qcs404: Add HFPLL node Niklas Cassel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, amit.kucheria, Jorge Ramirez-Ortiz, Rob Herring,
	Mark Rutland, devicetree, linux-kernel

From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

Specify the clocks that feed the APCS mux/divider instead of using
default hardcoded values in the source code.

The driver still supports the previous bindings; however with this
update it we allow the msm8916 to access the parent clock names
required by the driver operation using the device tree node.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
-Swapped order of "pll" and "aux" clocks, in order to not break DT
backwards compatibility. (In case no clock-names are given, "pll" still
has to be the first clock).

 arch/arm64/boot/dts/qcom/msm8916.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 8686e101905c..9ec41b24a51f 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -429,7 +429,8 @@
 			compatible = "qcom,msm8916-apcs-kpss-global", "syscon";
 			reg = <0xb011000 0x1000>;
 			#mbox-cells = <1>;
-			clocks = <&a53pll>;
+			clocks = <&a53pll>, <&gcc GPLL0_VOTE>;
+			clock-names = "pll", "aux";
 			#clock-cells = <0>;
 		};
 
-- 
2.23.0


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

* [PATCH v2 2/5] arm64: dts: qcom: qcs404: Add HFPLL node
  2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 1/5] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Niklas Cassel
@ 2019-11-25 14:25 ` Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 3/5] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Niklas Cassel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, amit.kucheria, Jorge Ramirez-Ortiz, Niklas Cassel,
	Rob Herring, Mark Rutland, devicetree, linux-kernel

From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

The high frequency pll functionality is required to enable CPU
frequency scaling operation.

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
-None

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

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index f5f0c4c9cb16..78065fbb3626 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -904,6 +904,15 @@
 			#mbox-cells = <1>;
 		};
 
+		apcs_hfpll: clock-controller@b016000 {
+			compatible = "qcom,hfpll";
+			reg = <0x0b016000 0x30>;
+			#clock-cells = <0>;
+			clock-output-names = "apcs_hfpll";
+			clocks = <&xo_board>;
+			clock-names = "xo";
+		};
+
 		watchdog@b017000 {
 			compatible = "qcom,kpss-wdt";
 			reg = <0x0b017000 0x1000>;
-- 
2.23.0


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

* [PATCH v2 3/5] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider
  2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 1/5] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 2/5] arm64: dts: qcom: qcs404: Add HFPLL node Niklas Cassel
@ 2019-11-25 14:25 ` Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 4/5] arm64: dts: qcom: qcs404: Add DVFS support Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 5/5] arm64: defconfig: Enable HFPLL Niklas Cassel
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, amit.kucheria, Jorge Ramirez-Ortiz, Niklas Cassel,
	Rob Herring, Mark Rutland, devicetree, linux-kernel

From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

Specify the clocks that feed the APCS mux/divider instead of using
default hardcoded values in the source code.

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
-Swapped order of "pll" and "aux" clocks, in order to not break DT
backwards compatibility. (In case no clock-names are given, "pll" still
has to be the first clock).

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

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 78065fbb3626..ee5ecf413664 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -902,6 +902,9 @@
 			compatible = "qcom,qcs404-apcs-apps-global", "syscon";
 			reg = <0x0b011000 0x1000>;
 			#mbox-cells = <1>;
+			clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
+			clock-names = "pll", "aux";
+			#clock-cells = <0>;
 		};
 
 		apcs_hfpll: clock-controller@b016000 {
-- 
2.23.0


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

* [PATCH v2 4/5] arm64: dts: qcom: qcs404: Add DVFS support
  2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
                   ` (2 preceding siblings ...)
  2019-11-25 14:25 ` [PATCH v2 3/5] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Niklas Cassel
@ 2019-11-25 14:25 ` Niklas Cassel
  2019-11-25 14:25 ` [PATCH v2 5/5] arm64: defconfig: Enable HFPLL Niklas Cassel
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, amit.kucheria, Jorge Ramirez-Ortiz, Niklas Cassel,
	Rob Herring, Mark Rutland, devicetree, linux-kernel

From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

Support dynamic voltage and frequency scaling on qcs404.

CPUFreq will soon be superseded by Core Power Reduction (CPR, a form
of Adaptive Voltage Scaling found on some Qualcomm SoCs like the
qcs404).

Due to the CPR upstreaming already being in progress - and some
commits already merged -  the following commit will need to be
reverted to enable CPUFreq support

   Author: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
   Date:   Thu Jul 25 12:41:36 2019 +0200
       cpufreq: Add qcs404 to cpufreq-dt-platdev blacklist

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
-Removed incorrect newline in the middle of the cpu0 DT node.
(This extra newline must have been added by mistake, since no other
cpuX node in the same cluster had this extra newline added.)

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

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index ee5ecf413664..03aa80f2814a 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -42,6 +42,9 @@
 			cpu-idle-states = <&CPU_SLEEP_0>;
 			next-level-cache = <&L2_0>;
 			#cooling-cells = <2>;
+			clocks = <&apcs_glb>;
+			operating-points-v2 = <&cpu_opp_table>;
+			cpu-supply = <&pms405_s3>;
 		};
 
 		CPU1: cpu@101 {
@@ -52,6 +55,9 @@
 			cpu-idle-states = <&CPU_SLEEP_0>;
 			next-level-cache = <&L2_0>;
 			#cooling-cells = <2>;
+			clocks = <&apcs_glb>;
+			operating-points-v2 = <&cpu_opp_table>;
+			cpu-supply = <&pms405_s3>;
 		};
 
 		CPU2: cpu@102 {
@@ -62,6 +68,9 @@
 			cpu-idle-states = <&CPU_SLEEP_0>;
 			next-level-cache = <&L2_0>;
 			#cooling-cells = <2>;
+			clocks = <&apcs_glb>;
+			operating-points-v2 = <&cpu_opp_table>;
+			cpu-supply = <&pms405_s3>;
 		};
 
 		CPU3: cpu@103 {
@@ -72,6 +81,9 @@
 			cpu-idle-states = <&CPU_SLEEP_0>;
 			next-level-cache = <&L2_0>;
 			#cooling-cells = <2>;
+			clocks = <&apcs_glb>;
+			operating-points-v2 = <&cpu_opp_table>;
+			cpu-supply = <&pms405_s3>;
 		};
 
 		L2_0: l2-cache {
@@ -94,6 +106,24 @@
 		};
 	};
 
+	cpu_opp_table: cpu-opp-table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-1094400000 {
+			opp-hz = /bits/ 64 <1094400000>;
+			opp-microvolt = <1224000 1224000 1224000>;
+		};
+		opp-1248000000 {
+			opp-hz = /bits/ 64 <1248000000>;
+			opp-microvolt = <1288000 1288000 1288000>;
+		};
+		opp-1401600000 {
+			opp-hz = /bits/ 64 <1401600000>;
+			opp-microvolt = <1384000 1384000 1384000>;
+		};
+	};
+
 	firmware {
 		scm: scm {
 			compatible = "qcom,scm-qcs404", "qcom,scm";
-- 
2.23.0


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

* [PATCH v2 5/5] arm64: defconfig: Enable HFPLL
  2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
                   ` (3 preceding siblings ...)
  2019-11-25 14:25 ` [PATCH v2 4/5] arm64: dts: qcom: qcs404: Add DVFS support Niklas Cassel
@ 2019-11-25 14:25 ` Niklas Cassel
  4 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2019-11-25 14:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-msm, amit.kucheria, bjorn.andersson,
	Jorge Ramirez-Ortiz, Niklas Cassel, Catalin Marinas, Will Deacon,
	linux-arm-kernel

From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

The high frequency pll is required on compatible Qualcomm SoCs to
support the CPU frequency scaling feature.

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
-None

 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7fa92defb964..e76b42b25dd6 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -727,6 +727,7 @@ CONFIG_MSM_GCC_8998=y
 CONFIG_QCS_GCC_404=y
 CONFIG_SDM_GCC_845=y
 CONFIG_SM_GCC_8150=y
+CONFIG_QCOM_HFPLL=y
 CONFIG_HWSPINLOCK=y
 CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_ARM_MHU=y
-- 
2.23.0


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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 14:25 [PATCH v2 0/5] DTS changes to support cpufreq on QCS404 Niklas Cassel
2019-11-25 14:25 ` [PATCH v2 1/5] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Niklas Cassel
2019-11-25 14:25 ` [PATCH v2 2/5] arm64: dts: qcom: qcs404: Add HFPLL node Niklas Cassel
2019-11-25 14:25 ` [PATCH v2 3/5] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Niklas Cassel
2019-11-25 14:25 ` [PATCH v2 4/5] arm64: dts: qcom: qcs404: Add DVFS support Niklas Cassel
2019-11-25 14:25 ` [PATCH v2 5/5] arm64: defconfig: Enable HFPLL Niklas Cassel

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git