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
mcu/nrf5340: Add secure functions package #2899
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sjanc
reviewed
Oct 12, 2022
hw/mcu/nordic/nrf5340/syscfg.yml
Outdated
@@ -126,6 +126,13 @@ syscfg.defs: | |||
Application code to runs in secure mode. | |||
This settings must have same value for bootloader and application build. | |||
value: 1 | |||
MCU_NET_GPIO: |
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.
hmm there is already MCU_GPIO_NET
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.
Thanks, old MCU_GPIO_NET reused. Old code from startup that used it is now removed.
kasjer
force-pushed
the
kasjer/nrf5340-tfm
branch
from
October 12, 2022 09:25
3560f11
to
fc4df1e
Compare
New package will contain secure functions. Those functions will allow access to secure only peripherals. To start MCU assignment to GPIO function tfm_gpio_pin_mcu_select allows to redirect PIN to net core. tfm_uicr_otp_read() allows to read UICR->OTP from non-secure code. When tfm package build with bootloader or secure application functions are treated as every other function. When tfm is build with non-secure application function bodies are not present in the build and are expected to be linked with library that provides secure gateways. tfm can be also build into bootloader in this case it's the bootloader that provides secure functions. ELF that provides implementation of secure functions must be build with TFM_EXPORT_NSC: 1 syscfg value. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
It was possible to assign GPIO pins to network core. It was done in ipc driver or for unsecure code it in bootloader code from hal_system_start.c. Now pin assignment to net core is done in nrf5340_periph_create() which is called in hal_bsp_init(). With this change pin assigment can be done: - in bootloader (regardless if it is secure or not) - in application build with MCU_APP_SECURE - in non-secure application when tfm functionality is provided by bootloader or other secure code. In this case bootloader does not redirect pins during startup but allows change from non-secure application at runtime. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
kasjer
force-pushed
the
kasjer/nrf5340-tfm
branch
from
October 12, 2022 09:33
fc4df1e
to
78901f1
Compare
Style check summaryNo suggestions at this time! |
sjanc
approved these changes
Oct 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New package will contain secure functions.
Those functions will allow access to secure only peripherals.
To start MCU assignment to GPIO function tfm_gpio_pin_mcu_select
allows to redirect PIN to net core.
tfm_uicr_otp_read() allows to read UICR->OTP from non-secure code.
When tfm package build with bootloader or secure application
functions are treated as every other function.
When tfm is build with non-secure application function bodies
are not present in the build and are expected to be linked with
library that provides secure gateways.
tfm can be also build into bootloader in this case it's the
bootloader that provides secure functions.
ELF that provides implementation of secure functions must be
build with TFM_EXPORT_NSC: 1 syscfg value.
Signed-off-by: Jerzy Kasenberg jerzy.kasenberg@codecoup.pl