Skip to contentSkip to conversation

arm: v7m: Allow SYS_ARCH_TIMER here

PATCH In review Tom Rini 2 participants 8 messages Aug 13, 2025 – Oct 14, 2025 Arm (32-bit)

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/2 arm: v7m: Allow SYS_ARCH_TIMER here

We have had an implementation of the generic timer found in many v7m chips since 2017, but as part of the Kconfig migration forgot to allow it as it wasn't being used at the time. Allow it to be built.

---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
index 40368abc297e..73b4aad28b50 100644
@@ -445,7 +445,7 @@ config ARCH_CPU_INIT
 
 config SYS_ARCH_TIMER
 	bool "ARM Generic Timer support"
-	depends on CPU_V7A || ARM64
+	depends on CPU_V7A || CPU_V7M || ARM64
 	default y if ARM64
 	help
 	  The ARM Generic Timer (aka arch-timer) provides an architected
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 2/2 timer: Mark this as incompatible with SYS_ARCH_TIMER

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

---
 arch/arm/Kconfig      | 1 +
 drivers/timer/Kconfig | 1 +
 2 files changed, 2 insertions(+)
arch/arm/Kconfig +1 -0
index 73b4aad28b50..0dba2e2c8567 100644
@@ -452,6 +452,7 @@ config SYS_ARCH_TIMER
 	  interface to a timer source on an SoC.
 	  It is mandatory for ARMv8 implementation and widely available
 	  on ARMv7 systems.
+	  This timer driver is incompatible with the DM timer framework.
 
 config ARM_SMCCC
 	bool "Support for ARM SMC Calling Convention (SMCCC)"
drivers/timer/Kconfig +1 -0
index cb6fc0e7fda8..2ab4d971dffa 100644
@@ -2,6 +2,7 @@ menu "Timer Support"
 
 config TIMER
 	bool "Enable driver model for timer drivers"
+	depends on !SYS_ARCH_TIMER
 	depends on DM
 	help
 	  Enable driver model for timer access. It uses the same API as
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 2/2] timer: Mark this as incompatible with SYS_ARCH_TIMER

Quoted 10 lines · Tom Rini

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

No need for credits.
I think you should keep the warning message in the Timer drivers menu. It provides a quick explanation why the menu is empty.

Bugs are reported in this mailing list too?
Thanks!

Quoted 32 lines
---
 arch/arm/Kconfig      | 1 +
 drivers/timer/Kconfig | 1 +
 2 files changed, 2 insertions(+)
arch/arm/Kconfig +1 -0
index 73b4aad28b50..0dba2e2c8567 100644
@@ -452,6 +452,7 @@ config SYS_ARCH_TIMER
 	  interface to a timer source on an SoC.
 	  It is mandatory for ARMv8 implementation and widely available
 	  on ARMv7 systems.
+	  This timer driver is incompatible with the DM timer framework.
 
 config ARM_SMCCC
 	bool "Support for ARM SMC Calling Convention (SMCCC)"
drivers/timer/Kconfig +1 -0
index cb6fc0e7fda8..2ab4d971dffa 100644
@@ -2,6 +2,7 @@ menu "Timer Support"
 
 config TIMER
 	bool "Enable driver model for timer drivers"
+	depends on !SYS_ARCH_TIMER
 	depends on DM
 	help
 	  Enable driver model for timer access. It uses the same API as
Signature · 1 line
2.43.0
author
#3 lore raw

Re: [PATCH 2/2] timer: Mark this as incompatible with SYS_ARCH_TIMER

Quoted 5 lines · Marius Dinu
Quoted 4 lines · Tom Rini

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

Quoted 8 lines
Quoted 6 lines

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

No need for credits.

OK.

Quoted 2 lines

I think you should keep the warning message in the Timer drivers menu. It provides a quick explanation why the menu is empty.

I thought about it, and we don't do anything like that for other either/or choices, and it's now in the help text itself at least. The other thing however, is that a few platforms do allow for both, because they play some games with CFG_SYS_TIMER* defines. So I'm not entirely sure what to do here.

Quoted 1 line

Bugs are reported in this mailing list too?

Yes.

Signature · 1 line
Tom
#4 lore raw

Re: [PATCH 2/2] timer: Mark this as incompatible with SYS_ARCH_TIMER

Quoted 26 lines · Tom Rini
Quoted 5 lines · Marius Dinu
Quoted 4 lines · Tom Rini

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

Quoted 8 lines
Quoted 6 lines

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

No need for credits.

OK.

Quoted 2 lines

I think you should keep the warning message in the Timer drivers menu. It provides a quick explanation why the menu is empty.

I thought about it, and we don't do anything like that for other either/or choices, and it's now in the help text itself at least. The other thing however, is that a few platforms do allow for both, because they play some games with CFG_SYS_TIMER* defines. So I'm not entirely sure what to do here.

Quoted 6 lines
Quoted 1 line

Bugs are reported in this mailing list too?

Yes.

Signature · 1 line
Tom

With the original patch I only tried to reduce the number of compilation failures. I encounter a lot. I'm no expert and I can only try to fix little things such as this one.

I belive some people (like myself) would be confused by an empty menu and would not immediately remember the SYS_ARCH_TIMER in a completely different part of menuconfig.

I tried to find configs with both CONFIG_SYS_ARCH_TIMER and CONFIG_TIMER enabled amd I couldn't find any. So it's probably OK to leave the patch as it is and exceptions, if needed, can be added later.

PS: I saw your other patches that add dependencies on platform type.
Nice work, really needed!

Marius

author
#5 lore raw

Re: [PATCH 2/2] timer: Mark this as incompatible with SYS_ARCH_TIMER

Quoted 38 lines · Marius Dinu
Quoted 26 lines · Tom Rini
Quoted 5 lines · Marius Dinu
Quoted 4 lines · Tom Rini

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

Quoted 8 lines
Quoted 6 lines

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

No need for credits.

OK.

Quoted 2 lines

I think you should keep the warning message in the Timer drivers menu. It provides a quick explanation why the menu is empty.

I thought about it, and we don't do anything like that for other either/or choices, and it's now in the help text itself at least. The other thing however, is that a few platforms do allow for both, because they play some games with CFG_SYS_TIMER* defines. So I'm not entirely sure what to do here.

Quoted 6 lines
Quoted 1 line

Bugs are reported in this mailing list too?

Yes.

Signature · 1 line
Tom

With the original patch I only tried to reduce the number of compilation failures. I encounter a lot. I'm no expert and I can only try to fix little things such as this one.

Quoted 8 lines

I belive some people (like myself) would be confused by an empty menu and would not immediately remember the SYS_ARCH_TIMER in a completely different part of menuconfig.

I tried to find configs with both CONFIG_SYS_ARCH_TIMER and CONFIG_TIMER enabled amd I couldn't find any. So it's probably OK to leave the patch as it is and exceptions, if needed, can be added later.

I haven't forgotten about this, sorry. I'm just debating with myself what's best here, because another part of the proper solution is that we should get the generic ARMv8 timer on moved to the framework too, but it's more easily said than done, but I have asked some people to look in to it.

Signature · 1 line
Tom
#6 lore raw

Re: [PATCH 2/2] timer: Mark this as incompatible with SYS_ARCH_TIMER

Quoted 48 lines · Tom Rini
Quoted 38 lines · Marius Dinu
Quoted 26 lines · Tom Rini
Quoted 5 lines · Marius Dinu
Quoted 4 lines · Tom Rini

The timers implemented under SYS_ARCH_TIMER are not part of the TIMER framework and thus cannot be enabled at the same time. Express this dependency in Kconfig and add a note to the help of SYS_ARCH_TIMER.

Quoted 8 lines
Quoted 6 lines

---
Marius, I ended up reworking things a bit (and also found part 1/2 of this series) but please let me know if you feel this should retain your Author and such instead. Thanks!

No need for credits.

OK.

Quoted 2 lines

I think you should keep the warning message in the Timer drivers menu. It provides a quick explanation why the menu is empty.

I thought about it, and we don't do anything like that for other either/or choices, and it's now in the help text itself at least. The other thing however, is that a few platforms do allow for both, because they play some games with CFG_SYS_TIMER* defines. So I'm not entirely sure what to do here.

Quoted 6 lines
Quoted 1 line

Bugs are reported in this mailing list too?

Yes.

Signature · 1 line
Tom

With the original patch I only tried to reduce the number of compilation failures. I encounter a lot. I'm no expert and I can only try to fix little things such as this one.

Quoted 8 lines

I belive some people (like myself) would be confused by an empty menu and would not immediately remember the SYS_ARCH_TIMER in a completely different part of menuconfig.

I tried to find configs with both CONFIG_SYS_ARCH_TIMER and CONFIG_TIMER enabled amd I couldn't find any. So it's probably OK to leave the patch as it is and exceptions, if needed, can be added later.

Quoted 8 lines

I haven't forgotten about this, sorry. I'm just debating with myself what's best here, because another part of the proper solution is that we should get the generic ARMv8 timer on moved to the framework too, but it's more easily said than done, but I have asked some people to look in to it.

Signature · 1 line
Tom

No hurry. Take your time.

Marius

author
#7 lore raw

Re: (subset) [PATCH 1/2] arm: v7m: Allow SYS_ARCH_TIMER here

In reply to Tom Rini
Quoted 5 lines · Tom Rini

We have had an implementation of the generic timer found in many v7m chips since 2017, but as part of the Kconfig migration forgot to allow it as it wasn't being used at the time. Allow it to be built.

Applied to u-boot/master, thanks!

[1/2] arm: v7m: Allow SYS_ARCH_TIMER here

      commit: 9de2fc9878e7a79752fab26312f9d160b4103e3e
Signature · 1 line
Tom