~postmarketos/upstreaming

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
18 5

[PATCH 0/7] Add CPU frequency scaling support for MSM8226

Details
Message ID
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu>
DKIM signature
pass
Download raw message
Apart from a bunch of bindings updates, add support for the a7pll found
on the SoC and wire up everything in the dtsi. And finally switch over
to using apcs via mbox interface to stop using the apcs via syscon.

Only a limited list of CPU frequencies are supported for now, higher
ones require speedbin support which I plan to work on after this lands.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
Luca Weiss (7):
      dt-bindings: mailbox: qcom: add compatible for MSM8226 SoC
      dt-bindings: clock: qcom,a53pll: Allow opp-table subnode
      dt-bindings: clock: qcom,a53pll: Add msm8226-a7pll compatible
      clk: qcom: a53-pll: Add MSM8226 a7pll support
      ARM: dts: qcom: msm8226: Add CPU frequency scaling support
      ARM: dts: qcom: msm8226: Hook up CPU cooling
      ARM: dts: qcom: msm8226: Convert APCS usages to mbox interface

 .../devicetree/bindings/clock/qcom,a53pll.yaml     |   4 +
 .../bindings/mailbox/qcom,apcs-kpss-global.yaml    |   1 +
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi           | 134 ++++++++++++++++++++-
 drivers/clk/qcom/a53-pll.c                         |   1 +
 4 files changed, 134 insertions(+), 6 deletions(-)
---
base-commit: 0efa3123a1658dbafdace0bfcdcc4f34eebc7f9f
change-id: 20240619-msm8226-cpufreq-788b0bf0256a

Best regards,
-- 
Luca Weiss <luca@lucaweiss.eu>

[PATCH 2/7] dt-bindings: clock: qcom,a53pll: Allow opp-table subnode

Details
Message ID
<20240619-msm8226-cpufreq-v1-2-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +3 -0
Allow placing an opp-table as a subnode that can be assigned using
operating-points-v2 to specify the frequency table for the PLL.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 Documentation/devicetree/bindings/clock/qcom,a53pll.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
index 5ca927a8b1d5..8cd73a623ef5 100644
--- a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
@@ -40,6 +40,9 @@ properties:

  operating-points-v2: true

  opp-table:
    type: object

required:
  - compatible
  - reg

-- 
2.45.2

[PATCH 1/7] dt-bindings: mailbox: qcom: add compatible for MSM8226 SoC

Details
Message ID
<20240619-msm8226-cpufreq-v1-1-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +1 -0
Add the mailbox compatible for MSM8226 SoC.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
index 982c741e6225..dc75ea2383f1 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
@@ -25,6 +25,7 @@ properties:
          - const: qcom,ipq6018-apcs-apps-global
      - items:
          - enum:
              - qcom,msm8226-apcs-kpss-global
              - qcom,qcs404-apcs-apps-global
          - const: qcom,msm8916-apcs-kpss-global
          - const: syscon

-- 
2.45.2

[PATCH 3/7] dt-bindings: clock: qcom,a53pll: Add msm8226-a7pll compatible

Details
Message ID
<20240619-msm8226-cpufreq-v1-3-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +1 -0
Add the compatible for the A7PLL found in MSM8226 SoCs.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 Documentation/devicetree/bindings/clock/qcom,a53pll.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
index 8cd73a623ef5..47ceab641a4c 100644
--- a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml
@@ -21,6 +21,7 @@ properties:
      - qcom,ipq6018-a53pll
      - qcom,ipq8074-a53pll
      - qcom,ipq9574-a73pll
      - qcom,msm8226-a7pll
      - qcom,msm8916-a53pll
      - qcom,msm8939-a53pll


-- 
2.45.2

[PATCH 5/7] ARM: dts: qcom: msm8226: Add CPU frequency scaling support

Details
Message ID
<20240619-msm8226-cpufreq-v1-5-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +100 -3
Add a node for the a7pll with its frequencies. With this we can use the
apcs-kpss-global driver for the apcs node and use the apcs to scale the
CPU frequency according to the opp-table.

At the same time unfortunately we need to provide the gcc node xo_board
instead of the XO via rpmcc since otherwise we'll have a circular
dependency between apcs, gcc and the rpm.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 103 ++++++++++++++++++++++++++++++-
 1 file changed, 100 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
index 270973e85625..6e9fbe2e7223 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
@@ -44,6 +44,8 @@ CPU0: cpu@0 {
			device_type = "cpu";
			reg = <0>;
			next-level-cache = <&L2>;
			clocks = <&apcs>;
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc0>;
			qcom,saw = <&saw0>;
		};
@@ -54,6 +56,8 @@ CPU1: cpu@1 {
			device_type = "cpu";
			reg = <1>;
			next-level-cache = <&L2>;
			clocks = <&apcs>;
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc1>;
			qcom,saw = <&saw1>;
		};
@@ -64,6 +68,8 @@ CPU2: cpu@2 {
			device_type = "cpu";
			reg = <2>;
			next-level-cache = <&L2>;
			clocks = <&apcs>;
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc2>;
			qcom,saw = <&saw2>;
		};
@@ -74,6 +80,8 @@ CPU3: cpu@3 {
			device_type = "cpu";
			reg = <3>;
			next-level-cache = <&L2>;
			clocks = <&apcs>;
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc3>;
			qcom,saw = <&saw3>;
		};
@@ -98,6 +106,29 @@ memory@0 {
		reg = <0x0 0x0>;
	};

	cpu_opp_table: opp-table-cpu {
		compatible = "operating-points-v2";
		opp-shared;

		opp-300000000 {
			opp-hz = /bits/ 64 <300000000>;
		};

		opp-384000000 {
			opp-hz = /bits/ 64 <384000000>;
		};

		opp-600000000 {
			opp-hz = /bits/ 64 <600000000>;
		};

		opp-787200000 {
			opp-hz = /bits/ 64 <787200000>;
		};

		/* Higher CPU frequencies need speedbin support */
	};

	pmu {
		compatible = "arm,cortex-a7-pmu";
		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
@@ -231,9 +262,75 @@ intc: interrupt-controller@f9000000 {
			#interrupt-cells = <3>;
		};

		apcs: syscon@f9011000 {
			compatible = "syscon";
		apcs: mailbox@f9011000 {
			compatible = "qcom,msm8226-apcs-kpss-global",
				     "qcom,msm8916-apcs-kpss-global", "syscon";
			reg = <0xf9011000 0x1000>;
			#mbox-cells = <1>;
			clocks = <&a7pll>, <&gcc GPLL0_VOTE>;
			clock-names = "pll", "aux";
			#clock-cells = <0>;
		};

		a7pll: clock@f9016000 {
			compatible = "qcom,msm8226-a7pll";
			reg = <0xf9016000 0x40>;
			#clock-cells = <0>;
			clocks = <&xo_board>;
			clock-names = "xo";
			operating-points-v2 = <&a7pll_opp_table>;

			a7pll_opp_table: opp-table {
				compatible = "operating-points-v2";

				opp-768000000 {
					opp-hz = /bits/ 64 <768000000>;
				};

				opp-787200000 {
					opp-hz = /bits/ 64 <787200000>;
				};

				opp-998400000 {
					opp-hz = /bits/ 64 <998400000>;
				};

				opp-1094400000 {
					opp-hz = /bits/ 64 <1094400000>;
				};

				opp-1190400000 {
					opp-hz = /bits/ 64 <1190400000>;
				};

				opp-1305600000 {
					opp-hz = /bits/ 64 <1305600000>;
				};

				opp-1344000000 {
					opp-hz = /bits/ 64 <1344000000>;
				};

				opp-1401600000 {
					opp-hz = /bits/ 64 <1401600000>;
				};

				opp-1497600000 {
					opp-hz = /bits/ 64 <1497600000>;
				};

				opp-1593600000 {
					opp-hz = /bits/ 64 <1593600000>;
				};

				opp-1689600000 {
					opp-hz = /bits/ 64 <1689600000>;
				};

				opp-1785600000 {
					opp-hz = /bits/ 64 <1785600000>;
				};
			};
		};

		saw_l2: power-manager@f9012000 {
@@ -571,7 +668,7 @@ gcc: clock-controller@fc400000 {
			#reset-cells = <1>;
			#power-domain-cells = <1>;

			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>,
			clocks = <&xo_board>,
				 <&sleep_clk>;
			clock-names = "xo",
				      "sleep_clk";

-- 
2.45.2

[PATCH 6/7] ARM: dts: qcom: msm8226: Hook up CPU cooling

Details
Message ID
<20240619-msm8226-cpufreq-v1-6-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +25 -0
Add cooling-maps for the CPU thermal zones so the driver can actually do
something when the CPU temperature rises too much.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
index 6e9fbe2e7223..9deee34fc5ca 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
@@ -12,6 +12,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,gcc-msm8974.h>
#include <dt-bindings/thermal/thermal.h>

/ {
	#address-cells = <1>;
@@ -48,6 +49,7 @@ CPU0: cpu@0 {
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc0>;
			qcom,saw = <&saw0>;
			#cooling-cells = <2>;
		};

		CPU1: cpu@1 {
@@ -60,6 +62,7 @@ CPU1: cpu@1 {
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc1>;
			qcom,saw = <&saw1>;
			#cooling-cells = <2>;
		};

		CPU2: cpu@2 {
@@ -72,6 +75,7 @@ CPU2: cpu@2 {
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc2>;
			qcom,saw = <&saw2>;
			#cooling-cells = <2>;
		};

		CPU3: cpu@3 {
@@ -84,6 +88,7 @@ CPU3: cpu@3 {
			operating-points-v2 = <&cpu_opp_table>;
			qcom,acc = <&acc3>;
			qcom,saw = <&saw3>;
			#cooling-cells = <2>;
		};

		L2: l2-cache {
@@ -1256,6 +1261,16 @@ cpu0-thermal {

			thermal-sensors = <&tsens 5>;

			cooling-maps {
				map0 {
					trip = <&cpu_alert0>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};

			trips {
				cpu_alert0: trip0 {
					temperature = <75000>;
@@ -1277,6 +1292,16 @@ cpu1-thermal {

			thermal-sensors = <&tsens 2>;

			cooling-maps {
				map0 {
					trip = <&cpu_alert1>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};

			trips {
				cpu_alert1: trip0 {
					temperature = <75000>;

-- 
2.45.2

[PATCH 4/7] clk: qcom: a53-pll: Add MSM8226 a7pll support

Details
Message ID
<20240619-msm8226-cpufreq-v1-4-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +1 -0
The MSM8226 has one PLL for its Cortex-A7 cores. The frequencies will be
specified in devicetree.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 drivers/clk/qcom/a53-pll.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/qcom/a53-pll.c b/drivers/clk/qcom/a53-pll.c
index f9c5e296dba2..f43d455ab4b8 100644
--- a/drivers/clk/qcom/a53-pll.c
+++ b/drivers/clk/qcom/a53-pll.c
@@ -151,6 +151,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev)
}

static const struct of_device_id qcom_a53pll_match_table[] = {
	{ .compatible = "qcom,msm8226-a7pll" },
	{ .compatible = "qcom,msm8916-a53pll" },
	{ .compatible = "qcom,msm8939-a53pll" },
	{ }

-- 
2.45.2

[PATCH 7/7] ARM: dts: qcom: msm8226: Convert APCS usages to mbox interface

Details
Message ID
<20240619-msm8226-cpufreq-v1-7-85143f5291d1@lucaweiss.eu>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
Patch: +3 -3
Since we now have the apcs set up as a mailbox provider, let's use the
interface for all drivers where possible.

Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
index 9deee34fc5ca..5c1122f93054 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
@@ -157,7 +157,7 @@ master-stats {

		smd-edge {
			interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
			qcom,ipc = <&apcs 8 0>;
			mboxes = <&apcs 0>;
			qcom,smd-edge = <15>;

			rpm_requests: rpm-requests {
@@ -235,7 +235,7 @@ smp2p-adsp {
		interrupt-parent = <&intc>;
		interrupts = <GIC_SPI 158 IRQ_TYPE_EDGE_RISING>;

		qcom,ipc = <&apcs 8 10>;
		mboxes = <&apcs 10>;

		qcom,local-pid = <0>;
		qcom,remote-pid = <2>;
@@ -1232,7 +1232,7 @@ adsp: remoteproc@fe200000 {
			smd-edge {
				interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;

				qcom,ipc = <&apcs 8 8>;
				mboxes = <&apcs 8>;
				qcom,smd-edge = <1>;

				label = "lpass";

-- 
2.45.2

Re: [PATCH 1/7] dt-bindings: mailbox: qcom: add compatible for MSM8226 SoC

Krzysztof Kozlowski <krzk@kernel.org>
Details
Message ID
<84f21651-14d5-4394-b37c-00f87f494782@kernel.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-1-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19/06/2024 23:02, Luca Weiss wrote:
> Add the mailbox compatible for MSM8226 SoC.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

Re: [PATCH 3/7] dt-bindings: clock: qcom,a53pll: Add msm8226-a7pll compatible

Krzysztof Kozlowski <krzk@kernel.org>
Details
Message ID
<30bc3417-afda-4ec5-bfc2-2dbebc805027@kernel.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-3-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19/06/2024 23:02, Luca Weiss wrote:
> Add the compatible for the A7PLL found in MSM8226 SoCs.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

Re: [PATCH 2/7] dt-bindings: clock: qcom,a53pll: Allow opp-table subnode

Krzysztof Kozlowski <krzk@kernel.org>
Details
Message ID
<20bd14a0-bdfb-4fd3-912a-d28ab43b4db2@kernel.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-2-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19/06/2024 23:02, Luca Weiss wrote:
> Allow placing an opp-table as a subnode that can be assigned using
> operating-points-v2 to specify the frequency table for the PLL.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---
>  Documentation/devicetree/bindings/clock/qcom,a53pll.yaml | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

Re: [PATCH 5/7] ARM: dts: qcom: msm8226: Add CPU frequency scaling support

Details
Message ID
<2dr3dyqu3epnrdpot3iwatkwq4uxgcmkoh7mzru2pet6xllarr@izq6mmyquffk>
In-Reply-To
<20240619-msm8226-cpufreq-v1-5-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On Wed, Jun 19, 2024 at 11:02:49PM GMT, Luca Weiss wrote:
> Add a node for the a7pll with its frequencies. With this we can use the
> apcs-kpss-global driver for the apcs node and use the apcs to scale the
> CPU frequency according to the opp-table.
> 
> At the same time unfortunately we need to provide the gcc node xo_board
> instead of the XO via rpmcc since otherwise we'll have a circular
> dependency between apcs, gcc and the rpm.

But it should be fine, isn't it? Clock controllers can handle orphaned
clocks.

The xo_board is really a hack and should eventually be removed.

> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---

-- 
With best wishes
Dmitry

Re: [PATCH 6/7] ARM: dts: qcom: msm8226: Hook up CPU cooling

Details
Message ID
<c2lknbesy7yamql6e2kwksmctjjodvzmksmvbophn7ze66n7vw@amb4kuy4qw7n>
In-Reply-To
<20240619-msm8226-cpufreq-v1-6-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On Wed, Jun 19, 2024 at 11:02:50PM GMT, Luca Weiss wrote:
> Add cooling-maps for the CPU thermal zones so the driver can actually do
> something when the CPU temperature rises too much.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---
>  arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry

Re: [PATCH 7/7] ARM: dts: qcom: msm8226: Convert APCS usages to mbox interface

Details
Message ID
<pfltjzuqsyetcjcseoaopkhvljfduwmldyx2rtcrhpwbkhkstc@dqw63ajpq37n>
In-Reply-To
<20240619-msm8226-cpufreq-v1-7-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On Wed, Jun 19, 2024 at 11:02:51PM GMT, Luca Weiss wrote:
> Since we now have the apcs set up as a mailbox provider, let's use the
> interface for all drivers where possible.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---
>  arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry

Re: [PATCH 5/7] ARM: dts: qcom: msm8226: Add CPU frequency scaling support

Details
Message ID
<3116757.mvXUDI8C0e@g550jk>
In-Reply-To
<2dr3dyqu3epnrdpot3iwatkwq4uxgcmkoh7mzru2pet6xllarr@izq6mmyquffk> (view parent)
DKIM signature
pass
Download raw message
On Donnerstag, 20. Juni 2024 22:54:37 MESZ Dmitry Baryshkov wrote:
> On Wed, Jun 19, 2024 at 11:02:49PM GMT, Luca Weiss wrote:
> > Add a node for the a7pll with its frequencies. With this we can use the
> > apcs-kpss-global driver for the apcs node and use the apcs to scale the
> > CPU frequency according to the opp-table.
> > 
> > At the same time unfortunately we need to provide the gcc node xo_board
> > instead of the XO via rpmcc since otherwise we'll have a circular
> > dependency between apcs, gcc and the rpm.
> 
> But it should be fine, isn't it? Clock controllers can handle orphaned
> clocks.
> 
> The xo_board is really a hack and should eventually be removed.

I can check again what happened but pretty sure there were some issues with
this still being rpmcc.

But there were also some clock issues with apcs-as-syscon usage (that's
the main reason for my influx of patches regarding this topic), so maybe
with the apcs one solved that one's also fine.

I'll check again!

> 
> > 
> > Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> > ---
> 
> 

Re: [PATCH 5/7] ARM: dts: qcom: msm8226: Add CPU frequency scaling support

Details
Message ID
<6e7e7b44-3c06-42ce-9d9b-9dcc83387657@linaro.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-5-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19.06.2024 11:02 PM, Luca Weiss wrote:
> Add a node for the a7pll with its frequencies. With this we can use the
> apcs-kpss-global driver for the apcs node and use the apcs to scale the
> CPU frequency according to the opp-table.
> 
> At the same time unfortunately we need to provide the gcc node xo_board
> instead of the XO via rpmcc since otherwise we'll have a circular
> dependency between apcs, gcc and the rpm.

Hm.. thinking of a solution to that, should we maybe split the mux/clk
part of APCS into a subnode and bind the clk device to that?

Dmitry, Bjorn, thoughts?

[...]
> +
> +		opp-600000000 {

Can't find this one in the random msm-3.10 I have

> +			opp-hz = /bits/ 64 <600000000>;
> +		};
> +
> +		opp-787200000 {
> +			opp-hz = /bits/ 64 <787200000>;
> +		};
> +
> +		/* Higher CPU frequencies need speedbin support */

1190400 kHz seems to also be a supported-across-the-board one.. unless the
watch edition shuffled things around with a newer tree


> +	};
> +
>  	pmu {
>  		compatible = "arm,cortex-a7-pmu";
>  		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
> @@ -231,9 +262,75 @@ intc: interrupt-controller@f9000000 {
>  			#interrupt-cells = <3>;
>  		};
>  
> -		apcs: syscon@f9011000 {
> -			compatible = "syscon";
> +		apcs: mailbox@f9011000 {
> +			compatible = "qcom,msm8226-apcs-kpss-global",
> +				     "qcom,msm8916-apcs-kpss-global", "syscon";
>  			reg = <0xf9011000 0x1000>;
> +			#mbox-cells = <1>;
> +			clocks = <&a7pll>, <&gcc GPLL0_VOTE>;
> +			clock-names = "pll", "aux";
> +			#clock-cells = <0>;
> +		};
> +
> +		a7pll: clock@f9016000 {
> +			compatible = "qcom,msm8226-a7pll";
> +			reg = <0xf9016000 0x40>;
> +			#clock-cells = <0>;
> +			clocks = <&xo_board>;
> +			clock-names = "xo";
> +			operating-points-v2 = <&a7pll_opp_table>;
> +
> +			a7pll_opp_table: opp-table {
> +				compatible = "operating-points-v2";
> +
> +				opp-768000000 {
> +					opp-hz = /bits/ 64 <768000000>;
> +				};

Looks like scaling this PLL should also scale some voltage domains:
CPR (fed by pm8226_s2) and MX

Perhaps hook up MX to this one for now and add CPR to the CPU nodes( & OPP table)
after that is brought up

Konrad

Re: [PATCH 6/7] ARM: dts: qcom: msm8226: Hook up CPU cooling

Details
Message ID
<a7cd32a6-4689-4bb4-b211-b8dab5caa0a5@linaro.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-6-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19.06.2024 11:02 PM, Luca Weiss wrote:
> Add cooling-maps for the CPU thermal zones so the driver can actually do
> something when the CPU temperature rises too much.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---

Very cool, thanks

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

Re: [PATCH 7/7] ARM: dts: qcom: msm8226: Convert APCS usages to mbox interface

Details
Message ID
<2fcf909c-10c5-41b4-9962-d085e7e2bf5c@linaro.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-7-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On 19.06.2024 11:02 PM, Luca Weiss wrote:
> Since we now have the apcs set up as a mailbox provider, let's use the
> interface for all drivers where possible.
> 
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

Re: (subset) [PATCH 0/7] Add CPU frequency scaling support for MSM8226

Bjorn Andersson <andersson@kernel.org>
Details
Message ID
<172375444799.1011236.3821270590230686544.b4-ty@kernel.org>
In-Reply-To
<20240619-msm8226-cpufreq-v1-0-85143f5291d1@lucaweiss.eu> (view parent)
DKIM signature
pass
Download raw message
On Wed, 19 Jun 2024 23:02:44 +0200, Luca Weiss wrote:
> Apart from a bunch of bindings updates, add support for the a7pll found
> on the SoC and wire up everything in the dtsi. And finally switch over
> to using apcs via mbox interface to stop using the apcs via syscon.
> 
> Only a limited list of CPU frequencies are supported for now, higher
> ones require speedbin support which I plan to work on after this lands.
> 
> [...]

Applied, thanks!

[5/7] ARM: dts: qcom: msm8226: Add CPU frequency scaling support
      commit: 02f2ddaa1a78cbebd4255f78260781b404225170
[6/7] ARM: dts: qcom: msm8226: Hook up CPU cooling
      commit: 807dfab845209062e4d268157cfbf0ba46652df7
[7/7] ARM: dts: qcom: msm8226: Convert APCS usages to mbox interface
      commit: c47dd4a87160fd604577aca41ca8b3391b5c5d3e

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Reply to thread Export thread (mbox)