linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property
@ 2019-08-26 16:48 Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 2/6] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Jorge Ramirez-Ortiz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

When the APCS clock is registered (platform dependent), it retrieves
its parent names from hardcoded values in the driver.

The following commit allows the DT node to provide such clock names to
the platform data based clock driver therefore avoiding having to
explicitly embed those names in the clock driver 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: Rob Herring <robh@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 .../mailbox/qcom,apcs-kpss-global.txt         | 24 ++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
index 1232fc9fc709..b69310322b09 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
@@ -18,10 +18,11 @@ platforms.
 	Usage: required
 	Value type: <prop-encoded-array>
 	Definition: must specify the base address and size of the global block
+
 - clocks:
-	Usage: required if #clocks-cells property is present
-	Value type: <phandle>
-	Definition: phandle to the input PLL, which feeds the APCS mux/divider
+	Usage: required if #clock-names property is present
+	Value type: <phandle array>
+	Definition: phandles to the two parent clocks of the clock driver.
 
 - #mbox-cells:
 	Usage: required
@@ -33,6 +34,12 @@ platforms.
 	Value type: <u32>
 	Definition: as described in clock.txt, must be 0
 
+- clock-names:
+	Usage: required if the platform data based clock driver needs to
+	retrieve the parent clock names from device tree.
+	This will requires two mandatory clocks to be defined.
+	Value type: <string-array>
+	Definition: must be "aux" and "pll"
 
 = EXAMPLE
 The following example describes the APCS HMSS found in MSM8996 and part of the
@@ -65,3 +72,14 @@ Below is another example of the APCS binding on MSM8916 platforms:
 		clocks = <&a53pll>;
 		#clock-cells = <0>;
 	};
+
+Below is another example of the APCS binding on QCS404 platforms:
+
+	apcs_glb: mailbox@b011000 {
+		compatible = "qcom,qcs404-apcs-apps-global", "syscon";
+		reg = <0x0b011000 0x1000>;
+		#mbox-cells = <1>;
+		clocks = <&gcc GCC_GPLL0_AO_OUT_MAIN>, <&apcs_hfpll>;
+		clock-names = "aux", "pll";
+		#clock-cells = <0>;
+	};
-- 
2.22.0


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

* [PATCH 2/6] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
@ 2019-08-26 16:48 ` Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 3/6] arm64: dts: qcom: qcs404: Add HFPLL node Jorge Ramirez-Ortiz
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

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>
---
 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 5ea9fb8f2f87..96dc7a12aa94 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 = <&gcc GPLL0_VOTE>, <&a53pll>;
+			clock-names = "aux", "pll";
 			#clock-cells = <0>;
 		};
 
-- 
2.22.0


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

* [PATCH 3/6] arm64: dts: qcom: qcs404: Add HFPLL node
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 2/6] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Jorge Ramirez-Ortiz
@ 2019-08-26 16:48 ` Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 4/6] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Jorge Ramirez-Ortiz
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

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>
---
 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 a97eeb4569c0..75ea356a3fb0 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -869,6 +869,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";
+		};
+
 		timer@b120000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
-- 
2.22.0


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

* [PATCH 4/6] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 2/6] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 3/6] arm64: dts: qcom: qcs404: Add HFPLL node Jorge Ramirez-Ortiz
@ 2019-08-26 16:48 ` Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 5/6] arm64: dts: qcom: qcs404: Add DVFS support Jorge Ramirez-Ortiz
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

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>
---
 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 75ea356a3fb0..34360b2d3e0d 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -867,6 +867,9 @@
 			compatible = "qcom,qcs404-apcs-apps-global", "syscon";
 			reg = <0x0b011000 0x1000>;
 			#mbox-cells = <1>;
+			clocks = <&gcc GCC_GPLL0_AO_OUT_MAIN>, <&apcs_hfpll>;
+			clock-names = "aux", "pll";
+			#clock-cells = <0>;
 		};
 
 		apcs_hfpll: clock-controller@b016000 {
-- 
2.22.0


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

* [PATCH 5/6] arm64: dts: qcom: qcs404: Add DVFS support
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
                   ` (2 preceding siblings ...)
  2019-08-26 16:48 ` [PATCH 4/6] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Jorge Ramirez-Ortiz
@ 2019-08-26 16:48 ` Jorge Ramirez-Ortiz
  2019-08-26 16:48 ` [PATCH 6/6] arm64: defconfig: Enable HFPLL Jorge Ramirez-Ortiz
  2019-09-05  7:30 ` [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

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>
---
 arch/arm64/boot/dts/qcom/qcs404.dtsi | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 34360b2d3e0d..e425e54e1af9 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -36,6 +36,10 @@
 			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 {
@@ -46,6 +50,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 {
@@ -56,6 +63,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 {
@@ -66,6 +76,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 {
@@ -88,6 +101,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.22.0


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

* [PATCH 6/6] arm64: defconfig: Enable HFPLL
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
                   ` (3 preceding siblings ...)
  2019-08-26 16:48 ` [PATCH 5/6] arm64: dts: qcom: qcs404: Add DVFS support Jorge Ramirez-Ortiz
@ 2019-08-26 16:48 ` Jorge Ramirez-Ortiz
  2019-09-05  7:30 ` [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez-Ortiz @ 2019-08-26 16:48 UTC (permalink / raw)
  To: jorge.ramirez-ortiz, bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

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>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 74f82901aa2d..af13602c3987 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -703,6 +703,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.22.0


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

* Re: [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property
  2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
                   ` (4 preceding siblings ...)
  2019-08-26 16:48 ` [PATCH 6/6] arm64: defconfig: Enable HFPLL Jorge Ramirez-Ortiz
@ 2019-09-05  7:30 ` Jorge Ramirez
  5 siblings, 0 replies; 7+ messages in thread
From: Jorge Ramirez @ 2019-09-05  7:30 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, agross, mark.rutland
  Cc: niklas.cassel, linux-arm-msm, devicetree, linux-kernel

On 8/26/19 18:48, Jorge Ramirez-Ortiz wrote:
> When the APCS clock is registered (platform dependent), it retrieves
> its parent names from hardcoded values in the driver.
> 
> The following commit allows the DT node to provide such clock names to
> the platform data based clock driver therefore avoiding having to
> explicitly embed those names in the clock driver 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: Rob Herring <robh@kernel.org>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  .../mailbox/qcom,apcs-kpss-global.txt         | 24 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
> index 1232fc9fc709..b69310322b09 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt
> @@ -18,10 +18,11 @@ platforms.
>  	Usage: required
>  	Value type: <prop-encoded-array>
>  	Definition: must specify the base address and size of the global block
> +
>  - clocks:
> -	Usage: required if #clocks-cells property is present
> -	Value type: <phandle>
> -	Definition: phandle to the input PLL, which feeds the APCS mux/divider
> +	Usage: required if #clock-names property is present
> +	Value type: <phandle array>
> +	Definition: phandles to the two parent clocks of the clock driver.
>  
>  - #mbox-cells:
>  	Usage: required
> @@ -33,6 +34,12 @@ platforms.
>  	Value type: <u32>
>  	Definition: as described in clock.txt, must be 0
>  
> +- clock-names:
> +	Usage: required if the platform data based clock driver needs to
> +	retrieve the parent clock names from device tree.
> +	This will requires two mandatory clocks to be defined.
> +	Value type: <string-array>
> +	Definition: must be "aux" and "pll"
>  
>  = EXAMPLE
>  The following example describes the APCS HMSS found in MSM8996 and part of the
> @@ -65,3 +72,14 @@ Below is another example of the APCS binding on MSM8916 platforms:
>  		clocks = <&a53pll>;
>  		#clock-cells = <0>;
>  	};
> +
> +Below is another example of the APCS binding on QCS404 platforms:
> +
> +	apcs_glb: mailbox@b011000 {
> +		compatible = "qcom,qcs404-apcs-apps-global", "syscon";
> +		reg = <0x0b011000 0x1000>;
> +		#mbox-cells = <1>;
> +		clocks = <&gcc GCC_GPLL0_AO_OUT_MAIN>, <&apcs_hfpll>;
> +		clock-names = "aux", "pll";
> +		#clock-cells = <0>;
> +	};
> 

just a quick follow up, is this series being picked-up?


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

end of thread, other threads:[~2019-09-05  7:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 16:48 [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez-Ortiz
2019-08-26 16:48 ` [PATCH 2/6] arm64: dts: qcom: msm8916: Add the clocks for the APCS mux/divider Jorge Ramirez-Ortiz
2019-08-26 16:48 ` [PATCH 3/6] arm64: dts: qcom: qcs404: Add HFPLL node Jorge Ramirez-Ortiz
2019-08-26 16:48 ` [PATCH 4/6] arm64: dts: qcom: qcs404: Add the clocks for APCS mux/divider Jorge Ramirez-Ortiz
2019-08-26 16:48 ` [PATCH 5/6] arm64: dts: qcom: qcs404: Add DVFS support Jorge Ramirez-Ortiz
2019-08-26 16:48 ` [PATCH 6/6] arm64: defconfig: Enable HFPLL Jorge Ramirez-Ortiz
2019-09-05  7:30 ` [PATCH 1/6] dt-bindings: mailbox: qcom: Add clock-name optional property Jorge Ramirez

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).