diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/bl2/include/boot_record.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/bl2/include/boot_record.h deleted file mode 100644 index 217a20684c..0000000000 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/bl2/include/boot_record.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2018-2019, Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __BOOT_RECORD_H__ -#define __BOOT_RECORD_H__ - -#include -#include -#include -#include "../ext/mcuboot/bootutil/include/bootutil/image.h" -#include "../ext/mcuboot/include/flash_map/flash_map.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * \enum shared_data_err_t - * - * \brief Return values for adding data entry to shared memory area - */ -enum shared_memory_err_t { - SHARED_MEMORY_OK = 0, - SHARED_MEMORY_OVERFLOW = 1, - SHARED_MEMORY_OVERWRITE = 2, - - /* This is used to force the maximum size */ - TLV_TYPE_MAX = INT_MAX -}; - -/*! - * \enum boot_status_err_t - * - * \brief Return values for saving boot status information to shared memory are - */ -enum boot_status_err_t { - BOOT_STATUS_OK, - BOOT_STATUS_ERROR, -}; - -/*! - * \brief Add a data item to the shared data area between bootloader and - * runtime SW - * - * \param[in] major_type TLV major type, identify consumer - * \param[in] minor_type TLV minor type, identify TLV type - * \param[in] size length of added data - * \param[in] data pointer to data - * - * \return Returns error code as specified in \ref shared_memory_err_t - */ -enum shared_memory_err_t -boot_add_data_to_shared_area(uint8_t major_type, - uint16_t minor_type, - size_t size, - const uint8_t *data); - -/*! - * \brief Add an image's all boot status information to the shared data area - * between bootloader and runtime SW - * - * \param[in] sw_module Identifier of the SW component - * \param[in] hdr Pointer to the image header stored in RAM - * \param[in] fap Pointer to the flash area where image is stored - * - * \return Returns error code as specified in \ref boot_status_err_t - */ -enum boot_status_err_t -boot_save_boot_status(uint8_t sw_module, - const struct image_header *hdr, - const struct flash_area *fap); - -#ifdef __cplusplus -} -#endif - -#endif /* __BOOT_RECORD_H__ */ diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/CMakeLists.inc b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/CMakeLists.inc deleted file mode 100644 index 0b290d5b01..0000000000 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/CMakeLists.inc +++ /dev/null @@ -1,71 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2017-2018, Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -#------------------------------------------------------------------------------- - -#Definitions to compile the "core" module. -#This file assumes it will be included from a project specific cmakefile, and -#will not create a library or executable. -#Inputs: -# TFM_ROOT_DIR - directory where secure FW sourec is located. -# -#Outputs: -# Will modify include directories to make the source compile. -# ALL_SRC_C: C source files to be compiled will be added to this list. -# This shall be added to your add_executable or add_library command. -# ALL_SRC_CXX: C++ source files to be compiled will be added to this list. -# This shall be added to your add_executable or add_library command. -# ALL_SRC_ASM: assembly source files to be compiled will be added to this -# list. This shall be added to your add_executable or add_library -# command. -# Include directories will be modified by using the include_directories() -# commands as needed. - -#Get the current directory where this file is located. -set(SS_CORE_DIR ${CMAKE_CURRENT_LIST_DIR}) -if(NOT DEFINED TFM_ROOT_DIR) - message(FATAL_ERROR - "Please set TFM_ROOT_DIR before including this file.") -endif() - -set (SS_CORE_C_SRC - "${SS_CORE_DIR}/tfm_core.c" - "${SS_CORE_DIR}/tfm_handler.c" - "${SS_CORE_DIR}/tfm_secure_api.c" - "${SS_CORE_DIR}/tfm_spm_services.c" - "${SS_CORE_DIR}/tfm_nspm.c" - "${SS_CORE_DIR}/tfm_boot_data.c" - ) - -#Append all our source files to global lists. -list(APPEND ALL_SRC_C ${SS_CORE_C_SRC}) -unset(SS_CORE_C_SRC) - -#Setting include directories -embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core ABSOLUTE) - -set(BUILD_CMSIS_CORE Off) -set(BUILD_RETARGET Off) -set(BUILD_NATIVE_DRIVERS Off) -set(BUILD_STARTUP Off) -set(BUILD_TARGET_CFG Off) -set(BUILD_TARGET_HARDWARE_KEYS Off) -set(BUILD_TARGET_NV_COUNTERS Off) -set(BUILD_CMSIS_DRIVERS Off) -set(BUILD_TIME Off) -set(BUILD_UART_STDOUT Off) -set(BUILD_FLASH Off) -set(BUILD_BOOT_SEED Off) -set(BUILD_DEVICE_ID Off) -if(NOT DEFINED PLATFORM_CMAKE_FILE) - message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") -elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) - message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") -else() - include(${PLATFORM_CMAKE_FILE}) -endif() diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/CMakeLists.inc b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/CMakeLists.inc deleted file mode 100644 index 59c074e60f..0000000000 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/CMakeLists.inc +++ /dev/null @@ -1,74 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2018, Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -#------------------------------------------------------------------------------- - -#Definitions to compile the "ipc" module. -#This file assumes it will be included from a project specific cmakefile, and -#will not create a library or executable. -#Inputs: -# TFM_ROOT_DIR - directory where secure FW sourec is located. -# -#Outputs: -# Will modify include directories to make the source compile. -# ALL_SRC_C: C source files to be compiled will be added to this list. -# This shall be added to your add_executable or add_library command. -# ALL_SRC_CXX: C++ source files to be compiled will be added to this list. -# This shall be added to your add_executable or add_library command. -# ALL_SRC_ASM: assembly source files to be compiled will be added to this -# list. This shall be added to your add_executable or add_library -# command. -# Include directories will be modified by using the include_directories() -# commands as needed. - -#Get the current directory where this file is located. -set(SS_IPC_DIR ${CMAKE_CURRENT_LIST_DIR}) -if(NOT DEFINED TFM_ROOT_DIR) - message(FATAL_ERROR - "Please set TFM_ROOT_DIR before including this file.") -endif() - -if (NOT DEFINED TFM_PSA_API) - message(FATAL_ERROR "Incomplete build configuration: TFM_PSA_API is undefined. ") -elseif (TFM_PSA_API) - set (SS_IPC_C_SRC "${SS_IPC_DIR}/tfm_svcalls.c" - "${SS_IPC_DIR}/psa_service.c" - "${SS_IPC_DIR}/psa_client.c" - "${SS_IPC_DIR}/tfm_arch_v8m.c" - "${SS_IPC_DIR}/tfm_thread.c" - "${SS_IPC_DIR}/tfm_wait.c" - "${SS_IPC_DIR}/tfm_utils.c" - "${SS_IPC_DIR}/tfm_message_queue.c" - "${SS_IPC_DIR}/tfm_pools.c" - "${SS_IPC_DIR}/tfm_spm.c" - "${SS_IPC_DIR}/../tfm_core.c" - "${SS_IPC_DIR}/../tfm_secure_api.c" - "${SS_IPC_DIR}/../tfm_spm_services.c" - "${SS_IPC_DIR}/../tfm_handler.c" - "${SS_IPC_DIR}/../tfm_psa_api_client.c" - "${SS_IPC_DIR}/../tfm_nspm.c" - "${SS_IPC_DIR}/../tfm_boot_data.c" - ) -endif() - -#Append all our source files to global lists. -list(APPEND ALL_SRC_C ${SS_IPC_C_SRC}) -unset(SS_IPC_C_SRC) - -#Setting include directories -embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core/ipc ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core/ipc/include ABSOLUTE) - -if(NOT DEFINED PLATFORM_CMAKE_FILE) - message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") -elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) - message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") -else() - include(${PLATFORM_CMAKE_FILE}) -endif() diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_message_queue.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_message_queue.h index a00c179893..44f5af44bf 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_message_queue.h +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_message_queue.h @@ -7,7 +7,9 @@ #ifndef __TFM_MESSAGE_QUEUE_H__ #define __TFM_MESSAGE_QUEUE_H__ +#ifndef TFM_MSG_QUEUE_MAX_MSG_NUM #define TFM_MSG_QUEUE_MAX_MSG_NUM 128 +#endif #define TFM_MSG_MAGIC 0x15154343 /* Message struct to collect parameter from client */ struct tfm_msg_body_t { diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm.h index d197ae9a8c..b089d008e9 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm.h +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm.h @@ -10,11 +10,15 @@ #include #include "tfm_list.h" +#ifndef TFM_SPM_MAX_ROT_SERV_NUM #define TFM_SPM_MAX_ROT_SERV_NUM 28 +#endif #define TFM_VERSION_POLICY_RELAXED 0 #define TFM_VERSION_POLICY_STRICT 1 +#ifndef TFM_CONN_HANDLE_MAX_NUM #define TFM_CONN_HANDLE_MAX_NUM 32 +#endif /* RoT connection handle list */ struct tfm_conn_handle_t { diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm_signal_defs.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm_signal_defs.h deleted file mode 100644 index 924de1f74a..0000000000 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/include/tfm_spm_signal_defs.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2018-2019, Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ -#ifndef __TFM_SPM_SIGNAL_DEFS_H__ -#define __TFM_SPM_SIGNAL_DEFS_H__ - -#include "test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h" -#include "test/test_services/tfm_core_test/tfm_ss_core_test_signal.h" -#include "test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h" - -#endif diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c index dfc8c94c9d..0b43660ec8 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c @@ -46,7 +46,7 @@ TFM_POOL_DECLARE(msg_db_pool, sizeof(struct tfm_msg_body_t), TFM_MSG_QUEUE_MAX_MSG_NUM); static struct tfm_spm_service_db_t g_spm_service_db[] = { - #include "secure_fw/services/tfm_service_list.inc" + #include "tfm_service_list.inc" }; /********************** SPM functions for handler mode ***********************/ diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/secure_utilities.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/secure_utilities.h index 99962d37f3..8c96de8f3d 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/secure_utilities.h +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/secure_utilities.h @@ -25,6 +25,8 @@ #define EXC_NUM_PENDSV (14) #define EXC_NUM_SYSTICK (15) +#define printf(...) + /* Disable NS exceptions by setting NS PRIMASK to 1 */ #define TFM_NS_EXC_DISABLE() __TZ_set_PRIMASK_NS(1) /* Enable NS exceptions by setting NS PRIMASK to 0 */ diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_core.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_core.c index 7cf65082a9..db5921061e 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_core.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_core.c @@ -11,7 +11,6 @@ #include "tfm_internal.h" #include "tfm_api.h" #include "platform/include/tfm_spm_hal.h" -#include "uart_stdout.h" #include "secure_utilities.h" #include "secure_fw/spm/spm_api.h" #include "secure_fw/include/tfm_spm_services_api.h" @@ -88,7 +87,6 @@ int32_t tfm_core_init(void) __enable_irq(); - stdio_init(); LOG_MSG("Secure image initializing!"); #ifdef TFM_CORE_DEBUG diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_secure_api.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_secure_api.c index 0d0f8ff570..0b11881bb7 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_secure_api.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_secure_api.c @@ -12,7 +12,6 @@ #include "tfm_secure_api.h" #include "tfm_nspm.h" #include "secure_utilities.h" -#include "uart_stdout.h" #include "secure_fw/spm/spm_api.h" #include "region_defs.h" #include "tfm_api.h" diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/CMakeLists.inc b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/CMakeLists.inc deleted file mode 100644 index d1e57d888f..0000000000 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/CMakeLists.inc +++ /dev/null @@ -1,61 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2017-2018, Arm Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -#------------------------------------------------------------------------------- - -#Definitions to compile the "spm" module. -#This file assumes it will be included from a project specific cmakefile, and -#will not create a library or executable. -#Inputs: -# TFM_ROOT_DIR - root directory of the TF-M repository. -# -#Outputs: -# Will modify include directories to make the source compile. -# ALL_SRC_C: C source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. -# ALL_SRC_CXX: C++ source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. -# ALL_SRC_ASM: assembly source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. -# Include directories will be modified by using the include_directories() commands as needed. - -#Get the current directory where this file is located. -set(SS_SPM_DIR ${CMAKE_CURRENT_LIST_DIR}) -if(NOT DEFINED TFM_ROOT_DIR) - message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.") -endif() - -set (SS_SPM_C_SRC "${SS_SPM_DIR}/spm_api.c") - - -#Append all our source files to global lists. -list(APPEND ALL_SRC_C ${SS_SPM_C_SRC}) -unset(SS_SPM_C_SRC) - -#Setting include directories -embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core ABSOLUTE) -embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) - -set(BUILD_CMSIS_CORE Off) -set(BUILD_RETARGET Off) -set(BUILD_NATIVE_DRIVERS Off) -set(BUILD_STARTUP Off) -set(BUILD_TARGET_CFG Off) -set(BUILD_TARGET_HARDWARE_KEYS Off) -set(BUILD_TARGET_NV_COUNTERS Off) -set(BUILD_CMSIS_DRIVERS Off) -set(BUILD_TIME Off) -set(BUILD_UART_STDOUT Off) -set(BUILD_FLASH Off) -set(BUILD_BOOT_SEED Off) -set(BUILD_DEVICE_ID Off) -if(NOT DEFINED PLATFORM_CMAKE_FILE) - message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") -elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) - message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") -else() - include(${PLATFORM_CMAKE_FILE}) -endif() - diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_api.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_api.c index e08230abd8..ff994d8bab 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_api.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_api.c @@ -122,7 +122,7 @@ enum spm_err_t tfm_spm_db_init(void) ++g_spm_partition_db.partition_count; /* Add user-defined secure partitions */ - #include "secure_fw/services/tfm_partition_list.inc" + #include "tfm_partition_list.inc" g_spm_partition_db.is_init = 1; diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_partition_defs.h b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_partition_defs.h index 85ab1eca6e..0533881f87 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_partition_defs.h +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_partition_defs.h @@ -29,7 +29,7 @@ */ #define TFM_SP_CORE_ID (1) -#include "secure_fw/services/tfm_partition_defs.inc" +#include "tfm_partition_defs.inc" /* This limit is only used to define the size of the database reserved for * partitions. There's no requirement that it match the number of partitions