drivers: entropy: fix TF-M enabled build with MbedTLS 3.6.0

This fixes the compilation of entropy_psa_crypto.c that failed
when trying to include the MbedTLS configuration.

Inherit the needed include folders and definitions from tfm_api.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
This commit is contained in:
Tomi Fontanilles 2024-04-17 15:08:49 +03:00 committed by Flavio Ceolin
commit 43651979fc
2 changed files with 3 additions and 7 deletions

View file

@ -34,8 +34,4 @@ zephyr_library_sources_ifdef(CONFIG_ENTROPY_GECKO_SE entropy_gecko_se.
zephyr_library_sources_ifdef(CONFIG_ENTROPY_PSA_CRYPTO_RNG entropy_psa_crypto.c)
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NPCX_DRBG entropy_npcx_drbg.c)
if (CONFIG_BUILD_WITH_TFM)
target_include_directories(${ZEPHYR_CURRENT_LIBRARY} PRIVATE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
)
endif()
zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api)

View file

@ -363,13 +363,13 @@ if (CONFIG_BUILD_WITH_TFM)
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
endif()
target_include_directories(tfm_api PRIVATE
target_include_directories(tfm_api PUBLIC
${TFM_INTERFACE_INCLUDE_DIR}
${TFM_INTERFACE_INCLUDE_DIR}/crypto_keys
${ZEPHYR_BASE}/modules/mbedtls/configs
)
# Pass down the MbedTLS configuration file to use.
target_compile_definitions(tfm_api PRIVATE
target_compile_definitions(tfm_api PUBLIC
MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CFG_FILE}"
)