Ulf Magnusson | bd6e044 | 2019-11-01 13:45:29 +0100 | [diff] [blame] | 1 | # Clock controller driver configuration options |
| 2 | |
Vinayak Chettimada | 5843e8d | 2016-09-14 19:45:18 +0200 | [diff] [blame] | 3 | # Copyright (c) 2016 Nordic Semiconductor ASA |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
Vinayak Chettimada | 5843e8d | 2016-09-14 19:45:18 +0200 | [diff] [blame] | 5 | |
Thomas Stenersen | db90e24 | 2019-02-21 16:02:16 +0100 | [diff] [blame] | 6 | config 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 Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 13 | menuconfig CLOCK_CONTROL_NRF |
| 14 | bool "NRF Clock controller support" |
Alberto Escolar Piedras | cba2f29 | 2018-10-03 16:36:02 +0200 | [diff] [blame] | 15 | depends on SOC_COMPATIBLE_NRF |
Rubin Gerritsen | bf5d48a | 2020-12-14 13:46:35 +0100 | [diff] [blame] | 16 | select NRFX_CLOCK if !CLOCK_CONTROL_NRF_FORCE_ALT |
Thomas Stenersen | a3fc1a1 | 2019-02-21 15:53:29 +0100 | [diff] [blame] | 17 | default y |
Vinayak Chettimada | 5843e8d | 2016-09-14 19:45:18 +0200 | [diff] [blame] | 18 | help |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 19 | Enable support for the Nordic Semiconductor nRFxx series SoC clock |
Vinayak Chettimada | 5843e8d | 2016-09-14 19:45:18 +0200 | [diff] [blame] | 20 | driver. |
| 21 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 22 | if CLOCK_CONTROL_NRF |
Vinayak Kariappa Chettimada | 23c9210 | 2018-07-09 11:15:48 +0200 | [diff] [blame] | 23 | |
Krzysztof Chruscinski | 04e770b | 2020-04-01 11:27:46 +0200 | [diff] [blame] | 24 | config CLOCK_CONTROL_NRF_SHELL |
| 25 | bool "Shell commands" |
| 26 | depends on SHELL |
| 27 | default y if SHELL |
| 28 | |
Thomas Stenersen | 923658a | 2019-02-21 16:00:20 +0100 | [diff] [blame] | 29 | choice CLOCK_CONTROL_NRF_SOURCE |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 30 | prompt "32KHz clock source" |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 31 | default CLOCK_CONTROL_NRF_K32SRC_XTAL |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 32 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 33 | config CLOCK_CONTROL_NRF_K32SRC_RC |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 34 | bool "RC Oscillator" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 35 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 36 | config CLOCK_CONTROL_NRF_K32SRC_XTAL |
Krzysztof Chruscinski | dcaead6 | 2020-08-06 08:38:00 +0200 | [diff] [blame] | 37 | select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED if !SOC_SERIES_BSIM_NRFXX |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 38 | bool "Crystal Oscillator" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 39 | |
Krzysztof Chruscinski | d2291c4 | 2019-04-15 08:04:42 +0200 | [diff] [blame] | 40 | config CLOCK_CONTROL_NRF_K32SRC_SYNTH |
| 41 | depends on !SOC_SERIES_NRF91X |
| 42 | bool "Synthesized from HFCLK" |
| 43 | |
Krzysztof Chruscinski | c661cc6 | 2019-07-02 07:40:42 +0200 | [diff] [blame] | 44 | config CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING |
| 45 | depends on SOC_SERIES_NRF52X |
Krzysztof Chruscinski | dcaead6 | 2020-08-06 08:38:00 +0200 | [diff] [blame] | 46 | select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED |
Krzysztof Chruscinski | c661cc6 | 2019-07-02 07:40:42 +0200 | [diff] [blame] | 47 | bool "External low swing" |
| 48 | |
| 49 | config CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING |
| 50 | depends on SOC_SERIES_NRF52X |
Krzysztof Chruscinski | dcaead6 | 2020-08-06 08:38:00 +0200 | [diff] [blame] | 51 | select NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED |
Krzysztof Chruscinski | c661cc6 | 2019-07-02 07:40:42 +0200 | [diff] [blame] | 52 | bool "External full swing" |
| 53 | |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 54 | endchoice |
| 55 | |
Krzysztof Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 56 | config CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION |
Krzysztof Chruscinski | dc9d373 | 2020-06-03 11:10:14 +0200 | [diff] [blame] | 57 | bool "Enable LF clock calibration" |
Rubin Gerritsen | 2a95e9a | 2020-12-14 14:00:57 +0100 | [diff] [blame] | 58 | depends on !SOC_SERIES_NRF91X && CLOCK_CONTROL_NRF_K32SRC_RC |
Krzysztof Chruscinski | dc9d373 | 2020-06-03 11:10:14 +0200 | [diff] [blame] | 59 | default n if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS |
Rubin Gerritsen | 2a95e9a | 2020-12-14 14:00:57 +0100 | [diff] [blame] | 60 | default y |
Krzysztof Chruscinski | dc9d373 | 2020-06-03 11:10:14 +0200 | [diff] [blame] | 61 | 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 Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 65 | |
| 66 | if CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION |
| 67 | |
Krzysztof Chruscinski | 6f01c0b | 2020-02-03 12:58:30 +0100 | [diff] [blame] | 68 | config 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 Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 75 | config CLOCK_CONTROL_NRF_CALIBRATION_PERIOD |
Krzysztof Chruscinski | a36a478 | 2020-02-07 13:27:13 +0100 | [diff] [blame] | 76 | int "Calibration opportunity period in milliseconds" |
| 77 | default 4000 |
Vinayak Kariappa Chettimada | 23c9210 | 2018-07-09 11:15:48 +0200 | [diff] [blame] | 78 | help |
Krzysztof Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 79 | 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 | |
| 86 | config 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 | |
| 97 | config 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 | |
| 104 | config CLOCK_CONTROL_NRF_CALIBRATION_DEBUG |
David B. Kinder | 241044f | 2019-10-28 16:17:17 -0700 | [diff] [blame] | 105 | bool "Calibration instrumentation" |
Krzysztof Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 106 | help |
| 107 | Enables retrieving debug information like number of performed or |
| 108 | skipped calibrations. |
| 109 | |
| 110 | config CLOCK_CONTROL_NRF_USES_TEMP_SENSOR |
| 111 | bool |
Andrzej Głąbek | f766a3e | 2020-05-25 10:31:08 +0000 | [diff] [blame] | 112 | depends on HAS_HW_NRF_TEMP |
Krzysztof Chruscinski | 6700f2f | 2019-06-26 13:27:31 +0200 | [diff] [blame] | 113 | 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 | |
| 118 | endif # CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION |
Vinayak Kariappa Chettimada | 23c9210 | 2018-07-09 11:15:48 +0200 | [diff] [blame] | 119 | |
Thomas Stenersen | 923658a | 2019-02-21 16:00:20 +0100 | [diff] [blame] | 120 | choice CLOCK_CONTROL_NRF_ACCURACY |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 121 | prompt "32KHz clock accuracy" |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 122 | default CLOCK_CONTROL_NRF_K32SRC_500PPM if CLOCK_CONTROL_NRF_K32SRC_RC |
| 123 | default CLOCK_CONTROL_NRF_K32SRC_20PPM |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 124 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 125 | config CLOCK_CONTROL_NRF_K32SRC_500PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 126 | bool "251 ppm to 500 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 127 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 128 | config CLOCK_CONTROL_NRF_K32SRC_250PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 129 | bool "151 ppm to 250 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 130 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 131 | config CLOCK_CONTROL_NRF_K32SRC_150PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 132 | bool "101 ppm to 150 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 133 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 134 | config CLOCK_CONTROL_NRF_K32SRC_100PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 135 | bool "76 ppm to 100 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 136 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 137 | config CLOCK_CONTROL_NRF_K32SRC_75PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 138 | bool "51 ppm to 75 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 139 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 140 | config CLOCK_CONTROL_NRF_K32SRC_50PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 141 | bool "31 ppm to 50 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 142 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 143 | config CLOCK_CONTROL_NRF_K32SRC_30PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 144 | bool "21 ppm to 30 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 145 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 146 | config CLOCK_CONTROL_NRF_K32SRC_20PPM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 147 | bool "0 ppm to 20 ppm" |
Vinayak Chettimada | 13534db | 2016-11-05 05:11:43 +0100 | [diff] [blame] | 148 | |
| 149 | endchoice |
Vinayak Kariappa Chettimada | 23c9210 | 2018-07-09 11:15:48 +0200 | [diff] [blame] | 150 | |
Ioannis Glaropoulos | 302a746b | 2019-01-15 09:49:17 +0100 | [diff] [blame] | 151 | endif # CLOCK_CONTROL_NRF |