[PATCH v2 04/14] realtek: use fixed-clock as CPU clock

Sander Vanheule sander at svanheule.net
Sun Dec 12 12:01:26 PST 2021


CPU clock definition in devicetree should be specified per CPU, not in
the cpus node. This modification causes plat_init_time() to not find the
CPU frequency in the devicetree any more, but it can fall back to the
(identical) default.

Co-developed-by: INAGAKI Hiroshi <musashino.open at gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
Signed-off-by: Sander Vanheule <sander at svanheule.net>
Tested-by: Bjørn Mork <bjorn at mork.no>
---
 target/linux/realtek/dts-5.10/rtl838x.dtsi | 9 ++++++++-
 target/linux/realtek/dts-5.10/rtl930x.dtsi | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/dts-5.10/rtl838x.dtsi b/target/linux/realtek/dts-5.10/rtl838x.dtsi
index 899c1731fb51..835fc4a8f8c3 100644
--- a/target/linux/realtek/dts-5.10/rtl838x.dtsi
+++ b/target/linux/realtek/dts-5.10/rtl838x.dtsi
@@ -56,11 +56,12 @@
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		frequency = <500000000>;
 
 		cpu at 0 {
 			compatible = "mips,mips4KEc";
 			reg = <0>;
+			clocks = <&cpu_clk>;
+			clock-names = "cpu";
 		};
 	};
 
@@ -68,6 +69,12 @@
 		bootargs = "console=ttyS0,115200";
 	};
 
+	cpu_clk: cpu_clk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <500000000>;
+	};
+
 	lx_clk: lx_clk {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
diff --git a/target/linux/realtek/dts-5.10/rtl930x.dtsi b/target/linux/realtek/dts-5.10/rtl930x.dtsi
index 991e9e2f9a28..3a9b0e23c470 100644
--- a/target/linux/realtek/dts-5.10/rtl930x.dtsi
+++ b/target/linux/realtek/dts-5.10/rtl930x.dtsi
@@ -56,11 +56,12 @@
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		frequency = <800000000>;
 
 		cpu at 0 {
 			compatible = "mips,mips34Kc";
 			reg = <0>;
+			clocks = <&cpu_clk>;
+			clock-names = "cpu";
 		};
 	};
 
@@ -80,6 +81,12 @@
 		interrupt-controller;
 	};
 
+	cpu_clk: cpu_clk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency  = <800000000>;
+	};
+
 	lx_clk: lx_clk {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
-- 
2.33.1




More information about the openwrt-devel mailing list