[openwrt/openwrt] realtek: Use Otto timer on RTL931x

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 22 14:12:29 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/83880cd01ee4db9cdf5c63d9c7fa1973366e4acc

commit 83880cd01ee4db9cdf5c63d9c7fa1973366e4acc
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Jun 22 03:53:08 2025 -0400

    realtek: Use Otto timer on RTL931x
    
    Until now the timer management on the RTL931x devices depends
    on the MIPS default timer. Looking at the clock progress on
    these devices one can see that it is totally off. It is running
    at half the required speed (e.g. if 1 minute passes the date
    command shows that according to the timers only 30 seconds have
    elapsed). This is a mix from wrong DTS and bad startup code.
    
    This is not only a cosmetic issue but has effects on every
    delay operation inside the kernel. Switch RTL931x to the proven
    Otto timer.
    
    Tested on LGS352C based on RTL9311.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/19205
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/dts/rtl931x.dtsi | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi
index c7feef4724..df85112464 100644
--- a/target/linux/realtek/dts/rtl931x.dtsi
+++ b/target/linux/realtek/dts/rtl931x.dtsi
@@ -89,12 +89,6 @@
 		 * controller & should be probed first.
 		 */
 		interrupt-parent = <&cpuintc>;
-
-		timer {
-			compatible = "mti,gic-timer";
-			interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
-			clocks = <&cpuclock>;
-		};
 	};
 
 	soc: soc {
@@ -141,6 +135,18 @@
 			interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		timer0: timer at 3200 {
+			compatible = "realtek,rtl931x-timer", "realtek,otto-timer";
+			reg = <0x3200 0x10>, <0x3210 0x10>, <0x3220 0x10>,
+			      <0x3230 0x10>, <0x3240 0x10>, <0x3250 0x10>;
+
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SHARED 0 IRQ_TYPE_LEVEL_HIGH>, <GIC_SHARED 1 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>, <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>, <GIC_SHARED 5 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&lx_clk>;
+                };
+
 		uart0: uart at 2000 {
 			compatible = "ns16550a";
 			reg = <0x2000 0x100>;




More information about the lede-commits mailing list