drivers/timer: Select tickless via driver kconfig flag

Add a TICKLESS_CAPABLE kconfig variable which is used by the kernel to
select tickless mode's default automatically on drivers that support
it (rather than having to set the default per-board).  Select it from
the ARM SysTick and Intel HPET drivers.

Also remove the old qemu_cortex_m3 default settings which this
replaces.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-10-12 06:58:21 -07:00 committed by Anas Nashif
commit c0a184c067
3 changed files with 13 additions and 8 deletions

View file

@ -7,10 +7,4 @@ config BUILD_OUTPUT_BIN
config BOARD
default "qemu_cortex_m3"
config TICKLESS_IDLE
default y
config TICKLESS_KERNEL
default y
endif # BOARD_QEMU_CORTEX_M3

View file

@ -132,6 +132,7 @@ config CORTEX_M_SYSTICK
bool "Cortex-M SYSTICK timer"
default y
depends on CPU_HAS_SYSTICK
select TICKLESS_CAPABLE
help
This module implements a kernel device driver for the Cortex-M processor
SYSTICK timer and provides the standard "system clock driver" interfaces.
@ -242,6 +243,16 @@ config SYSTEM_CLOCK_INIT_PRIORITY
the clock to be running already, you should let the default value as it
is (0).
config TICKLESS_CAPABLE
bool "Timer driver supports tickless operation"
help
Timer drivers should select this flag if they are capable of
supporting tickless operation. That is, a call to
z_clock_set_timeout() with a number of ticks greater than
one should be expected not to produce a call to
z_clock_announce() (really, not to produce an interrupt at
all) until the specified expiration.
config QEMU_TICKLESS_WORKAROUND
bool "Disable tickless on qemu due to asynchrony bug"
depends on QEMU_TARGET && TICKLESS_KERNEL

View file

@ -677,7 +677,7 @@ endmenu
config TICKLESS_IDLE
bool "Tickless idle"
default y if SYS_POWER_MANAGEMENT
default y if SYS_POWER_MANAGEMENT || TICKLESS_CAPABLE
help
This option suppresses periodic system clock interrupts whenever the
kernel becomes idle. This permits the system to remain in a power
@ -696,7 +696,7 @@ config TICKLESS_IDLE_THRESH
config TICKLESS_KERNEL
bool "Tickless kernel"
default n
default y if TICKLESS_CAPABLE
help
This option enables a fully event driven kernel. Periodic system
clock interrupt generation would be stopped at all times. This option