Commit Graph

168 Commits (ff0756d338b669cfb6c66cd44247fbc49b6ad143)

Author SHA1 Message Date
Lingkai Dong 31cc82dabb "Updated secure binaries for [(ARM_MUSCA_S1, ARMCLANG)]"
This brings in the platform init fix:

    https://github.com/ARMmbed/trusted-firmware-m/pull/15
2021-03-09 10:22:58 +00:00
Lingkai Dong 3e19778597 CMake: Enable post binary hook for ARM_MUSCA_B1 2021-03-05 16:16:26 +00:00
Lingkai Dong 816f81d018 CMake: Enable post binary hook for ARM_MUSCA_S1 2021-03-05 16:16:26 +00:00
Lingkai Dong 4e45b0a4eb Copy signing keys into each Musca target's path
The signing keys were previously imported from trusted-firmware-m
and located in mbed-os/tools/targets/musca_* (path for Mbed CLI 1).
This PR copie them into each target's directory as per the
convention of the new tools. Keys in the old path remain untouched
for backward compatibility, but they will be eventually removed
once we stop supporting Mbed CLI 1.
2021-03-05 16:16:26 +00:00
Lingkai Dong 6ab4b1c1d4 "Updated secure binaries for [('ARM_MUSCA_S1', 'ARMCLANG')]" 2021-02-25 14:02:57 +00:00
Lingkai Dong 29f7f9f5d2 "Updated secure binaries for [('ARM_MUSCA_B1', 'ARMCLANG')]" 2021-02-25 14:02:57 +00:00
Lingkai Dong 63523bd0aa Remove _NS aliases for Musca B1/S1
In targets.json, ARM_MUSCA_B1 and ARM_MUSCA_S1 have alias target
names suffixed with `_NS`. They are identical to targets without
`_NS` and exist purely for compatibility with the old naming
convention we had. The CI builds them as separate targets and uses
extra resources.

As we are upgrading Musca targets to TF-M v1.2, it's time to clean
up the aliases.
2021-02-25 14:02:57 +00:00
Lingkai Dong 88a38c2750 Musca S1: include missing `cmsis_nvic.h`
The vector table needs to be copied from ROM to RAM, in order for us
to set IRQ handlers at run time. The address in RAM is defined by
`NVIC_RAM_VECTOR_ADDRESS` in `cmsis_nvic.h`, but its inclusion
was missing from Musca S1's `cmsis.h` and consequently the vector
table was not copied.

On most targets this results in a memory access error when we set
vectors. But Musca S1's ROM is in its MRAM (which can be accessed
like any RAMs), and this causes the ROM image to be modified
with no error/warning. On the next boot, MCUboot fails the image
integrity check.

This commit adds the missing include, in the same spirit as
01dd997d55.
2021-02-25 14:02:57 +00:00
Lingkai Dong ac4533a5bd Exclude Musca signing layouts from compilation
Files containing signing layouts are parsed by the post build
hook for signing purpose only.
2021-02-25 14:02:57 +00:00
Vikas Katariya 39e226bf6a Update target `ARM_MUSCA_S1` TF-M V1.2 binaries
* Remove the old `mcuboot.bin`
* Add `bl2.bin`
* Update TF-M secure binaries

GCC_ARM toolchain used.
2021-02-25 14:02:56 +00:00
Vikas Katariya c0721a95ca Update partition files for `ARM_MUSCA_S1`
* Partition files are synced with TF-M v1.2
* To have uniformity with TF-M v1.2, rename the following:
 ** image_macros_preprocessed_ns.c to `signing_layout_ns.c`
 ** image_macros_preprocessed_s.c to `signing_layout_s.c`
* `MCUBOOT_IMAGE_NUMBER` is set to 2 by default for TF-M v1.2,
therefore it is necessary that Mbed OS compiles the right macros
for when linking and using the partition files.
2021-02-25 14:02:56 +00:00
Vikas Katariya 65e2d45d99 Update target `ARM_MUSCA_B1` TF-M V1.2 binaries
* Remove the old `mcuboot.bin`
* Add `bl2.bin`
* Update TF-M secure binaries

GCC_ARM toolchain used.
2021-02-25 14:02:56 +00:00
Vikas Katariya 0ccf4db143 Update partition files for `ARM_MUSCA_B1`
* Partition files are synced with TF-M v1.2
* To have uniformity with TF-M v1.2, rename the following:
 ** image_macros_preprocessed_ns.c to `signing_layout_ns.c`
 ** image_macros_preprocessed_s.c to `signing_layout_s.c`
* `MCUBOOT_IMAGE_NUMBER` is set to 2 by default for TF-M v1.2,
therefore it is necessary that Mbed OS compiles the right macros
for when linking and using the partition files

** Workaround **
The `region_defs.h` has an explicit definition of `BL2`, even
though it is already defined in target.json for `ARM_MUSCA_B1`.
This is because of Mbed CLI 1, as it can't seem to use the right
macro when linking the files for Mbed OS application when using
the ARMCLANG toolchain.
2021-02-25 14:02:56 +00:00
Martin Kojtal 57a6fe3a8e
Merge pull request #14314 from hugueskamba/hk_cmake_fix_musca_ns
CMake: Fix ARM MUSCA NS targets build
2021-02-23 11:04:38 +00:00
Martin Kojtal 88a242f749
Merge pull request #14306 from hugueskamba/hk_cmake_create_cmsis_cortex_libs
CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
2021-02-23 08:36:49 +00:00
Hugues Kamba 0ce36ac5e2 CMake: Fix ARM MUSCA NS targets build
Add the missing CMake targets for NS Mbed boards.
2021-02-22 12:17:41 +00:00
Hugues Kamba 2c3481297c CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify
the requirements of Mbed targets.
2021-02-19 13:39:32 +00:00
Harrison Mutai 0000b37124 Fix indentation in RW_IRAM1 load region description 2021-02-19 10:09:25 +00:00
Harrison Mutai 9f5f3ea855 Fix indentation in ER_IROM1 load region description 2021-02-18 14:47:36 +00:00
Harrison Mutai b31ce7a9c7 Refactor ARM MSP2 target scatter files for bare metal support 2021-02-18 14:44:46 +00:00
Harrison Mutai 0f233735af Add bare metal support to ARM_MPS2_Target family of targets 2021-02-18 09:34:16 +00:00
Martin Kojtal 0adb917dab CMake Arm SSG: refactor CMake targets
Create CMake target per each Mbed OS target.
2021-02-15 10:39:30 +00:00
Hugues Kamba 1d6214df0b CMake: Add support Arm Musca S1 target
Add CMakeLists.txt file for the target
2021-01-18 17:39:13 +00:00
Hugues Kamba 8123cdbe2f CMake: Add support for ARM's MUSCA B1 target
Add CMakeLists.txt input source file for the target
2021-01-18 17:39:13 +00:00
Hugues Kamba 0ac503312a CMake: Add support for Arm's MPS2 targets 2021-01-15 16:32:43 +00:00
Hugues Kamba 470cc1a1a6 CMake: Add support for Arm's CM3DS_MPS2 target 2021-01-15 16:32:43 +00:00
Hugues Kamba 96dbb42024 MUSCA_B1: Fix heap size formula in scatter files
The heap size was incorrectly calculated.
This fixes it by subtracting the Stack size, any memory chunks allocated
before the start of the application (for vectors and/or crash report), and
finally the size of the application from the total RAM size.
2021-01-08 18:35:33 +00:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Martin Kojtal 6bfd89e656
Merge pull request #13196 from gbrtth/musca_s1_support_mbed6
Add ARM_MUSCA_S1 as a new target platform
2020-09-10 16:53:14 +01:00
Mark Horvath 37f26692b1 Workaround to fix clang build
Change-Id: Ib0d207d4ca22ae239f6b40b95618b66eb329a29c
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
2020-09-10 13:59:32 +01:00
Gabor Toth bdf2306f16 Add platform support to Musca S1
Change-Id: Iebdd4bc402446caba6b7bd894eddb0a85ed884d8
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Gabor Toth <gabor.toth@arm.com>
2020-09-10 14:53:41 +02:00
Jaeden Amero 612b148fd4 stack: armc: Workaround config passing bug
Workaround a bug where the boot stack size configuration option is not
passed on to armlink, the Arm Compiler's linker. Prefer
MBED_CONF_TARGET_BOOT_STACK_SIZE if present, as this is what the
configuration system should provide. Fall back to MBED_BOOT_STACK_SIZE
if MBED_CONF_TARGET_BOOT_STACK_SIZE is not defined, as in the case of
buggy tools. If both MBED_CONF_TARGET_BOOT_STACK_SIZE and
MBED_BOOT_STACK_SIZE are not defined, then we fall back to a hard-coded
value provided by the linkerscript. See
https://github.com/ARMmbed/mbed-os/issues/13474 for more information.
2020-09-10 10:08:38 +01:00
Jaeden Amero 39e69d328d Use boot stack size from config system
To allow overriding of the boot stack size from the Mbed configuration
system, consistently use MBED_CONF_TARGET_BOOT_STACK_SIZE rather than
MBED_BOOT_STACK_SIZE.

Fixes #10319
2020-09-10 10:08:38 +01:00
Vikas Katariya 776ccce8d6 psa: Update TF-M for ARM_MUSCA_B1 2020-07-14 11:54:57 +01:00
Jaeden Amero 2f2e4a95a1 psa: Update TF-M for ARM_MUSCA_B1 2020-07-09 15:40:38 +01:00
Marcelo Salazar dbbdb3f5bd Remove Musca A1 target
The MUSCA_A1 target isn't supported in Mbed OS 6.
Removing as it was left in master by mistake.
However, it continues to be available in 5.15 branch.
2020-06-22 13:24:40 +01:00
Devaraj Ranganna 76e911c5ef psa: Replace Mbed PSA with TF-M
Add TF-M to Mbed OS, replacing the previous PSA implementation for
TF-M-capable targets. This commit adds files imported from TF-M, without
modification. The version of TF-M imported can be found in
`features/FEATURE_PSA/TARGET_TFM/VERSION.txt`.

These changes switch to TF-M as the sole PSA implementation for v8-M and
dual core targets, with TF-M running on the secure side and Mbed OS
running on the non-secure side. Single core v7-M targets will continue
to have PSA implemented via PSA emulation, implemented by Mbed OS.

Move or remove many PSA-implementing files, as PSA will be provided by
TF-M on non-single-v7-M targets. Delete any files that are not relevant
for PSA emulation mode.
 - Remove imported TF-M SPM
 - Remove Mbed SPM and tests
 - Remove Mbed-implemented PSA services and tests
 - Remove PSA_SRV_IMPL, PSA_SRV_IPC, PSA_SRV_EMUL and NSPE.
 - Replace PSA_SRV_EMUL and PSA_SRV_IMPL with MBED_PSA_SRV
 - Remove any files autogenerated by
   "tools/psa/generate_partition_code.py", which no longer exists.

Add new feature `PSA` to support PSA in Mbed OS.

Move the Mbed OS implementation of PSA services for v7-M targets (which
employ PSA emulation, and don't yet use TF-M) to
features/FEATURE_PSA/TARGET_MBED_PSA_SRV. Update the `requires`
attribute in TESTS/configs/baremetal.json to avoid breaking baremetal
testing builds.

Update .astyleignore to match new directory structure

Update Mbed TLS importer to place files into FEATURE_PSA

Create the following generic PSA targets:

* `PSA_Target` (Root level PSA generic target)
* `PSA_V7_M` (Single v7-M PSA generic target)
* `PSA_DUAL_CORE` (Dual-core PSA generic target)
* `PSA_V8_M` (v8-M PSA generic target)

Flatten MUSCA_NS and private MUSCA targets into public MUSCA targets.

Move mcuboot.bin to flat location (removing prebuilt folder)

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-06-18 12:16:20 +01:00
Devaraj Ranganna 01dd997d55 target: Include missing `cmsis_nvic.h`
The header `cmsis_nvic.h` defines vector start address in RAM
`NVIC_RAM_VECTOR_ADDRESS` which is used in
`mbed_boot.c:mbed_cpy_nvic()`. But `mbed_boot.c` only includes
`cmsis.h`. Due to this `mbed_cpy_nvic` becomes an empty function and the
vectors don't get relocated to RAM. This causes BusFault error when Mbed
OS tries to update any of the IRQ handlers.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:19 +01:00
Devaraj Ranganna e2af612a99 tools: Musca B1 signing strategy
Currently, the final binary (TF-M + Mbed OS) is signed after
concatenating TF-M and Mbed OS binaries. But TF-M signs the images
separately and then concatenates them. Update the Musca B1 signing
strategy to match TF-M.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:16 +01:00
Jaeden Amero dc22d89c7f musca_b1: Remove device-specific virtual NVIC
Use instead the general TF-M v8-M virtual NVIC which will be added in
the commit that replaces Mbed PSA with TF-M PSA:
features/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V8M/src/cmsis_nvic_virtual.c
2020-06-18 12:16:14 +01:00
Martin Kojtal a7a6de28c3
Merge pull request #12888 from GaborAbonyi/musca_b1_i2c_pinmap_fix
Musca-B1: Fix I2C pinmap array
2020-05-12 14:17:29 +02:00
Marcelo Salazar d413cf137f Remove IOTSS_BEID target 2020-05-06 16:45:46 +01:00
Gabor Abonyi f7b7f457b6 Musca-B1: Fix I2C pinmap array
Change-Id: I00ba75d1a673a091cec9236c1e7dd71ac3994610
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-05-04 13:44:05 +02:00
Jaeden Amero 6f6a92c1eb musca_b1: Add TF-M compatibility
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>
2020-04-30 11:36:09 +01:00
Devaraj Ranganna 0ad1a988ec musca_a1: Add TF-M compatibility
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>
2020-04-30 11:35:05 +01:00
Jaeden Amero 6b3a9cb4fa psa: Remove v8-M S targets
Remove PSA v8-M S target binaries will be built outside of Mbed OS and
added in as binaries which NS targets consume. Mbed OS no longer
implements PSA for v8-M targets, so there is no reason for it to build
PSA S targets.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-27 09:51:09 +01:00
Gabor Abonyi 636523b862 Musca-B1: Grant Non-Secure access for MHU0 on EXP0
Change-Id: I0a15c695e6ccec3d13e0fa66257278172be75680
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-04-20 15:17:42 +02:00
Gabor Abonyi b442e35f85 Add I2C api to Musca-B1 target
Change-Id: Iab5a76e6b8ea28933b39b4ec4ee753f45e5bfcc7
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-04-15 11:13:46 +02:00
Rajkumar Kanagaraj 3d128e861b - Fix the CI build issue.
- Incorporate the review comment.
2020-04-08 10:35:07 +01:00
Rajkumar Kanagaraj 9739b565b2 Fix the CI build issue 2020-04-08 10:35:07 +01:00