Skip to content

Commit 2572a53

Browse files
joerchannashif
authored andcommitted
tfm: Remove library model support
In TF-M 1.7.0 release the Library model has been removed. Remove the library model support from zephyr before updating TF-M version. Signed-off-by: Joakim Andersson <[email protected]> Signed-off-by: David Brown <[email protected]>
1 parent d5e0fda commit 2572a53

File tree

5 files changed

+16
-67
lines changed

5 files changed

+16
-67
lines changed

modules/trusted-firmware-m/CMakeLists.txt

+16-36
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@ set(TFM_CRYPTO_MODULES
3131

3232

3333
if (CONFIG_BUILD_WITH_TFM)
34-
if (CONFIG_TFM_LIBRARY)
35-
list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=ON)
36-
else()
37-
list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=OFF)
38-
# PSA API awareness for the Non-Secure application
39-
target_compile_definitions(app PRIVATE "TFM_PSA_API")
40-
if (CONFIG_TFM_SFN)
41-
list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN")
42-
else() # CONFIG_TFM_IPC
43-
list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="IPC")
44-
endif()
34+
list(APPEND TFM_CMAKE_ARGS -DTFM_LIB_MODEL=OFF)
35+
# PSA API awareness for the Non-Secure application
36+
target_compile_definitions(app PRIVATE "TFM_PSA_API")
37+
if (CONFIG_TFM_SFN)
38+
list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN")
39+
else() # CONFIG_TFM_IPC
40+
list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="IPC")
4541
endif()
4642
if (CONFIG_TFM_REGRESSION_S)
4743
list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON)
@@ -219,13 +215,6 @@ if (CONFIG_BUILD_WITH_TFM)
219215

220216
${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c
221217

222-
${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c
223-
${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c
224-
${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c
225-
${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c
226-
${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c
227-
${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c
228-
229218
# Specific to nordic_nrf platform
230219
${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c
231220
)
@@ -380,26 +369,17 @@ if (CONFIG_BUILD_WITH_TFM)
380369
endif()
381370

382371
if(NOT CONFIG_TFM_BUILD_NS)
383-
if(CONFIG_TFM_IPC OR CONFIG_TFM_SFN)
384-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c)
385-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c)
386-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c)
387-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c)
388-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c)
389-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c)
390-
391-
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c)
392-
else()
393-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_func_api.c)
394-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_func_api.c)
395-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_func_api.c)
396-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_func_api.c)
397-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_func_api.c)
398-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_func_api.c)
399-
endif()
372+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_ipc_api.c)
373+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_ipc_api.c)
374+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_ipc_api.c)
375+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_ipc_api.c)
376+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_initial_attestation_ipc_api.c)
377+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_firmware_update_ipc_api.c)
378+
379+
zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_psa_ns_api.c)
400380

401381
if(CONFIG_SOC_FAMILY_NRF)
402-
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
382+
zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c)
403383
endif()
404384

405385
else()

modules/trusted-firmware-m/Kconfig.tfm

-10
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,6 @@ choice TFM_MODEL
283283
The Firmware Framework M (FF-M) provides different programming models
284284
for Secure Partitions.
285285

286-
config TFM_LIBRARY
287-
bool "Library Model"
288-
help
289-
Use the library model instead of PSA API.
290-
291-
The library model conforms to the PSA Firmware Framework for M (FF-M)
292-
v1.0.
293-
294-
NOTE: The Library Model will be removed and replaced by the SFN model.
295-
296286
config TFM_IPC
297287
bool "IPC Model"
298288
help

modules/trusted-firmware-m/Kconfig.tfm.partitions

-14
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ config TFM_PARTITION_PLATFORM
6565
options are handled by the build system in the trusted-firmware-m
6666
repository.
6767

68-
config TFM_PARTITION_AUDIT_LOG
69-
bool "Secure partition 'Audit Log'"
70-
depends on TFM_LIBRARY
71-
default y
72-
help
73-
Setting this option will cause '-DTFM_PARTITION_AUDIT_LOG'
74-
to be passed to the TF-M build system. Look at 'config_default.cmake'
75-
in the trusted-firmware-m repository for details regarding this
76-
parameter. Any dependencies between the various TFM_PARTITION_*
77-
options are handled by the build system in the trusted-firmware-m
78-
repository.
79-
Note: the Audit Log service does not implement the IPC model
80-
interface so it may not be enabled together with IPC option.
81-
8268
config TFM_PARTITION_FIRMWARE_UPDATE
8369
bool "Include the secure parition 'Firmware Update'"
8470
select TFM_MCUBOOT_DATA_SHARING

samples/tfm_integration/tfm_regression_test/sample.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ sample:
1717
name: "TFM Regression Test"
1818

1919
tests:
20-
sample.tfm.regression_lib_mode:
21-
extra_args: CONFIG_TFM_LIBRARY=y CONFIG_TFM_ISOLATION_LEVEL=1 CONFIG_TFM_PARTITION_AUDIT_LOG=y
22-
timeout: 200
23-
2420
sample.tfm.regression_ipc_lvl1:
2521
extra_args: CONFIG_TFM_IPC=y CONFIG_TFM_ISOLATION_LEVEL=1
2622
timeout: 200

samples/tfm_integration/tfm_secure_partition/sample.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,3 @@ sample:
2020
tests:
2121
sample.tfm.secure_partition:
2222
tags: tfm
23-
sample.tfm.secure_partition.lib:
24-
tags: tfm
25-
extra_args: "CONFIG_TFM_LIBRARY=y"

0 commit comments

Comments
 (0)