diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 22214b70bda..e5e5e536dd5 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -332,7 +332,9 @@ if (CONFIG_BUILD_WITH_TFM) interface/interface.c ) # Non-Secure interface to request system reboot - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM src/reboot.c) + if (CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) + zephyr_library_sources(src/reboot.c) + endif() zephyr_library_sources_ifndef(CONFIG_TFM_PSA_TEST_NONE src/zephyr_tfm_psa_test.c) zephyr_include_directories( diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 99224cc3aae..cb7373b9cbe 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -167,6 +167,15 @@ config TFM_ITS_MAX_ASSET_SIZE Maximum size (in bytes) of a single asset to be stored in Internal Trusted Storage (ITS). +config TFM_PARTITION_PLATFORM_CUSTOM_REBOOT + bool "Use custom reboot handler" + depends on TFM_PARTITION_PLATFORM + help + Do not include the default zephyr implementation of calling the TF-M + platform reset service. + Instead the application will have to override the weak ARM + implementation of sys_arch_reset(). + config TFM_BL2_NOT_SUPPORTED bool help