zephyr/drivers/clock_control/Kconfig.nrf
Thomas Stenersen db90e24326 drivers: nrf: add support for forcing driver implementation
An external project extending the Zephyr RTOS and its drivers may have
subsystems that must use its own specific driver(s) when active. One
example is the nRF5x NVMC that must be scheduled in between radio
operations. A subsystem may also be dependent on its own drivers for
security, real-time and/or because of hardware constrains.

In order to not introduce non-Zephyr specific code into the Zephyr tree,
an option is added to disable the in-tree drivers in Zephyr. Because
Kconfig does not support a good way of de-selecting other symbols, a
variable on the form `<DRIVER>_FORCE_ALT` is added as a
dependency for each `<DRIVER>`. For example, the out-of-tree subsystem
will select `FLASH_NRF_FORCE_ALT` to disable the in-tree driver. A
solution for issue #8181 would open up for a more general solution,
however #8181 requires significant effort.

Support for out-of-tree drivers is added to Nordic drivers for
clock_control, entropy and flash.

A generic solution for this is desired. Issue #14527 is tracking that
progress.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-20 10:27:28 -05:00

81 lines
1.9 KiB
Plaintext

# Kconfig - Clock controller driver configuration options
#
# Copyright (c) 2016 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
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.
if !CLOCK_CONTROL_NRF_FORCE_ALT
menuconfig CLOCK_CONTROL_NRF
bool "NRF Clock controller support"
depends on SOC_COMPATIBLE_NRF
default y
help
Enable support for the Nordic Semiconductor nRFxx series SoC clock
driver.
if CLOCK_CONTROL_NRF
choice CLOCK_CONTROL_NRF_SOURCE
prompt "32KHz clock source"
default CLOCK_CONTROL_NRF_K32SRC_XTAL
config CLOCK_CONTROL_NRF_K32SRC_RC
bool "RC Oscillator"
config CLOCK_CONTROL_NRF_K32SRC_XTAL
bool "Crystal Oscillator"
endchoice
config CLOCK_CONTROL_NRF_K32SRC_BLOCKING
bool "Blocking 32KHz crystal oscillator startup"
depends on CLOCK_CONTROL_NRF_K32SRC_XTAL
help
Clock control driver will spin wait in CPU sleep until 32KHz
crystal oscillator starts up. If not enabled, RC oscillator will
initially start running and automatically switch to crystal when
ready.
choice CLOCK_CONTROL_NRF_ACCURACY
prompt "32KHz clock accuracy"
default CLOCK_CONTROL_NRF_K32SRC_500PPM if CLOCK_CONTROL_NRF_K32SRC_RC
default CLOCK_CONTROL_NRF_K32SRC_20PPM
config CLOCK_CONTROL_NRF_K32SRC_500PPM
bool "251 ppm to 500 ppm"
config CLOCK_CONTROL_NRF_K32SRC_250PPM
bool "151 ppm to 250 ppm"
config CLOCK_CONTROL_NRF_K32SRC_150PPM
bool "101 ppm to 150 ppm"
config CLOCK_CONTROL_NRF_K32SRC_100PPM
bool "76 ppm to 100 ppm"
config CLOCK_CONTROL_NRF_K32SRC_75PPM
bool "51 ppm to 75 ppm"
config CLOCK_CONTROL_NRF_K32SRC_50PPM
bool "31 ppm to 50 ppm"
config CLOCK_CONTROL_NRF_K32SRC_30PPM
bool "21 ppm to 30 ppm"
config CLOCK_CONTROL_NRF_K32SRC_20PPM
bool "0 ppm to 20 ppm"
endchoice
endif # CLOCK_CONTROL_NRF
endif #!CLOCK_CONTROL_NRF_FORCE_ALT