| # Timer driver configuration options |
| # Copyright (c) 2024 Nordic Semiconductor ASA |
| |
| menuconfig NRF_GRTC_TIMER |
| bool "nRF GRTC Timer" |
| default y |
| depends on DT_HAS_NORDIC_NRF_GRTC_ENABLED |
| select TICKLESS_CAPABLE |
| select SYSTEM_TIMER_HAS_DISABLE_SUPPORT |
| select TIMER_HAS_64BIT_CYCLE_COUNTER |
| select NRFX_GRTC |
| help |
| This module implements a kernel device driver for the nRF Global Real |
| Time Counter NRF_GRTC and provides the standard "system clock driver" |
| interfaces. |
| |
| if NRF_GRTC_TIMER |
| |
| config NRF_GRTC_ALWAYS_ON |
| bool |
| help |
| Always keep the SYSCOUNTER active even if the CPU is in sleep mode. |
| |
| config NRF_GRTC_TIMER_APP_DEFINED_INIT |
| bool "Application defines GRTC initialization" |
| help |
| Application defines the initialization procedure and time of the GRTC |
| drivers, rather than leaving it up to SYS_INIT. |
| |
| config NRF_GRTC_START_SYSCOUNTER |
| bool "Start SYSCOUNTER on driver init" |
| select NRF_GRTC_TIMER_CLOCK_MANAGEMENT |
| help |
| Start the SYSCOUNTER when initializing the GRTC. This should only be |
| handled by one processor in the system. |
| |
| config NRF_GRTC_TIMER_CLOCK_MANAGEMENT |
| bool |
| help |
| Compile additional driver code for enabling management functionality of |
| the GRTC. Usually this is only needed by the processor that is starting |
| the SYSCOUNTER, but can be shared by multiple processors in the system. |
| |
| config NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY |
| int |
| default 1000 |
| depends on POWEROFF |
| help |
| The value (in us) ensures that the wakeup event will not fire |
| too early. In other words, applying SYSCOUNTER sleep state for less than |
| NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY period makes no sense. |
| |
| config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE |
| bool |
| default y if NRF_GRTC_START_SYSCOUNTER |
| help |
| This feature prevents the SYSCOUNTER from sleeping when any core is in |
| active state. |
| |
| if NRF_GRTC_START_SYSCOUNTER |
| |
| config NRF_GRTC_TIMER_STOP_AT_UNINIT |
| bool "Automatically stop the GRTC when uninitialized" |
| default y if !MCUBOOT |
| help |
| If enabled, the GRTC timer will be stopped automatically |
| when the driver is uninitialized (e.g. when sys_clock_disable() is called). |
| |
| config NRF_GRTC_TIMER_CLEAR_AT_UNINIT |
| bool "Automatically clear the GRTC when uninitialized" |
| default y if !MCUBOOT |
| help |
| If enabled, the GRTC timer will be cleared automatically |
| when the driver is uninitialized (e.g. when sys_clock_disable() is called). |
| |
| choice NRF_GRTC_TIMER_SOURCE |
| prompt "nRF GRTC clock source" |
| # Default to LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC for backwards compatibility |
| default NRF_GRTC_TIMER_SOURCE_LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC || \ |
| $(dt_node_str_prop_equals,$(dt_nodelabel_path,lfclk),k32src,rc) |
| # Default to LFXO if present as this allows GRTC to run in SYSTEM OFF |
| default NRF_GRTC_TIMER_SOURCE_LFXO |
| # Default to SYSTEM_LFCLK if LFXO is not present |
| default NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK |
| |
| config NRF_GRTC_TIMER_SOURCE_LFXO |
| bool "Use Low Frequency XO as clock source" |
| depends on $(dt_nodelabel_enabled,lfxo) |
| |
| config NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK |
| bool "Use System Low Frequency clock as clock source" |
| |
| config NRF_GRTC_TIMER_SOURCE_LFLPRC |
| bool "Use Low Frequency Low Power RC as clock source" |
| |
| endchoice # NRF_GRTC_TIMER_SOURCE |
| |
| endif # NRF_GRTC_START_SYSCOUNTER |
| |
| endif # NRF_GRTC_TIMER |