[PATCH v3 2/5] realtek: Add Lexra bus clock

Sander Vanheule sander at svanheule.net
Sat Nov 6 07:52:47 PDT 2021


The CPU peripherals on RTL83xx/RTL930x are connected to the CPU via the
Lexra bus. This bus can provide a clock signal to these peripherals, but
no clock driver is currently available. Instead, use a fixed-clock to
provide the clock frequency, and update the dependent peripherals.

Lexra bus clock frequencies:
- RTL838x: 200MHz
- RTL839x: 200MHz
- RTL930x: 175MHz

Signed-off-by: Sander Vanheule <sander at svanheule.net>

--
v2:
- Lexra clock defintion for RTL930x, update peripherals
---
 target/linux/realtek/dts-5.10/rtl838x.dtsi | 10 ++++++++--
 target/linux/realtek/dts-5.10/rtl930x.dtsi | 11 +++++------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/dts-5.10/rtl838x.dtsi b/target/linux/realtek/dts-5.10/rtl838x.dtsi
index 52e9fe67b757..a3b15689ed24 100644
--- a/target/linux/realtek/dts-5.10/rtl838x.dtsi
+++ b/target/linux/realtek/dts-5.10/rtl838x.dtsi
@@ -69,6 +69,12 @@
 		bootargs = "earlycon console=ttyS0,115200";
 	};
 
+	lx_clk: lx_clk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <200000000>;
+	};
+
 	cpuintc: cpuintc {
 		compatible = "mti,cpu-interrupt-controller";
 		#address-cells = <0>;
@@ -117,7 +123,7 @@
 			compatible = "ns16550a";
 			reg = <0x2000 0x100>;
 
-			clock-frequency = <200000000>;
+			clocks = <&lx_clk>;
 
 			interrupt-parent = <&intc>;
 			interrupts = <31>;
@@ -135,7 +141,7 @@
 			compatible = "ns16550a";
 			reg = <0x2100 0x100>;
 
-			clock-frequency = <200000000>;
+			clocks = <&lx_clk>;
 
 			interrupt-parent = <&intc>;
 			interrupts = <30>;
diff --git a/target/linux/realtek/dts-5.10/rtl930x.dtsi b/target/linux/realtek/dts-5.10/rtl930x.dtsi
index 6207865f5b7e..cd94c880b414 100644
--- a/target/linux/realtek/dts-5.10/rtl930x.dtsi
+++ b/target/linux/realtek/dts-5.10/rtl930x.dtsi
@@ -81,11 +81,10 @@
 		interrupt-controller;
 	};
 
-	osc: oscillator {
+	lx_clk: lx_clk {
 		compatible = "fixed-clock";
-		#clock-cells = <1>;
+		#clock-cells = <0>;
 		clock-frequency  = <175000000>;
-		clock-output-names = "osc";
 	};
 
 	soc: soc {
@@ -120,7 +119,7 @@
 			interrupt-parent = <&intc>;
 			interrupts = <8>;
 			interrupt-names = "ostimer";
-			clocks = <&osc 0>;
+			clocks = <&lx_clk>;
 		};
 
 		spi0: spi at 1200 {
@@ -135,7 +134,7 @@
 			compatible = "ns16550a";
 			reg = <0x2000 0x100>;
 
-			clock-frequency = <175000000>;
+			clocks = <&lx_clk>;
 
 			interrupt-parent = <&intc>;
 			interrupts = <30>;
@@ -150,7 +149,7 @@
 			compatible = "ns16550a";
 			reg = <0x2100 0x100>;
 
-			clock-frequency = <175000000>;
+			clocks = <&lx_clk>;
 
 			interrupt-parent = <&intc>;
 			interrupts = <31>;
-- 
2.33.1




More information about the openwrt-devel mailing list