blob: d5c0855b184d578ed3ef946aebb6e22e39354dce [file] [log] [blame]
Ulf Magnussonbd6e0442019-11-01 13:45:29 +01001# Clock controller driver configuration options
2
Vinayak Chettimada5843e8d2016-09-14 19:45:18 +02003# Copyright (c) 2016 Nordic Semiconductor ASA
David B. Kinderac74d8b2017-01-18 17:01:01 -08004# SPDX-License-Identifier: Apache-2.0
Vinayak Chettimada5843e8d2016-09-14 19:45:18 +02005
Thomas Stenersendb90e242019-02-21 16:02:16 +01006config CLOCK_CONTROL_NRF_FORCE_ALT
7 bool
8 depends on SOC_COMPATIBLE_NRF
9 help
10 This option can be enabled to force an alternative implementation
11 of the clock control driver.
12
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010013menuconfig CLOCK_CONTROL_NRF
14 bool "NRF Clock controller support"
Alberto Escolar Piedrascba2f292018-10-03 16:36:02 +020015 depends on SOC_COMPATIBLE_NRF
Rubin Gerritsenbf5d48a2020-12-14 13:46:35 +010016 select NRFX_CLOCK if !CLOCK_CONTROL_NRF_FORCE_ALT
Thomas Stenersena3fc1a12019-02-21 15:53:29 +010017 default y
Vinayak Chettimada5843e8d2016-09-14 19:45:18 +020018 help
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010019 Enable support for the Nordic Semiconductor nRFxx series SoC clock
Vinayak Chettimada5843e8d2016-09-14 19:45:18 +020020 driver.
21
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010022if CLOCK_CONTROL_NRF
Vinayak Kariappa Chettimada23c92102018-07-09 11:15:48 +020023
Krzysztof Chruscinski04e770b2020-04-01 11:27:46 +020024config CLOCK_CONTROL_NRF_SHELL
25 bool "Shell commands"
26 depends on SHELL
27 default y if SHELL
28
Thomas Stenersen923658a2019-02-21 16:00:20 +010029choice CLOCK_CONTROL_NRF_SOURCE
Vinayak Chettimada13534db2016-11-05 05:11:43 +010030 prompt "32KHz clock source"
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010031 default CLOCK_CONTROL_NRF_K32SRC_XTAL
Vinayak Chettimada13534db2016-11-05 05:11:43 +010032
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010033config CLOCK_CONTROL_NRF_K32SRC_RC
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020034 bool "RC Oscillator"
Vinayak Chettimada13534db2016-11-05 05:11:43 +010035
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +010036config CLOCK_CONTROL_NRF_K32SRC_XTAL
Krzysztof Chruscinskidcaead62020-08-06 08:38:00 +020037 select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED if !SOC_SERIES_BSIM_NRFXX
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020038 bool "Crystal Oscillator"
Vinayak Chettimada13534db2016-11-05 05:11:43 +010039
Krzysztof Chruscinskid2291c42019-04-15 08:04:42 +020040config CLOCK_CONTROL_NRF_K32SRC_SYNTH
41 depends on !SOC_SERIES_NRF91X
42 bool "Synthesized from HFCLK"
43
Krzysztof Chruscinskic661cc62019-07-02 07:40:42 +020044config CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING
45 depends on SOC_SERIES_NRF52X
Krzysztof Chruscinskidcaead62020-08-06 08:38:00 +020046 select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED
Krzysztof Chruscinskic661cc62019-07-02 07:40:42 +020047 bool "External low swing"
48
49config CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING
50 depends on SOC_SERIES_NRF52X
Krzysztof Chruscinskidcaead62020-08-06 08:38:00 +020051 select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED
Krzysztof Chruscinskic661cc62019-07-02 07:40:42 +020052 bool "External full swing"
53
Vinayak Chettimada13534db2016-11-05 05:11:43 +010054endchoice
55
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +020056config CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
Krzysztof Chruscinskidc9d3732020-06-03 11:10:14 +020057 bool "Enable LF clock calibration"
Rubin Gerritsen2a95e9a2020-12-14 14:00:57 +010058 depends on !SOC_SERIES_NRF91X && CLOCK_CONTROL_NRF_K32SRC_RC
Krzysztof Chruscinskidc9d3732020-06-03 11:10:14 +020059 default n if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS
Rubin Gerritsen2a95e9a2020-12-14 14:00:57 +010060 default y
Krzysztof Chruscinskidc9d3732020-06-03 11:10:14 +020061 help
62 If calibration is disabled when RC is used for low frequency clock then
63 accuracy of the low frequency clock will degrade. Disable on your own
64 risk.
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +020065
66if CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
67
Krzysztof Chruscinski6f01c0b2020-02-03 12:58:30 +010068config CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON
69 bool "LF clock is always on"
70 default y if NRF_RTC_TIMER
71 help
72 If RTC is used as system timer then LF clock is always on and handling
73 can be simplified.
74
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +020075config CLOCK_CONTROL_NRF_CALIBRATION_PERIOD
Krzysztof Chruscinskia36a4782020-02-07 13:27:13 +010076 int "Calibration opportunity period in milliseconds"
77 default 4000
Vinayak Kariappa Chettimada23c92102018-07-09 11:15:48 +020078 help
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +020079 Periodically, calibration action is performed. Action includes
80 temperature measurement followed by clock calibration. Calibration may
81 be skipped if temperature change (compared to measurement of previous
82 calibration) did not exceeded CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF
83 and number of consecutive skips did not exceeded
84 CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP.
85
86config CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP
87 int "Maximum number of calibration skips"
88 default 1
89 range 0 255
90 help
91 Calibration is skipped when temperature change since last calibration
92 was less than configured threshold. If number of consecutive skips
93 reaches configured value then calibration is performed
94 unconditionally. Set to 0 to perform calibration periodically
95 regardless of temperature change.
96
97config CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF
98 int "Temperature change triggering calibration (in 0.25 degree units)"
99 default 2
100 help
101 Calibration is triggered if the temperature has changed by at least
102 this amount since the last calibration.
103
104config CLOCK_CONTROL_NRF_CALIBRATION_DEBUG
David B. Kinder241044f2019-10-28 16:17:17 -0700105 bool "Calibration instrumentation"
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +0200106 help
107 Enables retrieving debug information like number of performed or
108 skipped calibrations.
109
110config CLOCK_CONTROL_NRF_USES_TEMP_SENSOR
111 bool
Andrzej Głąbekf766a3e2020-05-25 10:31:08 +0000112 depends on HAS_HW_NRF_TEMP
Krzysztof Chruscinski6700f2f2019-06-26 13:27:31 +0200113 default y if CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP > 0 && \
114 CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF > 0
115 select TEMP_NRF5
116 select SENSOR
117
118endif # CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
Vinayak Kariappa Chettimada23c92102018-07-09 11:15:48 +0200119
Thomas Stenersen923658a2019-02-21 16:00:20 +0100120choice CLOCK_CONTROL_NRF_ACCURACY
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100121 prompt "32KHz clock accuracy"
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100122 default CLOCK_CONTROL_NRF_K32SRC_500PPM if CLOCK_CONTROL_NRF_K32SRC_RC
123 default CLOCK_CONTROL_NRF_K32SRC_20PPM
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100124
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100125config CLOCK_CONTROL_NRF_K32SRC_500PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200126 bool "251 ppm to 500 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100127
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100128config CLOCK_CONTROL_NRF_K32SRC_250PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200129 bool "151 ppm to 250 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100130
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100131config CLOCK_CONTROL_NRF_K32SRC_150PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200132 bool "101 ppm to 150 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100133
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100134config CLOCK_CONTROL_NRF_K32SRC_100PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200135 bool "76 ppm to 100 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100136
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100137config CLOCK_CONTROL_NRF_K32SRC_75PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200138 bool "51 ppm to 75 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100139
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100140config CLOCK_CONTROL_NRF_K32SRC_50PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200141 bool "31 ppm to 50 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100142
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100143config CLOCK_CONTROL_NRF_K32SRC_30PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200144 bool "21 ppm to 30 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100145
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100146config CLOCK_CONTROL_NRF_K32SRC_20PPM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200147 bool "0 ppm to 20 ppm"
Vinayak Chettimada13534db2016-11-05 05:11:43 +0100148
149endchoice
Vinayak Kariappa Chettimada23c92102018-07-09 11:15:48 +0200150
Ioannis Glaropoulos302a746b2019-01-15 09:49:17 +0100151endif # CLOCK_CONTROL_NRF