From 51794637509d5f26901d610316c581126f253660 Mon Sep 17 00:00:00 2001 From: Titan Chen Date: Mon, 14 Apr 2025 20:15:11 +0800 Subject: [PATCH] drivers: timer : fix rtmr and slow timer. RTMR use slow timer be the busy_wait timers, only ARCH_HAS_CUSTOM_BUSY_WAIT if slow timer disabled. Signed-off-by: Titan Chen --- drivers/timer/realtek_rts5912_rtmr.c | 3 +-- dts/arm/realtek/ec/rts5912.dtsi | 2 +- soc/realtek/ec/rts5912/Kconfig.defconfig.rts5912 | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/timer/realtek_rts5912_rtmr.c b/drivers/timer/realtek_rts5912_rtmr.c index 859275f3163..21e0b14ca5e 100644 --- a/drivers/timer/realtek_rts5912_rtmr.c +++ b/drivers/timer/realtek_rts5912_rtmr.c @@ -28,8 +28,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define RTMR_REG ((RTOSTMR_Type *)DT_INST_REG_ADDR(0)) -#define SLWTMR_REG \ - ((RTOSTMR_Type *)(DT_REG_ADDR(DT_COMPAT_GET_ANY_STATUS_OKAY(realtek_rts5912_slwtimer)))) +#define SLWTMR_REG ((RTOSTMR_Type *)(DT_REG_ADDR(DT_NODELABEL(slwtmr0)))) #define SSCON_REG ((SYSTEM_Type *)(DT_REG_ADDR(DT_NODELABEL(sccon)))) diff --git a/dts/arm/realtek/ec/rts5912.dtsi b/dts/arm/realtek/ec/rts5912.dtsi index bb022acbf72..236abbdb7d1 100644 --- a/dts/arm/realtek/ec/rts5912.dtsi +++ b/dts/arm/realtek/ec/rts5912.dtsi @@ -96,7 +96,7 @@ max-value = <0xFFFFFFFF>; clock-frequency = <1000000>; prescaler = <0>; - status = "okay"; + status = "disabled"; }; rtmr: rtmr@4000c500 { diff --git a/soc/realtek/ec/rts5912/Kconfig.defconfig.rts5912 b/soc/realtek/ec/rts5912/Kconfig.defconfig.rts5912 index 5ff22637497..517b5ed6bdf 100644 --- a/soc/realtek/ec/rts5912/Kconfig.defconfig.rts5912 +++ b/soc/realtek/ec/rts5912/Kconfig.defconfig.rts5912 @@ -18,6 +18,7 @@ config SYS_CLOCK_TICKS_PER_SEC config ARCH_HAS_CUSTOM_BUSY_WAIT default y + depends on !COUNTER_REALTEK_RTS5912_SLWTMR endif # REALTEK_RTS5912_RTMR