drivers/timer/apic_tsc: use ICR as a fallback timeout event source

This adds support for the local APIC in one-shot mode as the timeout
event source for those cases where the CPU supports invariant TSC but
no TSC deadline capability. It is presented as another timer choice.
Existing Kconfig symbols were preserved to minimize board config
disturbance.

This hybrid approach was implemented kind of backward in the apic_timer
driver but it is far cleaner to carry this here.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2024-05-23 17:27:18 -04:00 committed by Henrik Brix Andersen
commit 3c2e57c923
9 changed files with 100 additions and 25 deletions

View file

@ -16,6 +16,8 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
if APIC_TIMER
config APIC_TIMER_IRQ
default 24
endif
if APIC_TIMER_TSC
config APIC_TIMER_TSC_M
default 3
config APIC_TIMER_TSC_N

View file

@ -27,6 +27,8 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
if APIC_TIMER
config APIC_TIMER_IRQ
default 24
endif
if APIC_TIMER_TSC
config APIC_TIMER_TSC_M
default 3
config APIC_TIMER_TSC_N

View file

@ -17,6 +17,8 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
if APIC_TIMER
config APIC_TIMER_IRQ
default 24
endif
if APIC_TIMER_TSC
config APIC_TIMER_TSC_M
default 3
config APIC_TIMER_TSC_N

View file

@ -18,6 +18,8 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
if APIC_TIMER
config APIC_TIMER_IRQ
default 24
endif
if APIC_TIMER_TSC
config APIC_TIMER_TSC_M
default 3
config APIC_TIMER_TSC_N

View file

@ -19,6 +19,8 @@ if APIC_TIMER
config APIC_TIMER_IRQ
default 24
endif
if APIC_TIMER_TSC
config APIC_TIMER_TSC_M
default 3
config APIC_TIMER_TSC_N