Skip to content

Commit

Permalink
[nrf fromlist] tfm: Add option for implementation custom reset handle…
Browse files Browse the repository at this point in the history
…r with TF-M

Zephyr adds a custom handler that overrides the weak function
sys_arch_reset when TF-M platform partition is enabled.

This takes away the option for the application to override the weak
definition for their platform or use-case.

Add an option that control whether this default reset handling is added
to the build.

Upstream PR:
zephyrproject-rtos/zephyr#46133

Signed-off-by: Joakim Andersson <[email protected]>
  • Loading branch information
joerchan authored and carlescufi committed May 31, 2022
1 parent 5b202e4 commit 0a904d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,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(
Expand Down
9 changes: 9 additions & 0 deletions modules/trusted-firmware-m/Kconfig.tfm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a904d0

Please sign in to comment.