Build: Follow the 'source_structure.rst'
This is the first patch to follow the first commit of source structure
document. The items under the 'secure_fw' folder are re-organized:
- Create/Move some folders/files to follow document.
- Rename some folders to foll, for example, 'secure_fw/services' to
'secure_fw/partitions'.
- Update affected files to make it work.
This is a big change, to make the structure meet the basic shape of
the structure document defined, and make it easier to be understood
for users. Staging changes are not applicable so they are combined
into one - and because it is not the final shape yet, so:
- Upcoming updates on the 'secure_fw' folder would follow up soon.
- Fine-tune about the 'source_structure.rst' would come, too.
Change-Id: I5c11175e0a4579cd9b42d3e3519dbffb87334d0b
Signed-off-by: Ken Liu <ken.liu@arm.com>
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index cd4273d..bf9b545 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -97,17 +97,14 @@
message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_ENABLE_IRQ_TEST is not defined.")
endif()
-include(${SECURE_FW_DIR}/spm/CMakeLists.inc)
-if (NOT DEFINED TFM_MULTI_CORE_TOPOLOGY OR NOT TFM_MULTI_CORE_TOPOLOGY)
- include(${SECURE_FW_DIR}/ns_callable/CMakeLists.inc)
-endif ()
#Involve all IPC related sources in ipc's CMakeLists.inc, and switch core between IPC and Library.
if(TFM_PSA_API)
- include(${SECURE_FW_DIR}/core/ipc/CMakeLists.inc)
+ include(${SECURE_FW_DIR}/spm/model_ipc/CMakeLists.inc)
else()
- include(${SECURE_FW_DIR}/core/CMakeLists.inc)
+ include(${SECURE_FW_DIR}/spm/model_func/CMakeLists.inc)
endif()
-include(${SECURE_FW_DIR}/core/arch/CMakeLists.inc)
+
+include(${SECURE_FW_DIR}/spm/arch/CMakeLists.inc)
set(BUILD_CMSIS_CORE On)
set(BUILD_RETARGET On)
@@ -506,36 +503,36 @@
#Add the crypto library target
if (TFM_PARTITION_CRYPTO)
- add_subdirectory(${SECURE_FW_DIR}/services/crypto)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/crypto)
endif()
#Add the secure storage library target
if (TFM_PARTITION_SECURE_STORAGE)
- add_subdirectory(${SECURE_FW_DIR}/services/secure_storage)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/secure_storage)
endif()
#Add the internal trusted storage library target
if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
- add_subdirectory(${SECURE_FW_DIR}/services/internal_trusted_storage)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/internal_trusted_storage)
endif()
#Add the platform service library target
if (TFM_PARTITION_PLATFORM)
- add_subdirectory(${SECURE_FW_DIR}/services/platform)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/platform)
endif()
#Add the initial attestation service library target
if (TFM_PARTITION_INITIAL_ATTESTATION)
- add_subdirectory(${SECURE_FW_DIR}/services/initial_attestation)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/initial_attestation)
endif()
#Add the audit logging library target
if (TFM_PARTITION_AUDIT_LOG)
- add_subdirectory(${SECURE_FW_DIR}/services/audit_logging)
+ add_subdirectory(${SECURE_FW_DIR}/partitions/audit_logging)
endif()
#Add the secure runtime library target
-add_subdirectory(${SECURE_FW_DIR}/lib/sprt)
+add_subdirectory(${SECURE_FW_DIR}/partitions/lib/sprt)
if (NOT DEFINED TFM_MULTI_CORE_TOPOLOGY OR NOT TFM_MULTI_CORE_TOPOLOGY)
#Broadcast veneer path in bundled building case
diff --git a/secure_fw/core/CMakeLists.inc b/secure_fw/core/CMakeLists.inc
deleted file mode 100644
index 1a2ded0..0000000
--- a/secure_fw/core/CMakeLists.inc
+++ /dev/null
@@ -1,74 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2020, 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_core_svcalls_func.c"
- "${SS_CORE_DIR}/tfm_secure_api.c"
- "${SS_CORE_DIR}/tfm_spm_services.c"
- "${SS_CORE_DIR}/tfm_nspm_func.c"
- "${SS_CORE_DIR}/tfm_boot_data.c"
- "${SS_CORE_DIR}/tfm_utils.c"
- "${SS_CORE_DIR}/tfm_core_mem_check.c"
- "${SS_CORE_DIR}/tfm_core_utils.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/include ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core/arch/include 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_PLAT_TEST 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/secure_fw/core/dir_core.dox b/secure_fw/core/dir_core.dox
deleted file mode 100644
index a8da848..0000000
--- a/secure_fw/core/dir_core.dox
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-//This file holds description for the current directory. This documentation
-//will be included in the Doxygen output.
-
-/*!
-\dir
-\brief Source code for the TF-M core.
-\details This directory holds the source code of the "TF-M core" module.
-
-*/
\ No newline at end of file
diff --git a/secure_fw/core/ipc/CMakeLists.inc b/secure_fw/core/ipc/CMakeLists.inc
deleted file mode 100644
index 3559b2b..0000000
--- a/secure_fw/core/ipc/CMakeLists.inc
+++ /dev/null
@@ -1,84 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, 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_thread.c"
- "${SS_IPC_DIR}/tfm_wait.c"
- "${SS_IPC_DIR}/tfm_message_queue.c"
- "${SS_IPC_DIR}/tfm_pools.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_utils.c"
- "${SS_IPC_DIR}/../tfm_core_svcalls_ipc.c"
- "${SS_IPC_DIR}/../tfm_boot_data.c"
- "${SS_IPC_DIR}/../tfm_core_utils.c"
- )
-
- # Add multi-core topology support
- if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
- list(APPEND SS_IPC_C_SRC "${SS_IPC_DIR}/tfm_rpc.c"
- "${SS_IPC_DIR}/tfm_spe_mailbox.c"
- "${SS_IPC_DIR}/tfm_multi_core.c"
- "${SS_IPC_DIR}/tfm_multi_core_mem_check.c"
- )
- else ()
- list(APPEND SS_IPC_C_SRC "${SS_IPC_DIR}/../tfm_nspm_ipc.c"
- "${SS_IPC_DIR}/../tfm_core_mem_check.c"
- )
- endif ()
-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}/platform/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/include 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)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core/arch/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/secure_fw/dir_secure_fw.dox b/secure_fw/dir_secure_fw.dox
deleted file mode 100644
index df4dbc2..0000000
--- a/secure_fw/dir_secure_fw.dox
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-//This file holds description for the current directory. This documentation
-//will be included in the Doxygen output.
-
-/*!
-\dir
-\brief Source code for the secure side application.
-\details This directory holds the source code of the secure side application.
-This mainly means the TF-M core and the services.
-
-*/
\ No newline at end of file
diff --git a/secure_fw/include/dir_include.dox b/secure_fw/include/dir_include.dox
deleted file mode 100644
index 10d074f..0000000
--- a/secure_fw/include/dir_include.dox
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-//This file holds description for the current directory. This documentation
-//will be included in the Doxygen output.
-
-/*!
-\dir
-\brief Include files for the TF-M.
-\details This directory currently only holds the include file for the SPM
-module.
-
-*/
diff --git a/secure_fw/spm/spm_api.h b/secure_fw/include/tfm/spm_api.h
similarity index 99%
rename from secure_fw/spm/spm_api.h
rename to secure_fw/include/tfm/spm_api.h
index fa0a02d..83b3801 100644
--- a/secure_fw/spm/spm_api.h
+++ b/secure_fw/include/tfm/spm_api.h
@@ -10,7 +10,7 @@
/* This file contains the apis exported by the SPM to tfm core */
#include "tfm_api.h"
-#include "spm_partition_defs.h"
+#include "tfm/spm_partition_defs.h"
#include "tfm_secure_api.h"
#include <stdbool.h>
#ifdef TFM_PSA_API
diff --git a/secure_fw/spm/spm_db.h b/secure_fw/include/tfm/spm_db.h
similarity index 98%
rename from secure_fw/spm/spm_db.h
rename to secure_fw/include/tfm/spm_db.h
index 656bdac..912b438 100644
--- a/secure_fw/spm/spm_db.h
+++ b/secure_fw/include/tfm/spm_db.h
@@ -9,7 +9,6 @@
#define __SPM_DB_H__
#include <stdint.h>
-#include "spm_api.h"
#include "target_cfg.h"
#ifdef TFM_PSA_API
#include "tfm_spm_hal.h"
diff --git a/secure_fw/spm/spm_partition_defs.h b/secure_fw/include/tfm/spm_partition_defs.h
similarity index 100%
rename from secure_fw/spm/spm_partition_defs.h
rename to secure_fw/include/tfm/spm_partition_defs.h
diff --git a/secure_fw/include/core/tfm_core_svc.h b/secure_fw/include/tfm/tfm_core_svc.h
similarity index 100%
rename from secure_fw/include/core/tfm_core_svc.h
rename to secure_fw/include/tfm/tfm_core_svc.h
diff --git a/secure_fw/include/tfm_spm_services_api.h b/secure_fw/include/tfm/tfm_spm_services_api.h
similarity index 100%
rename from secure_fw/include/tfm_spm_services_api.h
rename to secure_fw/include/tfm/tfm_spm_services_api.h
diff --git a/secure_fw/ns_callable/CMakeLists.inc b/secure_fw/ns_callable/CMakeLists.inc
deleted file mode 100644
index 13a9ed3..0000000
--- a/secure_fw/ns_callable/CMakeLists.inc
+++ /dev/null
@@ -1,39 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "NS Callable" 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 source 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 the 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_NS_CALLABLE_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 (TFM_PSA_API)
- set (SS_NS_CALLABLE_C_SRC "${CMAKE_CURRENT_LIST_DIR}/tfm_psa_api_veneers.c")
-else()
- set (SS_NS_CALLABLE_C_SRC "${CMAKE_CURRENT_LIST_DIR}/tfm_veneers.c")
-endif()
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${SS_NS_CALLABLE_C_SRC})
-unset(SS_NS_CALLABLE_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)
diff --git a/secure_fw/ns_callable/dir_ns_callable.dox b/secure_fw/ns_callable/dir_ns_callable.dox
deleted file mode 100644
index d09a913..0000000
--- a/secure_fw/ns_callable/dir_ns_callable.dox
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-//This file holds description for the current directory. This documentation
-//will be included in the Doxygen output.
-
-/*!
-\dir
-\brief Source code for veeners callable from the non-secure
-domain.
-\details Each service has a .c file here which implement the entry points for
-service function calls.
-
-*/
\ No newline at end of file
diff --git a/secure_fw/services/audit_logging/CMakeLists.inc b/secure_fw/partitions/audit_logging/CMakeLists.inc
similarity index 100%
rename from secure_fw/services/audit_logging/CMakeLists.inc
rename to secure_fw/partitions/audit_logging/CMakeLists.inc
diff --git a/secure_fw/services/audit_logging/CMakeLists.txt b/secure_fw/partitions/audit_logging/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/audit_logging/CMakeLists.txt
rename to secure_fw/partitions/audit_logging/CMakeLists.txt
diff --git a/secure_fw/services/audit_logging/audit_core.c b/secure_fw/partitions/audit_logging/audit_core.c
similarity index 100%
rename from secure_fw/services/audit_logging/audit_core.c
rename to secure_fw/partitions/audit_logging/audit_core.c
diff --git a/secure_fw/services/audit_logging/audit_core.h b/secure_fw/partitions/audit_logging/audit_core.h
similarity index 100%
rename from secure_fw/services/audit_logging/audit_core.h
rename to secure_fw/partitions/audit_logging/audit_core.h
diff --git a/secure_fw/services/audit_logging/dir_audit_logging.dox b/secure_fw/partitions/audit_logging/dir_audit_logging.dox
similarity index 100%
rename from secure_fw/services/audit_logging/dir_audit_logging.dox
rename to secure_fw/partitions/audit_logging/dir_audit_logging.dox
diff --git a/secure_fw/services/audit_logging/psa_manifest/tfm_audit_logging.h b/secure_fw/partitions/audit_logging/psa_manifest/tfm_audit_logging.h
similarity index 100%
rename from secure_fw/services/audit_logging/psa_manifest/tfm_audit_logging.h
rename to secure_fw/partitions/audit_logging/psa_manifest/tfm_audit_logging.h
diff --git a/secure_fw/services/audit_logging/tfm_audit_logging.yaml b/secure_fw/partitions/audit_logging/tfm_audit_logging.yaml
similarity index 100%
rename from secure_fw/services/audit_logging/tfm_audit_logging.yaml
rename to secure_fw/partitions/audit_logging/tfm_audit_logging.yaml
diff --git a/secure_fw/services/audit_logging/tfm_audit_secure_api.c b/secure_fw/partitions/audit_logging/tfm_audit_secure_api.c
similarity index 100%
rename from secure_fw/services/audit_logging/tfm_audit_secure_api.c
rename to secure_fw/partitions/audit_logging/tfm_audit_secure_api.c
diff --git a/secure_fw/services/crypto/CMakeLists.inc b/secure_fw/partitions/crypto/CMakeLists.inc
similarity index 100%
rename from secure_fw/services/crypto/CMakeLists.inc
rename to secure_fw/partitions/crypto/CMakeLists.inc
diff --git a/secure_fw/services/crypto/CMakeLists.txt b/secure_fw/partitions/crypto/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/crypto/CMakeLists.txt
rename to secure_fw/partitions/crypto/CMakeLists.txt
diff --git a/secure_fw/services/crypto/crypto_aead.c b/secure_fw/partitions/crypto/crypto_aead.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_aead.c
rename to secure_fw/partitions/crypto/crypto_aead.c
diff --git a/secure_fw/services/crypto/crypto_alloc.c b/secure_fw/partitions/crypto/crypto_alloc.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_alloc.c
rename to secure_fw/partitions/crypto/crypto_alloc.c
diff --git a/secure_fw/services/crypto/crypto_asymmetric.c b/secure_fw/partitions/crypto/crypto_asymmetric.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_asymmetric.c
rename to secure_fw/partitions/crypto/crypto_asymmetric.c
diff --git a/secure_fw/services/crypto/crypto_cipher.c b/secure_fw/partitions/crypto/crypto_cipher.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_cipher.c
rename to secure_fw/partitions/crypto/crypto_cipher.c
diff --git a/secure_fw/services/crypto/crypto_hash.c b/secure_fw/partitions/crypto/crypto_hash.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_hash.c
rename to secure_fw/partitions/crypto/crypto_hash.c
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/partitions/crypto/crypto_init.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_init.c
rename to secure_fw/partitions/crypto/crypto_init.c
diff --git a/secure_fw/services/crypto/crypto_key.c b/secure_fw/partitions/crypto/crypto_key.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_key.c
rename to secure_fw/partitions/crypto/crypto_key.c
diff --git a/secure_fw/services/crypto/crypto_key_derivation.c b/secure_fw/partitions/crypto/crypto_key_derivation.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_key_derivation.c
rename to secure_fw/partitions/crypto/crypto_key_derivation.c
diff --git a/secure_fw/services/crypto/crypto_mac.c b/secure_fw/partitions/crypto/crypto_mac.c
similarity index 100%
rename from secure_fw/services/crypto/crypto_mac.c
rename to secure_fw/partitions/crypto/crypto_mac.c
diff --git a/secure_fw/services/crypto/crypto_spe.h b/secure_fw/partitions/crypto/crypto_spe.h
similarity index 100%
rename from secure_fw/services/crypto/crypto_spe.h
rename to secure_fw/partitions/crypto/crypto_spe.h
diff --git a/secure_fw/services/crypto/dir_crypto.dox b/secure_fw/partitions/crypto/dir_crypto.dox
similarity index 100%
rename from secure_fw/services/crypto/dir_crypto.dox
rename to secure_fw/partitions/crypto/dir_crypto.dox
diff --git a/secure_fw/services/crypto/psa_manifest/tfm_crypto.h b/secure_fw/partitions/crypto/psa_manifest/tfm_crypto.h
similarity index 100%
rename from secure_fw/services/crypto/psa_manifest/tfm_crypto.h
rename to secure_fw/partitions/crypto/psa_manifest/tfm_crypto.h
diff --git a/secure_fw/services/crypto/tfm_crypto.yaml b/secure_fw/partitions/crypto/tfm_crypto.yaml
similarity index 100%
rename from secure_fw/services/crypto/tfm_crypto.yaml
rename to secure_fw/partitions/crypto/tfm_crypto.yaml
diff --git a/secure_fw/services/crypto/tfm_crypto_api.h b/secure_fw/partitions/crypto/tfm_crypto_api.h
similarity index 100%
rename from secure_fw/services/crypto/tfm_crypto_api.h
rename to secure_fw/partitions/crypto/tfm_crypto_api.h
diff --git a/secure_fw/services/crypto/tfm_crypto_secure_api.c b/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
similarity index 100%
rename from secure_fw/services/crypto/tfm_crypto_secure_api.c
rename to secure_fw/partitions/crypto/tfm_crypto_secure_api.c
diff --git a/secure_fw/services/crypto/tfm_mbedcrypto_alt.c b/secure_fw/partitions/crypto/tfm_mbedcrypto_alt.c
similarity index 100%
rename from secure_fw/services/crypto/tfm_mbedcrypto_alt.c
rename to secure_fw/partitions/crypto/tfm_mbedcrypto_alt.c
diff --git a/secure_fw/services/crypto/tfm_mbedcrypto_include.h b/secure_fw/partitions/crypto/tfm_mbedcrypto_include.h
similarity index 100%
rename from secure_fw/services/crypto/tfm_mbedcrypto_include.h
rename to secure_fw/partitions/crypto/tfm_mbedcrypto_include.h
diff --git a/secure_fw/services/dir_services.dox b/secure_fw/partitions/dir_services.dox
similarity index 100%
rename from secure_fw/services/dir_services.dox
rename to secure_fw/partitions/dir_services.dox
diff --git a/secure_fw/services/initial_attestation/CMakeLists.inc b/secure_fw/partitions/initial_attestation/CMakeLists.inc
similarity index 100%
rename from secure_fw/services/initial_attestation/CMakeLists.inc
rename to secure_fw/partitions/initial_attestation/CMakeLists.inc
diff --git a/secure_fw/services/initial_attestation/CMakeLists.txt b/secure_fw/partitions/initial_attestation/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/initial_attestation/CMakeLists.txt
rename to secure_fw/partitions/initial_attestation/CMakeLists.txt
diff --git a/secure_fw/services/initial_attestation/attest_eat_defines.h b/secure_fw/partitions/initial_attestation/attest_eat_defines.h
similarity index 100%
rename from secure_fw/services/initial_attestation/attest_eat_defines.h
rename to secure_fw/partitions/initial_attestation/attest_eat_defines.h
diff --git a/secure_fw/services/initial_attestation/attest_token.c b/secure_fw/partitions/initial_attestation/attest_token.c
similarity index 100%
rename from secure_fw/services/initial_attestation/attest_token.c
rename to secure_fw/partitions/initial_attestation/attest_token.c
diff --git a/secure_fw/services/initial_attestation/attest_token.h b/secure_fw/partitions/initial_attestation/attest_token.h
similarity index 100%
rename from secure_fw/services/initial_attestation/attest_token.h
rename to secure_fw/partitions/initial_attestation/attest_token.h
diff --git a/secure_fw/services/initial_attestation/attestation.h b/secure_fw/partitions/initial_attestation/attestation.h
similarity index 100%
rename from secure_fw/services/initial_attestation/attestation.h
rename to secure_fw/partitions/initial_attestation/attestation.h
diff --git a/secure_fw/services/initial_attestation/attestation_core.c b/secure_fw/partitions/initial_attestation/attestation_core.c
similarity index 100%
rename from secure_fw/services/initial_attestation/attestation_core.c
rename to secure_fw/partitions/initial_attestation/attestation_core.c
diff --git a/secure_fw/services/initial_attestation/attestation_key.c b/secure_fw/partitions/initial_attestation/attestation_key.c
similarity index 100%
rename from secure_fw/services/initial_attestation/attestation_key.c
rename to secure_fw/partitions/initial_attestation/attestation_key.c
diff --git a/secure_fw/services/initial_attestation/attestation_key.h b/secure_fw/partitions/initial_attestation/attestation_key.h
similarity index 100%
rename from secure_fw/services/initial_attestation/attestation_key.h
rename to secure_fw/partitions/initial_attestation/attestation_key.h
diff --git a/secure_fw/services/initial_attestation/dir_initial_attestation.dox b/secure_fw/partitions/initial_attestation/dir_initial_attestation.dox
similarity index 100%
rename from secure_fw/services/initial_attestation/dir_initial_attestation.dox
rename to secure_fw/partitions/initial_attestation/dir_initial_attestation.dox
diff --git a/secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h b/secure_fw/partitions/initial_attestation/psa_manifest/tfm_initial_attestation.h
similarity index 100%
rename from secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h
rename to secure_fw/partitions/initial_attestation/psa_manifest/tfm_initial_attestation.h
diff --git a/secure_fw/services/initial_attestation/tfm_attestation.c b/secure_fw/partitions/initial_attestation/tfm_attestation.c
similarity index 100%
rename from secure_fw/services/initial_attestation/tfm_attestation.c
rename to secure_fw/partitions/initial_attestation/tfm_attestation.c
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c b/secure_fw/partitions/initial_attestation/tfm_attestation_req_mngr.c
similarity index 100%
rename from secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
rename to secure_fw/partitions/initial_attestation/tfm_attestation_req_mngr.c
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c b/secure_fw/partitions/initial_attestation/tfm_attestation_secure_api.c
similarity index 100%
rename from secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
rename to secure_fw/partitions/initial_attestation/tfm_attestation_secure_api.c
diff --git a/secure_fw/services/initial_attestation/tfm_client.h b/secure_fw/partitions/initial_attestation/tfm_client.h
similarity index 100%
rename from secure_fw/services/initial_attestation/tfm_client.h
rename to secure_fw/partitions/initial_attestation/tfm_client.h
diff --git a/secure_fw/services/initial_attestation/tfm_initial_attestation.yaml b/secure_fw/partitions/initial_attestation/tfm_initial_attestation.yaml
similarity index 100%
rename from secure_fw/services/initial_attestation/tfm_initial_attestation.yaml
rename to secure_fw/partitions/initial_attestation/tfm_initial_attestation.yaml
diff --git a/secure_fw/services/internal_trusted_storage/CMakeLists.inc b/secure_fw/partitions/internal_trusted_storage/CMakeLists.inc
similarity index 96%
rename from secure_fw/services/internal_trusted_storage/CMakeLists.inc
rename to secure_fw/partitions/internal_trusted_storage/CMakeLists.inc
index 5c8f0ca..2d0345b 100644
--- a/secure_fw/services/internal_trusted_storage/CMakeLists.inc
+++ b/secure_fw/partitions/internal_trusted_storage/CMakeLists.inc
@@ -103,9 +103,12 @@
endif()
#Setting include directories
+embedded_include_directories(PATH ${INTERNAL_TRUSTED_STORAGE_DIR} ABSOLUTE)
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}/platform/ext/driver ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/partitions/secure_storage ABSOLUTE)
+
set(BUILD_CMSIS_CORE Off)
set(BUILD_RETARGET Off)
set(BUILD_NATIVE_DRIVERS Off)
diff --git a/secure_fw/services/internal_trusted_storage/CMakeLists.txt b/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/CMakeLists.txt
rename to secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash.c
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash.h b/secure_fw/partitions/internal_trusted_storage/flash/its_flash.h
similarity index 98%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash.h
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash.h
index 03fcb48..de6a4bf 100644
--- a/secure_fw/services/internal_trusted_storage/flash/its_flash.h
+++ b/secure_fw/partitions/internal_trusted_storage/flash/its_flash.h
@@ -13,7 +13,7 @@
#include "flash_layout.h"
#include "psa/error.h"
-#include "secure_fw/services/internal_trusted_storage/its_utils.h"
+#include "its_utils.h"
#ifdef __cplusplus
extern "C" {
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_info_external.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_external.c
similarity index 94%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_info_external.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_external.c
index 9b27be5..03d2d2d 100644
--- a/secure_fw/services/internal_trusted_storage/flash/its_flash_info_external.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_external.c
@@ -9,8 +9,8 @@
#include "Driver_Flash.h"
#include "flash_layout.h"
-#include "secure_fw/services/internal_trusted_storage/its_utils.h"
-#include "secure_fw/services/secure_storage/sst_object_defs.h"
+#include "its_utils.h"
+#include "sst_object_defs.h"
#ifndef SST_FLASH_DEV_NAME
#error "SST_FLASH_DEV_NAME must be defined by the target in flash_layout.h"
@@ -121,4 +121,4 @@
/* Checks at compile time that the flash device configuration is valid */
#include \
-"secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h"
+"secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h"
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_info_internal.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_internal.c
similarity index 95%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_info_internal.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_internal.c
index 5cd0a90..cc17501 100644
--- a/secure_fw/services/internal_trusted_storage/flash/its_flash_info_internal.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_info_internal.c
@@ -9,7 +9,7 @@
#include "Driver_Flash.h"
#include "flash_layout.h"
-#include "secure_fw/services/internal_trusted_storage/its_utils.h"
+#include "its_utils.h"
#ifndef ITS_FLASH_DEV_NAME
#error "ITS_FLASH_DEV_NAME must be defined by the target in flash_layout.h"
@@ -119,5 +119,4 @@
};
/* Checks at compile time that the flash device configuration is valid */
-#include \
-"secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h"
+#include "flash_fs/its_flash_fs_check_info.h"
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_nand.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_nand.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_nand.h b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_nand.h
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.h
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_nor.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_nor.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_nor.h b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_nor.h
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.h
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_ram.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_ram.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_ram.c
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_ram.c
diff --git a/secure_fw/services/internal_trusted_storage/flash/its_flash_ram.h b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_ram.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash/its_flash_ram.h
rename to secure_fw/partitions/internal_trusted_storage/flash/its_flash_ram.h
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.c b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.c
similarity index 99%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.c
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.c
index 0d35473..91953a1 100644
--- a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.c
@@ -9,7 +9,7 @@
#include "its_flash_fs_dblock.h"
#include "tfm_memory_utils.h"
-#include "secure_fw/services/internal_trusted_storage/its_utils.h"
+#include "its_utils.h"
#define ITS_FLASH_FS_INIT_FILE 0
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.h b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.h
similarity index 98%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.h
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.h
index 12b7d35..5cd782e 100644
--- a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs.h
+++ b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs.h
@@ -21,7 +21,7 @@
#include "its_flash_fs_mblock.h"
#include "psa/error.h"
-#include "secure_fw/services/internal_trusted_storage/flash/its_flash.h"
+#include "flash/its_flash.h"
#ifdef __cplusplus
extern "C" {
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_check_info.h
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c
similarity index 98%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c
index ca06cf9..9f8e8ad 100644
--- a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_dblock.c
@@ -7,7 +7,7 @@
#include "its_flash_fs_dblock.h"
-#include "secure_fw/services/internal_trusted_storage/flash/its_flash.h"
+#include "flash/its_flash.h"
/**
* \brief Converts logical data block number to physical number.
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_dblock.h b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_dblock.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_dblock.h
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_dblock.h
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c
diff --git a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h
similarity index 98%
rename from secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h
rename to secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h
index f7ff46f..4e2ba2c 100644
--- a/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h
+++ b/secure_fw/partitions/internal_trusted_storage/flash_fs/its_flash_fs_mblock.h
@@ -11,8 +11,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "secure_fw/services/internal_trusted_storage/flash/its_flash.h"
-#include "secure_fw/services/internal_trusted_storage/its_utils.h"
+#include "flash/its_flash.h"
+#include "its_utils.h"
#include "psa/error.h"
#ifdef __cplusplus
diff --git a/secure_fw/services/internal_trusted_storage/its_utils.c b/secure_fw/partitions/internal_trusted_storage/its_utils.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/its_utils.c
rename to secure_fw/partitions/internal_trusted_storage/its_utils.c
diff --git a/secure_fw/services/internal_trusted_storage/its_utils.h b/secure_fw/partitions/internal_trusted_storage/its_utils.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/its_utils.h
rename to secure_fw/partitions/internal_trusted_storage/its_utils.h
diff --git a/secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h b/secure_fw/partitions/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
rename to secure_fw/partitions/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
diff --git a/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.c b/secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.c
rename to secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.c
diff --git a/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.h b/secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.h
rename to secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.h
diff --git a/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml b/secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.yaml
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml
rename to secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.yaml
diff --git a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c b/secure_fw/partitions/internal_trusted_storage/tfm_its_req_mngr.c
similarity index 99%
rename from secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
rename to secure_fw/partitions/internal_trusted_storage/tfm_its_req_mngr.c
index eb634b8..79f2b63 100644
--- a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
+++ b/secure_fw/partitions/internal_trusted_storage/tfm_its_req_mngr.c
@@ -12,7 +12,7 @@
#include "psa/storage_common.h"
#include "tfm_internal_trusted_storage.h"
#include "its_utils.h"
-#include "secure_fw/services/secure_storage/sst_object_defs.h"
+#include "sst_object_defs.h"
#ifdef TFM_PSA_API
#include "psa/service.h"
diff --git a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.h b/secure_fw/partitions/internal_trusted_storage/tfm_its_req_mngr.h
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.h
rename to secure_fw/partitions/internal_trusted_storage/tfm_its_req_mngr.h
diff --git a/secure_fw/services/internal_trusted_storage/tfm_its_secure_api.c b/secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c
similarity index 100%
rename from secure_fw/services/internal_trusted_storage/tfm_its_secure_api.c
rename to secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c
diff --git a/secure_fw/lib/sprt/CMakeLists.inc b/secure_fw/partitions/lib/sprt/CMakeLists.inc
similarity index 100%
rename from secure_fw/lib/sprt/CMakeLists.inc
rename to secure_fw/partitions/lib/sprt/CMakeLists.inc
diff --git a/secure_fw/lib/sprt/CMakeLists.txt b/secure_fw/partitions/lib/sprt/CMakeLists.txt
similarity index 89%
rename from secure_fw/lib/sprt/CMakeLists.txt
rename to secure_fw/partitions/lib/sprt/CMakeLists.txt
index dd70c2e..a183397 100644
--- a/secure_fw/lib/sprt/CMakeLists.txt
+++ b/secure_fw/partitions/lib/sprt/CMakeLists.txt
@@ -8,11 +8,11 @@
cmake_minimum_required(VERSION 3.7)
#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#Some project global settings
set (LIBSPRT_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${LIBSPRT_DIR}/../../.." ABSOLUTE)
+get_filename_component(TFM_ROOT_DIR "${CMAKE_SOURCE_DIR}" ABSOLUTE)
#Include common stuff to control cmake.
include("Common/BuildSys")
diff --git a/secure_fw/lib/sprt/tfm_libsprt_c.h b/secure_fw/partitions/lib/sprt/tfm_libsprt_c.h
similarity index 100%
rename from secure_fw/lib/sprt/tfm_libsprt_c.h
rename to secure_fw/partitions/lib/sprt/tfm_libsprt_c.h
diff --git a/secure_fw/lib/sprt/tfm_libsprt_c_memcmp.c b/secure_fw/partitions/lib/sprt/tfm_libsprt_c_memcmp.c
similarity index 100%
rename from secure_fw/lib/sprt/tfm_libsprt_c_memcmp.c
rename to secure_fw/partitions/lib/sprt/tfm_libsprt_c_memcmp.c
diff --git a/secure_fw/lib/sprt/tfm_libsprt_c_memcpy.c b/secure_fw/partitions/lib/sprt/tfm_libsprt_c_memcpy.c
similarity index 100%
rename from secure_fw/lib/sprt/tfm_libsprt_c_memcpy.c
rename to secure_fw/partitions/lib/sprt/tfm_libsprt_c_memcpy.c
diff --git a/secure_fw/lib/sprt/tfm_libsprt_c_memmove.c b/secure_fw/partitions/lib/sprt/tfm_libsprt_c_memmove.c
similarity index 100%
rename from secure_fw/lib/sprt/tfm_libsprt_c_memmove.c
rename to secure_fw/partitions/lib/sprt/tfm_libsprt_c_memmove.c
diff --git a/secure_fw/services/manifestfilename.template b/secure_fw/partitions/manifestfilename.template
similarity index 100%
rename from secure_fw/services/manifestfilename.template
rename to secure_fw/partitions/manifestfilename.template
diff --git a/secure_fw/services/platform/CMakeLists.inc b/secure_fw/partitions/platform/CMakeLists.inc
similarity index 100%
rename from secure_fw/services/platform/CMakeLists.inc
rename to secure_fw/partitions/platform/CMakeLists.inc
diff --git a/secure_fw/services/platform/CMakeLists.txt b/secure_fw/partitions/platform/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/platform/CMakeLists.txt
rename to secure_fw/partitions/platform/CMakeLists.txt
diff --git a/secure_fw/services/platform/dir_platform.dox b/secure_fw/partitions/platform/dir_platform.dox
similarity index 100%
rename from secure_fw/services/platform/dir_platform.dox
rename to secure_fw/partitions/platform/dir_platform.dox
diff --git a/secure_fw/services/platform/platform_sp.c b/secure_fw/partitions/platform/platform_sp.c
similarity index 99%
rename from secure_fw/services/platform/platform_sp.c
rename to secure_fw/partitions/platform/platform_sp.c
index 9756d5d..461432c 100644
--- a/secure_fw/services/platform/platform_sp.c
+++ b/secure_fw/partitions/platform/platform_sp.c
@@ -9,7 +9,7 @@
#include "platform/include/tfm_platform_system.h"
#include "platform/include/tfm_plat_nv_counters.h"
-#include "secure_fw/include/tfm_spm_services_api.h"
+#include "secure_fw/include/tfm/tfm_spm_services_api.h"
#include "tfm_secure_api.h"
#include "psa_manifest/pid.h"
diff --git a/secure_fw/services/platform/platform_sp.h b/secure_fw/partitions/platform/platform_sp.h
similarity index 100%
rename from secure_fw/services/platform/platform_sp.h
rename to secure_fw/partitions/platform/platform_sp.h
diff --git a/secure_fw/services/platform/psa_manifest/tfm_platform.h b/secure_fw/partitions/platform/psa_manifest/tfm_platform.h
similarity index 100%
rename from secure_fw/services/platform/psa_manifest/tfm_platform.h
rename to secure_fw/partitions/platform/psa_manifest/tfm_platform.h
diff --git a/secure_fw/services/platform/tfm_platform.yaml b/secure_fw/partitions/platform/tfm_platform.yaml
similarity index 100%
rename from secure_fw/services/platform/tfm_platform.yaml
rename to secure_fw/partitions/platform/tfm_platform.yaml
diff --git a/secure_fw/services/platform/tfm_platform_secure_api.c b/secure_fw/partitions/platform/tfm_platform_secure_api.c
similarity index 100%
rename from secure_fw/services/platform/tfm_platform_secure_api.c
rename to secure_fw/partitions/platform/tfm_platform_secure_api.c
diff --git a/secure_fw/services/secure_storage/CMakeLists.inc b/secure_fw/partitions/secure_storage/CMakeLists.inc
similarity index 98%
rename from secure_fw/services/secure_storage/CMakeLists.inc
rename to secure_fw/partitions/secure_storage/CMakeLists.inc
index 55dc163..e17c787 100644
--- a/secure_fw/services/secure_storage/CMakeLists.inc
+++ b/secure_fw/partitions/secure_storage/CMakeLists.inc
@@ -109,9 +109,9 @@
#Setting include directories
embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE)
+embedded_include_directories(PATH ${SECURE_STORAGE_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/include ABSOLUTE)
embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/ext/common ABSOLUTE)
embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/ext/driver ABSOLUTE)
set(BUILD_CMSIS_CORE Off)
diff --git a/secure_fw/services/secure_storage/CMakeLists.txt b/secure_fw/partitions/secure_storage/CMakeLists.txt
similarity index 100%
rename from secure_fw/services/secure_storage/CMakeLists.txt
rename to secure_fw/partitions/secure_storage/CMakeLists.txt
diff --git a/secure_fw/services/secure_storage/crypto/sst_crypto_interface.c b/secure_fw/partitions/secure_storage/crypto/sst_crypto_interface.c
similarity index 100%
rename from secure_fw/services/secure_storage/crypto/sst_crypto_interface.c
rename to secure_fw/partitions/secure_storage/crypto/sst_crypto_interface.c
diff --git a/secure_fw/services/secure_storage/crypto/sst_crypto_interface.h b/secure_fw/partitions/secure_storage/crypto/sst_crypto_interface.h
similarity index 100%
rename from secure_fw/services/secure_storage/crypto/sst_crypto_interface.h
rename to secure_fw/partitions/secure_storage/crypto/sst_crypto_interface.h
diff --git a/secure_fw/services/secure_storage/dir_secure_storage.dox b/secure_fw/partitions/secure_storage/dir_secure_storage.dox
similarity index 100%
rename from secure_fw/services/secure_storage/dir_secure_storage.dox
rename to secure_fw/partitions/secure_storage/dir_secure_storage.dox
diff --git a/secure_fw/services/secure_storage/nv_counters/sst_nv_counters.c b/secure_fw/partitions/secure_storage/nv_counters/sst_nv_counters.c
similarity index 100%
rename from secure_fw/services/secure_storage/nv_counters/sst_nv_counters.c
rename to secure_fw/partitions/secure_storage/nv_counters/sst_nv_counters.c
diff --git a/secure_fw/services/secure_storage/nv_counters/sst_nv_counters.h b/secure_fw/partitions/secure_storage/nv_counters/sst_nv_counters.h
similarity index 100%
rename from secure_fw/services/secure_storage/nv_counters/sst_nv_counters.h
rename to secure_fw/partitions/secure_storage/nv_counters/sst_nv_counters.h
diff --git a/secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h b/secure_fw/partitions/secure_storage/psa_manifest/tfm_secure_storage.h
similarity index 100%
rename from secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h
rename to secure_fw/partitions/secure_storage/psa_manifest/tfm_secure_storage.h
diff --git a/secure_fw/services/secure_storage/sst_encrypted_object.c b/secure_fw/partitions/secure_storage/sst_encrypted_object.c
similarity index 100%
rename from secure_fw/services/secure_storage/sst_encrypted_object.c
rename to secure_fw/partitions/secure_storage/sst_encrypted_object.c
diff --git a/secure_fw/services/secure_storage/sst_encrypted_object.h b/secure_fw/partitions/secure_storage/sst_encrypted_object.h
similarity index 100%
rename from secure_fw/services/secure_storage/sst_encrypted_object.h
rename to secure_fw/partitions/secure_storage/sst_encrypted_object.h
diff --git a/secure_fw/services/secure_storage/sst_object_defs.h b/secure_fw/partitions/secure_storage/sst_object_defs.h
similarity index 100%
rename from secure_fw/services/secure_storage/sst_object_defs.h
rename to secure_fw/partitions/secure_storage/sst_object_defs.h
diff --git a/secure_fw/services/secure_storage/sst_object_system.c b/secure_fw/partitions/secure_storage/sst_object_system.c
similarity index 100%
rename from secure_fw/services/secure_storage/sst_object_system.c
rename to secure_fw/partitions/secure_storage/sst_object_system.c
diff --git a/secure_fw/services/secure_storage/sst_object_system.h b/secure_fw/partitions/secure_storage/sst_object_system.h
similarity index 100%
rename from secure_fw/services/secure_storage/sst_object_system.h
rename to secure_fw/partitions/secure_storage/sst_object_system.h
diff --git a/secure_fw/services/secure_storage/sst_object_table.c b/secure_fw/partitions/secure_storage/sst_object_table.c
similarity index 100%
rename from secure_fw/services/secure_storage/sst_object_table.c
rename to secure_fw/partitions/secure_storage/sst_object_table.c
diff --git a/secure_fw/services/secure_storage/sst_object_table.h b/secure_fw/partitions/secure_storage/sst_object_table.h
similarity index 100%
rename from secure_fw/services/secure_storage/sst_object_table.h
rename to secure_fw/partitions/secure_storage/sst_object_table.h
diff --git a/secure_fw/services/secure_storage/sst_utils.c b/secure_fw/partitions/secure_storage/sst_utils.c
similarity index 100%
rename from secure_fw/services/secure_storage/sst_utils.c
rename to secure_fw/partitions/secure_storage/sst_utils.c
diff --git a/secure_fw/services/secure_storage/sst_utils.h b/secure_fw/partitions/secure_storage/sst_utils.h
similarity index 100%
rename from secure_fw/services/secure_storage/sst_utils.h
rename to secure_fw/partitions/secure_storage/sst_utils.h
diff --git a/secure_fw/services/secure_storage/tfm_protected_storage.c b/secure_fw/partitions/secure_storage/tfm_protected_storage.c
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_protected_storage.c
rename to secure_fw/partitions/secure_storage/tfm_protected_storage.c
diff --git a/secure_fw/services/secure_storage/tfm_protected_storage.h b/secure_fw/partitions/secure_storage/tfm_protected_storage.h
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_protected_storage.h
rename to secure_fw/partitions/secure_storage/tfm_protected_storage.h
diff --git a/secure_fw/services/secure_storage/tfm_secure_storage.yaml b/secure_fw/partitions/secure_storage/tfm_secure_storage.yaml
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_secure_storage.yaml
rename to secure_fw/partitions/secure_storage/tfm_secure_storage.yaml
diff --git a/secure_fw/services/secure_storage/tfm_sst_req_mngr.c b/secure_fw/partitions/secure_storage/tfm_sst_req_mngr.c
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_sst_req_mngr.c
rename to secure_fw/partitions/secure_storage/tfm_sst_req_mngr.c
diff --git a/secure_fw/services/secure_storage/tfm_sst_req_mngr.h b/secure_fw/partitions/secure_storage/tfm_sst_req_mngr.h
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_sst_req_mngr.h
rename to secure_fw/partitions/secure_storage/tfm_sst_req_mngr.h
diff --git a/secure_fw/services/secure_storage/tfm_sst_secure_api.c b/secure_fw/partitions/secure_storage/tfm_sst_secure_api.c
similarity index 100%
rename from secure_fw/services/secure_storage/tfm_sst_secure_api.c
rename to secure_fw/partitions/secure_storage/tfm_sst_secure_api.c
diff --git a/secure_fw/services/tfm_service_list.inc b/secure_fw/partitions/tfm_service_list.inc
similarity index 97%
rename from secure_fw/services/tfm_service_list.inc
rename to secure_fw/partitions/tfm_service_list.inc
index 0cda109..ddedbc8 100644
--- a/secure_fw/services/tfm_service_list.inc
+++ b/secure_fw/partitions/tfm_service_list.inc
@@ -10,12 +10,12 @@
#ifndef __TFM_SERVICE_LIST_INC__
#define __TFM_SERVICE_LIST_INC__
-#include "secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h"
-#include "secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
-#include "secure_fw/services/audit_logging/psa_manifest/tfm_audit_logging.h"
-#include "secure_fw/services/crypto/psa_manifest/tfm_crypto.h"
-#include "secure_fw/services/platform/psa_manifest/tfm_platform.h"
-#include "secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h"
+#include "secure_fw/partitions/secure_storage/psa_manifest/tfm_secure_storage.h"
+#include "secure_fw/partitions/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
+#include "secure_fw/partitions/audit_logging/psa_manifest/tfm_audit_logging.h"
+#include "secure_fw/partitions/crypto/psa_manifest/tfm_crypto.h"
+#include "secure_fw/partitions/platform/psa_manifest/tfm_platform.h"
+#include "secure_fw/partitions/initial_attestation/psa_manifest/tfm_initial_attestation.h"
#include "test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
#include "test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
#include "test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
diff --git a/secure_fw/services/tfm_service_list.inc.template b/secure_fw/partitions/tfm_service_list.inc.template
similarity index 100%
rename from secure_fw/services/tfm_service_list.inc.template
rename to secure_fw/partitions/tfm_service_list.inc.template
diff --git a/secure_fw/spm/CMakeLists.inc b/secure_fw/spm/CMakeLists.inc
deleted file mode 100644
index cb458d5..0000000
--- a/secure_fw/spm/CMakeLists.inc
+++ /dev/null
@@ -1,65 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2020, 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")
-
-if(TFM_PSA_API)
- list(APPEND SS_SPM_C_SRC "${SS_SPM_DIR}/spm_ipc.c"
- "${SS_SPM_DIR}/spm_psa_client_call.c")
-else()
- list(APPEND SS_SPM_C_SRC "${SS_SPM_DIR}/spm_func.c")
-endif()
-
-#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/include 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_PLAT_TEST 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/secure_fw/core/arch/CMakeLists.inc b/secure_fw/spm/arch/CMakeLists.inc
similarity index 91%
rename from secure_fw/core/arch/CMakeLists.inc
rename to secure_fw/spm/arch/CMakeLists.inc
index 295342e..01ab370 100644
--- a/secure_fw/core/arch/CMakeLists.inc
+++ b/secure_fw/spm/arch/CMakeLists.inc
@@ -56,8 +56,5 @@
#Setting include directories
embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/ext/cmsis 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)
embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/include ABSOLUTE)
embedded_include_directories(PATH ${TFM_ARCH_DIR}/include ABSOLUTE)
diff --git a/secure_fw/core/arch/include/tfm_arch.h b/secure_fw/spm/arch/include/tfm_arch.h
similarity index 100%
rename from secure_fw/core/arch/include/tfm_arch.h
rename to secure_fw/spm/arch/include/tfm_arch.h
diff --git a/secure_fw/core/arch/include/tfm_arch_v6m_v7m.h b/secure_fw/spm/arch/include/tfm_arch_v6m_v7m.h
similarity index 100%
rename from secure_fw/core/arch/include/tfm_arch_v6m_v7m.h
rename to secure_fw/spm/arch/include/tfm_arch_v6m_v7m.h
diff --git a/secure_fw/core/arch/include/tfm_arch_v8m.h b/secure_fw/spm/arch/include/tfm_arch_v8m.h
similarity index 100%
rename from secure_fw/core/arch/include/tfm_arch_v8m.h
rename to secure_fw/spm/arch/include/tfm_arch_v8m.h
diff --git a/secure_fw/core/arch/tfm_arch.c b/secure_fw/spm/arch/tfm_arch.c
similarity index 100%
rename from secure_fw/core/arch/tfm_arch.c
rename to secure_fw/spm/arch/tfm_arch.c
diff --git a/secure_fw/core/arch/tfm_arch_v6m_v7m.c b/secure_fw/spm/arch/tfm_arch_v6m_v7m.c
similarity index 100%
rename from secure_fw/core/arch/tfm_arch_v6m_v7m.c
rename to secure_fw/spm/arch/tfm_arch_v6m_v7m.c
diff --git a/secure_fw/core/arch/tfm_arch_v8m_base.c b/secure_fw/spm/arch/tfm_arch_v8m_base.c
similarity index 99%
rename from secure_fw/core/arch/tfm_arch_v8m_base.c
rename to secure_fw/spm/arch/tfm_arch_v8m_base.c
index c22d832..00c4fca 100644
--- a/secure_fw/core/arch/tfm_arch_v8m_base.c
+++ b/secure_fw/spm/arch/tfm_arch_v8m_base.c
@@ -10,8 +10,8 @@
#include "secure_utilities.h"
#include "tfm_arch.h"
#include "tfm_secure_api.h"
-#include "spm_api.h"
-#include "core/tfm_core_svc.h"
+#include "tfm/spm_api.h"
+#include "tfm/tfm_core_svc.h"
#if !defined(__ARM_ARCH_8M_BASE__)
#error "Unsupported ARM Architecture."
diff --git a/secure_fw/core/arch/tfm_arch_v8m_main.c b/secure_fw/spm/arch/tfm_arch_v8m_main.c
similarity index 99%
rename from secure_fw/core/arch/tfm_arch_v8m_main.c
rename to secure_fw/spm/arch/tfm_arch_v8m_main.c
index 9b8e974..f975a66 100644
--- a/secure_fw/core/arch/tfm_arch_v8m_main.c
+++ b/secure_fw/spm/arch/tfm_arch_v8m_main.c
@@ -13,8 +13,8 @@
#include "tfm_memory_utils.h"
#include "tfm_core_utils.h"
#include "tfm_secure_api.h"
-#include "spm_api.h"
-#include "core/tfm_core_svc.h"
+#include "tfm/spm_api.h"
+#include "tfm/tfm_core_svc.h"
#if !defined(__ARM_ARCH_8M_MAIN__) && !defined(__ARM_ARCH_8_1M_MAIN__)
#error "Unsupported ARM Architecture."
diff --git a/secure_fw/spm/dir_spm.dox b/secure_fw/spm/dir_spm.dox
deleted file mode 100644
index 92c8a27..0000000
--- a/secure_fw/spm/dir_spm.dox
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-//This file holds description for the current directory. This documentation
-//will be included in the Doxygen output.
-
-/*!
-\dir
-\brief Source code for the Secure Partition Manager.
-\details This directory holds the source code of the "TF-M SPM" module.
-
-*/
\ No newline at end of file
diff --git a/secure_fw/core/include/secure_utilities.h b/secure_fw/spm/include/secure_utilities.h
similarity index 100%
rename from secure_fw/core/include/secure_utilities.h
rename to secure_fw/spm/include/secure_utilities.h
diff --git a/secure_fw/core/include/tfm_core.h b/secure_fw/spm/include/tfm_core.h
similarity index 100%
rename from secure_fw/core/include/tfm_core.h
rename to secure_fw/spm/include/tfm_core.h
diff --git a/secure_fw/core/include/tfm_core_mem_check.h b/secure_fw/spm/include/tfm_core_mem_check.h
similarity index 100%
rename from secure_fw/core/include/tfm_core_mem_check.h
rename to secure_fw/spm/include/tfm_core_mem_check.h
diff --git a/secure_fw/core/include/tfm_core_topology.h b/secure_fw/spm/include/tfm_core_topology.h
similarity index 100%
rename from secure_fw/core/include/tfm_core_topology.h
rename to secure_fw/spm/include/tfm_core_topology.h
diff --git a/secure_fw/core/include/tfm_core_trustzone.h b/secure_fw/spm/include/tfm_core_trustzone.h
similarity index 100%
rename from secure_fw/core/include/tfm_core_trustzone.h
rename to secure_fw/spm/include/tfm_core_trustzone.h
diff --git a/secure_fw/core/include/tfm_core_utils.h b/secure_fw/spm/include/tfm_core_utils.h
similarity index 100%
rename from secure_fw/core/include/tfm_core_utils.h
rename to secure_fw/spm/include/tfm_core_utils.h
diff --git a/secure_fw/core/include/tfm_internal.h b/secure_fw/spm/include/tfm_internal.h
similarity index 100%
rename from secure_fw/core/include/tfm_internal.h
rename to secure_fw/spm/include/tfm_internal.h
diff --git a/secure_fw/core/include/tfm_irq_list.h b/secure_fw/spm/include/tfm_irq_list.h
similarity index 100%
rename from secure_fw/core/include/tfm_irq_list.h
rename to secure_fw/spm/include/tfm_irq_list.h
diff --git a/secure_fw/core/include/tfm_memory_utils.h b/secure_fw/spm/include/tfm_memory_utils.h
similarity index 100%
rename from secure_fw/core/include/tfm_memory_utils.h
rename to secure_fw/spm/include/tfm_memory_utils.h
diff --git a/secure_fw/core/include/tfm_nspm.h b/secure_fw/spm/include/tfm_nspm.h
similarity index 100%
rename from secure_fw/core/include/tfm_nspm.h
rename to secure_fw/spm/include/tfm_nspm.h
diff --git a/secure_fw/core/include/tfm_platform_core_api.h b/secure_fw/spm/include/tfm_platform_core_api.h
similarity index 100%
rename from secure_fw/core/include/tfm_platform_core_api.h
rename to secure_fw/spm/include/tfm_platform_core_api.h
diff --git a/secure_fw/core/include/tfm_secure_api.h b/secure_fw/spm/include/tfm_secure_api.h
similarity index 99%
rename from secure_fw/core/include/tfm_secure_api.h
rename to secure_fw/spm/include/tfm_secure_api.h
index 250dc0a..2112ce9 100644
--- a/secure_fw/core/include/tfm_secure_api.h
+++ b/secure_fw/spm/include/tfm_secure_api.h
@@ -12,7 +12,7 @@
#include <arm_cmse.h>
#endif
#include "tfm_arch.h"
-#include "core/tfm_core_svc.h"
+#include "tfm/tfm_core_svc.h"
#include "tfm_core.h"
#include "tfm_api.h"
#include "tfm_utils.h"
diff --git a/secure_fw/core/include/tfm_utils.h b/secure_fw/spm/include/tfm_utils.h
similarity index 100%
rename from secure_fw/core/include/tfm_utils.h
rename to secure_fw/spm/include/tfm_utils.h
diff --git a/secure_fw/core/include/tfm_version.h b/secure_fw/spm/include/tfm_version.h
similarity index 100%
rename from secure_fw/core/include/tfm_version.h
rename to secure_fw/spm/include/tfm_version.h
diff --git a/secure_fw/core/tfm_boot_data.c b/secure_fw/spm/init/tfm_boot_data.c
similarity index 98%
rename from secure_fw/core/tfm_boot_data.c
rename to secure_fw/spm/init/tfm_boot_data.c
index 84a7825..2dfbbc4 100644
--- a/secure_fw/core/tfm_boot_data.c
+++ b/secure_fw/spm/init/tfm_boot_data.c
@@ -11,9 +11,9 @@
#include "tfm_memory_utils.h"
#include "tfm_internal.h"
#include "tfm_api.h"
-#include "secure_fw/spm/spm_api.h"
#include "tfm_core_utils.h"
-#include "spm_partition_defs.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_partition_defs.h"
#ifdef TFM_PSA_API
#include "tfm_internal_defines.h"
#include "tfm_utils.h"
@@ -22,8 +22,7 @@
#include "tfm_wait.h"
#include "tfm_message_queue.h"
#include "tfm_spm_hal.h"
-#include "spm_db.h"
-#include "spm_api.h"
+#include "tfm/spm_db.h"
#endif
/*!
diff --git a/secure_fw/core/tfm_core.c b/secure_fw/spm/init/tfm_core.c
similarity index 98%
rename from secure_fw/core/tfm_core.c
rename to secure_fw/spm/init/tfm_core.c
index 9360c01..e1f0c14 100644
--- a/secure_fw/core/tfm_core.c
+++ b/secure_fw/spm/init/tfm_core.c
@@ -6,7 +6,6 @@
*/
#include "region.h"
-#include "spm_db.h"
#include "tfm_core_topology.h"
#include "tfm_internal.h"
#include "tfm_irq_list.h"
@@ -14,6 +13,8 @@
#include "tfm_spm_hal.h"
#include "tfm_version.h"
#include "log/tfm_log.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_db.h"
/*
* Avoids the semihosting issue
diff --git a/secure_fw/spm/model_func/CMakeLists.inc b/secure_fw/spm/model_func/CMakeLists.inc
new file mode 100644
index 0000000..154417c
--- /dev/null
+++ b/secure_fw/spm/model_func/CMakeLists.inc
@@ -0,0 +1,60 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file assumes it will be included from a project specific cmakefile.
+#
+#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.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR
+ "Please set TFM_ROOT_DIR before including this file.")
+endif()
+
+#Get the current directory where this file is located.
+set(SFW_FUNC_SPM_DIR ${CMAKE_CURRENT_LIST_DIR})
+set(SFW_SPM_DIR "${SFW_FUNC_SPM_DIR}/..")
+set(SFW_SPM_ARCH_DIR "${SFW_SPM_DIR}/arch")
+set(SFW_SPM_INIT_DIR "${SFW_SPM_DIR}/init")
+
+set (SFW_FUNC_SPM_SRC
+ "${SFW_SPM_INIT_DIR}/tfm_boot_data.c"
+ "${SFW_SPM_INIT_DIR}/tfm_core.c"
+ "${SFW_FUNC_SPM_DIR}/tfm_core_svcalls_func.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/tfm_secure_api.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/tfm_spm_services.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/spm_api.c"
+ "${SFW_FUNC_SPM_DIR}/spm_func.c"
+ "${SFW_FUNC_SPM_DIR}/tfm_nspm_func.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/tfm_utils.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/tfm_core_mem_check.c"
+ "${SFW_FUNC_SPM_DIR}/../runtime/tfm_core_utils.c"
+ "${SFW_FUNC_SPM_DIR}/tfm_veneers.c"
+ )
+
+#Append all our source files to global lists.
+list(APPEND ALL_SRC_C ${SFW_FUNC_SPM_SRC})
+unset(SFW_FUNC_SPM_SRC)
+
+#Setting include directories
+embedded_include_directories(PATH ${SFW_FUNC_SPM_DIR} ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm/arch/include ABSOLUTE)
diff --git a/secure_fw/spm/spm_func.c b/secure_fw/spm/model_func/spm_func.c
similarity index 99%
rename from secure_fw/spm/spm_func.c
rename to secure_fw/spm/model_func/spm_func.c
index 696fdcf..cd88329 100644
--- a/secure_fw/spm/spm_func.c
+++ b/secure_fw/spm/model_func/spm_func.c
@@ -17,11 +17,11 @@
#include "tfm_core_mem_check.h"
#include "tfm_secure_api.h"
#include "tfm_spm_hal.h"
-#include "spm_api.h"
-#include "spm_db.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_db.h"
#include "region_defs.h"
#include "region.h"
-#include "tfm_spm_services_api.h"
+#include "tfm/tfm_spm_services_api.h"
#define EXC_RETURN_SECURE_FUNCTION 0xFFFFFFFD
#define EXC_RETURN_SECURE_HANDLER 0xFFFFFFF1
diff --git a/secure_fw/core/tfm_core_svcalls_func.c b/secure_fw/spm/model_func/tfm_core_svcalls_func.c
similarity index 96%
rename from secure_fw/core/tfm_core_svcalls_func.c
rename to secure_fw/spm/model_func/tfm_core_svcalls_func.c
index c1f9587..9af7104 100644
--- a/secure_fw/core/tfm_core_svcalls_func.c
+++ b/secure_fw/spm/model_func/tfm_core_svcalls_func.c
@@ -8,18 +8,17 @@
#include <string.h>
#include "secure_utilities.h"
-#include "core/tfm_core_svc.h"
+#include "tfm/tfm_core_svc.h"
#include "tfm_secure_api.h"
#include "region_defs.h"
-#include "spm_api.h"
-#include "spm_partition_defs.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_partition_defs.h"
#include "tfm_api.h"
#include "tfm_internal.h"
#include "tfm_memory_utils.h"
#include "tfm_arch.h"
#include "tfm_peripherals_def.h"
#include "tfm_irq_list.h"
-#include "spm_api.h"
#ifdef PLATFORM_SVC_HANDLERS
extern int32_t platform_svc_handlers(tfm_svc_number_t svc_num,
diff --git a/secure_fw/core/tfm_nspm_func.c b/secure_fw/spm/model_func/tfm_nspm_func.c
similarity index 100%
rename from secure_fw/core/tfm_nspm_func.c
rename to secure_fw/spm/model_func/tfm_nspm_func.c
diff --git a/secure_fw/core/tfm_secure_irq_handlers.inc b/secure_fw/spm/model_func/tfm_secure_irq_handlers.inc
similarity index 80%
rename from secure_fw/core/tfm_secure_irq_handlers.inc
rename to secure_fw/spm/model_func/tfm_secure_irq_handlers.inc
index 0793403..45418a2 100644
--- a/secure_fw/core/tfm_secure_irq_handlers.inc
+++ b/secure_fw/spm/model_func/tfm_secure_irq_handlers.inc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -7,12 +7,12 @@
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-#include "secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h"
-#include "secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
-#include "secure_fw/services/audit_logging/psa_manifest/tfm_audit_logging.h"
-#include "secure_fw/services/crypto/psa_manifest/tfm_crypto.h"
-#include "secure_fw/services/platform/psa_manifest/tfm_platform.h"
-#include "secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h"
+#include "secure_fw/partitions/secure_storage/psa_manifest/tfm_secure_storage.h"
+#include "secure_fw/partitions/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
+#include "secure_fw/partitions/audit_logging/psa_manifest/tfm_audit_logging.h"
+#include "secure_fw/partitions/crypto/psa_manifest/tfm_crypto.h"
+#include "secure_fw/partitions/platform/psa_manifest/tfm_platform.h"
+#include "secure_fw/partitions/initial_attestation/psa_manifest/tfm_initial_attestation.h"
#include "test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
#include "test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
#include "test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
diff --git a/secure_fw/core/tfm_secure_irq_handlers.inc.template b/secure_fw/spm/model_func/tfm_secure_irq_handlers.inc.template
similarity index 97%
rename from secure_fw/core/tfm_secure_irq_handlers.inc.template
rename to secure_fw/spm/model_func/tfm_secure_irq_handlers.inc.template
index 3fabdc0..9db5d64 100644
--- a/secure_fw/core/tfm_secure_irq_handlers.inc.template
+++ b/secure_fw/spm/model_func/tfm_secure_irq_handlers.inc.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
diff --git a/secure_fw/spm/tfm_spm_db_func.inc b/secure_fw/spm/model_func/tfm_spm_db_func.inc
similarity index 99%
rename from secure_fw/spm/tfm_spm_db_func.inc
rename to secure_fw/spm/model_func/tfm_spm_db_func.inc
index 7a99476..21a76ca 100644
--- a/secure_fw/spm/tfm_spm_db_func.inc
+++ b/secure_fw/spm/model_func/tfm_spm_db_func.inc
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_FUNC_INC__
#define __TFM_SPM_DB_FUNC_INC__
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "psa_manifest/sid.h"
/**************************************************************************/
diff --git a/secure_fw/spm/tfm_spm_db_func.inc.template b/secure_fw/spm/model_func/tfm_spm_db_func.inc.template
similarity index 99%
rename from secure_fw/spm/tfm_spm_db_func.inc.template
rename to secure_fw/spm/model_func/tfm_spm_db_func.inc.template
index 8f424b8..55bcce5 100644
--- a/secure_fw/spm/tfm_spm_db_func.inc.template
+++ b/secure_fw/spm/model_func/tfm_spm_db_func.inc.template
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_FUNC_INC__
#define __TFM_SPM_DB_FUNC_INC__
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "psa_manifest/sid.h"
{# Produce a build error if heap_size is presented in the manifest, because of the dynamic memory allocation is not supported now. #}
diff --git a/secure_fw/ns_callable/tfm_veneers.c b/secure_fw/spm/model_func/tfm_veneers.c
similarity index 99%
rename from secure_fw/ns_callable/tfm_veneers.c
rename to secure_fw/spm/model_func/tfm_veneers.c
index 0ec4da5..0da2ca9 100644
--- a/secure_fw/ns_callable/tfm_veneers.c
+++ b/secure_fw/spm/model_func/tfm_veneers.c
@@ -8,7 +8,7 @@
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
#include "tfm_secure_api.h"
-#include "secure_fw/spm/spm_partition_defs.h"
+#include "tfm/spm_partition_defs.h"
#ifdef TFM_PARTITION_SECURE_STORAGE
/******** TFM_SP_STORAGE ********/
diff --git a/secure_fw/ns_callable/tfm_veneers.c.template b/secure_fw/spm/model_func/tfm_veneers.c.template
similarity index 96%
rename from secure_fw/ns_callable/tfm_veneers.c.template
rename to secure_fw/spm/model_func/tfm_veneers.c.template
index 258f5bd..f6b482e 100644
--- a/secure_fw/ns_callable/tfm_veneers.c.template
+++ b/secure_fw/spm/model_func/tfm_veneers.c.template
@@ -8,7 +8,7 @@
{{utilities.donotedit_warning}}
#include "tfm_secure_api.h"
-#include "secure_fw/spm/spm_partition_defs.h"
+#include "tfm/spm_partition_defs.h"
{% for manifest in manifests %}
{% if manifest.attr.conditional %}
diff --git a/secure_fw/spm/model_ipc/CMakeLists.inc b/secure_fw/spm/model_ipc/CMakeLists.inc
new file mode 100644
index 0000000..a95fd99
--- /dev/null
+++ b/secure_fw/spm/model_ipc/CMakeLists.inc
@@ -0,0 +1,76 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file assumes it will be included from a project specific cmakefile.
+#
+#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.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR
+ "Please set TFM_ROOT_DIR before including this file.")
+endif()
+
+#Get the current directory where this file is located.
+set(SFW_IPC_SPM_DIR ${CMAKE_CURRENT_LIST_DIR})
+set(SFW_SPM_DIR "${SFW_IPC_SPM_DIR}/..")
+set(SFW_SPM_ARCH_DIR "${SFW_SPM_DIR}/arch")
+set(SFW_SPM_INIT_DIR "${SFW_SPM_DIR}/init")
+
+set (SFW_IPC_SPM_SRC
+ "${SFW_SPM_INIT_DIR}/tfm_boot_data.c"
+ "${SFW_SPM_INIT_DIR}/tfm_core.c"
+ "${SFW_IPC_SPM_DIR}/spm_ipc.c"
+ "${SFW_IPC_SPM_DIR}/spm_psa_client_call.c"
+ "${SFW_IPC_SPM_DIR}/tfm_core_svcalls_ipc.c"
+ "${SFW_IPC_SPM_DIR}/tfm_message_queue.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/tfm_utils.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/tfm_core_utils.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/spm_api.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/tfm_spm_services.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/tfm_secure_api.c"
+ "${SFW_IPC_SPM_DIR}/tfm_pools.c"
+ "${SFW_IPC_SPM_DIR}/tfm_thread.c"
+ "${SFW_IPC_SPM_DIR}/tfm_wait.c"
+ )
+
+if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
+ list(APPEND SFW_IPC_SPM_SRC "${SFW_IPC_SPM_DIR}/tfm_rpc.c"
+ "${SFW_IPC_SPM_DIR}/tfm_spe_mailbox.c"
+ "${SFW_IPC_SPM_DIR}/tfm_multi_core.c"
+ "${SFW_IPC_SPM_DIR}/tfm_multi_core_mem_check.c"
+ )
+else ()
+ list(APPEND SFW_IPC_SPM_SRC "${SFW_IPC_SPM_DIR}/tfm_nspm_ipc.c"
+ "${SFW_IPC_SPM_DIR}/tfm_psa_api_veneers.c"
+ "${SFW_IPC_SPM_DIR}/../runtime/tfm_core_mem_check.c"
+ )
+endif ()
+
+#Append all our source files to global lists.
+list(APPEND ALL_SRC_C ${SFW_IPC_SPM_SRC})
+unset(SFW_IPC_SPM_SRC)
+
+#Setting include directories
+embedded_include_directories(PATH ${SFW_IPC_SPM_DIR} ABSOLUTE)
+embedded_include_directories(PATH ${SFW_IPC_SPM_DIR}/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm/include ABSOLUTE)
+embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm/arch/include ABSOLUTE)
diff --git a/secure_fw/core/ipc/include/tfm_internal_defines.h b/secure_fw/spm/model_ipc/include/tfm_internal_defines.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_internal_defines.h
rename to secure_fw/spm/model_ipc/include/tfm_internal_defines.h
diff --git a/secure_fw/core/ipc/include/tfm_list.h b/secure_fw/spm/model_ipc/include/tfm_list.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_list.h
rename to secure_fw/spm/model_ipc/include/tfm_list.h
diff --git a/secure_fw/core/ipc/include/tfm_message_queue.h b/secure_fw/spm/model_ipc/include/tfm_message_queue.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_message_queue.h
rename to secure_fw/spm/model_ipc/include/tfm_message_queue.h
diff --git a/secure_fw/core/ipc/include/tfm_multi_core.h b/secure_fw/spm/model_ipc/include/tfm_multi_core.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_multi_core.h
rename to secure_fw/spm/model_ipc/include/tfm_multi_core.h
diff --git a/secure_fw/core/ipc/include/tfm_pools.h b/secure_fw/spm/model_ipc/include/tfm_pools.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_pools.h
rename to secure_fw/spm/model_ipc/include/tfm_pools.h
diff --git a/secure_fw/core/ipc/include/tfm_rpc.h b/secure_fw/spm/model_ipc/include/tfm_rpc.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_rpc.h
rename to secure_fw/spm/model_ipc/include/tfm_rpc.h
diff --git a/secure_fw/core/ipc/include/tfm_spe_mailbox.h b/secure_fw/spm/model_ipc/include/tfm_spe_mailbox.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_spe_mailbox.h
rename to secure_fw/spm/model_ipc/include/tfm_spe_mailbox.h
diff --git a/secure_fw/core/ipc/include/tfm_svcalls.h b/secure_fw/spm/model_ipc/include/tfm_svcalls.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_svcalls.h
rename to secure_fw/spm/model_ipc/include/tfm_svcalls.h
diff --git a/secure_fw/core/ipc/include/tfm_thread.h b/secure_fw/spm/model_ipc/include/tfm_thread.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_thread.h
rename to secure_fw/spm/model_ipc/include/tfm_thread.h
diff --git a/secure_fw/core/ipc/include/tfm_wait.h b/secure_fw/spm/model_ipc/include/tfm_wait.h
similarity index 100%
rename from secure_fw/core/ipc/include/tfm_wait.h
rename to secure_fw/spm/model_ipc/include/tfm_wait.h
diff --git a/secure_fw/spm/spm_ipc.c b/secure_fw/spm/model_ipc/spm_ipc.c
similarity index 99%
rename from secure_fw/spm/spm_ipc.c
rename to secure_fw/spm/model_ipc/spm_ipc.c
index a571454..99f6925 100644
--- a/secure_fw/spm/spm_ipc.c
+++ b/secure_fw/spm/model_ipc/spm_ipc.c
@@ -20,9 +20,9 @@
#include "tfm_api.h"
#include "tfm_secure_api.h"
#include "tfm_memory_utils.h"
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "tfm_peripherals_def.h"
-#include "spm_db.h"
+#include "tfm/spm_db.h"
#include "tfm_core_utils.h"
#include "spm_psa_client_call.h"
#include "tfm_rpc.h"
@@ -32,9 +32,9 @@
#include "tfm_list.h"
#include "tfm_pools.h"
#include "region_defs.h"
-#include "tfm_spm_services_api.h"
+#include "tfm/tfm_spm_services_api.h"
-#include "secure_fw/services/tfm_service_list.inc"
+#include "secure_fw/partitions/tfm_service_list.inc"
/* Extern service variable */
extern struct tfm_spm_service_t service[];
diff --git a/secure_fw/spm/spm_psa_client_call.c b/secure_fw/spm/model_ipc/spm_psa_client_call.c
similarity index 99%
rename from secure_fw/spm/spm_psa_client_call.c
rename to secure_fw/spm/model_ipc/spm_psa_client_call.c
index bf5171e..58aae56 100644
--- a/secure_fw/spm/spm_psa_client_call.c
+++ b/secure_fw/spm/model_ipc/spm_psa_client_call.c
@@ -6,7 +6,7 @@
*/
#include "psa/service.h"
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "tfm_core_utils.h"
#include "tfm_internal_defines.h"
#include "tfm_memory_utils.h"
diff --git a/secure_fw/spm/spm_psa_client_call.h b/secure_fw/spm/model_ipc/spm_psa_client_call.h
similarity index 100%
rename from secure_fw/spm/spm_psa_client_call.h
rename to secure_fw/spm/model_ipc/spm_psa_client_call.h
diff --git a/secure_fw/core/tfm_core_svcalls_ipc.c b/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
similarity index 98%
rename from secure_fw/core/tfm_core_svcalls_ipc.c
rename to secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
index bd2133c..2c07bf4 100644
--- a/secure_fw/core/tfm_core_svcalls_ipc.c
+++ b/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
@@ -7,15 +7,15 @@
#include <string.h>
#include "region.h"
-#include "spm_api.h"
-#include "spm_db.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_db.h"
#include "tfm_api.h"
#include "tfm_arch.h"
#include "tfm_core_trustzone.h"
#include "tfm_internal.h"
#include "tfm_svcalls.h"
#include "tfm_utils.h"
-#include "core/tfm_core_svc.h"
+#include "tfm/tfm_core_svc.h"
/* The section names come from the scatter file */
REGION_DECLARE(Image$$, TFM_UNPRIV_CODE, $$RO$$Base);
diff --git a/secure_fw/core/ipc/tfm_message_queue.c b/secure_fw/spm/model_ipc/tfm_message_queue.c
similarity index 100%
rename from secure_fw/core/ipc/tfm_message_queue.c
rename to secure_fw/spm/model_ipc/tfm_message_queue.c
diff --git a/secure_fw/core/ipc/tfm_multi_core.c b/secure_fw/spm/model_ipc/tfm_multi_core.c
similarity index 100%
rename from secure_fw/core/ipc/tfm_multi_core.c
rename to secure_fw/spm/model_ipc/tfm_multi_core.c
diff --git a/secure_fw/core/ipc/tfm_multi_core_mem_check.c b/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
similarity index 99%
rename from secure_fw/core/ipc/tfm_multi_core_mem_check.c
rename to secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
index b126c7d..ccd93d2 100644
--- a/secure_fw/core/ipc/tfm_multi_core_mem_check.c
+++ b/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
@@ -9,8 +9,8 @@
#include "platform/include/tfm_spm_hal.h"
#include "region_defs.h"
#include "secure_utilities.h"
-#include "secure_fw/spm/spm_api.h"
-#include "spm_db.h"
+#include "tfm/spm_api.h"
+#include "tfm/spm_db.h"
#include "tfm_internal.h"
#include "tfm_multi_core.h"
#include "tfm_secure_api.h"
diff --git a/secure_fw/core/tfm_nspm_ipc.c b/secure_fw/spm/model_ipc/tfm_nspm_ipc.c
similarity index 100%
rename from secure_fw/core/tfm_nspm_ipc.c
rename to secure_fw/spm/model_ipc/tfm_nspm_ipc.c
diff --git a/secure_fw/core/ipc/tfm_pools.c b/secure_fw/spm/model_ipc/tfm_pools.c
similarity index 100%
rename from secure_fw/core/ipc/tfm_pools.c
rename to secure_fw/spm/model_ipc/tfm_pools.c
diff --git a/secure_fw/ns_callable/tfm_psa_api_veneers.c b/secure_fw/spm/model_ipc/tfm_psa_api_veneers.c
similarity index 100%
rename from secure_fw/ns_callable/tfm_psa_api_veneers.c
rename to secure_fw/spm/model_ipc/tfm_psa_api_veneers.c
diff --git a/secure_fw/core/ipc/tfm_rpc.c b/secure_fw/spm/model_ipc/tfm_rpc.c
similarity index 98%
rename from secure_fw/core/ipc/tfm_rpc.c
rename to secure_fw/spm/model_ipc/tfm_rpc.c
index f2778aa..073e4f4 100644
--- a/secure_fw/core/ipc/tfm_rpc.c
+++ b/secure_fw/spm/model_ipc/tfm_rpc.c
@@ -5,7 +5,7 @@
*
*/
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "spm_psa_client_call.h"
#include "tfm_rpc.h"
#include "tfm_utils.h"
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc b/secure_fw/spm/model_ipc/tfm_secure_irq_handlers_ipc.inc
similarity index 80%
rename from secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
rename to secure_fw/spm/model_ipc/tfm_secure_irq_handlers_ipc.inc
index 0c86e72..22f92cd 100644
--- a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
+++ b/secure_fw/spm/model_ipc/tfm_secure_irq_handlers_ipc.inc
@@ -7,12 +7,12 @@
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-#include "secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h"
-#include "secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
-#include "secure_fw/services/audit_logging/psa_manifest/tfm_audit_logging.h"
-#include "secure_fw/services/crypto/psa_manifest/tfm_crypto.h"
-#include "secure_fw/services/platform/psa_manifest/tfm_platform.h"
-#include "secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h"
+#include "secure_fw/partitions/secure_storage/psa_manifest/tfm_secure_storage.h"
+#include "secure_fw/partitions/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h"
+#include "secure_fw/partitions/audit_logging/psa_manifest/tfm_audit_logging.h"
+#include "secure_fw/partitions/crypto/psa_manifest/tfm_crypto.h"
+#include "secure_fw/partitions/platform/psa_manifest/tfm_platform.h"
+#include "secure_fw/partitions/initial_attestation/psa_manifest/tfm_initial_attestation.h"
#include "test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
#include "test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
#include "test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template b/secure_fw/spm/model_ipc/tfm_secure_irq_handlers_ipc.inc.template
similarity index 100%
rename from secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
rename to secure_fw/spm/model_ipc/tfm_secure_irq_handlers_ipc.inc.template
diff --git a/secure_fw/core/ipc/tfm_spe_mailbox.c b/secure_fw/spm/model_ipc/tfm_spe_mailbox.c
similarity index 100%
rename from secure_fw/core/ipc/tfm_spe_mailbox.c
rename to secure_fw/spm/model_ipc/tfm_spe_mailbox.c
diff --git a/secure_fw/spm/tfm_spm_db_ipc.inc b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
similarity index 99%
rename from secure_fw/spm/tfm_spm_db_ipc.inc
rename to secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
index 2dd09bc..3a99b2e 100644
--- a/secure_fw/spm/tfm_spm_db_ipc.inc
+++ b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_IPC_INC__
#define __TFM_SPM_DB_IPC_INC__
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "psa_manifest/sid.h"
/**************************************************************************/
diff --git a/secure_fw/spm/tfm_spm_db_ipc.inc.template b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
similarity index 99%
rename from secure_fw/spm/tfm_spm_db_ipc.inc.template
rename to secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
index 86390df..4fcd0fb 100644
--- a/secure_fw/spm/tfm_spm_db_ipc.inc.template
+++ b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_IPC_INC__
#define __TFM_SPM_DB_IPC_INC__
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "psa_manifest/sid.h"
{# Produce a build error if heap_size is presented in the manifest, because of the dynamic memory allocation is not supported now. #}
diff --git a/secure_fw/core/ipc/tfm_thread.c b/secure_fw/spm/model_ipc/tfm_thread.c
similarity index 98%
rename from secure_fw/core/ipc/tfm_thread.c
rename to secure_fw/spm/model_ipc/tfm_thread.c
index 2b956a3..1d66e25 100644
--- a/secure_fw/core/ipc/tfm_thread.c
+++ b/secure_fw/spm/model_ipc/tfm_thread.c
@@ -9,8 +9,8 @@
#include "tfm_thread.h"
#include "tfm_utils.h"
#include "tfm_memory_utils.h"
-#include "core/tfm_core_svc.h"
-#include "spm_api.h"
+#include "tfm/tfm_core_svc.h"
+#include "tfm/spm_api.h"
#include "tfm_core_utils.h"
/* Force ZERO in case ZI(bss) clear is missing */
diff --git a/secure_fw/core/ipc/tfm_wait.c b/secure_fw/spm/model_ipc/tfm_wait.c
similarity index 100%
rename from secure_fw/core/ipc/tfm_wait.c
rename to secure_fw/spm/model_ipc/tfm_wait.c
diff --git a/secure_fw/spm/spm_api.c b/secure_fw/spm/runtime/spm_api.c
similarity index 97%
rename from secure_fw/spm/spm_api.c
rename to secure_fw/spm/runtime/spm_api.c
index 9dae74b..a72b402 100644
--- a/secure_fw/spm/spm_api.c
+++ b/secure_fw/spm/runtime/spm_api.c
@@ -9,16 +9,16 @@
#include <stdio.h>
#include <string.h>
-#include "spm_api.h"
+#include "tfm/spm_api.h"
#include "tfm_spm_hal.h"
#include "tfm_memory_utils.h"
-#include "spm_db.h"
+#include "tfm/spm_db.h"
#include "tfm_internal.h"
#include "tfm_api.h"
#include "tfm_nspm.h"
#include "tfm_core.h"
#include "tfm_peripherals_def.h"
-#include "spm_partition_defs.h"
+#include "tfm/spm_partition_defs.h"
#include "region.h"
#define NON_SECURE_INTERNAL_PARTITION_DB_IDX 0
diff --git a/secure_fw/core/tfm_core_mem_check.c b/secure_fw/spm/runtime/tfm_core_mem_check.c
similarity index 96%
rename from secure_fw/core/tfm_core_mem_check.c
rename to secure_fw/spm/runtime/tfm_core_mem_check.c
index 6e65102..17ab074 100644
--- a/secure_fw/core/tfm_core_mem_check.c
+++ b/secure_fw/spm/runtime/tfm_core_mem_check.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -7,7 +7,7 @@
#include <arm_cmse.h>
#include "region_defs.h"
-#include "secure_fw/spm/spm_api.h"
+#include "tfm/spm_api.h"
#include "tfm_api.h"
/**
diff --git a/secure_fw/core/tfm_core_utils.c b/secure_fw/spm/runtime/tfm_core_utils.c
similarity index 100%
rename from secure_fw/core/tfm_core_utils.c
rename to secure_fw/spm/runtime/tfm_core_utils.c
diff --git a/secure_fw/core/tfm_secure_api.c b/secure_fw/spm/runtime/tfm_secure_api.c
similarity index 100%
rename from secure_fw/core/tfm_secure_api.c
rename to secure_fw/spm/runtime/tfm_secure_api.c
diff --git a/secure_fw/spm/tfm_spm_db.inc b/secure_fw/spm/runtime/tfm_spm_db.inc
similarity index 100%
rename from secure_fw/spm/tfm_spm_db.inc
rename to secure_fw/spm/runtime/tfm_spm_db.inc
diff --git a/secure_fw/core/tfm_spm_services.c b/secure_fw/spm/runtime/tfm_spm_services.c
similarity index 95%
rename from secure_fw/core/tfm_spm_services.c
rename to secure_fw/spm/runtime/tfm_spm_services.c
index cecdbf2..2a04c6e 100644
--- a/secure_fw/core/tfm_spm_services.c
+++ b/secure_fw/spm/runtime/tfm_spm_services.c
@@ -7,11 +7,11 @@
#include <arm_cmse.h>
-#include "core/tfm_core_svc.h"
+#include "tfm/tfm_core_svc.h"
#include "tfm_secure_api.h"
#include "tfm_internal.h"
-#include "secure_fw/include/tfm_spm_services_api.h"
-#include "spm_api.h"
+#include "secure_fw/include/tfm/tfm_spm_services_api.h"
+#include "tfm/spm_api.h"
#include "psa/service.h"
#ifndef TFM_PSA_API
diff --git a/secure_fw/core/tfm_utils.c b/secure_fw/spm/runtime/tfm_utils.c
similarity index 100%
rename from secure_fw/core/tfm_utils.c
rename to secure_fw/spm/runtime/tfm_utils.c