realtek: Add Lexra bus clock
authorSander Vanheule <sander@svanheule.net>
Sun, 14 Nov 2021 18:45:31 +0000 (19:45 +0100)
committerStijn Tintel <stijn@linux-ipv6.be>
Wed, 24 Nov 2021 19:42:56 +0000 (21:42 +0200)
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@svanheule.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
target/linux/realtek/dts-5.10/rtl838x.dtsi
target/linux/realtek/dts-5.10/rtl930x.dtsi

index a33b6d899e2a87b8903bca190fc0c722dab8cbde..dc60e12bad0be9f407f41e9ba2324372bece69d2 100644 (file)
                bootargs = "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>;
                        compatible = "ns16550a";
                        reg = <0x2000 0x100>;
 
-                       clock-frequency = <200000000>;
+                       clocks = <&lx_clk>;
 
                        interrupt-parent = <&intc>;
                        interrupts = <31>;
                        compatible = "ns16550a";
                        reg = <0x2100 0x100>;
 
-                       clock-frequency = <200000000>;
+                       clocks = <&lx_clk>;
 
                        interrupt-parent = <&intc>;
                        interrupts = <30>;
index e53f506a956f1950b6752946d4301c5b8b2bb900..9e9501d51ad5759c582962abd0a2ee6bf538d095 100644 (file)
                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 {
                        interrupt-parent = <&intc>;
                        interrupts = <8>;
                        interrupt-names = "ostimer";
-                       clocks = <&osc 0>;
+                       clocks = <&lx_clk>;
                };
 
                spi0: spi@1200 {
                        compatible = "ns16550a";
                        reg = <0x2000 0x100>;
 
-                       clock-frequency = <175000000>;
+                       clocks = <&lx_clk>;
 
                        interrupt-parent = <&intc>;
                        interrupts = <30>;
                        compatible = "ns16550a";
                        reg = <0x2100 0x100>;
 
-                       clock-frequency = <175000000>;
+                       clocks = <&lx_clk>;
 
                        interrupt-parent = <&intc>;
                        interrupts = <31>;