Skip to content

Commit

Permalink
Upload trusted-firmware-m 1.3.3.3125
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Apr 22, 2022
1 parent 3118a80 commit ad842e7
Show file tree
Hide file tree
Showing 29 changed files with 14,051 additions and 13,130 deletions.
17 changes: 9 additions & 8 deletions COMPONENT_TFM_NS_INTERFACE/include/platform_multicore.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2019, Arm Limited. All rights reserved.
* Copyright (c) 2019, Cypress Semiconductor Corporation. All rights reserved
* Copyright (c) 2019-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand All @@ -14,14 +15,14 @@

#define IPC_PSA_CLIENT_CALL_CHAN (8)
#define IPC_PSA_CLIENT_CALL_INTR_STRUCT (6)
#define IPC_PSA_CLIENT_CALL_INTR_MASK (1 << IPC_PSA_CLIENT_CALL_CHAN)
#define IPC_PSA_CLIENT_CALL_NOTIFY_MASK (1 << IPC_PSA_CLIENT_CALL_INTR_STRUCT)
#define IPC_PSA_CLIENT_CALL_INTR_MASK (1UL << IPC_PSA_CLIENT_CALL_CHAN)
#define IPC_PSA_CLIENT_CALL_NOTIFY_MASK (1UL << IPC_PSA_CLIENT_CALL_INTR_STRUCT)
#define IPC_PSA_CLIENT_CALL_IPC_INTR cpuss_interrupts_ipc_6_IRQn

#define IPC_PSA_CLIENT_REPLY_CHAN (9)
#define IPC_PSA_CLIENT_REPLY_INTR_STRUCT (8)
#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_INTR_MASK (1UL << IPC_PSA_CLIENT_REPLY_CHAN)
#define IPC_PSA_CLIENT_REPLY_NOTIFY_MASK (1UL << IPC_PSA_CLIENT_REPLY_INTR_STRUCT)
#define IPC_PSA_CLIENT_REPLY_IPC_INTR cpuss_interrupts_ipc_8_IRQn

#define IPC_PSA_MAILBOX_LOCK_CHAN (10)
Expand All @@ -30,8 +31,8 @@

#define CY_IPC_NOTIFY_SHIFT (16)

#define PSA_CLIENT_CALL_REQ_MAGIC (0xA5CF50C6)
#define PSA_CLIENT_CALL_REPLY_MAGIC (0xC605FC5A)
#define PSA_CLIENT_CALL_REQ_MAGIC (0xA5CF50C6UL)
#define PSA_CLIENT_CALL_REPLY_MAGIC (0xC605FC5AUL)

#define NS_MAILBOX_INIT_ENABLE (0xAE)
#define S_MAILBOX_READY (0xC3)
Expand All @@ -46,7 +47,7 @@
#define PLATFORM_MAILBOX_IPC_CHAN_SEMA CY_IPC_CHAN_SEMA
#define MAILBOX_SEMAPHORE_NUM (16)

#define IPC_SYNC_MAGIC 0x7DADE011
#define IPC_SYNC_MAGIC (0x7DADE011UL)

/**
* \brief Fetch a pointer from mailbox message
Expand Down
2 changes: 2 additions & 0 deletions COMPONENT_TFM_NS_INTERFACE/include/psa/initial_attestation.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2018-2020, Arm Limited. All rights reserved.
* Copyright (c) 2020-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down
18 changes: 0 additions & 18 deletions COMPONENT_TFM_NS_INTERFACE/include/psa_manifest/sid.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,6 @@ extern "C" {
#define TFM_PS_TEST_PREPARE_SID (0x0000F0C0U)
#define TFM_PS_TEST_PREPARE_VERSION (1U)

/******** TFM_SP_PSOC_SERVICE_TEST ********/
#define PSOC_SERVICE_TEST_PSA_INIT_WD_SID (0x00002001U)
#define PSOC_SERVICE_TEST_PSA_INIT_WD_VERSION (1U)
#define PSOC_SERVICE_TEST_PSA_POKE_WD_SID (0x00002002U)
#define PSOC_SERVICE_TEST_PSA_POKE_WD_VERSION (1U)
#define PSOC_SERVICE_TEST_PSA_KILL_WD_SID (0x00002003U)
#define PSOC_SERVICE_TEST_PSA_KILL_WD_VERSION (1U)
#define PSOC_SERVICE_TEST_PSA_WRITE_FLASH_SID (0x00002004U)
#define PSOC_SERVICE_TEST_PSA_WRITE_FLASH_VERSION (1U)
#define PSOC_SERVICE_TEST_PSA_READ_FLASH_SID (0x00002005U)
#define PSOC_SERVICE_TEST_PSA_READ_FLASH_VERSION (1U)
#define PSOC_SERVICE_TEST_PSA_GET_REBOOT_REASON_SID (0x00002006U)
#define PSOC_SERVICE_TEST_PSA_GET_REBOOT_REASON_VERSION (1U)

/******** TFM_PSOC_CLIENT_TEST ********/
#define PSOC_CLIENT_TEST_LVL2_SID (0x00002000U)
#define PSOC_CLIENT_TEST_LVL2_VERSION (1U)

/******** TFM_SP_SECURE_CLIENT_2 ********/
#define TFM_SECURE_CLIENT_2_SID (0x0000F0E0U)
#define TFM_SECURE_CLIENT_2_VERSION (1U)
Expand Down
84 changes: 84 additions & 0 deletions COMPONENT_TFM_NS_INTERFACE/include/static_checks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef __STATIC_CHECKS_H__
#define __STATIC_CHECKS_H__

/*******************************************************************************
* Provides the macros for MISRA and CERT C violation documentation in Coverity tool.
*******************************************************************************/
/*
* Macros usage examples:
* 1. For MISRA checker violation specification used misra_c_2012_rule_12_1 message
* TFM_COVERITY_DEVIATE_LINE(MISRA_C_2012_Rule_12_1, "violation specified message")
*
* 2. For CERT C checker violation specification used cert_exp34_c message
* TFM_COVERITY_DEVIATE_LINE(cert_exp34_c, "violation specified message")
*
* 3. If TFM_COVERITY_BLOCK macro is used then you must use Multiple Checkers
* (TFM_COVERITY_DEVIATE, TFM_COVERITY_DEVIATE_COUNT, TFM_COVERITY_DEVIATE_COUNT, TFM_COVERITY_FP_COUNT)
* as arguments to specified type of actions on violation.
*
* Example:
* TFM_COVERITY_BLOCK(TFM_COVERITY_DEVIATE(cert_int31_c, "type cast is safe because SystemCoreClock limits are checked") \
* TFM_COVERITY_FP(cert_int30_c, "SystemCoreClock limits are checked, wrap is impossible"))
* *****deviated block of code*****
* TFM_COVERITY_BLOCK_END(cert_int31_c cert_int30_c)
*/
#ifdef TFM_COVERITY_CHECK /* Check MISRA-C:2012 and CERT C with Coverity tool */
#define _TFM_COVERITY_STR(a) #a

#define TFM_COVERITY_DEVIATE_LINE(checker, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance deviate checker message))

#define TFM_COVERITY_FP_LINE(checker, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance fp checker message))

#define TFM_COVERITY_DEVIATE_BLOCK(checker, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance block deviate checker message))

#define TFM_COVERITY_DEVIATE_BLOCK_COUNT(checker, count, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance block (deviate:count checker message)))

#define TFM_COVERITY_FP_BLOCK(checker, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance block fp checker message))

#define TFM_COVERITY_FP_BLOCK_COUNT(checker, count, message) \
_Pragma(_TFM_COVERITY_STR(coverity compliance block (fp:count checker message)))

#define TFM_COVERITY_BLOCK(checkers) \
_Pragma(_TFM_COVERITY_STR(coverity compliance block checkers))

#define TFM_COVERITY_BLOCK_END(checker) \
_Pragma(_TFM_COVERITY_STR(coverity compliance end_block checker))

/* Multiple Checkers */
#define TFM_COVERITY_DEVIATE(checker, message) (deviate checker message)
#define TFM_COVERITY_DEVIATE_COUNT(checker, count, message) (deviate:count checker message)
#define TFM_COVERITY_FP(checker, message) (fp checker message)
#define TFM_COVERITY_FP_COUNT(checker, count, message) (fp:count checker message)

#else /* General usage */

#define TFM_COVERITY_DEVIATE_LINE(checker, message)
#define TFM_COVERITY_FP_LINE(checker, message)
#define TFM_COVERITY_DEVIATE_BLOCK(checker, message)
#define TFM_COVERITY_DEVIATE_BLOCK_COUNT(checker, count, message)
#define TFM_COVERITY_FP_BLOCK(checker, message)
#define TFM_COVERITY_FP_BLOCK_COUNT(checker, count, message)
#define TFM_COVERITY_BLOCK(checkers)
#define TFM_COVERITY_BLOCK_END(checker)

/* Multiple Checkers */
#define TFM_COVERITY_DEVIATE(checker, message)
#define TFM_COVERITY_DEVIATE_COUNT(checker, count, message)
#define TFM_COVERITY_FP(checker, message)
#define TFM_COVERITY_FP_COUNT(checker, count, message)

#endif /* TFM_COVERITY_CHECK */

#endif /* __STATIC_CHECKS_H__ */
3 changes: 2 additions & 1 deletion COMPONENT_TFM_NS_INTERFACE/include/tfm_mbedtls_version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Cypress Semiconductor Corporation. All rights reserved.
* Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down
3 changes: 2 additions & 1 deletion COMPONENT_TFM_NS_INTERFACE/src/os_wrapper_cyabs_rtos.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2017-2021, Arm Limited. All rights reserved.
* Copyright (c) 2017-2021, Cypress Semiconductor Corporation.
* Copyright (c) 2017-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down
2 changes: 2 additions & 0 deletions COMPONENT_TFM_NS_INTERFACE/src/os_wrapper_stub.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2017-2019, Arm Limited. All rights reserved.
* Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down
7 changes: 5 additions & 2 deletions COMPONENT_TFM_NS_INTERFACE/src/platform_multicore.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2019-2021 Arm Limited. All rights reserved.
* Copyright (c) 2019 Cypress Semiconductor Corporation. All rights reserved.
* Copyright (c) 2019-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand All @@ -11,6 +12,7 @@
#include "tfm_multi_core_api.h"

#include "cy_ipc_drv.h"
#include "cy_ipc_sema.h"
#include "cy_sysint.h"
#if CY_SYSTEM_CPU_CM0P
#include "spe_ipc_config.h"
Expand Down Expand Up @@ -60,8 +62,9 @@ int platform_mailbox_send_msg_ptr(const void *msg_ptr)
{
cy_en_ipcdrv_status_t status;

if (!msg_ptr)
if (!msg_ptr) {
return PLATFORM_MAILBOX_INVAL_PARAMS;
}

status = Cy_IPC_Drv_SendMsgPtr(Cy_IPC_Drv_GetIpcBaseAddress(IPC_TX_CHAN),
IPC_TX_NOTIFY_MASK, msg_ptr);
Expand Down
16 changes: 6 additions & 10 deletions COMPONENT_TFM_NS_INTERFACE/src/platform_ns_mailbox.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2019-2021, Arm Limited. All rights reserved.
* Copyright (c) 2019, Cypress Semiconductor Corporation. All rights reserved
* Copyright (c) 2019-2022 Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand All @@ -19,7 +20,7 @@
#include "tfm_ns_mailbox.h"
#include "platform_multicore.h"

static uint8_t saved_irq_state = 1;
static uint32_t saved_irq_state = 1UL;

/* -------------------------------------- HAL API ------------------------------------ */

Expand Down Expand Up @@ -59,12 +60,6 @@ int32_t tfm_ns_mailbox_hal_init(struct ns_mailbox_queue_t *queue)
return MAILBOX_INVAL_PARAMS;
}

/*
* FIXME
* Further verification of mailbox queue address may be required according
* to diverse NSPE implementations.
*/

mailbox_ipc_init();

/*
Expand Down Expand Up @@ -151,10 +146,11 @@ static bool mailbox_clear_intr(void)

void cpuss_interrupts_ipc_8_IRQHandler(void)
{
uint32_t magic;
uint32_t magic = 0UL;

if (!mailbox_clear_intr())
if (!mailbox_clear_intr()) {
return;
}

platform_mailbox_fetch_msg_data(&magic);
if (magic == PSA_CLIENT_CALL_REPLY_MAGIC) {
Expand Down
Loading

0 comments on commit ad842e7

Please sign in to comment.