2019-11-01 13:45:29 +01:00
|
|
|
# Clock controller driver configuration options
|
|
|
|
|
2016-09-14 19:45:18 +02:00
|
|
|
# Copyright (c) 2016 Nordic Semiconductor ASA
|
2017-01-19 02:01:01 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-09-14 19:45:18 +02:00
|
|
|
|
2019-02-21 16:02:16 +01:00
|
|
|
config CLOCK_CONTROL_NRF_FORCE_ALT
|
|
|
|
bool
|
|
|
|
depends on SOC_COMPATIBLE_NRF
|
|
|
|
help
|
|
|
|
This option can be enabled to force an alternative implementation
|
|
|
|
of the clock control driver.
|
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
menuconfig CLOCK_CONTROL_NRF
|
|
|
|
bool "NRF Clock controller support"
|
2018-10-03 16:36:02 +02:00
|
|
|
depends on SOC_COMPATIBLE_NRF
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on !CLOCK_CONTROL_NRF_FORCE_ALT
|
2019-02-21 15:53:29 +01:00
|
|
|
default y
|
2016-09-14 19:45:18 +02:00
|
|
|
help
|
2019-01-15 09:49:17 +01:00
|
|
|
Enable support for the Nordic Semiconductor nRFxx series SoC clock
|
2016-09-14 19:45:18 +02:00
|
|
|
driver.
|
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
if CLOCK_CONTROL_NRF
|
2018-07-09 11:15:48 +02:00
|
|
|
|
2019-02-21 16:00:20 +01:00
|
|
|
choice CLOCK_CONTROL_NRF_SOURCE
|
2016-11-05 05:11:43 +01:00
|
|
|
prompt "32KHz clock source"
|
2019-01-15 09:49:17 +01:00
|
|
|
default CLOCK_CONTROL_NRF_K32SRC_XTAL
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_RC
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "RC Oscillator"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_XTAL
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Crystal Oscillator"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-04-15 08:04:42 +02:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_SYNTH
|
|
|
|
depends on !SOC_SERIES_NRF91X
|
|
|
|
bool "Synthesized from HFCLK"
|
|
|
|
|
2019-07-02 07:40:42 +02:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING
|
|
|
|
depends on SOC_SERIES_NRF52X
|
|
|
|
bool "External low swing"
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING
|
|
|
|
depends on SOC_SERIES_NRF52X
|
|
|
|
bool "External full swing"
|
|
|
|
|
2016-11-05 05:11:43 +01:00
|
|
|
endchoice
|
|
|
|
|
2019-06-26 13:27:31 +02:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
|
2020-06-03 11:10:14 +02:00
|
|
|
bool "Enable LF clock calibration"
|
2019-06-26 13:27:31 +02:00
|
|
|
depends on !SOC_SERIES_NRF91X
|
2020-06-03 11:10:14 +02:00
|
|
|
default n if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS
|
2019-06-26 13:27:31 +02:00
|
|
|
default y if CLOCK_CONTROL_NRF_K32SRC_RC
|
2020-06-03 11:10:14 +02:00
|
|
|
help
|
|
|
|
If calibration is disabled when RC is used for low frequency clock then
|
|
|
|
accuracy of the low frequency clock will degrade. Disable on your own
|
|
|
|
risk.
|
2019-06-26 13:27:31 +02:00
|
|
|
|
|
|
|
if CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_CALIBRATION_PERIOD
|
2020-02-07 13:27:13 +01:00
|
|
|
int "Calibration opportunity period in milliseconds"
|
|
|
|
default 4000
|
2019-06-26 13:27:31 +02:00
|
|
|
help
|
|
|
|
Periodically, calibration action is performed. Action includes
|
|
|
|
temperature measurement followed by clock calibration. Calibration may
|
|
|
|
be skipped if temperature change (compared to measurement of previous
|
|
|
|
calibration) did not exceeded CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF
|
|
|
|
and number of consecutive skips did not exceeded
|
|
|
|
CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP.
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP
|
|
|
|
int "Maximum number of calibration skips"
|
|
|
|
default 1
|
|
|
|
range 0 255
|
|
|
|
help
|
|
|
|
Calibration is skipped when temperature change since last calibration
|
|
|
|
was less than configured threshold. If number of consecutive skips
|
|
|
|
reaches configured value then calibration is performed
|
|
|
|
unconditionally. Set to 0 to perform calibration periodically
|
|
|
|
regardless of temperature change.
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF
|
|
|
|
int "Temperature change triggering calibration (in 0.25 degree units)"
|
|
|
|
default 2
|
2018-07-09 11:15:48 +02:00
|
|
|
help
|
2019-06-26 13:27:31 +02:00
|
|
|
Calibration is triggered if the temperature has changed by at least
|
|
|
|
this amount since the last calibration.
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_CALIBRATION_DEBUG
|
2019-10-29 00:17:17 +01:00
|
|
|
bool "Calibration instrumentation"
|
2019-06-26 13:27:31 +02:00
|
|
|
help
|
|
|
|
Enables retrieving debug information like number of performed or
|
|
|
|
skipped calibrations.
|
|
|
|
|
|
|
|
config CLOCK_CONTROL_NRF_USES_TEMP_SENSOR
|
|
|
|
bool
|
2020-05-25 12:31:08 +02:00
|
|
|
depends on HAS_HW_NRF_TEMP
|
2019-06-26 13:27:31 +02:00
|
|
|
default y if CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP > 0 && \
|
|
|
|
CLOCK_CONTROL_NRF_CALIBRATION_TEMP_DIFF > 0
|
|
|
|
select TEMP_NRF5
|
|
|
|
select SENSOR
|
|
|
|
|
|
|
|
endif # CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
|
2018-07-09 11:15:48 +02:00
|
|
|
|
2019-02-21 16:00:20 +01:00
|
|
|
choice CLOCK_CONTROL_NRF_ACCURACY
|
2016-11-05 05:11:43 +01:00
|
|
|
prompt "32KHz clock accuracy"
|
2019-01-15 09:49:17 +01:00
|
|
|
default CLOCK_CONTROL_NRF_K32SRC_500PPM if CLOCK_CONTROL_NRF_K32SRC_RC
|
|
|
|
default CLOCK_CONTROL_NRF_K32SRC_20PPM
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_500PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "251 ppm to 500 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_250PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "151 ppm to 250 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_150PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "101 ppm to 150 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_100PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "76 ppm to 100 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_75PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "51 ppm to 75 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_50PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "31 ppm to 50 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_30PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "21 ppm to 30 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
config CLOCK_CONTROL_NRF_K32SRC_20PPM
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "0 ppm to 20 ppm"
|
2016-11-05 05:11:43 +01:00
|
|
|
|
|
|
|
endchoice
|
2018-07-09 11:15:48 +02:00
|
|
|
|
2019-01-15 09:49:17 +01:00
|
|
|
endif # CLOCK_CONTROL_NRF
|