Commit graph

119 commits

Author SHA1 Message Date
Carles Cufi aaa9cf2edd drivers: entropy: nrf5: Clarify Kconfig options
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>
2018-04-05 08:09:57 -04:00
Sebastian Bøe 5165876164 doc: Add a comment describing the algorithm used by entropy_nrf5.c
Improve the documentation of entropy_nrf5.c by adding a comment that
clarifies it's characteristics.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-05 13:10:49 +02:00
Ulf Magnusson 93689bdc80 kconfig: Remove no-op selects of choice symbols
Selecting a choice symbol is always a no-op, and the latest version of
Kconfiglib prints a warning. This commit removes all selects of choice
symbols, which might make the Kconfig files a bit clearer and gets rid
of the warnings.

This is just a dumb removal. I did not try to guess the intent of each
select.

Fixes #6849

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-29 08:57:39 -04:00
Alberto Escolar Piedras 474a56b806 entropy: nrf5x remove unnecessary header
Remove unnecessary header inclusion in nordic's nrf5 random
driver which added a dependency to ext/hal/nordic.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-03-21 15:35:42 -04:00
Carles Cufi fb3387a490 Bluetooth: Remove rand driver and use entropy instead
After porting the rand driver to drivers/entropy, replace the usage of
the old, Buetooth-specific driver with the generic entropy one.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-03-14 16:47:50 +01:00
Carles Cufi 813b41beec drivers: entropy: Port the LL rand driver to entropy
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>
2018-03-14 16:47:50 +01:00
Alberto Escolar Piedras 30ae79ae39 native: added entropy device
Added pseudorandom entropy device for the native_posix board

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-23 07:34:07 -05:00
Erwin Rol 1537b4502b drivers: entropy: stm32: use Kconfig to select HAL/LL sources
Use "select USE_STM32_LL_RNG" to select the needed STM32 LL files,
instead of editing ext/hal/st/stm32cube/CMakeLists.txt

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-01-23 08:46:16 -06:00
Kumar Gala b92a40a798 drivers: entropy: stm32: Remove STM32F411XE from building
It appears the STM32F411XE doesn't support RNG so remove enabling it
from the SoC defconfig and flag an error if attempting to build the
driver on that SoC.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-12 19:42:54 -05:00
Erwan Gouriou 164fb32cf6 drivers: entropy: stm32: limit driver to SoC supporting it
In STM32 family, RNG IP is available only on F4 and L4 series.
Besides STM32F401 does not support is neither.
Get entropy driver available on STM32 devices supporting it and
generate a compilation issue on STM32 devices that do not own
the RNG IP.

Solves #5448

Signed-Off-By: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-11 19:00:19 -05:00
Erwan Gouriou 48ff51af75 drivers: entropy: Clock activation is missing on stm32l4
On STM32L4 SoCs RNG is clocked by 48MHz domain.
Hence, besides clock activation, it requires 48M
domain to be enabled.

Tested on:
*nucleo_l476rg
*stm32l476g_disco
*disco_l475_iot1

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-11 19:00:19 -05:00
Ding Tao 8fbbc13d20 CMake: Fix wrong file name of entropy_stm32.c
Signed-off-by: Ding Tao <miyatsu@qq.com>
2017-11-14 08:10:22 -05:00
Thiago Silveira 912a51957e drivers: entropy: Add nRF5 entropy generator driver
Origin: Original

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2017-11-14 07:02:12 -05:00
David Leach 513ce10da8 cmake: Fix build of entropy driver for MCUX TRNG
Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-13 16:32:08 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Leandro Pereira 1eed91f024 drivers: entropy: Only show STM32 entropy driver on if applicable
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira 8b883a61a3 subsys/random: sys_rand32_get() implementation that uses entropy API
Instead of every hardware number generator driver providing an
implementation of this function, use the random device API to
centralize the implementation of this function.

This is a very simplistic function that can be seen as a stepping stone
to refactor the random number generation in Zephyr.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00