zephyr/drivers/timer/Kconfig.cortex_m_systick
Gerard Marull-Paretas 7d1bfb51ae drivers: timer: cortex_m_systick: improve ISR installation
A Cortex-M specific function (sys_clock_isr()) was defined as a weak
function, so in practice it was always available when system clock was
enabled, even if no Cortex-M systick was available. This patch
introduces an auxiliary Kconfig option that, when selected, the ISR
function gets installed. External SysTick drivers can also make use of
this function, thus achieving the same functionality offered today but
in a cleaner way.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00

31 lines
1.1 KiB
Plaintext

# Copyright (c) 2014-2015 Wind River Systems, Inc.
# Copyright (c) 2016 Cadence Design Systems, Inc.
# Copyright (c) 2019 Intel Corp.
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_ARM_V6M_SYSTICK := arm,armv6m-systick
DT_COMPAT_ARM_V7M_SYSTICK := arm,armv7m-systick
DT_COMPAT_ARM_V8M_SYSTICK := arm,armv8m-systick
DT_COMPAT_ARM_V8_1M_SYSTICK := arm,armv8.1m-systick
config CORTEX_M_SYSTICK
bool "Cortex-M SYSTICK timer"
depends on CPU_CORTEX_M_HAS_SYSTICK
default $(dt_compat_enabled,$(DT_COMPAT_ARM_V6M_SYSTICK)) || \
$(dt_compat_enabled,$(DT_COMPAT_ARM_V7M_SYSTICK)) || \
$(dt_compat_enabled,$(DT_COMPAT_ARM_V8M_SYSTICK)) || \
$(dt_compat_enabled,$(DT_COMPAT_ARM_V8_1M_SYSTICK))
select TICKLESS_CAPABLE
select SYSTEM_TIMER_HAS_DISABLE_SUPPORT
select CORTEX_M_SYSTICK_INSTALL_ISR
help
This module implements a kernel device driver for the Cortex-M processor
SYSTICK timer and provides the standard "system clock driver" interfaces.
config CORTEX_M_SYSTICK_INSTALL_ISR
bool
depends on CPU_CORTEX_M_HAS_SYSTICK
help
This option should be selected by SysTick-based drivers so that the
sys_clock_isr() function is installed.