Skip to content

Commit e64df3f

Browse files
joerchanVge0rge
authored andcommitted
[nrf fromtree] tfm: Remove TFM_BUILD_NS and update TFM_USE_NS_APP for NS build folder
TF-M no longer builds the NS app, but exports build files to api_ns folder and expects the user to build the rest themselves. Remove the option to build the NS app, and update the TFM_USE_NS_APP to look for an output hex file in the tfm_ns folder. Signed-off-by: Joakim Andersson <[email protected]> Signed-off-by: Markus Swarowsky <[email protected]> (cherry picked from commit f49cbf1) Signed-off-by: Markus Swarowsky <[email protected]>
1 parent 339058d commit e64df3f

File tree

4 files changed

+10
-44
lines changed

4 files changed

+10
-44
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ if (CONFIG_BUILD_WITH_TFM)
5151
else()
5252
list(APPEND TFM_CMAKE_ARGS -DBL2=FALSE)
5353
endif()
54-
if (CONFIG_TFM_BUILD_NS)
55-
list(APPEND TFM_CMAKE_ARGS -DNS=TRUE)
56-
else()
57-
list(APPEND TFM_CMAKE_ARGS -DNS=FALSE)
58-
endif()
5954
if (CONFIG_TFM_ISOLATION_LEVEL)
6055
list(APPEND TFM_CMAKE_ARGS -DTFM_ISOLATION_LEVEL=${CONFIG_TFM_ISOLATION_LEVEL})
6156
endif()
@@ -185,9 +180,6 @@ if (CONFIG_BUILD_WITH_TFM)
185180
set(TFM_INTERFACE_INCLUDE_DIR ${TFM_BINARY_DIR}/api_ns/interface/include)
186181
set(TFM_INTERFACE_LIB_DIR ${TFM_BINARY_DIR}/api_ns/interface/lib)
187182

188-
set(TFM_API_NS_PATH ${TFM_BINARY_DIR}/tf-m-tests/app/libtfm_api_ns.a)
189-
set(PLATFORM_NS_FILE ${TFM_BINARY_DIR}/platform/ns/libplatform_ns.a)
190-
191183
if (TFM_PSA_TEST_SUITE)
192184
set(PSA_TEST_VAL_FILE ${TFM_BINARY_DIR}/tf-m-tests/app/psa_api_tests/val/val_nspe.a)
193185
set(PSA_TEST_PAL_FILE ${TFM_BINARY_DIR}/tf-m-tests/app/psa_api_tests/platform/pal_nspe.a)
@@ -208,27 +200,22 @@ if (CONFIG_BUILD_WITH_TFM)
208200
set(TFM_S_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s.bin)
209201
set(TFM_S_HEX_FILE ${TFM_BINARY_DIR}/bin/tfm_s.hex)
210202
set(TFM_NS_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns.bin)
211-
set(TFM_NS_HEX_FILE ${TFM_BINARY_DIR}/bin/tfm_ns.hex)
203+
set(TFM_NS_HEX_FILE ${CMAKE_BINARY_DIR}/tfm_ns/bin/tfm_ns.hex)
212204
set(TFM_S_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s_signed.bin)
213205
set(TFM_NS_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns_signed.bin)
214206
set(TFM_S_NS_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s_ns_signed.bin)
215207

216208
set(BUILD_BYPRODUCTS
217-
${TFM_API_NS_PATH}
218209
${PSA_TEST_VAL_FILE}
219210
${PSA_TEST_PAL_FILE}
220211
${PSA_TEST_COMBINE_FILE}
221-
${PLATFORM_NS_FILE}
222212
${BL2_ELF_FILE}
223213
${BL2_BIN_FILE}
224214
${BL2_HEX_FILE}
225215
${TFM_S_ELF_FILE}
226216
${TFM_S_BIN_FILE}
227217
${TFM_S_HEX_FILE}
228-
${TFM_NS_BIN_FILE}
229-
${TFM_NS_HEX_FILE}
230218
${TFM_S_SIGNED_BIN_FILE}
231-
${TFM_NS_SIGNED_BIN_FILE}
232219
${TFM_S_NS_SIGNED_BIN_FILE}
233220

234221
${TFM_INTERFACE_LIB_DIR}/s_veneers.o
@@ -426,25 +413,17 @@ if (CONFIG_BUILD_WITH_TFM)
426413
)
427414
endif()
428415

429-
if(NOT CONFIG_TFM_BUILD_NS)
430-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c)
431-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c)
432-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c)
433-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c)
434-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c)
435-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c)
436-
437-
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c)
416+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c)
417+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c)
418+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c)
419+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c)
420+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c)
421+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c)
438422

439-
if(CONFIG_SOC_FAMILY_NRF)
440-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
441-
endif()
423+
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c)
442424

443-
else()
444-
zephyr_library_link_libraries(
445-
${PLATFORM_NS_FILE}
446-
${TFM_API_NS_PATH}
447-
)
425+
if(CONFIG_SOC_FAMILY_NRF)
426+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
448427
endif()
449428

450429
target_include_directories(tfm_api PRIVATE

modules/trusted-firmware-m/Kconfig.tfm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,8 @@ config TFM_BL2
226226
TFM is designed to run with MCUboot in a certain configuration.
227227
This config adds MCUboot to the build - built via TFM's build system.
228228

229-
config TFM_BUILD_NS
230-
bool "Build the TF-M Non-Secure application and libraries"
231-
help
232-
Instruct the TF-M build system to build the TF-M Non-Secure
233-
application and libraries.
234-
235-
This option is intended for testing purposes only, since this is the
236-
easiest way to build the TF-M regression tests application and test
237-
support libraries in the zephyr build system.
238-
239229
config TFM_USE_NS_APP
240230
bool "Use the TF-M Non-Secure application"
241-
depends on TFM_BUILD_NS
242231
help
243232
The TF-M build system can produce multiple executable files.
244233
The main one is the TF-M secure firmware. Optionally the TF-M

samples/tfm_integration/tfm_psa_test/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#
66

77
CONFIG_BUILD_WITH_TFM=y
8-
CONFIG_TFM_BUILD_NS=y
98
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
109
CONFIG_QEMU_ICOUNT_SHIFT=1
1110

samples/tfm_integration/tfm_regression_test/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
CONFIG_BUILD_WITH_TFM=y
88
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
9-
CONFIG_TFM_BUILD_NS=y
109
CONFIG_TFM_USE_NS_APP=y
1110
CONFIG_TFM_REGRESSION_S=y
1211
CONFIG_TFM_REGRESSION_NS=y

0 commit comments

Comments
 (0)