[PATCH resend 1/1] Timers: prevent conflict between ARM Generic Timer and Timer drivers
Marius Dinu
m95d+git at psihoexpert.ro
Mon Mar 16 21:03:54 CET 2026
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.
Signed-off-by: Marius Dinu <m95d+git at psihoexpert.ro>
---
arch/arm/Kconfig | 2 ++
drivers/timer/Kconfig | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3db5474a05b..534a649d521 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index f9511503b02..3be8bfe9e42 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -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
--
2.52.0
More information about the U-Boot
mailing list