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 <haoc@cypress.com>
pull/13358/head
Charley Chu 2020-07-17 12:27:37 -07:00 committed by Raymond Ngun
parent 8b663cfaa5
commit badfa189d6
45 changed files with 14 additions and 22 deletions

View File

@ -54,7 +54,6 @@ int32_t tfm_ns_mailbox_hal_notify_peer(void)
static int32_t mailbox_sema_init(void) static int32_t mailbox_sema_init(void)
{ {
#if defined(CY_IPC_DEFAULT_CFG_DISABLE)
/* semaphore data */ /* semaphore data */
static uint32_t tfm_sema __attribute__((section("TFM_SHARED_DATA"))); static uint32_t tfm_sema __attribute__((section("TFM_SHARED_DATA")));
@ -63,7 +62,6 @@ static int32_t mailbox_sema_init(void)
&tfm_sema) != CY_IPC_SEMA_SUCCESS) { &tfm_sema) != CY_IPC_SEMA_SUCCESS) {
return PLATFORM_MAILBOX_INIT_ERROR; return PLATFORM_MAILBOX_INIT_ERROR;
} }
#endif
return PLATFORM_MAILBOX_SUCCESS; return PLATFORM_MAILBOX_SUCCESS;
} }
@ -120,7 +118,11 @@ int32_t tfm_ns_mailbox_hal_init(struct ns_mailbox_queue_t *queue)
const void *tfm_ns_mailbox_get_task_handle(void) const void *tfm_ns_mailbox_get_task_handle(void)
{ {
return osThreadGetId();; #ifdef TFM_MULTI_CORE_MULTI_CLIENT_CALL
return osThreadGetId();
#else
return NULL;
#endif
} }
void tfm_ns_mailbox_hal_wait_reply(mailbox_msg_handle_t handle) void tfm_ns_mailbox_hal_wait_reply(mailbox_msg_handle_t handle)
@ -277,7 +279,7 @@ static bool mailbox_clear_intr(void)
return true; return true;
} }
void cpuss_interrupts_ipc_8_IRQHandler(void) void cpuss_interrupts_ipc_5_IRQHandler(void)
{ {
uint32_t magic; uint32_t magic;
mailbox_msg_handle_t handle; mailbox_msg_handle_t handle;
@ -297,6 +299,9 @@ void cpuss_interrupts_ipc_8_IRQHandler(void)
task_handle = (osThreadId_t)tfm_ns_mailbox_get_msg_owner(handle); task_handle = (osThreadId_t)tfm_ns_mailbox_get_msg_owner(handle);
if (task_handle) { if (task_handle) {
/* According to the description of CMSIS-RTOS v2 Thread Flags,
* osThreadFlagsSet() can be called inside Interrupt Service
* Routine. */
osThreadFlagsSet(task_handle, handle); osThreadFlagsSet(task_handle, handle);
} }
} }

View File

@ -9,22 +9,15 @@
#include "tfm_mailbox.h" #include "tfm_mailbox.h"
#include "tfm_multi_core_api.h" #include "tfm_multi_core_api.h"
#include "cmsis_os2.h" #include "cmsis_os2.h"
#include "mbed_rtos_storage.h"
#define MAX_SEMAPHORE_COUNT NUM_MAILBOX_QUEUE_SLOT #define MAX_SEMAPHORE_COUNT NUM_MAILBOX_QUEUE_SLOT
static void *ns_lock_handle = NULL; static osSemaphoreId_t ns_lock_handle = NULL;
static mbed_rtos_storage_semaphore_t tfm_ns_sema_obj;
__attribute__((weak)) __attribute__((weak))
enum tfm_status_e tfm_ns_interface_init(void) enum tfm_status_e tfm_ns_interface_init(void)
{ {
osSemaphoreAttr_t sema_attrib = { osSemaphoreAttr_t sema_attrib = {0};
.name = "tfm_ns_lock",
.attr_bits = 0,
.cb_size = sizeof(tfm_ns_sema_obj),
.cb_mem = &tfm_ns_sema_obj
};
ns_lock_handle = osSemaphoreNew(MAX_SEMAPHORE_COUNT, ns_lock_handle = osSemaphoreNew(MAX_SEMAPHORE_COUNT,
MAX_SEMAPHORE_COUNT, MAX_SEMAPHORE_COUNT,

View File

@ -19,10 +19,10 @@
#define IPC_PSA_CLIENT_CALL_IPC_INTR cpuss_interrupts_ipc_6_IRQn #define IPC_PSA_CLIENT_CALL_IPC_INTR cpuss_interrupts_ipc_6_IRQn
#define IPC_PSA_CLIENT_REPLY_CHAN (9) #define IPC_PSA_CLIENT_REPLY_CHAN (9)
#define IPC_PSA_CLIENT_REPLY_INTR_STRUCT (8) #define IPC_PSA_CLIENT_REPLY_INTR_STRUCT (5)
#define IPC_PSA_CLIENT_REPLY_INTR_MASK (1 << IPC_PSA_CLIENT_REPLY_CHAN) #define IPC_PSA_CLIENT_REPLY_INTR_MASK (1 << IPC_PSA_CLIENT_REPLY_CHAN)
#define IPC_PSA_CLIENT_REPLY_NOTIFY_MASK (1 << IPC_PSA_CLIENT_REPLY_INTR_STRUCT) #define IPC_PSA_CLIENT_REPLY_NOTIFY_MASK (1 << IPC_PSA_CLIENT_REPLY_INTR_STRUCT)
#define IPC_PSA_CLIENT_REPLY_IPC_INTR cpuss_interrupts_ipc_8_IRQn #define IPC_PSA_CLIENT_REPLY_IPC_INTR cpuss_interrupts_ipc_5_IRQn
#define IPC_RX_RELEASE_MASK (0) #define IPC_RX_RELEASE_MASK (0)

View File

@ -84,7 +84,6 @@ bool tfm_ns_mailbox_is_msg_replied(mailbox_msg_handle_t handle);
*/ */
int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue); int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue);
#ifdef TFM_MULTI_CORE_MULTI_CLIENT_CALL
/** /**
* \brief Get the handle of the current non-secure task executing mailbox * \brief Get the handle of the current non-secure task executing mailbox
* functionalities * functionalities
@ -97,12 +96,6 @@ int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue);
* \return Return the handle of task. * \return Return the handle of task.
*/ */
const void *tfm_ns_mailbox_get_task_handle(void); const void *tfm_ns_mailbox_get_task_handle(void);
#else
static inline const void *tfm_ns_mailbox_get_task_handle(void)
{
return NULL;
}
#endif
/** /**
* \brief Fetch the handle to the first replied mailbox message in the NSPE * \brief Fetch the handle to the first replied mailbox message in the NSPE

View File

@ -135,6 +135,7 @@
], ],
"extra_labels": [ "extra_labels": [
"TFM", "TFM",
"TFM_V1_1",
"TFM_V8M" "TFM_V8M"
], ],
"device_has": [ "device_has": [