Skip to content

Commit badfa18

Browse files
Charley ChuRaymond Ngun
authored andcommitted
Move current TFM to TFM_V1_1
Named TFM V1.1 as TFM_V1_1 instead of TFM_V1.1 as TFM_V1.1 is invalid as macro name Signed-off-by: Charley Chu <[email protected]>
1 parent 8b663cf commit badfa18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+14
-22
lines changed

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_DUALCPU/src/platform_ns_mailbox.c renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/src/platform_ns_mailbox.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ int32_t tfm_ns_mailbox_hal_notify_peer(void)
5454

5555
static int32_t mailbox_sema_init(void)
5656
{
57-
#if defined(CY_IPC_DEFAULT_CFG_DISABLE)
5857
/* semaphore data */
5958
static uint32_t tfm_sema __attribute__((section("TFM_SHARED_DATA")));
6059

@@ -63,7 +62,6 @@ static int32_t mailbox_sema_init(void)
6362
&tfm_sema) != CY_IPC_SEMA_SUCCESS) {
6463
return PLATFORM_MAILBOX_INIT_ERROR;
6564
}
66-
#endif
6765
return PLATFORM_MAILBOX_SUCCESS;
6866
}
6967

@@ -120,7 +118,11 @@ int32_t tfm_ns_mailbox_hal_init(struct ns_mailbox_queue_t *queue)
120118

121119
const void *tfm_ns_mailbox_get_task_handle(void)
122120
{
123-
return osThreadGetId();;
121+
#ifdef TFM_MULTI_CORE_MULTI_CLIENT_CALL
122+
return osThreadGetId();
123+
#else
124+
return NULL;
125+
#endif
124126
}
125127

126128
void tfm_ns_mailbox_hal_wait_reply(mailbox_msg_handle_t handle)
@@ -277,7 +279,7 @@ static bool mailbox_clear_intr(void)
277279
return true;
278280
}
279281

280-
void cpuss_interrupts_ipc_8_IRQHandler(void)
282+
void cpuss_interrupts_ipc_5_IRQHandler(void)
281283
{
282284
uint32_t magic;
283285
mailbox_msg_handle_t handle;
@@ -297,6 +299,9 @@ void cpuss_interrupts_ipc_8_IRQHandler(void)
297299

298300
task_handle = (osThreadId_t)tfm_ns_mailbox_get_msg_owner(handle);
299301
if (task_handle) {
302+
/* According to the description of CMSIS-RTOS v2 Thread Flags,
303+
* osThreadFlagsSet() can be called inside Interrupt Service
304+
* Routine. */
300305
osThreadFlagsSet(task_handle, handle);
301306
}
302307
}

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_DUALCPU/src/tfm_multi_core_api.c renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/src/tfm_multi_core_api.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,15 @@
99
#include "tfm_mailbox.h"
1010
#include "tfm_multi_core_api.h"
1111
#include "cmsis_os2.h"
12-
#include "mbed_rtos_storage.h"
1312

1413
#define MAX_SEMAPHORE_COUNT NUM_MAILBOX_QUEUE_SLOT
1514

16-
static void *ns_lock_handle = NULL;
17-
static mbed_rtos_storage_semaphore_t tfm_ns_sema_obj;
15+
static osSemaphoreId_t ns_lock_handle = NULL;
1816

1917
__attribute__((weak))
2018
enum tfm_status_e tfm_ns_interface_init(void)
2119
{
22-
osSemaphoreAttr_t sema_attrib = {
23-
.name = "tfm_ns_lock",
24-
.attr_bits = 0,
25-
.cb_size = sizeof(tfm_ns_sema_obj),
26-
.cb_mem = &tfm_ns_sema_obj
27-
};
20+
osSemaphoreAttr_t sema_attrib = {0};
2821

2922
ns_lock_handle = osSemaphoreNew(MAX_SEMAPHORE_COUNT,
3023
MAX_SEMAPHORE_COUNT,

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/include/platform_multicore.h renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/include/platform_multicore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#define IPC_PSA_CLIENT_CALL_IPC_INTR cpuss_interrupts_ipc_6_IRQn
2020

2121
#define IPC_PSA_CLIENT_REPLY_CHAN (9)
22-
#define IPC_PSA_CLIENT_REPLY_INTR_STRUCT (8)
22+
#define IPC_PSA_CLIENT_REPLY_INTR_STRUCT (5)
2323
#define IPC_PSA_CLIENT_REPLY_INTR_MASK (1 << IPC_PSA_CLIENT_REPLY_CHAN)
2424
#define IPC_PSA_CLIENT_REPLY_NOTIFY_MASK (1 << IPC_PSA_CLIENT_REPLY_INTR_STRUCT)
25-
#define IPC_PSA_CLIENT_REPLY_IPC_INTR cpuss_interrupts_ipc_8_IRQn
25+
#define IPC_PSA_CLIENT_REPLY_IPC_INTR cpuss_interrupts_ipc_5_IRQn
2626

2727
#define IPC_RX_RELEASE_MASK (0)
2828

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/include/tfm_ns_mailbox.h renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/include/tfm_ns_mailbox.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ bool tfm_ns_mailbox_is_msg_replied(mailbox_msg_handle_t handle);
8484
*/
8585
int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue);
8686

87-
#ifdef TFM_MULTI_CORE_MULTI_CLIENT_CALL
8887
/**
8988
* \brief Get the handle of the current non-secure task executing mailbox
9089
* functionalities
@@ -97,12 +96,6 @@ int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue);
9796
* \return Return the handle of task.
9897
*/
9998
const void *tfm_ns_mailbox_get_task_handle(void);
100-
#else
101-
static inline const void *tfm_ns_mailbox_get_task_handle(void)
102-
{
103-
return NULL;
104-
}
105-
#endif
10699

107100
/**
108101
* \brief Fetch the handle to the first replied mailbox message in the NSPE

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
],
136136
"extra_labels": [
137137
"TFM",
138+
"TFM_V1_1",
138139
"TFM_V8M"
139140
],
140141
"device_has": [

0 commit comments

Comments
 (0)