Skip to content

Commit bc25ca2

Browse files
committed
[nrf noup] Revert "modules: tf-m: build tfm_api lib only when !CONFIG_TFM_USE_NS_APP"
This reverts commit 06dd00c. This change is still causing undefined refernece to tfm_platform_gpio_pin_mcu_select from soc/nordic/common/soc_secure.c for the 5340. It's too central a place that cannot be disabled with a Kconfig option. Revert this commit until we update to Mbed TLS 4. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
1 parent 43626cb commit bc25ca2

2 files changed

Lines changed: 37 additions & 39 deletions

File tree

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -372,53 +372,51 @@ if(CONFIG_BUILD_WITH_TFM)
372372
TFM_S_NS_SIGNED_BIN_FILE ${TFM_S_NS_SIGNED_BIN_FILE} # Merged TFM Secure/Nonsecure FW (signed)
373373
)
374374

375-
if(NOT CONFIG_TFM_USE_NS_APP)
376-
zephyr_library_named(tfm_api)
375+
zephyr_library_named(tfm_api)
377376

378-
zephyr_library_sources(
379-
src/zephyr_tfm_log.c
380-
interface/interface.c
381-
)
377+
zephyr_library_sources(
378+
src/zephyr_tfm_log.c
379+
interface/interface.c
380+
)
382381

383-
# A dependency on tfm_s.hex for zephyr.elf will not cause a Zephyr re-link when
384-
# tfm_s.hex is updated, as the hex is not a direct input on the executable.
385-
# Instead we establish a source file dependency which ensures that tfm_api is
386-
# updated when there are changes in tfm itself, this again will trigger an re-link
387-
# of Zephyr.elf.
388-
set_property(SOURCE interface/interface.c APPEND PROPERTY OBJECT_DEPENDS ${TFM_S_HEX_FILE})
382+
# A dependency on tfm_s.hex for zephyr.elf will not cause a Zephyr re-link when
383+
# tfm_s.hex is updated, as the hex is not a direct input on the executable.
384+
# Instead we establish a source file dependency which ensures that tfm_api is
385+
# updated when there are changes in tfm itself, this again will trigger an re-link
386+
# of Zephyr.elf.
387+
set_property(SOURCE interface/interface.c APPEND PROPERTY OBJECT_DEPENDS ${TFM_S_HEX_FILE})
389388

390-
# Non-Secure interface to request system reboot
391-
if(CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT)
392-
zephyr_library_sources(src/reboot.c)
393-
endif()
389+
# Non-Secure interface to request system reboot
390+
if(CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT)
391+
zephyr_library_sources(src/reboot.c)
392+
endif()
394393

395-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c)
396-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c)
397-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c)
398-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c)
399-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c)
400-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c)
394+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c)
395+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c)
396+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c)
397+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c)
398+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c)
399+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c)
401400

402-
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c)
401+
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c)
403402

404-
if(CONFIG_SOC_FAMILY_NORDIC_NRF)
405-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
406-
endif()
403+
if(CONFIG_SOC_FAMILY_NORDIC_NRF)
404+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
405+
endif()
407406

408-
# TFM_INTERFACE_INCLUDE_DIR is already added to zephyr_interface below
409-
zephyr_library_include_directories(
410-
${TFM_INTERFACE_INCLUDE_DIR}/crypto_keys
411-
)
407+
# TFM_INTERFACE_INCLUDE_DIR is already added to zephyr_interface below
408+
zephyr_library_include_directories(
409+
${TFM_INTERFACE_INCLUDE_DIR}/crypto_keys
410+
)
412411

413-
# Add interface include directory (exported by TF-M) to zephyr_interface
414-
zephyr_include_directories(
415-
${TFM_INTERFACE_INCLUDE_DIR}
416-
)
412+
# Add interface include directory (exported by TF-M) to zephyr_interface
413+
zephyr_include_directories(
414+
${TFM_INTERFACE_INCLUDE_DIR}
415+
)
417416

418-
zephyr_library_link_libraries(
419-
${TFM_INTERFACE_LIB_DIR}/s_veneers.o
420-
)
421-
endif(NOT CONFIG_TFM_USE_NS_APP)
417+
zephyr_library_link_libraries(
418+
${TFM_INTERFACE_LIB_DIR}/s_veneers.o
419+
)
422420

423421
# Ensure that the generated syscall include headers of Zephyr are available to TF-M
424422
# because some platforms might use the same source files for both builds.

modules/trusted-firmware-m/Kconfig.tfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ menuconfig BUILD_WITH_TFM
5252
select PSA_CRYPTO_CLIENT
5353
imply INIT_ARCH_HW_AT_BOOT
5454
imply ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS
55-
imply MBEDTLS if !TFM_USE_NS_APP
55+
imply MBEDTLS
5656
help
5757
When enabled, this option instructs the Zephyr build process to
5858
additionally generate a TF-M image for the Secure Execution

0 commit comments

Comments
 (0)