Commit Graph

140 Commits (d1d6bf51b387ef39f97320b2febd5d79231682ba)

Author SHA1 Message Date
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
Rajkumar Kanagaraj 20c3e38349 Remove the deprecated ethernet APIs 2020-03-17 06:00:07 -07:00
Tamas Kaman 551c3c553c Add ARM_MUSCA_B1 as a new target platform
Musca-B1 is a Cortex-M33 based target with security extension enabled.

- ARM_MUSCA_B1 is the non-secure target running mbed-os.
- ARM_MUSCA_B1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_B1 is submitted by a
  pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
  signs it and then concatenates the bootloader with the signed binary.

Change-Id: I4b36290941b5f0bb7aa7c12dda2f38b5c1e39ae2
Signed-off-by: Tamas Kaman <tamas.kaman@arm.com>
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-21 14:34:39 +01:00
Gabor Abonyi a5a6912b0e Fix Musca-A1 gcc linker
Was broken since 3e3af70afc

Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-07 16:33:32 +01:00
Devaraj Ranganna bc7331b96e Import latest python scripts and MCUBoot image
To help with the integration of Musca B1 into Mbed OS, python
signing scripts and MCUBoot image and RSA private key for Musca A
has been updated from latest TF-M
(https://git.trustedfirmware.org/trusted-firmware-m.git/commit/?id=6c5be4a98e4d7055ee49076ca4e515fb4b172e66).

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-01-21 10:25:56 +00:00
Martin Kojtal c9c5b78ca3 "Update secure binaries for ARM_MUSCA_A1_S (ARMC6)" 2020-01-14 14:27:54 +00:00
Bence Kaposzta d5e89a25c6 Fix ethernet memory handling issues on CM3DS
Signed-off-by: Bence Kaposzta <bence.kaposzta@arm.com>
2019-11-11 14:39:08 +01:00
Kevin Bracey fb6aa3ef4f Clean up ARM toolchain heap+stack setup in targets
ARM Compiler 6.13 testing revealed linker errors pointing out
conflicting use of `__user_setup_stackheap` and
`__user_initial_stackheap` in some targets. Remove the unwanted
`__user_initial_stackheap` from the targets - the setup is
centralised in the common platform code.

Looking into this, a number of other issues were highlighted

* Almost all targets had `__initial_sp` hardcoded in assembler,
  rather than getting it from the scatter file. This was behind
  issue #11313. Fix this generally.
* A few targets' `__initial_sp` values did not match the scatter
  file layout, in some cases meaning they were overlapping heap
  space. They now all use the area reserved in the scatter file.
  If any problems are seen, then there is an error in the
  scatter file.
* A number of targets were reserving unneeded space for heap and
  stack in their startup assembler, on top of the space reserved in
  the scatter file, so wasting a few K. A couple were using that
  space for the stack, rather than the space in the scatter file.

To clarify expected behaviour:

* Each scatter file contains empty regions `ARM_LIB_HEAP` and
  `ARM_LIB_STACK` to reserve space. `ARM_LIB_STACK` is sized
  by the macro `MBED_BOOT_STACK_SIZE`, which is set by the tools.
  `ARM_LIB_HEAP` is generally the space left over after static
  RAM and stack.
* The address of the end of `ARM_LIB_STACK` is written into the
  vector table and on reset the CPU sets MSP to that address.
* The common platform code in Mbed OS provides `__user_setup_stackheap`
  for the ARM library. The ARM library calls this during startup, and
  it calls `__mbed_user_setup_stackheap`.
* The default weak definition of `__mbed_user_setup_stackheap` does not
  modify SP, so we remain on the boot stack, and the heap is set to
  the region described by `ARM_LIB_HEAP`. If `ARM_LIB_HEAP` doesn't
  exist, then the heap is the space from the end of the used data in
  `RW_IRAM1` to the start of `ARM_LIB_STACK`.
* Targets can override `__mbed_user_setup_stackheap` if they want.
  Currently only Renesas (ARMv7-A class) devices do.
* If microlib is in use, then it doesn't call `__user_setup_stackheap`.
  Instead it just finds and uses `ARM_LIB_STACK` and `ARM_LIB_HEAP`
  itself.
2019-10-23 14:53:49 +03:00
Jaeden Amero a848cd6987 psa: Update LPC55S69 and MUSCA_A1 TF-M binaries
Rebuild the TF-M binaries for the LPC55S69 and MUSCA_A1 using the latest
service updates. This allows the boards to use the PSA Crypto API 1.0b3.
2019-09-02 17:11:00 +01:00
Filip Jagodzinski 68d222b3d1 MPS2: Fix serial_init when FC is not used
After adding DEVICE_SERIAL_FC guards to serial_api.h
serial_set_flow_control is not available. In case of this
implementation, this function is a no-op and may be safely removed.
2019-07-09 16:12:32 +02:00
Maciej Bocianski fcde82ba4f HAL I2C: adds missing DEVICE_I2C guards 2019-06-19 23:08:55 +02:00
Oren Cohen 63487533aa Update secure binaries 2019-05-22 17:31:49 +03:00
Martin Kojtal fee07dcdf2 ARM_SSG: mbed_rtx remove empty line 2019-05-22 17:17:27 +03:00
Martin Kojtal a115c9333f gpio: indent fix 2019-05-22 17:17:27 +03:00
Gabor Kertesz 40627a5220 Fix last issues
Imports working McuBoot for reset.
Updates microsec ticker driver.
Default baudrate is set to 115200 to see TF-M boot messages.
Stack top is set to scatter file dependent and not hard-coded.
2019-05-22 17:17:26 +03:00
Michael Schwarcz bde2557629 Update secure binaries for ARM_MUSCA_A1_S 2019-05-22 17:17:26 +03:00
Michael Schwarcz 0fc629ce45 MUSCA_A1_NS: Add IAR support 2019-05-22 17:17:25 +03:00
Michael Schwarcz ef9c2721a0 Fix PinMap_UART_XX 2019-05-22 17:17:25 +03:00
Michael Schwarcz 1a182df19f Add serial_tx_pinmap() and serial_rx_pinmap() to serial_api.c 2019-05-22 17:17:25 +03:00
Michael Schwarcz c83ef8a444 Add license files 2019-05-22 17:17:24 +03:00
Michael Schwarcz 84bde31ea0 Increase Secure RAM by 4K
- 68KB Secure
- 60KB Non-secure
2019-05-22 17:17:24 +03:00
Michael Schwarcz 71683cbaa7 Fix secure linker script 2019-05-22 17:17:24 +03:00
Michael Schwarcz cebf30a701 Increase secure heap size to 0x4000 2019-05-22 17:17:24 +03:00
Michael Schwarcz 0701fb1c58 Move us_ticker.c to NS side 2019-05-22 17:17:23 +03:00
Michael Schwarcz 96268d91ef Updates after rebase
- postbuild: Use find_secure_image and update prebuilt binaries
- Add CMSIS driver headers
- Align with 2-region memory model
2019-05-22 17:17:23 +03:00
Michael Schwarcz a5fd9176bb Update target license headers
- Add SPDX identifiers and update dates
2019-05-22 17:17:22 +03:00
Michael Schwarcz ff1c769c7e Add ARM_MUSCA_A1 as a new target platform
Musca-A1 is a Cortex-M33 based target with security extension enabled.

- ARM_MUSCA_A1 is the non-secure target running mbed-os.
- ARM_MUSCA_A1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_A1 is submitted by a pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
  signs it and then concatenates the bootloader with the signed binary.
2019-05-22 17:17:20 +03:00
Kevin Bracey fd68691ce3 ARM SSG/FM: Cope correctly with NC GPIO 2019-05-02 12:16:34 +03:00
Shawn Shan 3d9b7df8e0 Fix the build failed issue of MPS2 targets with ARMC6.
Change-Id: I0205d381de331a827435d667c16297aaf5bb609e
Signed-off-by: Shawn Shan <shawn.shan@arm.com>
2019-04-15 16:56:44 +08:00