Commit Graph

30272 Commits (c70baa92893dea61bbe6ae17839b88a4ef9351bd)

Author SHA1 Message Date
Jaeden Amero b38c5ed8e3 examples: Add PSA example to list of examples 2020-06-18 12:16:30 +01:00
Devaraj Ranganna cd88e724f7 psa: Add a script to validate PSA targets
Add a script to parse `targets.json` to identify PSA targets and ensure
mandatory parameters are configured correctly for all PSA targets.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:29 +01:00
Devaraj Ranganna c9c593f7ca tools: Remove obsolete API
The API is_PSA_non_secure_target() uses obsolete labels to detect if a
target is PSA non-secure target and is not needed anymore.

Mbed OS depends on TF-M for PSA SPM and services. TF-M is built using
it's own build system. Therefore, we don't need to differentiate secure
and non-secure targets anymore in Mbed OS as all PSA targets in Mbed OS
are non-secure targets.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:28 +01:00
Devaraj Ranganna 939ed6940c tools: Improve PSA target identification logic
Current logic `is_TFM_target` relies on the availability of attribute
`tfm_target_name` to identify PSA targets. The API `is_TFM_target` is
used in pytest to validate PSA target configuration which again checks
the availability of `tfm_target_name`. If a target doesn't contain the
attribute `tfm_target_name` then this check will fail instead of
catching it. Therefore, we now check for `TFM` config option in `labels`
attribute.

The API `is_TFM_target()` returns true for Mbed OS PSA targets which are
supported by TF-M also.

Add a new API `is_PSA_target()` which returns true for all Mbed OS PSA
targets.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:26 +01:00
Jaeden Amero 0961f312c6 Make PSA util compatible with Mbed Crypto 3.0.1
Mbed Crypto 3.0.1 ships with TF-M. To make Mbed TLS 2.22.0 compatible
with Mbed Crypto 3.0.1, changes are needed in psa_util.h (which
abstracts some portions of the PSA Crypto API for use with TLS) to deal
with new ECC curve define changes.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:25 +01:00
Jaeden Amero 908c33bac7 psa: Add stubbed PSA client implementation
Add a stubbed PSA Client API implementation for application
compatibility. The interface is non-functional, but provides sane error
codes.
2020-06-18 12:16:23 +01:00
Devaraj Ranganna abccf97ebf psa: Import latest image signing scripts from TF-M
Import the latest image signing scripts from TF-M version
TF-Mv1.0-85-g3b7cc95a042c.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:22 +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 db67302850 target: Add BL2 macro to MUSCA B target config
BL2 macro is used in `region_defs.h` to define the `BL2_HEADER_SIZE`.
Without BL2 macro, `BL2_HEADER_SIZE` is set to 0. This leads to
incorrect start address (Reset_Handler of Mbed OS) derived by TF-M based
on `region_defs.h` and BL2 macro.

BL2 macro is set for MUSCA B in TF-M.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:17 +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
Vikas Katariya 8252f3ee6e psa: Add TF-M utility scripts to python path
When python3 is enforced to build the ARM_MUSCA_A1 or ARM_MUSCA_B1
targets, it is unable to find binary utility tool scripts which are
imported from TF-M.

The reason to use the python3 environment is as follows: Mbed OS + TFM
contained a faulty boot record TLV, which failed the attestation test
(TF-M regression). The data in the boot record TLV will be included in
the generated attestation token as 1 item in the SW_COMPONENTS claim.

This data (in the boot record TLV) is pre-encoded in CBOR format at
build time and appended to the image during the image signing process
(done by the imgtool Python3 script).

Signed-off-by: Vikas Katariya <vikas.katariya@arm.com>
2020-06-18 12:16:13 +01:00
Jaeden Amero f4b676b4ee psa: Fix style in psa_hrng.c 2020-06-18 12:16:12 +01:00
Jaeden Amero d314a6cc57 cypress: psoc64: Add TF-M compatibility (again)
Partially revert f38e21fa6c ("Update PSoC 6 BSPs to verion 1.2") to
restore TF-M compatibility.

Make the CY8CKIT_064S2_4343W target TF-M compatible by addding flash and
region definitions from TF-M (at c4f37c18c4a0) and by updating the
CY8CKIT_064S2_4343W linker script to create a flash image compatible
with TF-M.

Fixes: f38e21fa6c ("Update PSoC 6 BSPs to verion 1.2")

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-06-18 12:16:10 +01:00
Martin Kojtal 9fc12213f4
Merge pull request #13135 from MultiTechSystems/mts-mdot-bootloader
Restore MTS_MDOT_F411RE bootloader binary
2020-06-18 11:29:10 +02:00
Martin Kojtal e9b1df671e
Merge pull request #13143 from jeromecoutant/PR_H7_BARE
STM32H7: correct Ethernet issue in baremetal
2020-06-18 10:25:51 +02:00
Martin Kojtal eebd773d3a
Merge pull request #13148 from OpenNuvoton/nuvoton_remove_m2351_npsa_from_6.0
M2351: Remove from master
2020-06-18 10:24:41 +02:00
Martin Kojtal 29aa6d8ea5
Merge pull request #13115 from NXPmicro/MXRT1050_USB
MIMXRT1050_EVK: Add USB support
2020-06-18 09:56:47 +02:00
Martin Kojtal 0bdc712167
Merge pull request #12998 from sbutcher-arm/fix-adjust-config
Fix Mbed TLS `adjust-config.sh` script
2020-06-18 09:43:59 +02:00
Martin Kojtal 66343b0d25
Merge pull request #12937 from macronix/macronix_qspi
Modify the operation of setting qspi frequency when calling Octo controller
2020-06-18 09:43:45 +02:00
Martin Kojtal 62c2431344
Merge pull request #12824 from kjbracey-arm/faultasm
Optimise fault handler assembly
2020-06-18 09:43:00 +02:00
Martin Kojtal aafae5d644
Merge pull request #12751 from jeromecoutant/PR_WB_USB
STM32WB: enable USB Device
2020-06-18 09:42:42 +02:00
Martin Kojtal 0c77249067
Merge pull request #13119 from LDong-Arm/nanostack-target-dir
Move target implementations of NanostackRfPhy into nanostack-interface
2020-06-18 09:37:22 +02:00
Kimmo Vaisanen a8fd02adfb Cellular: ALT1250: Store RAT to permament memory
When RAT is changed it is now saved to modem's permanent memory. This avoid unnecessary
changing of it on every reboot.
2020-06-18 09:44:29 +03:00
Chun-Chieh Li 95635f9c54 M2351: Remove from master
Since Mbed OS 6.0, secure build is not supported yet. Remove it from master temporarily.

For non-TF-M support (NU_PFM_M2351_NPSA_S/NS), go to mbed-os-5.15 branch and Mbed OS 5.15 release.

For TF-M support (NU_PFM_M2351_S/NS), this needs M2351 integrated into TF-M repo first.
Expect M2351 TF-M support can come back into master after integration with TF-M is finished.
2020-06-18 09:42:29 +08:00
Martin Kojtal 86dad5cda9
Merge pull request #12471 from AGlass0fMilk/adc-voltage-api
Extend AnalogIn API: read_voltage
2020-06-17 19:57:28 +02:00
Rajkumar Kanagaraj 3e2e074938 Fix esp8266 driver compilation warning 2020-06-17 18:47:14 +01:00
jeromecoutant b4d31ae863 STM32H7: correct Ethernet issue in baremetal 2020-06-17 18:39:34 +02:00
Vance Farren 1f20df9c7d missing comma in targets.json 2020-06-17 12:10:19 -04:00
Vance Farren 1d8da69586 updates for mbed os 6 2020-06-17 12:10:19 -04:00
Vance Farren b8687ab524 add EP_ATLAS as mbed target 2020-06-17 12:10:19 -04:00
Mahesh Mahadevan 9e8998a91c KW41Z: Avoid using TARGET_NXP macro
Having Freescale and NXP macro causes compile from both
TARGET_Freescale and TARGET_NXP HAL folders.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-06-17 11:04:35 -05:00
Mahesh Mahadevan 469ada5a11 MIMXRT1050_EVK: Fix to linker script for non-cached region
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-06-17 11:04:35 -05:00
Mahesh Mahadevan 81a1193012 MIMXRT1050_EVK: Add USB support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-06-17 11:04:35 -05:00
Taylor Heck f145594b28 Restore MTS_MDOT_F411RE bootloader binary 2020-06-17 09:27:30 -05:00
Hugues Kamba a3f4cf212d Use std::chrono based functions
The chrono based functions improve readability. Using them also removes
warnings related to usage of deprecated warnings.
2020-06-17 14:52:50 +01:00
Martin Kojtal b1629b7e59
Merge pull request #13098 from AriParkkila/cell-free-stack
Cellular: Fix CellularContext destructor memory leak
2020-06-17 13:24:17 +02:00
Martin Kojtal 31748ed1a9
Merge pull request #13036 from jeromecoutant/PR_GENPERIPH_V12
STM32_gen_PeripheralPins.py script v1.12
2020-06-17 12:14:20 +02:00
Martin Kojtal 95a3a304af
Merge pull request #13009 from trowbridgec/add-telit-me310-driver
Add support for the Telit ME310 module
2020-06-17 11:35:58 +02:00
Martin Kojtal 28b7cf321b
Merge pull request #13130 from kyle-cypress/pr/psoc-usticker
Cypress: us_ticker fixes
2020-06-17 11:32:07 +02:00
Martin Kojtal e1b8f06272
Merge pull request #12899 from mikaleppanen/wisun_stats_
Added Wi-SUN statistics interface
2020-06-17 11:31:46 +02:00
Kyle Kearney 6a2d93ee94 Add optional post-bsp-init hook
This allows the application to inject its own resource reservations
immmediately after the BSP (and therefore HAL) is initialized,
ensuring that they can claim require resources before mbed tries
to use them for more flexible purposes. For example, the application
might want to claim a particular timer to make sure that it doesn't
get picked for us_ticker (which can use any arbitrary timer instance).
2020-06-16 11:07:34 -07:00
Kyle Kearney ab5eb07e3c Stop the us_ticker timer before deepsleep
A running timer will block DeepSleep, which would normally be
good because we don't want the timer to accidentally lose counts.
We don't care about that for us_ticker (If we're requesting deepsleep
the upper layers already determined that they are okay with that),
so explicitly stop the us_ticker timer before we go to sleep and
start it back up afterwards.
2020-06-16 11:07:34 -07:00
Lingkai Dong 8a31b6a7ca Apply astyle suggestions from the CI 2020-06-16 15:29:48 +01:00
Mika Leppänen ee5f077b0c Added Wi-SUN statistics interface
Added network and MAC statistics to Wi-SUN interface.
2020-06-16 16:08:07 +03:00
Martin Kojtal 8f87735152
Merge pull request #13040 from paul-szczepanek-arm/cordio-tx-power
BLE: Add tx power control to cordio HCI driver
2020-06-16 13:59:50 +02:00
Martin Kojtal 3333f4185e
Merge pull request #12747 from jeromecoutant/PR_MBEDTLS
STM32 MBEDTLS support with HW crypto
2020-06-16 13:55:50 +02:00
Martin Kojtal eb33549fbe
Merge pull request #12900 from mikaleppanen/ns_kv_store_
Added kv store adaptation to nanostack file interface
2020-06-16 13:55:26 +02:00
Martin Kojtal 7b5a8d37b5
Merge pull request #12966 from MultiTechSystems/update-df413-onoff
DRAGONFLY_F413RH: Update power on and power off functionality
2020-06-16 13:54:01 +02:00