-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF-M: provide option for non-secure targets to request TF-M to issue system resets #33510
TF-M: provide option for non-secure targets to request TF-M to issue system resets #33510
Conversation
6e4edf7
to
4c9f427
Compare
b4467f8
to
8b9a931
Compare
Thanks for the proposal @oyvindronningstad. I had also seen this myself while browsing the samples. However, I think that Zephyr should have an option to support the native TF-M interface, which based on CMSIS RTOS V2, as community might prefer that one instead of whatever we would like to define ourselves. The interface you present in #33553 should be the foundation of Zephyr's TF-M NS interface; currently it is minimal, so we need to do enhancements there. |
@ioannisg I don't see much reason though, since it's not really native. The osMutexAcquire eventually leads to a k_mutex_lock, so with the zephyr version we just cut out the indirection and call k_mutex_lock directly. I might be missing something though. |
8b9a931
to
3b57fef
Compare
df1c165
to
be01fd8
Compare
@oyvindronningstad i dragged your commit into this PR, which now introduces the Zephyr, (native) NS interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. No comments except the merging of commits
The reason that i pulled this out was to ease reviewing, as it does not have anything to do with moving the NS interface, it is a minor cleanup patch. But, since it is part of your original commit, actually, I will pull this back, if you insist @oyvindronningstad :) :) |
@oyvindronningstad thanks for cooperating on this PR, btw. |
5fdcf05
to
dac56d3
Compare
Merge the two commits in one, as suggested above. |
Instruct CMake to include interface libraries when building a Non-Secure ARM target with TF-M. In particular, include the reboot.c source file, which overrides the sys_arch_reboot implementation. Signed-off-by: Ioannis Glaropoulos <[email protected]>
In ARM Non-Secure builds with TF-M it is not, generally, possible to issue system reset requests from Non-Secure domain. When the Platform SPM Partition is enabled, the tfm_platform_system_reset(.) API can be used to request system resets from TF-M. This commit overrides the weak sys_arch_reboot() implementation in scb.c so Non-Secure code is able to issue system resets. Signed-off-by: Ioannis Glaropoulos <[email protected]>
The TF-M NS interface needs to be initialized before it is used. We add an initialization function that calls tfm_ns_interface_init(), at boot time, so then we can use TF-M interface calls (veneers). Signed-off-by: Ioannis Glaropoulos <[email protected]>
To allow using TFM NS interface without enabling CMSIS_RTOS V2 support. And to allow using TFM NS code that uses logging. Signed-off-by: Øyvind Rønningstad <[email protected]> Signed-off-by: Ioannis Glaropoulos <[email protected]>
Prevent a thread from being preempted, while executing a Secure function. This is required to prevent system crashes that could occur if a thead context switch is triggered in the middle of a Secure call. Signed-off-by: Ioannis Glaropoulos <[email protected]>
dac56d3
to
3a3693c
Compare
Rebased, to get TF-M v1.3.0 -RC1 |
@oyvindronningstad @microbuilder I added a patch to disable Audit Log for profile:medium builds, due to the upstream bug reported here: https://developer.trustedfirmware.org/T907 |
When compiling TF-M with profile_medium, disable the support for Audit Log due to an upstream bug. Signed-off-by: Ioannis Glaropoulos <[email protected]>
d0ca663
to
6da3d70
Compare
Add the infrastructure to issue system resets for Non-Secure Cortex-M builds with TF-M.
TF-M does not allow Non-Secure system reset by default. This needs to be done with a non-secure callable API.
This PR:
fixes dependencies for BUILD_WITH_TFMintroduces an option that signifies that the default NS interface is used (native), and sets up the required dependencies.