Skip to content

Commit 81979b4

Browse files
committed
Remove "PSA" label from single v7-M targets
The config option "extra_labels_add": ["PSA"] is removed from single v7-M targets and added config option "features_add": ["PSA"]. Rename COMPONENT_NSPE to FEATURE_NSPE, TARGET_PSA with FEATURE_PSA and TARGET_TFM with FEATURE_TFM. The service id definitions (sid.h) are not relevant for single v7-M. Removed them. Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent e953d9c commit 81979b4

File tree

16 files changed

+41
-80
lines changed

16 files changed

+41
-80
lines changed

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Folders containing files under different permissive license than Apache 2.0 are
55

66
- [cmsis](./cmsis) - MIT, BSD-3-Clause
77
- [components/802.15.4_RF/mcr20a-rf-driver](./components/802.15.4_RF/mcr20a-rf-driver) - BSD-3-Clause
8-
- [components/TARGET_PSA/TARGET_TFM](./components/TARGET_PSA/TARGET_TFM) - BSD-3-Clause
9-
- [components/TARGET_PSA/TARGET_PSA/services/attestation](./components/TARGET_PSA/services/attestation) - BSD-3-Clause
108
- [features/cryptocell/FEATURE_CRYPTOCELL310](./features/cryptocell/FEATURE_CRYPTOCELL310) - ARM Object Code and Header Files License
119
- [features/FEATURE_BOOTLOADER](./features/FEATURE_BOOTLOADER) - PBL
1210
- [features/FEATURE_BLE/targets](./features/FEATURE_BLE/targets) - BSD-style, PBL, MIT-style
11+
- [features/FEATURE_PSA/FEATURE_TFM](./features/FEATURE_PSA/FEATURE_TFM) - BSD-3-Clause
12+
- [features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/services/attestation](./features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/services/attestation) - BSD-3-Clause
1313
- [features/lorawan](./features/lorawan) - Revised BSD
1414
- [features/lwipstack](./features/lwipstack) - BSD-style, MIT-style
1515
- [features/nanostack/sal-stack-nanostack](./features/nanostack/sal-stack-nanostack) - BSD-3-Clause

TESTS/mbed-crypto/sanity/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "psa/crypto.h"
1919

20-
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
20+
#if ((!defined(FEATURE_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
2121
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
2222
#endif
2323

TESTS/mbed_hal/trng/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
using namespace utest::v1;
7070

71-
#if (defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
71+
#if (defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
7272
#include "entropy.h"
7373
#include "entropy_poll.h"
7474
#include "crypto.h"
@@ -93,7 +93,7 @@ void inject_entropy_for_psa()
9393
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
9494
}
9595
}
96-
#endif // (defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
96+
#endif // (defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
9797

9898
static int fill_buffer_trng(uint8_t *buffer, trng_t *trng_obj, size_t trng_len)
9999
{
@@ -274,7 +274,7 @@ int main()
274274
#if defined(MBEDTLS_PLATFORM_C)
275275
ret = mbedtls_platform_setup(NULL);
276276
#endif /* MBEDTLS_PLATFORM_C */
277-
#if (defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
277+
#if (defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
278278
inject_entropy_for_psa();
279279
#endif
280280
ret = !Harness::run(specification);

TESTS/mbedtls/selftest/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Case cases[] = {
8484
#endif /* MBEDTLS_SELF_TEST */
8585
};
8686

87-
#if (defined(MBEDTLS_ENTROPY_C) && defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
87+
#if (defined(MBEDTLS_ENTROPY_C) && defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
8888
#include "crypto.h"
8989
#if !defined(MAX)
9090
#define MAX(a,b) (((a)>(b))?(a):(b))
@@ -107,7 +107,7 @@ void inject_entropy_for_psa()
107107
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
108108
}
109109
}
110-
#endif // (defined(MBEDTLS_ENTROPY_C) && defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
110+
#endif // (defined(MBEDTLS_ENTROPY_C) && defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
111111

112112

113113
utest::v1::status_t test_setup(const size_t num_cases)
@@ -128,7 +128,7 @@ int main()
128128
}
129129
#endif
130130

131-
#if (defined(MBEDTLS_ENTROPY_C) && defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
131+
#if (defined(MBEDTLS_ENTROPY_C) && defined(FEATURE_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
132132
inject_entropy_for_psa();
133133
#endif
134134

cmsis/TARGET_CORTEX_M/mbed_tz_context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* limitations under the License.
2323
*/
2424

25-
#if !TARGET_TFM
25+
#if !FEATURE_TFM
2626

2727
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2828

@@ -204,4 +204,4 @@ uint32_t TZ_StoreContext_S (TZ_MemoryId_t id) {
204204
}
205205
#endif
206206

207-
#endif // !TARGET_TFM
207+
#endif // !FEATURE_TFM

features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/inc/psa/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#if defined(TARGET_TFM)
18+
#if defined(FEATURE_TFM)
1919
#include "interface/include/psa_client.h"
2020
#elif defined(TARGET_MBED_SPM)
2121
#include "TARGET_MBED_SPM/psa_defs.h"

features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/inc/psa/service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#if defined(TARGET_TFM)
18+
#if defined(FEATURE_TFM)
1919

2020
#include "interface/include/psa_service.h"
2121
#include "secure_fw/core/ipc/include/tfm_utils.h"

features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/inc/psa_manifest/sid.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

features/FEATURE_PSA/FEATURE_MBED_PSA_SRV/services/storage/its/FEATURE_PSA_SRV_IMPL/pits_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
using namespace mbed;
2828

29-
#if defined(TARGET_TFM)
29+
#if defined(FEATURE_TFM)
3030
KVStore *get_its_kvstore_instance(void);
3131
#else
3232
#include "KVMap.h"
@@ -58,7 +58,7 @@ MBED_WEAK psa_status_t its_version_migrate(KVStore *kvstore,
5858

5959
static void its_init(void)
6060
{
61-
#if defined(TARGET_TFM)
61+
#if defined(FEATURE_TFM)
6262
kvstore = get_its_kvstore_instance();
6363
#else
6464
KVMap &kv_map = KVMap::get_instance();
@@ -124,7 +124,7 @@ psa_status_t psa_its_remove_impl(int32_t pid, psa_storage_uid_t uid)
124124
psa_status_t psa_its_reset_impl()
125125
{
126126
// Do not call its_init here to avoid version check before reset
127-
#if defined(TARGET_TFM)
127+
#if defined(FEATURE_TFM)
128128
kvstore = get_its_kvstore_instance();
129129
#else
130130
KVMap &kv_map = KVMap::get_instance();

features/frameworks/FEATURE_MBED_PSA_SRV/FEATURE_PSA/pal/pal_client_api_intf.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@
1818
#ifndef _PAL_CLIENT_API_H_
1919
#define _PAL_CLIENT_API_H_
2020

21-
#if PSA_IPC_IMPLEMENTED
22-
/* psa/client.h: Contains the Client API elements. Accessible to all applications */
23-
#include "psa/client.h"
24-
25-
/* psa_manifest/sid.h: Macro definitions derived from manifest files that map from RoT Service
26-
* names to Service IDs (SIDs).
27-
* Partition manifest parse build tool must provide the implementation of this file.
28-
*/
29-
#include "psa_manifest/sid.h"
30-
31-
#else
3221
#include "pal_common.h"
3322

3423
#define PSA_VERSION_NONE (0)
@@ -60,7 +49,6 @@ psa_status_t psa_call(psa_handle_t handle,
6049
psa_outvec *out_vec,
6150
size_t out_len);
6251
void psa_close(psa_handle_t handle);
63-
#endif /* PSA_IPC_IMPLEMENTED */
6452

6553
uint32_t pal_ipc_framework_version(void);
6654
uint32_t pal_ipc_version(uint32_t sid);

features/mbedtls/platform/inc/platform_mbed.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#ifndef __PLATFORM_MBED__H__
2222
#define __PLATFORM_MBED__H__
2323

24-
#if (defined(TARGET_PSA) && defined(MBEDTLS_ENTROPY_NV_SEED))
24+
#if (defined(FEATURE_PSA) && defined(MBEDTLS_ENTROPY_NV_SEED))
2525

2626
#include "default_random_seed.h"
2727

@@ -37,7 +37,7 @@
3737
* MBEDTLS_ENTROPY_NV_SEED is enabled. */
3838
#define MBEDTLS_PSA_INJECT_ENTROPY
3939

40-
#endif // (defined(TARGET_PSA) && defined(MBEDTLS_ENTROPY_NV_SEED))
40+
#endif // (defined(FEATURE_PSA) && defined(MBEDTLS_ENTROPY_NV_SEED))
4141

4242
#if DEVICE_TRNG
4343
#define MBEDTLS_ENTROPY_HARDWARE_ALT
@@ -47,7 +47,7 @@
4747
#include "mbedtls_device.h"
4848
#endif
4949

50-
#if defined(TARGET_PSA)
50+
#if defined(FEATURE_PSA)
5151
/* The following configurations are a needed for Mbed Crypto submodule.
5252
* They are related to the persistent key storage feature.
5353
*/

platform/mbed_retarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ extern "C" long PREFIX(_flen)(FILEHANDLE fh)
913913
}
914914

915915
// Do not compile this code for TFM secure target
916-
#if !defined(COMPONENT_SPE) || !defined(TARGET_TFM)
916+
#if defined(FEATURE_NSPE)
917917

918918
#if !defined(__MICROLIB)
919919
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
@@ -979,7 +979,7 @@ extern "C" __value_in_regs struct __initial_stackheap __user_setup_stackheap(uin
979979
return _mbed_user_setup_stackheap(R0, R1, R2, R3);
980980
}
981981

982-
#endif // !defined(COMPONENT_SPE) || !defined(TARGET_TFM)
982+
#endif // !defined(FEATURE_TFM)
983983

984984
#endif
985985

rtos/TARGET_CORTEX/mbed_rtos_rtx.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
#include "spm_init.h"
2929
#include "spm_api.h"
3030
#endif
31-
#if defined(TARGET_TFM) && defined(COMPONENT_NSPE)
32-
#include "TARGET_TFM/interface/include/tfm_ns_lock.h"
31+
#if defined(FEATURE_TFM) && defined(FEATURE_NSPE)
32+
#include "FEATURE_TFM/interface/include/tfm_ns_lock.h"
3333
#endif
3434

35-
#if defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX)
35+
#if defined(FEATURE_NSPE) && defined(FEATURE_SPM_MAILBOX)
3636

3737
MBED_ALIGN(8) char psa_spm_dispatcher_th_stack[0x100];
3838
mbed_rtos_storage_thread_t psa_spm_dispatcher_th_tcb;
@@ -45,7 +45,7 @@ const osThreadAttr_t psa_spm_dispatcher_th_attr = {
4545
.cb_size = sizeof(psa_spm_dispatcher_th_tcb)
4646
};
4747

48-
#endif // defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX)
48+
#endif // defined(FEATURE_NSPE) && defined(FEATURE_SPM_MAILBOX)
4949

5050
osThreadAttr_t _main_thread_attr;
5151

@@ -83,9 +83,9 @@ MBED_NORETURN void mbed_rtos_start()
8383
_main_thread_attr.tz_module = 1U;
8484
#endif
8585

86-
#if defined(COMPONENT_SPM_MAILBOX)
86+
#if defined(FEATURE_SPM_MAILBOX)
8787
spm_ipc_mailbox_init();
88-
#endif // defined(COMPONENT_SPM_MAILBOX)
88+
#endif // defined(FEATURE_SPM_MAILBOX)
8989

9090
#if defined(TARGET_MBED_SPM)
9191

@@ -95,17 +95,17 @@ MBED_NORETURN void mbed_rtos_start()
9595
spm_hal_start_nspe();
9696
#endif // defined(COMPONENT_SPE)
9797

98-
#if defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX)
98+
#if defined(FEATURE_NSPE) && defined(FEATURE_SPM_MAILBOX)
9999
osThreadId_t spm_result = osThreadNew((osThreadFunc_t)psa_spm_mailbox_dispatcher, NULL, &psa_spm_dispatcher_th_attr);
100100
if ((void *)spm_result == NULL) {
101101
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Dispatcher thread not created", &psa_spm_dispatcher_th_attr);
102102
}
103-
#endif // defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX)
103+
#endif // defined(FEATURE_NSPE) && defined(FEATURE_SPM_MAILBOX)
104104
#endif // defined(TARGET_MBED_SPM)
105105

106-
#if defined(TARGET_TFM) && defined(COMPONENT_NSPE)
106+
#if defined(FEATURE_TFM) && defined(FEATURE_NSPE)
107107
tfm_ns_lock_init();
108-
#endif // defined(TARGET_TFM) && defined(COMPONENT_NSPE)
108+
#endif // defined(FEATURE_TFM) && defined(FEATURE_NSPE)
109109

110110
singleton_mutex_id = osMutexNew(&singleton_mutex_attr);
111111
osThreadId_t result = osThreadNew((osThreadFunc_t)mbed_start, NULL, &_main_thread_attr);

targets/TARGET_Cypress/TARGET_PSOC6/trng_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#if DEVICE_TRNG
2121

22-
#if !(defined(TARGET_PSA) && defined(COMPONENT_NSPE))
22+
#if !defined(FEATURE_PSA) && defined(FEATURE_NSPE)
2323

2424
#include "trng_api.h"
2525
#include "psoc6_utils.h"
@@ -72,5 +72,5 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
7272
return (ret);
7373
}
7474

75-
#endif // #if !(defined(TARGET_PSA) && defined(COMPONENT_NSPE))
75+
#endif // #if !defined(FEATURE_PSA) && defined(FEATURE_NSPE)
7676
#endif

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/mbed_rtx.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#if defined(TARGET_MCU_PSOC6_M0)
2323

24-
#ifdef TARGET_PSA
24+
#ifdef FEATURE_PSA
2525
#ifndef INITIAL_SP
2626
#define INITIAL_SP (PSA_SECURE_RAM_START + PSA_SECURE_RAM_SIZE)
2727
#endif // INITIAL_SP
@@ -30,18 +30,18 @@
3030
#define INITIAL_SP (0x08000000 + 0x00010000) // Ram origin + length
3131
#endif // INITIAL_SP
3232

33-
#endif // TARGET_PSA
33+
#endif // FEATURE_PSA
3434
#elif defined(TARGET_MCU_PSOC6_M4)
3535

36-
#ifdef TARGET_PSA
36+
#ifdef FEATURE_PSA
3737
#ifndef INITIAL_SP
3838
#define INITIAL_SP (PSA_NON_SECURE_RAM_START + PSA_NON_SECURE_RAM_SIZE)
3939
#endif // INITIAL_SP
4040
#else
4141
#ifndef INITIAL_SP
4242
#define INITIAL_SP (0x08010000 + 0x00037800) // Ram origin + length
4343
#endif // INITIAL_SP
44-
#endif // TARGET_PSA
44+
#endif // FEATURE_PSA
4545

4646
#else
4747

targets/targets.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,7 @@
14851485
"KPSDK_MCUS",
14861486
"KPSDK_CODE",
14871487
"MCU_K64F",
1488-
"Freescale_EMAC",
1489-
"PSA"
1488+
"Freescale_EMAC"
14901489
],
14911490
"features_add": ["PSA"],
14921491
"is_disk_virtual": true,
@@ -1778,8 +1777,7 @@
17781777
"MCUXpresso_MCUS",
17791778
"KSDK2_MCUS",
17801779
"FRDM",
1781-
"Freescale_EMAC",
1782-
"PSA"
1780+
"Freescale_EMAC"
17831781
],
17841782
"features_add": ["PSA"],
17851783
"is_disk_virtual": true,
@@ -2821,8 +2819,7 @@
28212819
"STM32F429ZI",
28222820
"STM32F429xx",
28232821
"STM32F429xI",
2824-
"STM_EMAC",
2825-
"PSA"
2822+
"STM_EMAC"
28262823
],
28272824
"features_add": ["PSA"],
28282825
"components_add": ["FLASHIAP"],
@@ -4611,7 +4608,6 @@
46114608
"supported_form_factors": ["ARDUINO"],
46124609
"release_versions": ["5"],
46134610
"device_has_remove": [],
4614-
"extra_labels_add": ["PSA"],
46154611
"features_add": ["PSA"],
46164612
"components_add": ["SD", "FLASHIAP"],
46174613
"config": {
@@ -8731,7 +8727,7 @@
87318727
"supported_form_factors": ["ARDUINO"],
87328728
"core": "Cortex-M4F",
87338729
"components_add": ["FLASHIAP"],
8734-
"extra_labels_add": ["GD32F4XX", "GD32F450ZI", "GD_EMAC","PSA"],
8730+
"extra_labels_add": ["GD32F4XX", "GD32F450ZI", "GD_EMAC"],
87358731
"features_add": ["PSA"],
87368732
"device_has_add": [
87378733
"RTC",

0 commit comments

Comments
 (0)