CSS was deprecated from the mcu-sdk. Removing driver from lpc55s36
to clear build error.
This is a temporary patch to remove the build error.
Fixes#69961
Signed-off-by: David Leach <david.leach@nxp.com>
The srandom function is not available
unless _XOPEN_SOURCE is set > 500 or an equivalent
declaration is done.
Let's set it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a command line option which will seed the random generator
from /dev/urandom.
This can be usefull for some particular tests in which we are
interested in having different random numbers in each run,
but we cannot provide a different random seed from command line.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
With PM, when resuming from low power mode, reenable the RNG register
clocks and check the health register. If it is not set to the desired
value, it means we exit Suspend to RAM mode, and that the RNG needs to be
reinitialized.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The place where TF-M places its non-secure api header files has changed
Therefore changing it for for all applications that use it.
Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
STM32WBA controller uses a PKA driver to perform cyphering operations
on keys. Since PKA hardware block requires RNG clock to be enabled, a
synchronization with zephyr RNG driver is needed.
Use RNG enable status to check if RNG could be switched off or needs to
be switched on.
Similarly in entropy driver, don't cut RNG clock if PKA is enabled.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Enable the RNG module interrupt every time it is resumed.
It is done to make sure the interrupt is always enabled. The CR register
may not persist when the device clock is disabled on some chips.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Move enabling/disabling the RNG module to acquire/release functions.
It causes enabling the RNG module for the get_entropy_isr function.
It fixes hanging in the get_entropy_isr function.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Suspend the RNG module when the pool is full to save power. The
generated numbers aren't used anyway.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Remove the depenency on TF-M so that this driver can be used when PSA
is provided by something else than TF-M.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.
Rename it to random.h and get consistently with other
subsystems.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Do not propagate unused parameter. ISR callback is already handling
the given flags, there is not need to propagate it through internal
calls.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
get_entropy_isr() has to return the number of bytes copied or
a negative value in case of error.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Return -ENODATA in neorv32_trng_get_entropy_isr when
there is no data available. This is consistent with other
drivers.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
get_entropy_isr() has to return the number of bytes copied or a negative
value for error. Since this driver is assuming that it will always
(????) get the number of requested bytes, change the function to return it
instead of 0.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When the legacy LLCP implementation was removed this Kconfig option was
mistakenly left over. Remove it now with all its users.
Fixes#63212.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Enable PM on STM32 entropy driver.
Only supports PM_DEVICE for now, runtime support will be added later.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Refactor the host libC accesses to use the native simulator
host trampolines.
In this way we support building this driver with embedded libCs.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Quite a few of the drivers meant for the POSIX arch
interacted with the host directly, and will not
work when we use an embedded libC.
Until we fix them, let's add the appropriate
kconfig dependencies to avoid users trying to build them.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit introduces a preprocessor checking mechanism for selecting the
correct RNGOUT FIFO memory base address depending on whether SL_TRUSTZONE
is used.
Fixes#59197.
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This adds a few line use zephyr_syscall_header() to include
headers containing syscall function prototypes.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clang doesn't support push_options, pop_options and optimize pragmas.
Since "Ofast" is only applied to rng_pool_get() we can use function
attributes instead of pragmas.
Please note that clang doesn't support applying optimizations to
functions.
This change was verified by comparing assembler output.
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Add a semaphore to the entropy mcux caam driver
to make the driver thread safe, since some static
variables in the HAL can be the source of
some race conditions.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add TRNG support for BG27, which has slightly different register
definitions in HAL, compared to BG22.
Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
Remove all init functions that do nothing, and provide a `NULL` to
*DEVICE*DEFINE* macros.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Don't check clock configuration before kernel was started since it
will prevent message to be displayed.
After kernel initialization, message is still valid and then ASSERT
more valuable to the user.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Unify the drivers/*/Kconfig menuconfig title strings to the format
"<class> [(acronym)] [bus] drivers".
Including both the full name of the driver class and an acronym makes
menuconfig more user friendly as some of the acronyms are less well-known
than others. It also improves Kconfig search, both via menuconfig and via
the generated Kconfig documentation.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This adds driver for SmartBond TRNG peripheral that with separate
ISR an thread data pools.
Co-authored-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Signed-off-by: Ben Lauret <ben.lauret.wm@renesas.com>
Use the appropriate kernel function, i.e. `k_cpu_atomic_idle()`,
instead of directly executing the WFE instruction.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The CAAM hardware needs to read RNG values into a non-cache
buffer. Since the contract to Zephyr RNG functions do not
require non-cache buffers, we use an intermediate non-cache
buffer to retrieve results.
Added a Kconfig to control the size of the intermediate buffer.
Fixes#53035
Signed-off-by: David Leach <david.leach@nxp.com>
RNG clock configuration constraints differ between each series.
Rather than providing complex build time code to verify RNG clock
configuration is correct, take advantage of CECS bit (Clock error
current status) to assess clock configuration.
This check is implemented under a specific ENTROPY_STM32_CLK_CHECK
Kconfig option. This allows user to disable this feature in specific
conditions:
- CED bit disabled in application (in which case CECS status is not valid)
- Clock configuration is deemed as correct by user. Note that RNG number
are always generated, whatever the clock status.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
RNG domain source clock is now configured via call to clock_control
driver.
Besides, add static checks to verify domain clock configuration
is correct:
- If HSI48 is used because it is default domain clock config,
it should be enabled
- If no HSI48 is available, a specific domain clock should be set
- In L0 case, PLL could be used as domain clock only at a specific freq.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Use STM32_DT_INST_CLOCKS to populate device clock information.
This will allow to add clock source information in next commits.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>