Skip to contentSkip to conversation

SCMI clocks on RK356x

PATCH Applied Heiko Stuebner 3 participants 10 messages Nov 3, 2025 – Nov 5, 2025

Subsystems (3)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

cover SCMI clocks on RK356x

This cleans up the existing use of SCMI clocks on the RK356x SoCs.

Heiko Stuebner (3):
dt-bindings: clock: rk3568: Add SCMI clock ids
arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x
arm64: dts: rockchip: add missing clocks for cpu cores on rk356

 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 5 ++++-
 include/dt-bindings/clock/rk3568-cru.h        | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.47.2
author maintainer
#1 lore raw

PATCH 1/3 dt-bindings: clock: rk3568: Add SCMI clock ids

The Trusted Firmware on RK3568 exposes 3 clocks via the SCMI clock interface. Add descriptive IDs for them.

The clock ids are used in both the older vendor-binary TF-A, as well as the recently merged upstream SCMI clock implementation.

---
 include/dt-bindings/clock/rk3568-cru.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/dt-bindings/clock/rk3568-cru.h +6 -0
index f01f0e9ce8f1..1e0aef8a645d 100644
@@ -483,6 +483,12 @@
 
 #define PCLK_CORE_PVTM		450
 
+/* scmi-clocks indices */
+
+#define SCMI_CLK_CPU		0
+#define SCMI_CLK_GPU		1
+#define SCMI_CLK_NPU		2
+
 /* pmu soft-reset indices */
 /* pmucru_softrst_con0 */
 #define SRST_P_PDPMU_NIU	0
Signature · 1 line
2.47.2
Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] dt-bindings: clock: rk3568: Add SCMI clock ids

In reply to Heiko Stuebner
Quoted 17 lines · Heiko Stuebner

The Trusted Firmware on RK3568 exposes 3 clocks via the SCMI clock interface. Add descriptive IDs for them.

The clock ids are used in both the older vendor-binary TF-A, as well as the recently merged upstream SCMI clock implementation.

---
 include/dt-bindings/clock/rk3568-cru.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/dt-bindings/clock/rk3568-cru.h +0 -0
index f01f0e9ce8f1..1e0aef8a645d 100644

include/dt-bindings/clock/rk3568-cru.h line 491

Quoted 9 lines
include/dt-bindings/clock/rk3568-cru.h +6 -0
@@ -483,6 +483,12 @@
 
 #define PCLK_CORE_PVTM		450
 
+/* scmi-clocks indices */
+
+#define SCMI_CLK_CPU		0
+#define SCMI_CLK_GPU		1
+#define SCMI_CLK_NPU		2
+

This corresponds with the id's in ``clock_table`` in TF-A's ``plat/rockchip/rk3568/drivers/scmi/rk3568_clk.c`` file, so

Quoted 3 lines
include/dt-bindings/clock/rk3568-cru.h +0 -0
 /* pmu soft-reset indices */
 /* pmucru_softrst_con0 */
 #define SRST_P_PDPMU_NIU	0
author maintainer
#4 lore raw

PATCH 2/3 arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x

In reply to Heiko Stuebner

Instead of hard-coding 0, use the more descriptive ID from the binding to reference the SCMI clock for the cpu on rk356x.

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +1 -1
index a3361527d4fe..d0c76401b45e 100644
@@ -53,7 +53,7 @@ cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x0>;
-			clocks = <&scmi_clk 0>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
Signature · 1 line
2.47.2
Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x

Hi Heiko,

Quoted 2 lines · Heiko Stuebner

Instead of hard-coding 0, use the more descriptive ID from the binding to reference the SCMI clock for the cpu on rk356x.

Any particular reason you only did it for the cpu, but not the gpu?

Quoted 10 lines
---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +0 -0
index a3361527d4fe..d0c76401b45e 100644

arch/arm64/boot/dts/rockchip/rk356x-base.dtsi cpu0: cpu@0 { · line 56

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +1 -1
@@ -53,7 +53,7 @@ cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x0>;
-			clocks = <&scmi_clk 0>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;

Regardless of the above comment, feel free to add

Cheers,
Diederik

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +0 -0
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
author maintainer
#6 lore raw

Re: [PATCH 2/3] arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x

Am Mittwoch, 5. November 2025, 14:16:42 Mitteleuropäische Normalzeit schrieb Diederik de Haas:

Quoted 7 lines

Hi Heiko,

Quoted 2 lines · Heiko Stuebner

Instead of hard-coding 0, use the more descriptive ID from the binding to reference the SCMI clock for the cpu on rk356x.

Any particular reason you only did it for the cpu, but not the gpu?

Didn't think of if at the time :-) .

Will prepare another one for the GPU.

Heiko

Quoted 29 lines
Quoted 11 lines
---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +0 -0
index a3361527d4fe..d0c76401b45e 100644

arch/arm64/boot/dts/rockchip/rk356x-base.dtsi cpu0: cpu@0 { · line 56

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +1 -1
@@ -53,7 +53,7 @@ cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x0>;
-			clocks = <&scmi_clk 0>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;

Regardless of the above comment, feel free to add

Cheers,
Diederik

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +0 -0
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
author maintainer
#7 lore raw

PATCH 3/3 arm64: dts: rockchip: add missing clocks for cpu cores on rk356x

In reply to Heiko Stuebner

All cpu cores are supplied by the same clock, but all except the first core are missing that clocks reference - add the missing ones.

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +3 -0
index d0c76401b45e..a1815f8a96e1 100644
@@ -69,6 +69,7 @@ cpu1: cpu@100 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x100>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
@@ -84,6 +85,7 @@ cpu2: cpu@200 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x200>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
@@ -99,6 +101,7 @@ cpu3: cpu@300 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x300>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
Signature · 1 line
2.47.2
Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] arm64: dts: rockchip: add missing clocks for cpu cores on rk356x

Quoted 2 lines · Heiko Stuebner

All cpu cores are supplied by the same clock, but all except the first core are missing that clocks reference - add the missing ones.

I noticed it myself some time ago (but failed to sent a patch), so

Cheers,
Diederik

Quoted 33 lines
---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +3 -0
index d0c76401b45e..a1815f8a96e1 100644
@@ -69,6 +69,7 @@ cpu1: cpu@100 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x100>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
@@ -84,6 +85,7 @@ cpu2: cpu@200 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x200>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
@@ -99,6 +101,7 @@ cpu3: cpu@300 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a55";
 			reg = <0x0 0x300>;
+			clocks = <&scmi_clk SCMI_CLK_CPU>;
 			#cooling-cells = <2>;
 			enable-method = "psci";
 			i-cache-size = <0x8000>;
author maintainer Applied
#9 lore raw
In reply to Heiko Stuebner
Quoted 9 lines · Heiko Stuebner

This cleans up the existing use of SCMI clocks on the RK356x SoCs.

Heiko Stuebner (3):
dt-bindings: clock: rk3568: Add SCMI clock ids
arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x
arm64: dts: rockchip: add missing clocks for cpu cores on rk356

[...]

Applied, thanks!

[1/3] dt-bindings: clock: rk3568: Add SCMI clock ids

      commit: 88b6a93af4345e901206d0576bdb4e88ea3eaeb8
[2/3] arm64: dts: rockchip: use SCMI clock id for cpu clock on rk356x
      commit: ff8912700f31782021ec28c530de1482fa99eab3
[3/3] arm64: dts: rockchip: add missing clocks for cpu cores on rk356x
      commit: e06a419eaab9cee7cd5bbb0cfcfbe49e443a9d75

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>