1# Copyright (c) 2014-2015 Wind River Systems, Inc.
2# Copyright (c) 2016 Cadence Design Systems, Inc.
3# Copyright (c) 2019 Intel Corp.
4# SPDX-License-Identifier: Apache-2.0
5
6config NRF_RTC_TIMER
7	bool "nRF Real Time Counter (NRF_RTC1) Timer"
8	depends on CLOCK_CONTROL
9	depends on SOC_COMPATIBLE_NRF
10	select TICKLESS_CAPABLE
11	select SYSTEM_TIMER_HAS_DISABLE_SUPPORT
12	depends on !$(dt_nodelabel_enabled,rtc1)
13	help
14	  This module implements a kernel device driver for the nRF Real Time
15	  Counter NRF_RTC1 and provides the standard "system clock driver"
16	  interfaces.
17
18if NRF_RTC_TIMER
19
20config NRF_RTC_TIMER_USER_CHAN_COUNT
21	int "Additional channels that can be used"
22	default 2 if NRF_802154_RADIO_DRIVER && SOC_NRF5340_CPUNET
23	default 3 if NRF_802154_RADIO_DRIVER
24	default 0
25	help
26	  Use nrf_rtc_timer.h API. Driver is not managing allocation of channels.
27
28config NRF_RTC_TIMER_LOCK_ZERO_LATENCY_IRQS
29	# hidden option
30	bool
31	depends on ZERO_LATENCY_IRQS
32	default y if !BT_LL_SW_SPLIT
33	help
34	  Enable use of __disable_irq() to disable Zero Latency IRQs to prevent
35	  higher priority contexts (including ZLIs) that might preempt the
36	  handler and call nrf_rtc_timer API from destroying the internal state
37	  in nrf_rtc_timer.
38
39config NRF_RTC_TIMER_TRIGGER_OVERFLOW
40	bool "Trigger overflow"
41	help
42	  When enabled, a function can be used to trigger RTC overflow and
43	  effectively shift time into the future.
44
45choice
46	prompt "Clock startup policy"
47	default SYSTEM_CLOCK_WAIT_FOR_STABILITY
48
49config SYSTEM_CLOCK_NO_WAIT
50	bool "No wait"
51	help
52	  System clock source is initiated but does not wait for clock readiness.
53	  When this option is picked, system clock may not be ready when code relying
54	  on kernel API is executed. Requested timeouts will be prolonged by the
55	  remaining startup time.
56
57config SYSTEM_CLOCK_WAIT_FOR_AVAILABILITY
58	bool "Wait for availability"
59	help
60	  System clock source initialization waits until clock is available. In some
61	  systems, clock initially runs from less accurate source which has faster
62	  startup time and then seamlessly switches to the target clock source when
63	  it is ready. When this option is picked, system clock is available after
64	  system clock driver initialization but it may be less accurate. Option is
65	  equivalent to waiting for stability if clock source does not have
66	  intermediate state.
67
68config SYSTEM_CLOCK_WAIT_FOR_STABILITY
69	bool "Wait for stability"
70	help
71	  System clock source initialization waits until clock is stable. When this
72	  option is picked, system clock is available and stable after system clock
73	  driver initialization.
74
75endchoice
76
77endif # NRF_RTC_TIMER
78