Virtio headers are moved to zephyr/drivers/ as they have no reason to be
top-level headers since virtio is a driver class.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Since `VirtIO` is not the official notation,
unify the name to `VIRTIO`.
In the text, `Virtio` and `virtio` can also be used
depending on the context.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add VirtIO Entropy driver.
The `virtio,device4` is a somewhat unfamiliar naming convention,
but it follows the convention used in Linux.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Even though the STM32 TRNG hardware produces 2- or 4-byte sized words of
random data before triggering an interrupt, the driver currently discards
all but the bottom byte: 50/75% of the produced entropy goes to waste!
Make sure we consume all the random data from each word we read to improve
the entropy generation rate seen by users of the driver.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
The low level function names in the stm32l4xx low level driver are
different than all the other stm32's even though the functionality is the
same. This breaks the entropy module for these parts. This patch fixes the
build and has been tested on a custom stm32l4p5 board.
This STM32CubeL4 issue has been reported (ST Internal Reference: 207828).
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/88621
Signed-off-by: Matt Ihnen <matt.ihnen@gmail.com>
The STM32WB09 TRNG has a prescaler that defaults (on reset) to 256, making
the entropy generation process unbearably slow. Change the prescaler value
to 1 instead, in order to make the IP about as fast as other STM32's.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
The STM32WB09 TRNG does not clear FIFO_FULL IRQ flag in hardware once the
FIFO is no longer full, a behavior which differs from all other series.
This results in spurious IRQs, as the TRNG IRQ line effectively remains
high forever once a single interrupt has been generated.
Clear the flag in software after reading from the FIFO on STM32WB09 SoC.
N.B.: the error IRQ flag is already handled properly, as this flag must
also be cleared by software on other series.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
CONFIG_SOC_STM32WB09XX implies CONFIG_SOC_SERIES_STM32WB0X, making it
pointless to assert the latter is defined before checking the former.
Simplify #ifdef checks in the entropy driver's LL wrappers thanks to
this observation, by removing unnecessary nesting.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
clean up usage of select USE_STM32_LL_RNG from Kconfig.stm32
this modifications due to the include unconditionally of
stm32xxxx_ll_rng.h in HAL.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Update the NEORV32 SoC, peripheral drivers, and board to support NEORV32
v1.11.1. Notable changes include:
- Optional RISC-V ISA Kconfigs are now selected on the board level.
- Peripheral registers are now automatically reset in hardware, no need for
software initialization code.
- The NEORV32 GPIO controller now supports 32 pins, not 64. Interrupt
support will be submitted in a separate PR.
- Default board configuration has 64k RAM and is clocked at 18 MHz.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Rename the driver files, binding and kconfig options, while deprecating
the old binding and kconfig options.
Uses in tree are replaced.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Support for random number generator is required for most of the
cryptographic operations, including support for WiFi and TLS.
This driver has been tested with tests/drivers/entropy:
*** Booting Zephyr OS build v3.7.0-4339-g1ec5ce05f9f8 ***
Running TESTSUITE entropy_api
===================================================================
START - test_entropy_get_entropy
random device is 0x8217298, name is rng@45090000
0x93
0x3e
0xf1
0x68
0xd4
0x22
0xbf
0x4d
0xad
PASS - test_entropy_get_entropy in 0.012 seconds
===================================================================
TESTSUITE entropy_api succeeded
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [entropy_api]: pass = 1, fail = 0, skip = 0 ...
- PASS - [entropy_api.test_entropy_get_entropy] duration = 0.01 ...
------ TESTSUITE SUMMARY END ------
===================================================================
RunID: d1547c805699201af769cb01331efcce
PROJECT EXECUTION SUCCESSFUL
Co-authored-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Tibor Laczko <tibor.laczko@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Correct the comment that tells how long it takes to get
random numbers. The old comment was too optimistic.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for TRNG peripherals that lack interrupt lines in the STM32
entropy driver.
This enables usage of the TRNG of STM32WB05/06/07 SoCs with the driver.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Fix the native_posix fake entropy driver for more than 3 byte requests,
and specially for native_sim//64 builds.
The host random() provides a number between 0 and 2**31-1 (INT_MAX),
so bit 32 was always 0.
So when filling a buffer with more than 3 bytes we would be filling
each 4th byte with a byte which always had its MSbit as 0.
For LP64 native_sim//64 builds, this was even worse, as the driver had
another bug where we assumed random() returned the whole long filled,
and therefore all 4 upper bytes would be 0.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
add support SCE9 to entropy driver for Renesas RA
Signed-off-by: Minh Hoang <minh.hoang.wm@bp.renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
entropy_nrf5 modules uses k_sem_xxx() functions in several
places, but these functions are only functional when
CONFIG_MULTITHREADING is set, otherwise they just fallback to
the empty weak implementation provided in
zephyr/lib/libc/armstdc/src/threading_weak.c.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
mcux_rnga driver calls k_cycle_get_32() which is not available
if CONFIG_SYS_CLOCK_EXISTS is not defined. Therefore we add
this depedendency to CONFIG_ENTROPY_MCUX_RNGA.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Automatically enable ENTROPY_GENERATOR if the device-tree has
any "zephyr,entropy" chosen property specified. This helps
in having CONFIG_ENTROPY_HAS_DRIVER set if the platform support
an entropy driver and this then enables CONFIG_CSPRNG_ENABLED.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
On platforms like nrf5340 there are 2 CPUs:
- one is the cpu_net which takes care of the radio stuff and
owns the HW random generator
- one is the cpu_app which holds application data and polls
cpu_net through HCI commands when it needs some random data.
The PSA core implemented in Mbed TLS needs random data at initialization
time, which happens early in the boot process. If we wait for BT to
be ready before issuing the HCI command, then PSA core intialization
will fail. In facts there is no need for the BT to be completely
initialized just to ask for some random data from the cpu_app to
the cpu_net since the HW random generator will likely be already
functional in the cpu_net.
So let's just try the HCI command and, if something is not right,
it will fail anyway. There's no need to anticipate the failure.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Provide a new kconfig option which can be used to disable
the default seeding of the host standard library random
generator by this driver.
This allows some other component to do so without this component
default initialization interfering.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Initial commit for entropy support on RA8
- drivers: entropy: implementation for TRNG driver of RA8x1
- dts: arm: add device node for trng of RA8x1
- boards: arm: enable support zephyr_entropy for ek_ra8m1 and
update board documentation
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
Clear pending interrupts after disabling TRNG to avoid
smartbond_trng_isr getting called with TRNG disabled
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Removed PM device runtime support from drivers in PD_SYS domain.
Update the rest device drivers to call pm_device_runtime_get/put()
functions when CONFIG_PM_DEVICE_RUNTIME is enabled.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Add a semaphore to protect the disable access to the RNG peripheral
when the PM is going to suspend mode.
The change does not affect other stm32 than CONFIG_SOC_SERIES_STM32WBX
or CONFIG_STM32H7_DUAL_CORE
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.
Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.
Updated the includes path of in-tree sources accordingly.
Most of the changes here are scripted, check the PR for more
info.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>