mbedtls: select ENTROPY_GENERATOR when a driver is available

This is based on the introduction of a helper Kconfig symbol in
"subsys/random/Kconfig" which is named CSPRNG_AVAILABLE. When this is
enabled it means that there is a "zephyr,entropy" property defined in the
device-tree, therefore Mbed TLS can select ENTROPY_GENERATOR to allow
the platform specific driver to be included into the build.

This commit also changes other locations where CSPRNG_ENABLED was used
moving it to CSPRNG_AVAILABLE in order to solve dependency loop
build failures.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2024-12-11 14:48:38 +01:00 committed by Benjamin Cabé
commit 39068cc70e
7 changed files with 29 additions and 9 deletions

View file

@ -82,8 +82,7 @@ choice SEGGER_SYSVIEW_SECTION
endchoice
config MBEDTLS
default y if CSPRNG_ENABLED
depends on ENTROPY_GENERATOR
default y if CSPRNG_AVAILABLE
if MBEDTLS
#

View file

@ -21,8 +21,7 @@ config ZTEST_NO_YIELD
default y if (PM && ZTEST)
config MBEDTLS
default y if CSPRNG_ENABLED
depends on ENTROPY_GENERATOR
default y if CSPRNG_AVAILABLE
if MBEDTLS
#

View file

@ -39,8 +39,7 @@ config ZTEST_NO_YIELD
default y if (ZTEST && PM)
config MBEDTLS
default y if CSPRNG_ENABLED
depends on ENTROPY_GENERATOR
default y if CSPRNG_AVAILABLE
if MBEDTLS
#