This driver makes use of the nRF RNG peripheral, so it can be used only
for SoCs that are equipped with one, and not all nRF SoCs are.
The option enabling the driver should then depend on `HAS_HW_NRF_RNG`,
which indicates the presence of this peripheral in a given SoC.
This patch removes also entries disabling this driver in default
configurations for nRF9160 SoC, as these were needed only because
of the invalid dependency of the ENTROPY_NRF5_RNG option.
A minor adjustment of Kconfig files of the nrf52_bsim board was
required as well, so that this board's configuration can properly
handle this corrected dependency.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
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>
Redefining the config will not let another (out-of-source) driver be
chosen instead of the default. The driver is practically forced by the
soc settings. This commit moves default settings from soc/arm/nordic_nrf
into the drivers themselves.
Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
Also remove some duplicated dependencies for the related symbol
ENTROPY_NRF5_RNG.
The redundant ENTROPY_GENERATOR deps. are in files sourced within a
if ENTROPY_GENERATOR
...
endif
block in drivers/entropy/Kconfig.
The redundant ENTROPY_NRF5_RNG deps. are due to redundant 'depends on'
within an 'if' in the same file.
Tip: Jump to symbols with '/' in the menuconfig and press '?' to check
their dependencies. If there are duplicated dependencies, the
'included via ...' path can be handy to discover where they are added.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The old algorithm managing random number pools was inefficient and
prone to race conditions. Moreover, its behaviour was not compatible
with the API (provided buffers were filled from the end, leaving
beggining of the buffer untouched if there was not enough random data).
The new implementation is a bit faster and it is race-free as long as
all callers of the entropy_get_entropy_isr() are executed in
"run-to-completion" mode.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
The nRF5x entropy driver does not depends on SOC_FAMILY_NRF is therefore
visible and selectable non-nRF5x SoCs. Fix that.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Depend on the new SOC_COMPATIBLE_NRF symbol instead of the
SOC_FAMILY_NRF symbol.
This allows the driver to be used from the bsim simulated board
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Clarify the difference between the buffer length and threshold Kconfig
options available in the nRF5 entropy driver.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The rand driver present in the BLE Link Layer is able to provide
entropy for both threads and ISRs, and so it is more suited to be used
as a generic nRF5x entropy driver instead of the current one. This will
allow applications and the Link Layer to use the same driver without
duplicating it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>