Skip to content

Update PSA porting guide #1416

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

Merged
merged 6 commits into from
Mar 4, 2021
Merged

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Feb 15, 2021

This PR

  • removes outdated secure/non-secure target naming convention - Mbed OS only provides the non-secure side, thus there's no point having different names for secure/non-secure sides of a target
  • removes details steps to use mbed-os-tf-m-regression-tests, as more up-to-date instructions are in the mbed-os-tf-m-regression-tests repo itself
  • removes the section "Enabling PSA at application level" which does not always work
  • documents more configurations:
    • TF-M version supported
    • support for TF-M bootloader and two image slots
    • post binary hooks
  • combines documentation for dual-core targets for Armv8-m targets
  • replaces the Musca A1 example with Musca S1

@LDong-Arm LDong-Arm changed the title Update PSA porting guide DO NOT MERGE: Update PSA porting guide Feb 15, 2021
@@ -466,7 +396,7 @@ To build TF-M and create an Mbed OS pull request:
python3 build_tfm.py -m <new target> -t <toolchain> --commit
```

The command builds TF-M with the config `ConfigCoreIPC.cmake`, copies the TF-M binary to the location defined by the target attribute `tfm_delivery_dir`, and commits the changes to Mbed OS.
The command builds TF-M with the config `ConfigCoreIPC`, copies the TF-M binary to the location defined by the target attribute `tfm_delivery_dir`, and commits the changes to Mbed OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its CoreIPC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- `TargetName`: PSA non-secure target (NSPE).
- `TargetName_NPSA_S`: Non-PSA secure target.
- `TargetName_NPSA`: Non-PSA non-secure target.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is the new convention ?

For ex, current NUCLEO_L552ZE_Q is used as a legacy coretex M target without trust zone.
When we will support TFM, how this new target should be called ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ex, current NUCLEO_L552ZE_Q is used as a legacy coretex M target without trust zone.
When we will support TFM, how this new target should be called ?

I think it should still be called NUCLEO_L552ZE_Q if we support only one flavour. Unless the intention is to provide users both TF-M and non-TF-M options?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First intention was to provide both options.
But maybe we need to change our mind.

@LMESTM

Copy link
Contributor Author

@LDong-Arm LDong-Arm Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First intention was to provide both options.

This should be okay, we can still have two target names (for TF-M and non-TF-M flavours) in this case I think. I removed the naming guideline section from the doc, only because no targets currently follow them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend removing the naming guideline for now as it is not currently used. As @LDong-Arm says, both options could still be used and so this could be re-visited when a use case arises.

@@ -466,7 +396,7 @@ To build TF-M and create an Mbed OS pull request:
python3 build_tfm.py -m <new target> -t <toolchain> --commit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a linux only command ?

Maybe mbed cli2 could be used ? mbedtools tfm -m xxx ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It runs on Windows and macOS too, as long as python and dependencies are installed. Mbed CLI 2 support for PSA/TF-M targets and repositories will be added, at which point we'll update the documentation.

@LDong-Arm LDong-Arm marked this pull request as draft February 16, 2021 12:55
@LDong-Arm LDong-Arm marked this pull request as ready for review February 16, 2021 13:04
@LDong-Arm LDong-Arm force-pushed the tf-m-v1.2-update branch 3 times, most recently from be70eb1 to b4c3a65 Compare February 17, 2021 16:11
@LDong-Arm LDong-Arm marked this pull request as draft February 17, 2021 17:11
- `TargetName`: PSA non-secure target (NSPE).
- `TargetName_NPSA_S`: Non-PSA secure target.
- `TargetName_NPSA`: Non-PSA non-secure target.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend removing the naming guideline for now as it is not currently used. As @LDong-Arm says, both options could still be used and so this could be re-visited when a use case arises.

For PSA/TF-M targets, Mbed OS provides the non-secure side only,
because secure-side binaries are built directly using TF-M's
repository and checked into the Mbed OS tree. Having one target
name for each board is sufficient, so we remove this outdated
section.
To avoid duplicaton, we just need to point users to the
mbed-os-tf-m-regression-tests repository which contains up-to-date
instructions on how to use our scripts to build and run TF-M,
regression tests and PSA compliance tests.
Overriding `inherits` in `mbed_app.json` is not always feasible - if
a target already has another inheritance in `targets.json`, the
existing one will be overriden. To avoid potential issues, we should
not recommend this method of enabling PSA.
Add documentation for more TF-M-related configurations:
* TF-M version supported
* Support for TF-M bootloader and two image slots
* post binary hooks

Combine documentation for dual-core and Armv8-M targets, as the
steps are basically identical. This reduces maintenance required
and improves readability.
From TF-M v1.2, ARM_MUSCA_A1 has been deprecated from Mbed OS.
Single-core v7-M targets use Mbed PSA service instead of TF-M.
@LDong-Arm LDong-Arm changed the title DO NOT MERGE: Update PSA porting guide Update PSA porting guide Mar 3, 2021
@LDong-Arm LDong-Arm marked this pull request as ready for review March 3, 2021 14:50
@evedon
Copy link
Contributor

evedon commented Mar 4, 2021

@donatieng Could you merge this PR please?

@donatieng donatieng merged commit 08bf7fa into ARMmbed:development Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants