* [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi
2024-02-09 21:28 [PATCH v1 0/2] meson-axg: properly setup CPU power management Dmitry Rokosov
@ 2024-02-09 21:28 ` Dmitry Rokosov
2024-02-12 6:20 ` Viacheslav
2024-02-12 15:02 ` neil.armstrong
2024-02-09 21:28 ` [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance Dmitry Rokosov
2024-02-13 8:47 ` [PATCH v1 0/2] meson-axg: properly setup CPU power management Neil Armstrong
2 siblings, 2 replies; 7+ messages in thread
From: Dmitry Rokosov @ 2024-02-09 21:28 UTC (permalink / raw)
To: neil.armstrong, jbrunet, mturquette, adeep, robh+dt,
krzysztof.kozlowski+dt, khilman, martin.blumenstingl, conor+dt
Cc: kernel, sdfw_system_team, rockosov, linux-amlogic, devicetree,
linux-kernel, linux-arm-kernel, Dmitry Rokosov
The CPU cooling-cells property should be located in the meson-axg common
dtsi, as it is required for all AXG-based boards with DVFS.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
.../amlogic/meson-axg-jethome-jethub-j1xx.dtsi | 16 ----------------
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
index db605f3a22b4..55802fb03a46 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
@@ -332,19 +332,3 @@ &gpio {
"", "", "", "", "", // 80 - 84
"", ""; // 85-86
};
-
-&cpu0 {
- #cooling-cells = <2>;
-};
-
-&cpu1 {
- #cooling-cells = <2>;
-};
-
-&cpu2 {
- #cooling-cells = <2>;
-};
-
-&cpu3 {
- #cooling-cells = <2>;
-};
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index 7e5ac9db93f8..ea96fef328e8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -74,6 +74,7 @@ cpu0: cpu@0 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ #cooling-cells = <2>;
};
cpu1: cpu@1 {
@@ -83,6 +84,7 @@ cpu1: cpu@1 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ #cooling-cells = <2>;
};
cpu2: cpu@2 {
@@ -92,6 +94,7 @@ cpu2: cpu@2 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ #cooling-cells = <2>;
};
cpu3: cpu@3 {
@@ -101,6 +104,7 @@ cpu3: cpu@3 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ #cooling-cells = <2>;
};
l2: l2-cache0 {
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi
2024-02-09 21:28 ` [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi Dmitry Rokosov
@ 2024-02-12 6:20 ` Viacheslav
2024-02-12 15:02 ` neil.armstrong
1 sibling, 0 replies; 7+ messages in thread
From: Viacheslav @ 2024-02-12 6:20 UTC (permalink / raw)
To: linux-amlogic; +Cc: Dmitry Rokosov
10/02/2024 00.28, Dmitry Rokosov wrote:
> The CPU cooling-cells property should be located in the meson-axg common
> dtsi, as it is required for all AXG-based boards with DVFS.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> ---
> .../amlogic/meson-axg-jethome-jethub-j1xx.dtsi | 16 ----------------
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
> 2 files changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> index db605f3a22b4..55802fb03a46 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> @@ -332,19 +332,3 @@ &gpio {
> "", "", "", "", "", // 80 - 84
> "", ""; // 85-86
> };
> -
> -&cpu0 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu1 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu2 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu3 {
> - #cooling-cells = <2>;
> -};
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index 7e5ac9db93f8..ea96fef328e8 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -74,6 +74,7 @@ cpu0: cpu@0 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu1: cpu@1 {
> @@ -83,6 +84,7 @@ cpu1: cpu@1 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu2: cpu@2 {
> @@ -92,6 +94,7 @@ cpu2: cpu@2 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu3: cpu@3 {
> @@ -101,6 +104,7 @@ cpu3: cpu@3 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> l2: l2-cache0 {
Acked-by: Viacheslav Bocharov <adeep@lexina.in>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi
2024-02-09 21:28 ` [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi Dmitry Rokosov
2024-02-12 6:20 ` Viacheslav
@ 2024-02-12 15:02 ` neil.armstrong
1 sibling, 0 replies; 7+ messages in thread
From: neil.armstrong @ 2024-02-12 15:02 UTC (permalink / raw)
To: Dmitry Rokosov, jbrunet, mturquette, adeep, robh+dt,
krzysztof.kozlowski+dt, khilman, martin.blumenstingl, conor+dt
Cc: kernel, sdfw_system_team, rockosov, linux-amlogic, devicetree,
linux-kernel, linux-arm-kernel
On 09/02/2024 22:28, Dmitry Rokosov wrote:
> The CPU cooling-cells property should be located in the meson-axg common
> dtsi, as it is required for all AXG-based boards with DVFS.
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> ---
> .../amlogic/meson-axg-jethome-jethub-j1xx.dtsi | 16 ----------------
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
> 2 files changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> index db605f3a22b4..55802fb03a46 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg-jethome-jethub-j1xx.dtsi
> @@ -332,19 +332,3 @@ &gpio {
> "", "", "", "", "", // 80 - 84
> "", ""; // 85-86
> };
> -
> -&cpu0 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu1 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu2 {
> - #cooling-cells = <2>;
> -};
> -
> -&cpu3 {
> - #cooling-cells = <2>;
> -};
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index 7e5ac9db93f8..ea96fef328e8 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -74,6 +74,7 @@ cpu0: cpu@0 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu1: cpu@1 {
> @@ -83,6 +84,7 @@ cpu1: cpu@1 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu2: cpu@2 {
> @@ -92,6 +94,7 @@ cpu2: cpu@2 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> cpu3: cpu@3 {
> @@ -101,6 +104,7 @@ cpu3: cpu@3 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + #cooling-cells = <2>;
> };
>
> l2: l2-cache0 {
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance
2024-02-09 21:28 [PATCH v1 0/2] meson-axg: properly setup CPU power management Dmitry Rokosov
2024-02-09 21:28 ` [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi Dmitry Rokosov
@ 2024-02-09 21:28 ` Dmitry Rokosov
2024-02-12 15:02 ` neil.armstrong
2024-02-13 8:47 ` [PATCH v1 0/2] meson-axg: properly setup CPU power management Neil Armstrong
2 siblings, 1 reply; 7+ messages in thread
From: Dmitry Rokosov @ 2024-02-09 21:28 UTC (permalink / raw)
To: neil.armstrong, jbrunet, mturquette, adeep, robh+dt,
krzysztof.kozlowski+dt, khilman, martin.blumenstingl, conor+dt
Cc: kernel, sdfw_system_team, rockosov, linux-amlogic, devicetree,
linux-kernel, linux-arm-kernel, Dmitry Rokosov
The capacitance value is required for the usage of the cpufreq cooling
device and power_allocator thermal governor in the appropriate energy
model.
It helps to compute the power estimated by the SoC at the appropriate
frequency. If it is the frequency of an existing OPP, or at the
frequency of the first OPP above the requested value otherwise.
The power is estimated as P = C * V^2 * f, with C being the SoC's
capacitance and V and f respectively representing the voltage and
frequency of the OPP.
Since AXG SoC doesn't have SCMI protocol support, we need to initialize
capacitance using the 'dynamic-power-coefficient' DT entry. Its value is
retrieved from the vendor kernel, and it gives us the following
freq2power mapping:
+-----------+--------+
| frequency,| power, |
| MHz | uW |
+-----------+--------+
| 100 | 10354 |
+-----------+--------+
| 250 | 27104 |
+-----------+--------+
| 500 | 55447 |
+-----------+--------+
| 667 | 77327 |
+-----------+--------+
| 1000 | 129024 |
+-----------+--------+
| 1200 | 164656 |
+-----------+--------+
| 1296 | 192489 |
+-----------+--------+
| 1416 | 239870 |
+-----------+--------+
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index ea96fef328e8..6d12b760b90f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -74,6 +74,7 @@ cpu0: cpu@0 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ dynamic-power-coefficient = <140>;
#cooling-cells = <2>;
};
@@ -84,6 +85,7 @@ cpu1: cpu@1 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ dynamic-power-coefficient = <140>;
#cooling-cells = <2>;
};
@@ -94,6 +96,7 @@ cpu2: cpu@2 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ dynamic-power-coefficient = <140>;
#cooling-cells = <2>;
};
@@ -104,6 +107,7 @@ cpu3: cpu@3 {
enable-method = "psci";
next-level-cache = <&l2>;
clocks = <&scpi_dvfs 0>;
+ dynamic-power-coefficient = <140>;
#cooling-cells = <2>;
};
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance
2024-02-09 21:28 ` [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance Dmitry Rokosov
@ 2024-02-12 15:02 ` neil.armstrong
0 siblings, 0 replies; 7+ messages in thread
From: neil.armstrong @ 2024-02-12 15:02 UTC (permalink / raw)
To: Dmitry Rokosov, jbrunet, mturquette, adeep, robh+dt,
krzysztof.kozlowski+dt, khilman, martin.blumenstingl, conor+dt
Cc: kernel, sdfw_system_team, rockosov, linux-amlogic, devicetree,
linux-kernel, linux-arm-kernel
On 09/02/2024 22:28, Dmitry Rokosov wrote:
> The capacitance value is required for the usage of the cpufreq cooling
> device and power_allocator thermal governor in the appropriate energy
> model.
>
> It helps to compute the power estimated by the SoC at the appropriate
> frequency. If it is the frequency of an existing OPP, or at the
> frequency of the first OPP above the requested value otherwise.
>
> The power is estimated as P = C * V^2 * f, with C being the SoC's
> capacitance and V and f respectively representing the voltage and
> frequency of the OPP.
>
> Since AXG SoC doesn't have SCMI protocol support, we need to initialize
> capacitance using the 'dynamic-power-coefficient' DT entry. Its value is
> retrieved from the vendor kernel, and it gives us the following
> freq2power mapping:
> +-----------+--------+
> | frequency,| power, |
> | MHz | uW |
> +-----------+--------+
> | 100 | 10354 |
> +-----------+--------+
> | 250 | 27104 |
> +-----------+--------+
> | 500 | 55447 |
> +-----------+--------+
> | 667 | 77327 |
> +-----------+--------+
> | 1000 | 129024 |
> +-----------+--------+
> | 1200 | 164656 |
> +-----------+--------+
> | 1296 | 192489 |
> +-----------+--------+
> | 1416 | 239870 |
> +-----------+--------+
>
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index ea96fef328e8..6d12b760b90f 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -74,6 +74,7 @@ cpu0: cpu@0 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + dynamic-power-coefficient = <140>;
> #cooling-cells = <2>;
> };
>
> @@ -84,6 +85,7 @@ cpu1: cpu@1 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + dynamic-power-coefficient = <140>;
> #cooling-cells = <2>;
> };
>
> @@ -94,6 +96,7 @@ cpu2: cpu@2 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + dynamic-power-coefficient = <140>;
> #cooling-cells = <2>;
> };
>
> @@ -104,6 +107,7 @@ cpu3: cpu@3 {
> enable-method = "psci";
> next-level-cache = <&l2>;
> clocks = <&scpi_dvfs 0>;
> + dynamic-power-coefficient = <140>;
> #cooling-cells = <2>;
> };
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 0/2] meson-axg: properly setup CPU power management
2024-02-09 21:28 [PATCH v1 0/2] meson-axg: properly setup CPU power management Dmitry Rokosov
2024-02-09 21:28 ` [PATCH v1 1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi Dmitry Rokosov
2024-02-09 21:28 ` [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance Dmitry Rokosov
@ 2024-02-13 8:47 ` Neil Armstrong
2 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2024-02-13 8:47 UTC (permalink / raw)
To: jbrunet, mturquette, adeep, robh+dt, krzysztof.kozlowski+dt,
khilman, martin.blumenstingl, conor+dt, Dmitry Rokosov
Cc: kernel, sdfw_system_team, rockosov, linux-amlogic, devicetree,
linux-kernel, linux-arm-kernel
Hi,
On Sat, 10 Feb 2024 00:28:04 +0300, Dmitry Rokosov wrote:
> The Meson AXG leverages the SCPI ARM protocol for the management of CPU
> power, thermal, and frequency. This series addresses several issues that
> have impacted the functionality of the power_allocator thermal governor
> and cpufreq cooling devices.
>
> Dmitry Rokosov (2):
> arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi
> arm64: dts: amlogic: axg: initialize default SoC capacitance
>
> [...]
Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.9/arm64-dt)
[1/2] arm64: dts: amlogic: axg: move cpu cooling-cells to common dtsi
https://git.kernel.org/amlogic/c/7c3215fe05fe3b8faacc03245cc922c4b98075d7
[2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance
https://git.kernel.org/amlogic/c/a06d4fdec1ce800188bec15c0219d6774dd145f8
These changes has been applied on the intermediate git tree [1].
The v6.9/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.
In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].
The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.
If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
--
Neil
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 7+ messages in thread