* [PATCH 0/2] Fix CPU and GPU clocks on RK3576
@ 2025-03-10 9:59 Nicolas Frattaroli
2025-03-10 9:59 ` [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks Nicolas Frattaroli
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Nicolas Frattaroli @ 2025-03-10 9:59 UTC (permalink / raw)
To: Jonas Karlman, Sebastian Reichel, Heiko Stuebner,
Detlev Casanova, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Liang Chen, Elaine Zhang,
Finley Xiao, Yifeng Zhao
Cc: kernel, linux-clk, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Nicolas Frattaroli
As Jonas Karlman pointed out on the #linux-rockchip IRC channel on
Libera yesterday, mainline has once again chosen a different set of
clock IDs compared to downstream, with hugely detrimental effects to
mainline's ability to use SCMI for clock operations. This is because
TF-A will use the downstream IDs, and when we reclock things through
SCMI, TF-A will get the wrong clock ID from us.
So this series adds the three relevant clock IDs to the bindings in
patch 1, and then uses them in the SoC .dtsi in patch 2. That way, we
actually get functional GPU reclocking, and cpufreq will work as well.
As a bonus, we no longer change random unrelated clocks all over the
place, and it seems somewhat miraculous this didn't blow up in our faces
in a much bigger way before this.
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
Nicolas Frattaroli (2):
dt-bindings: clock: rk3576: add SCMI clocks
arm64: dts: rockchip: fix RK3576 SCMI clock IDs
arch/arm64/boot/dts/rockchip/rk3576.dtsi | 18 +++++++++---------
include/dt-bindings/clock/rockchip,rk3576-cru.h | 5 +++++
2 files changed, 14 insertions(+), 9 deletions(-)
---
base-commit: f064b0a4aa5f2bc61c9611a23a7fc83855751626
change-id: 20250310-rk3576-scmi-clocks-a30655d70a72
Best regards,
--
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks
2025-03-10 9:59 [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Nicolas Frattaroli
@ 2025-03-10 9:59 ` Nicolas Frattaroli
2025-03-11 19:49 ` Rob Herring (Arm)
2025-03-10 9:59 ` [PATCH 2/2] arm64: dts: rockchip: fix RK3576 SCMI clock IDs Nicolas Frattaroli
2025-03-12 7:46 ` [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Heiko Stuebner
2 siblings, 1 reply; 5+ messages in thread
From: Nicolas Frattaroli @ 2025-03-10 9:59 UTC (permalink / raw)
To: Jonas Karlman, Sebastian Reichel, Heiko Stuebner,
Detlev Casanova, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Liang Chen, Elaine Zhang,
Finley Xiao, Yifeng Zhao
Cc: kernel, linux-clk, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Nicolas Frattaroli
Mainline Linux uses different clock IDs from both downstream and
mainline TF-A, which both got them from downstream Linux. If we want to
control clocks through SCMI, we'll need to know about these IDs.
Add the relevant ones prefixed with SCMI_ to the header.
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
include/dt-bindings/clock/rockchip,rk3576-cru.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/dt-bindings/clock/rockchip,rk3576-cru.h b/include/dt-bindings/clock/rockchip,rk3576-cru.h
index 25aed298ac2c2e2d37e2b441c9d92ac68801be6e..f576e61bec7041455e10ac18c92f3b33ec0760e3 100644
--- a/include/dt-bindings/clock/rockchip,rk3576-cru.h
+++ b/include/dt-bindings/clock/rockchip,rk3576-cru.h
@@ -589,4 +589,9 @@
#define PCLK_EDP_S 569
#define ACLK_KLAD 570
+/* SCMI clocks, use these when changing clocks through SCMI */
+#define SCMI_ARMCLK_L 10
+#define SCMI_ARMCLK_B 11
+#define SCMI_CLK_GPU 456
+
#endif
--
2.48.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: fix RK3576 SCMI clock IDs
2025-03-10 9:59 [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Nicolas Frattaroli
2025-03-10 9:59 ` [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks Nicolas Frattaroli
@ 2025-03-10 9:59 ` Nicolas Frattaroli
2025-03-12 7:46 ` [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Heiko Stuebner
2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Frattaroli @ 2025-03-10 9:59 UTC (permalink / raw)
To: Jonas Karlman, Sebastian Reichel, Heiko Stuebner,
Detlev Casanova, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Liang Chen, Elaine Zhang,
Finley Xiao, Yifeng Zhao
Cc: kernel, linux-clk, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Nicolas Frattaroli
Downstream Linux, and consequently both downstream and mainline TF-A,
all use a different set of clock IDs from mainline Linux. If we want to
fiddle with these clocks through SCMI, we'll need to use the right IDs.
If we don't do this we'll end up changing unrelated clocks all over the
place.
Change the clock IDs to the newly added SCMI clock IDs for the CPU and
GPU nodes, which are currently the only ones using SCMI clocks. This
fixes the terrible GPU performance, as we weren't reclocking it
properly.
Fixes: 57b1ce903966 ("arm64: dts: rockchip: Add rk3576 SoC base DT")
Reported-by: Jonas Karlman <jonas@kwiboo.se>
Closes: https://libera.irclog.whitequark.org/linux-rockchip/2025-03-09#1741542223-1741542875;
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
arch/arm64/boot/dts/rockchip/rk3576.dtsi | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
index 8591065b575223a5eb2da70f723f16969aa2ecf7..1fddf298795e5c914a76d9779b6f8563ee15c8e3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
@@ -111,7 +111,7 @@ cpu_l0: cpu@0 {
reg = <0x0>;
enable-method = "psci";
capacity-dmips-mhz = <485>;
- clocks = <&scmi_clk ARMCLK_L>;
+ clocks = <&scmi_clk SCMI_ARMCLK_L>;
operating-points-v2 = <&cluster0_opp_table>;
#cooling-cells = <2>;
dynamic-power-coefficient = <120>;
@@ -124,7 +124,7 @@ cpu_l1: cpu@1 {
reg = <0x1>;
enable-method = "psci";
capacity-dmips-mhz = <485>;
- clocks = <&scmi_clk ARMCLK_L>;
+ clocks = <&scmi_clk SCMI_ARMCLK_L>;
operating-points-v2 = <&cluster0_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -135,7 +135,7 @@ cpu_l2: cpu@2 {
reg = <0x2>;
enable-method = "psci";
capacity-dmips-mhz = <485>;
- clocks = <&scmi_clk ARMCLK_L>;
+ clocks = <&scmi_clk SCMI_ARMCLK_L>;
operating-points-v2 = <&cluster0_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -146,7 +146,7 @@ cpu_l3: cpu@3 {
reg = <0x3>;
enable-method = "psci";
capacity-dmips-mhz = <485>;
- clocks = <&scmi_clk ARMCLK_L>;
+ clocks = <&scmi_clk SCMI_ARMCLK_L>;
operating-points-v2 = <&cluster0_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -157,7 +157,7 @@ cpu_b0: cpu@100 {
reg = <0x100>;
enable-method = "psci";
capacity-dmips-mhz = <1024>;
- clocks = <&scmi_clk ARMCLK_B>;
+ clocks = <&scmi_clk SCMI_ARMCLK_B>;
operating-points-v2 = <&cluster1_opp_table>;
#cooling-cells = <2>;
dynamic-power-coefficient = <320>;
@@ -170,7 +170,7 @@ cpu_b1: cpu@101 {
reg = <0x101>;
enable-method = "psci";
capacity-dmips-mhz = <1024>;
- clocks = <&scmi_clk ARMCLK_B>;
+ clocks = <&scmi_clk SCMI_ARMCLK_B>;
operating-points-v2 = <&cluster1_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -181,7 +181,7 @@ cpu_b2: cpu@102 {
reg = <0x102>;
enable-method = "psci";
capacity-dmips-mhz = <1024>;
- clocks = <&scmi_clk ARMCLK_B>;
+ clocks = <&scmi_clk SCMI_ARMCLK_B>;
operating-points-v2 = <&cluster1_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -192,7 +192,7 @@ cpu_b3: cpu@103 {
reg = <0x103>;
enable-method = "psci";
capacity-dmips-mhz = <1024>;
- clocks = <&scmi_clk ARMCLK_B>;
+ clocks = <&scmi_clk SCMI_ARMCLK_B>;
operating-points-v2 = <&cluster1_opp_table>;
cpu-idle-states = <&CPU_SLEEP>;
};
@@ -932,7 +932,7 @@ power-domain@RK3576_PD_VO1 {
gpu: gpu@27800000 {
compatible = "rockchip,rk3576-mali", "arm,mali-bifrost";
reg = <0x0 0x27800000 0x0 0x200000>;
- assigned-clocks = <&scmi_clk CLK_GPU>;
+ assigned-clocks = <&scmi_clk SCMI_CLK_GPU>;
assigned-clock-rates = <198000000>;
clocks = <&cru CLK_GPU>;
clock-names = "core";
--
2.48.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks
2025-03-10 9:59 ` [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks Nicolas Frattaroli
@ 2025-03-11 19:49 ` Rob Herring (Arm)
0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2025-03-11 19:49 UTC (permalink / raw)
To: Nicolas Frattaroli
Cc: linux-rockchip, Elaine Zhang, Finley Xiao, Sebastian Reichel,
Heiko Stuebner, Liang Chen, kernel, devicetree, linux-arm-kernel,
Yifeng Zhao, Detlev Casanova, Stephen Boyd, Krzysztof Kozlowski,
Jonas Karlman, linux-kernel, linux-clk, Michael Turquette,
Conor Dooley
On Mon, 10 Mar 2025 10:59:56 +0100, Nicolas Frattaroli wrote:
> Mainline Linux uses different clock IDs from both downstream and
> mainline TF-A, which both got them from downstream Linux. If we want to
> control clocks through SCMI, we'll need to know about these IDs.
>
> Add the relevant ones prefixed with SCMI_ to the header.
>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> ---
> include/dt-bindings/clock/rockchip,rk3576-cru.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Fix CPU and GPU clocks on RK3576
2025-03-10 9:59 [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Nicolas Frattaroli
2025-03-10 9:59 ` [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks Nicolas Frattaroli
2025-03-10 9:59 ` [PATCH 2/2] arm64: dts: rockchip: fix RK3576 SCMI clock IDs Nicolas Frattaroli
@ 2025-03-12 7:46 ` Heiko Stuebner
2 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2025-03-12 7:46 UTC (permalink / raw)
To: Jonas Karlman, Sebastian Reichel, Detlev Casanova,
Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Liang Chen, Elaine Zhang,
Finley Xiao, Yifeng Zhao, Nicolas Frattaroli
Cc: Heiko Stuebner, kernel, linux-clk, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel
On Mon, 10 Mar 2025 10:59:55 +0100, Nicolas Frattaroli wrote:
> As Jonas Karlman pointed out on the #linux-rockchip IRC channel on
> Libera yesterday, mainline has once again chosen a different set of
> clock IDs compared to downstream, with hugely detrimental effects to
> mainline's ability to use SCMI for clock operations. This is because
> TF-A will use the downstream IDs, and when we reclock things through
> SCMI, TF-A will get the wrong clock ID from us.
>
> [...]
Applied, thanks!
[1/2] dt-bindings: clock: rk3576: add SCMI clocks
commit: 33a409dd1fc8be5ef8f33ebed76856c4cbc5bc15
[2/2] arm64: dts: rockchip: fix RK3576 SCMI clock IDs
commit: 825f48a12e597e7556768088b74f3384840df5e6
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-12 7:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-10 9:59 [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Nicolas Frattaroli
2025-03-10 9:59 ` [PATCH 1/2] dt-bindings: clock: rk3576: add SCMI clocks Nicolas Frattaroli
2025-03-11 19:49 ` Rob Herring (Arm)
2025-03-10 9:59 ` [PATCH 2/2] arm64: dts: rockchip: fix RK3576 SCMI clock IDs Nicolas Frattaroli
2025-03-12 7:46 ` [PATCH 0/2] Fix CPU and GPU clocks on RK3576 Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®