Skip to contentSkip to conversation

Enable SMP bring-up and cpu frequency-scaling for RK3128

PATCH Applied Alex Bee 2 participants 6 messages Aug 29, 2023 – Oct 4, 2023

Subsystems (2)
lore
Share & tools
lore

Alex Bee

author
#0 lore raw

v2 cover Enable SMP bring-up and cpu frequency-scaling for RK3128

This series aims to enable bring-up of the non-boot cpu-cores by the Rockchip platsmp driver and enables cpu frequency-scaling by defining appropriate operating points.
Please see commit messages of the individual patches for details.

These patches have been part of the pretty huge RK3128 bring-up/fix-up series [0] which I've splitted-up now, as suggested.

[0] https://lore.kernel.org/linux-rockchip/[email protected]

Alex Bee (4):
ARM: dts: rockchip: Add SRAM node for RK3128
ARM: dts: rockchip: Add CPU resets for RK3128
ARM: dts: rockchip: Enable SMP bring-up for RK3128
ARM: dts: rockchip: Switch to operating-points-v2 for RK3128's CPU

 arch/arm/boot/dts/rockchip/rk3128.dtsi | 61 ++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 4 deletions(-)

base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c

Signature · 7 lines
2.42.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author
#1 lore raw

PATCH v2 1/4 ARM: dts: rockchip: Add SRAM node for RK3128

RK3128 SoCs have 8KB of SRAM.
Add the respective device tree node for it.

---
 arch/arm/boot/dts/rockchip/rk3128.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/rockchip/rk3128.dtsi +8 -0
index b63bd4ad3143..3a0856973795 100644
@@ -76,6 +76,14 @@ xin24m: oscillator {
 		#clock-cells = <0>;
 	};
 
+	imem: sram@10080000 {
+		compatible = "mmio-sram";
+		reg = <0x10080000 0x2000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x10080000 0x2000>;
+	};
+
 	pmu: syscon@100a0000 {
 		compatible = "rockchip,rk3128-pmu", "syscon", "simple-mfd";
 		reg = <0x100a0000 0x1000>;
Signature · 7 lines
2.42.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author
#2 lore raw

PATCH v2 2/4 ARM: dts: rockchip: Add CPU resets for RK3128

In reply to Alex Bee

In order to support bring-up of the non-boot cores, this patch adds the reset controls for the cpu cores.
They are required/will be used by the Rockchip platsmp driver.

---
 arch/arm/boot/dts/rockchip/rk3128.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/rockchip/rk3128.dtsi +4 -0
index 3a0856973795..2778049003a1 100644
@@ -34,6 +34,7 @@ cpu0: cpu@f00 {
 			reg = <0xf00>;
 			clock-latency = <40000>;
 			clocks = <&cru ARMCLK>;
+			resets = <&cru SRST_CORE0>;
 			operating-points = <
 				/* KHz    uV */
 				 816000 1000000
@@ -45,18 +46,21 @@ cpu1: cpu@f01 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a7";
 			reg = <0xf01>;
+			resets = <&cru SRST_CORE1>;
 		};
 
 		cpu2: cpu@f02 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a7";
 			reg = <0xf02>;
+			resets = <&cru SRST_CORE2>;
 		};
 
 		cpu3: cpu@f03 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a7";
 			reg = <0xf03>;
+			resets = <&cru SRST_CORE3>;
 		};
 	};
 
Signature · 7 lines
2.42.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author
#3 lore raw

PATCH v2 3/4 ARM: dts: rockchip: Enable SMP bring-up for RK3128

In reply to Alex Bee

For bring-up of the non-boot cpu cores the enable-method for RK3036 can be re-used.
This adds a (small) chunk of SRAM for execution of the SMP trampoline code and the respective enable-method property to the cpus.

---
 arch/arm/boot/dts/rockchip/rk3128.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/rockchip/rk3128.dtsi +6 -0
index 2778049003a1..877854dd765d 100644
@@ -27,6 +27,7 @@ arm-pmu {
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
+		enable-method = "rockchip,rk3036-smp";
 
 		cpu0: cpu@f00 {
 			device_type = "cpu";
@@ -86,6 +87,11 @@ imem: sram@10080000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0 0x10080000 0x2000>;
+
+		smp-sram@0 {
+			compatible = "rockchip,rk3066-smp-sram";
+			reg = <0x00 0x10>;
+		};
 	};
 
 	pmu: syscon@100a0000 {
Signature · 7 lines
2.42.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author
#4 lore raw

PATCH v2 4/4 ARM: dts: rockchip: Switch to operating-points-v2 for RK3128's CPU

In reply to Alex Bee

This will allow frequency-scaling for the cpu-cores. Operating frequencies and voltages have been taken from Rockchip's downstream kernel.

---
 arch/arm/boot/dts/rockchip/rk3128.dtsi | 43 +++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 4 deletions(-)
arch/arm/boot/dts/rockchip/rk3128.dtsi +39 -4
index 877854dd765d..71964262cd5f 100644
@@ -36,10 +36,7 @@ cpu0: cpu@f00 {
 			clock-latency = <40000>;
 			clocks = <&cru ARMCLK>;
 			resets = <&cru SRST_CORE0>;
-			operating-points = <
-				/* KHz    uV */
-				 816000 1000000
-			>;
+			operating-points-v2 = <&cpu_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -48,6 +45,7 @@ cpu1: cpu@f01 {
 			compatible = "arm,cortex-a7";
 			reg = <0xf01>;
 			resets = <&cru SRST_CORE1>;
+			operating-points-v2 = <&cpu_opp_table>;
 		};
 
 		cpu2: cpu@f02 {
@@ -55,6 +53,7 @@ cpu2: cpu@f02 {
 			compatible = "arm,cortex-a7";
 			reg = <0xf02>;
 			resets = <&cru SRST_CORE2>;
+			operating-points-v2 = <&cpu_opp_table>;
 		};
 
 		cpu3: cpu@f03 {
@@ -62,6 +61,42 @@ cpu3: cpu@f03 {
 			compatible = "arm,cortex-a7";
 			reg = <0xf03>;
 			resets = <&cru SRST_CORE3>;
+			operating-points-v2 = <&cpu_opp_table>;
+		};
+	};
+
+	cpu_opp_table: opp-table-0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-216000000 {
+			opp-hz = /bits/ 64 <216000000>;
+			opp-microvolt = <950000 950000 1325000>;
+		};
+		opp-408000000 {
+			opp-hz = /bits/ 64 <408000000>;
+			opp-microvolt = <950000 950000 1325000>;
+		};
+		opp-600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt = <950000 950000 1325000>;
+		};
+		opp-696000000 {
+			opp-hz = /bits/ 64 <696000000>;
+			opp-microvolt = <975000 975000 1325000>;
+		};
+		opp-816000000 {
+			opp-hz = /bits/ 64 <816000000>;
+			opp-microvolt = <1075000 1075000 1325000>;
+			opp-suspend;
+		};
+		opp-1008000000 {
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt = <1200000 1200000 1325000>;
+		};
+		opp-1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1325000 1325000 1325000>;
 		};
 	};
 
Signature · 7 lines
2.42.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
maintainer Applied
#5 lore raw
In reply to Alex Bee
Quoted 9 lines · Alex Bee

This series aims to enable bring-up of the non-boot cpu-cores by the Rockchip platsmp driver and enables cpu frequency-scaling by defining appropriate operating points.
Please see commit messages of the individual patches for details.

These patches have been part of the pretty huge RK3128 bring-up/fix-up series [0] which I've splitted-up now, as suggested.

[...]

Applied, thanks!

[1/4] ARM: dts: rockchip: Add SRAM node for RK3128

      commit: 9107283badc7d058e34ef3b60a52afe6a5e0acfb
[2/4] ARM: dts: rockchip: Add CPU resets for RK3128
      commit: 02941bc2a1bc8ea82617ba1fd4d2c0643399a9ea
[3/4] ARM: dts: rockchip: Enable SMP bring-up for RK3128
      commit: da8b973957ca03f05f78384f2bf6d79a3fce9fb0
[4/4] ARM: dts: rockchip: Switch to operating-points-v2 for RK3128's CPU
      commit: c96b13d7c0e494e1072648301e61e13a2a85a362

Best regards,

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