Skip to content

Make MUSCA B1 and MUSCA A1 TF-M ready #12735

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 4 commits into from
May 4, 2020
Merged

Conversation

Patater
Copy link
Contributor

@Patater Patater commented Mar 31, 2020

Summary of changes

Refactor MUSCA platform support in a way that makes the NS binaries compatible with how TF-M expects: same layout in flash and RAM. Doing this doesn't break ordinary Mbed OS usage.

Impact of changes

No breaking changes. MUSCA targets will be ready for TF-M.

Migration actions required

None

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@Devran01 @jainvikas8


@ciarmcom ciarmcom requested review from ashok-rao, urutva, jainvikas8 and a team March 31, 2020 17:00
@ciarmcom
Copy link
Member

@Patater, thank you for your changes.
@ashok-rao @Devran01 @jainvikas8 @ARMmbed/mbed-os-core @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

0xc0170
0xc0170 previously approved these changes Apr 3, 2020
@mergify mergify bot added needs: CI and removed needs: review labels Apr 3, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2020

CI started

@mergify mergify bot added needs: work and removed needs: CI labels Apr 5, 2020
@mbed-ci
Copy link

mbed-ci commented Apr 5, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@mergify mergify bot dismissed 0xc0170’s stale review April 6, 2020 14:24

Pull request has been modified.

@Patater
Copy link
Contributor Author

Patater commented Apr 6, 2020

Updated to add image_macros_preprocessed.c for Musca B1, to update baud rate naming consistently, and to add copyright headers for all image_macros_preprocessed.c files.

Copy link
Contributor

@jainvikas8 jainvikas8 left a comment

Choose a reason for hiding this comment

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

Please update the copyright year of the files as needed.


/* To copy multiple ROM to RAM sections,
* define etext2/data2_start/data2_end and
* define __STARTUP_COPY_MULTIPLE in startup_cmsdk_musca_ns.S */
.copy.table :
{
. = ALIGN(8);
. = ALIGN(4);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to know why the alignment has been changed to 4-bytes in a comment.

@mbed-ci
Copy link

mbed-ci commented Apr 7, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM-lts
  • jenkins-ci/mbed-os-ci_build-GCC_ARM-lts

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 7, 2020

Please ignore lts jobs here , not valid for this PR. We will restart testing and fix lts status here later once 5.15 jobs are in

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 9, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 16, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Apr 16, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@Patater
Copy link
Contributor Author

Patater commented Apr 24, 2020

Wrap inclusion of region_defs.h to TARGET_TFM targets, as the header isn't available otherwise.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 5
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2020

CI failure is due to outstanding PR to Mbed OS that is in CI now, will fix the issue and I'll start the tests

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2020

Test run: FAILED

Summary: 1 of 6 test jobs failed
Build number : 6
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 28, 2020

Test psa failed, please review

@mergify
Copy link

mergify bot commented Apr 30, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

Patater and others added 4 commits April 30, 2020 11:32
Avoid surprising users. Use the Mbed OS default baud rate. Applications
that want to see TF-M debug prints can both enable and set their baud
rate at the application level. Mbed OS should not turn on TF-M debug
prints nor surprise the user with a non-default baud rate.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
We are moving to flash_layout.h and region_defs.h being more closely
aligned with TF-M's version. As such, some of the Mbed PSA
implementation needs to additionally include region_defs.h.
Make the MUSCA_A1 target TF-M compatible by doing the following:
    - Add flash, region definitions, and preprocessed image macros from
      TF-M (at version 6e7be077eabe "Core: Add lifecycle API")
    - Update the MUSCA_A1 linker script to create a flash image
      compatible with TF-M.
    - Update the tfm/bin_utils/assemble.py signing script to work with
      preprocessed image macros rather than flat C pre-processor defines

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Make the MUSCA_B1 target TF-M compatible by doing the following:
    - Add flash, region definitions, and preprocessed image macros from
      TF-M (at version 6e7be077eabe "Core: Add lifecycle API")
    - Update the MUSCA_B1 linker script to create a flash image
      compatible with TF-M.
    - Update the tfm/bin_utils/assemble.py signing script to work with
      preprocessed image macros rather than flat C pre-processor defines

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
@Patater
Copy link
Contributor Author

Patater commented Apr 30, 2020

Rebased on latest master to resolve conflicts. Conflicts were with MUSCA target tools and device_cfg.h because building for S targets was removed.

@adbridge
Copy link
Contributor

adbridge commented May 1, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented May 1, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 7
Build artifacts

Copy link
Contributor

@adbridge adbridge left a comment

Choose a reason for hiding this comment

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

AFAICT looks ok to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants