Skip to contentSkip to conversation

Timers: prevent conflict between ARM Generic Timer and Timer drivers

PATCH RESEND New Marius Dinu 1 participant 2 messages Mar 16 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover Timers: prevent conflict between ARM Generic Timer and Timer drivers

This patch was previously sent 2025-08-01. There was some private discussion but no decision to accept it or reject it was reached.

Marius Dinu (1):
Timers: prevent conflict between ARM Generic Timer and Timer drivers

 arch/arm/Kconfig      | 2 ++
 drivers/timer/Kconfig | 5 +++++
 2 files changed, 7 insertions(+)
Signature · 1 line
2.52.0
#1 lore raw

PATCH RESEND 1/1 Timers: prevent conflict between ARM Generic Timer and Timer drivers

Can't enable both CONFIG_SYS_ARCH_TIMER and CONFIG_TIMER_*.
This error occurs:
ld: lib/time.o: in function `get_tbclk':
/usr/src/u-boot/lib/time.c:72: multiple definition of `get_tbclk'; arch/arm/cpu/armv7/arch_timer.o:/usr/src/u-boot/arch/arm/cpu/armv7/arch_timer.c:63: first defined here
ld: lib/time.o: in function `get_ticks':
/usr/src/u-boot/lib/time.c:87: multiple definition of `get_ticks'; arch/arm/cpu/armv7/arch_timer.o:/usr/src/u-boot/arch/arm/cpu/armv7/arch_timer.c:44: first defined here

This commit makes timer drivers only available when ARM Generic Timer is not selected. If it's selected, shows a message explaining why timers aren't visible. The message should avoid the confusion that an empty Timers menu may cause.

---
 arch/arm/Kconfig      | 2 ++
 drivers/timer/Kconfig | 5 +++++
 2 files changed, 7 insertions(+)
arch/arm/Kconfig +2 -0
index 3db5474a05b..534a649d521 100644
@@ -453,6 +453,8 @@ config SYS_ARCH_TIMER
 	  It is mandatory for ARMv8 implementation and widely available
 	  on ARMv7 systems.
 
+	  Note: Timer drivers (CONFIG_TIMER) are unavailable when this timer is selected.
+
 config ARM_SMCCC
 	bool "Support for ARM SMC Calling Convention (SMCCC)"
 	depends on CPU_V7A || ARM64
drivers/timer/Kconfig +5 -0
index f9511503b02..3be8bfe9e42 100644
@@ -1,8 +1,13 @@
 menu "Timer Support"
 
+comment "Timer drivers are unavailable when ARM Generic Timer (CONFIG_SYS_ARCH_TIMER) is selected."
+	depends on DM
+	depends on SYS_ARCH_TIMER
+
 config TIMER
 	bool "Enable driver model for timer drivers"
 	depends on DM
+	depends on !SYS_ARCH_TIMER
 	help
 	  Enable driver model for timer access. It uses the same API as
 	  lib/time.c, but now implemented by the uclass. The first timer
Signature · 1 line
2.52.0