-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload trusted-firmware-m 1.3.1.1441
- Loading branch information
gitlab-runner
committed
Oct 19, 2021
1 parent
334f2df
commit 3118a80
Showing
62 changed files
with
28,016 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2017-2021 Arm Limited | ||
* Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved. | ||
* | ||
* Licensed under the Apache License Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing software | ||
* distributed under the License is distributed on an "AS IS" BASIS | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef __ARM_LTD_DEVICE_CFG_H__ | ||
#define __ARM_LTD_DEVICE_CFG_H__ | ||
|
||
/** | ||
* \file device_cfg.h | ||
* \brief Configuration file native driver re-targeting | ||
* | ||
* \details This file can be used to add native driver specific macro | ||
* definitions to select which peripherals are available in the build. | ||
* | ||
* This is a default device configuration file with all peripherals enabled. | ||
*/ | ||
|
||
/* TCPWM0 Timers (IRQ test) */ | ||
#define CY_TCPWM0_TIMER0_S | ||
#define CY_TCPWM0_TIMER1_NS | ||
|
||
#define DEFAULT_UART_BAUDRATE 115200 | ||
|
||
#endif /* __ARM_LTD_DEVICE_CFG_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2015-2016 ARM Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* ---------------------------------------------------------------------------- | ||
* | ||
* $Date: 21. September 2016 | ||
* $Revision: V1.0 | ||
* | ||
* Project: TrustZone for ARMv8-M | ||
* Title: Context Management for ARMv8-M TrustZone | ||
* | ||
* Version 1.0 | ||
* Initial Release | ||
*---------------------------------------------------------------------------*/ | ||
|
||
#ifndef TZ_CONTEXT_H | ||
#define TZ_CONTEXT_H | ||
|
||
#include <stdint.h> | ||
|
||
#ifndef TZ_MODULEID_T | ||
#define TZ_MODULEID_T | ||
/// \details Data type that identifies secure software modules called by a process. | ||
typedef uint32_t TZ_ModuleId_t; | ||
#endif | ||
|
||
/// \details TZ Memory ID identifies an allocated memory slot. | ||
typedef uint32_t TZ_MemoryId_t; | ||
|
||
/// Initialize secure context memory system | ||
/// \return execution status (1: success, 0: error) | ||
uint32_t TZ_InitContextSystem_S (void); | ||
|
||
/// Allocate context memory for calling secure software modules in TrustZone | ||
/// \param[in] module identifies software modules called from non-secure mode | ||
/// \return value != 0 id TrustZone memory slot identifier | ||
/// \return value 0 no memory available or internal error | ||
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); | ||
|
||
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S | ||
/// \param[in] id TrustZone memory slot identifier | ||
/// \return execution status (1: success, 0: error) | ||
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); | ||
|
||
/// Load secure context (called on RTOS thread context switch) | ||
/// \param[in] id TrustZone memory slot identifier | ||
/// \return execution status (1: success, 0: error) | ||
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); | ||
|
||
/// Store secure context (called on RTOS thread context switch) | ||
/// \param[in] id TrustZone memory slot identifier | ||
/// \return execution status (1: success, 0: error) | ||
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); | ||
|
||
#endif // TZ_CONTEXT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2019 Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef _IPC_CONFIG_H_ | ||
#define _IPC_CONFIG_H_ | ||
|
||
#include "platform_multicore.h" | ||
|
||
#define IPC_RX_CHAN IPC_PSA_CLIENT_REPLY_CHAN | ||
#define IPC_RX_INTR_STRUCT IPC_PSA_CLIENT_REPLY_INTR_STRUCT | ||
#define IPC_RX_INT_MASK IPC_PSA_CLIENT_REPLY_INTR_MASK | ||
|
||
#define IPC_TX_CHAN IPC_PSA_CLIENT_CALL_CHAN | ||
#define IPC_TX_NOTIFY_MASK IPC_PSA_CLIENT_CALL_NOTIFY_MASK | ||
|
||
#define PSA_CLIENT_REPLY_NVIC_IRQn IPC_PSA_CLIENT_REPLY_IPC_INTR | ||
#define PSA_CLIENT_REPLY_IRQ_PRIORITY 3 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2017-2019, Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
*/ | ||
|
||
#ifndef __OS_WRAPPER_COMMON_H__ | ||
#define __OS_WRAPPER_COMMON_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
|
||
#define OS_WRAPPER_SUCCESS (0x0) | ||
#define OS_WRAPPER_ERROR (0xFFFFFFFFU) | ||
#define OS_WRAPPER_WAIT_FOREVER (0xFFFFFFFFU) | ||
#define OS_WRAPPER_DEFAULT_STACK_SIZE (-1) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __OS_WRAPPER_COMMON_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (c) 2020-2021, Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
*/ | ||
|
||
#ifndef __OS_WRAPPER_MSG_QUEUE_H__ | ||
#define __OS_WRAPPER_MSG_QUEUE_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stddef.h> | ||
|
||
#include "common.h" | ||
|
||
/** | ||
* \brief Create and initialize a message queue | ||
* | ||
* \param[in] msg_size The maximum message size in bytes | ||
* \param[in] msg_count The maximum number of messages in queue | ||
* | ||
* \return Returns handle of the message queue created, or NULL in case of error | ||
*/ | ||
void *os_wrapper_msg_queue_create(size_t msg_size, uint8_t msg_count); | ||
|
||
/** | ||
* \brief Send a message via message queue | ||
* | ||
* \param[in] mq_handle The handle of message queue | ||
* \param[in] msg_ptr The pointer to the message to be sent | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS if the message is successfully sent, or | ||
* \ref OS_WRAPPER_ERROR in case of error | ||
* | ||
* \note The message size must be the same as the value set in | ||
* \ref os_wrapper_msg_queue_create. | ||
* | ||
* \note Time out value is not specified here. Whether the function is blocked | ||
* or returns instantly depends on the actual implementation and usage | ||
* scenario. | ||
*/ | ||
int32_t os_wrapper_msg_queue_send(void *mq_handle, | ||
const void *msg_ptr); | ||
|
||
/** | ||
* \brief Receive a message from message queue | ||
* | ||
* \param[in] mq_handle The handle of message queue | ||
* \param[in] msg_ptr The pointer to buffer for message to be received | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS if the message is successfully received, or | ||
* \ref OS_WRAPPER_ERROR in case of error | ||
* | ||
* \note The message size is the same as the value set in | ||
* \ref os_wrapper_msg_queue_create. | ||
* | ||
* \note The function should be blocked until a message is received from message | ||
* queue, unless an error occurs. | ||
*/ | ||
int32_t os_wrapper_msg_queue_receive(void *mq_handle, | ||
void *msg_ptr); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __OS_WRAPPER_MSG_QUEUE_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2017-2019, Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
*/ | ||
|
||
#ifndef __OS_WRAPPER_MUTEX_H__ | ||
#define __OS_WRAPPER_MUTEX_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "common.h" | ||
|
||
/** | ||
* \brief Creates a mutex for mutual exclusion of resources | ||
* | ||
* \return The handle of the created mutex on success or NULL on error | ||
*/ | ||
void *os_wrapper_mutex_create(void); | ||
|
||
/** | ||
* \brief Acquires a mutex that is created by \ref os_wrapper_mutex_create() | ||
* | ||
* \param[in] handle The handle of the mutex to acquire. Should be one of the | ||
* handles returned by \ref os_wrapper_mutex_create() | ||
* \param[in] timeout The maximum amount of time(in tick periods) for the | ||
* thread to wait for the mutex to be available. | ||
* If timeout is zero, the function will return immediately. | ||
* Setting timeout to \ref OS_WRAPPER_WAIT_FOREVER will | ||
* cause the thread to wait indefinitely | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS on success or \ref OS_WRAPPER_ERROR on error | ||
*/ | ||
uint32_t os_wrapper_mutex_acquire(void *handle, uint32_t timeout); | ||
|
||
/** | ||
* \brief Releases the mutex acquired previously | ||
* | ||
* \param[in] handle The handle of the mutex that has been acquired | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS on success or \ref OS_WRAPPER_ERROR on error | ||
*/ | ||
uint32_t os_wrapper_mutex_release(void *handle); | ||
|
||
/** | ||
* \brief Deletes a mutex that is created by \ref os_wrapper_mutex_create() | ||
* | ||
* \param[in] handle The handle of the mutex to be deleted | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS on success or \ref OS_WRAPPER_ERROR on error | ||
*/ | ||
uint32_t os_wrapper_mutex_delete(void *handle); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __OS_WRAPPER_MUTEX_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2017-2020, Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
*/ | ||
|
||
#ifndef __OS_WRAPPER_SEMAPHORE_H__ | ||
#define __OS_WRAPPER_SEMAPHORE_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "common.h" | ||
|
||
/** | ||
* \brief Creates a new semaphore | ||
* | ||
* \param[in] max_count Highest count of the semaphore | ||
* \param[in] initial_count Starting count of the available semaphore | ||
* \param[in] name Name of the semaphore | ||
* | ||
* \return Returns handle of the semaphore created, or NULL in case of error | ||
*/ | ||
void *os_wrapper_semaphore_create(uint32_t max_count, uint32_t initial_count, | ||
const char *name); | ||
|
||
/** | ||
* \brief Acquires the semaphore | ||
* | ||
* \param[in] hanlde Semaphore handle | ||
* \param[in] timeout Timeout value | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS in case of successful acquision, or | ||
* \ref OS_WRAPPER_ERROR in case of error | ||
*/ | ||
uint32_t os_wrapper_semaphore_acquire(void *handle, uint32_t timeout); | ||
|
||
/** | ||
* \brief Releases the semaphore | ||
* | ||
* \param[in] hanlde Semaphore handle | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS in case of successful release, or | ||
* \ref OS_WRAPPER_ERROR in case of error | ||
*/ | ||
uint32_t os_wrapper_semaphore_release(void *handle); | ||
|
||
/** | ||
* \brief Deletes the semaphore | ||
* | ||
* \param[in] handle Semaphore handle | ||
* | ||
* \return \ref OS_WRAPPER_SUCCESS in case of successful release, or | ||
* \ref OS_WRAPPER_ERROR in case of error | ||
*/ | ||
uint32_t os_wrapper_semaphore_delete(void *handle); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __OS_WRAPPER_SEMAPHORE_H__ */ |
Oops, something went wrong.