Build: Convert secure_fw dir to modern cmake
Rewrite cmake files inside the secure_fw directory. Removed generated
files as they are now generated into the build tree. Alter header
includes where include paths have changed.
WARNING: This change will not build in isolation, it requires _all_
other cmake changes to successfully build. It is split out only for
clarity of changes.
Change-Id: Ib1b13c9b69f2fcb1ff354ed6b5e5b717a207e3b8
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index f304358..cc5eb1e 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -1,586 +1,116 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
+cmake_minimum_required(VERSION 3.13)
-set(TFM_BUILD_IN_SPE ON)
+add_executable(tfm_s)
+add_library(secure_fw INTERFACE)
+add_library(tfm_secure_api STATIC)
+add_library(tfm_partitions INTERFACE)
+# Lots of seperate things need to know which partitions are enabled, so this
+# meta-target is provided so the related compile definitions can be collected in
+# such a way that they don't cause issues with linking to the full spm (which is
+# the other place these could be collected) Actual definitions are placed in the
+# directories of the partitions
+add_library(tfm_partition_defs INTERFACE)
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
+add_subdirectory(partitions/lib/sprt)
+add_subdirectory(partitions/audit_logging)
+add_subdirectory(partitions/crypto)
+add_subdirectory(partitions/initial_attestation)
+add_subdirectory(partitions/protected_storage)
+add_subdirectory(partitions/internal_trusted_storage)
+add_subdirectory(partitions/platform)
+add_subdirectory(spm)
-set(SECURE_FW_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set(TFM_ROOT_DIR "${SECURE_FW_DIR}/..")
-set(INTERFACE_DIR "${TFM_ROOT_DIR}/interface")
+target_include_directories(secure_fw
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/partitions>
+)
-#Include common stuff to control cmake.
-include("Common/BuildSys")
+target_link_libraries(secure_fw
+ INTERFACE
+ tfm_spm
+ tfm_partitions
+)
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_s LANGUAGES ASM C)
-embedded_project_fixup()
+target_link_libraries(tfm_s
+ PRIVATE
+ secure_fw
+ platform_s
+ psa_interface
+ tfm_sprt
+)
-#Include functionality to enable building the documentation.
-include("Common/BuildDoxygenDoc")
-include("Common/BuildSphinxDoc")
+set_target_properties(tfm_s
+ PROPERTIES
+ SUFFIX ".axf"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+)
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
+target_link_options(tfm_s
+ PRIVATE
+ --entry=Reset_Handler
+ $<$<C_COMPILER_ID:GNU>:-Wl,-Map=${CMAKE_BINARY_DIR}/bin/tfm_s.map>
+ $<$<C_COMPILER_ID:ARMClang>:--map>
+)
+
+add_convert_to_bin_target(tfm_s)
+
+############################ Secure API ########################################
+
+target_include_directories(tfm_secure_api
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
+
+target_link_libraries(tfm_secure_api
+ PUBLIC
+ tfm_arch
+ PRIVATE
+ psa_interface
+ platform_s
+)
+
+set_source_files_properties(
+ ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_client.c
+ ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_service.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-unused-parameter
+)
+
+############################# Secure veneers ###################################
+
+if(NOT (TFM_PSA_API AND TFM_MULTI_CORE_TOPOLOGY))
+ add_library(tfm_s_veneers STATIC)
+
+ target_sources(tfm_s_veneers
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}/s_veneers.o
+ )
+
+ # Since s_veneers.o doesn't exist when this is evaluated by cmake we need to
+ # explicity specify what language it will use.
+ set_target_properties(tfm_s_veneers
+ PROPERTIES
+ LINKER_LANGUAGE C
+ )
+
+ # Pretend we have a command to generate the veneers, when in reality all
+ # that's needed is the dependency on tfm_s. This is required for the ninja
+ # build system
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/s_veneers.o
+ COMMAND
+ DEPENDS tfm_s
+ )
+
+ target_link_options(tfm_s
+ PRIVATE
+ ${LINKER_VENEER_OUTPUT_FLAG}${CMAKE_CURRENT_BINARY_DIR}/s_veneers.o
+ )
endif()
-
-if (NOT DEFINED TFM_PARTITION_AUDIT_LOG)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_AUDIT_LOG is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_PLATFORM)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_PLATFORM is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_PROTECTED_STORAGE)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_PROTECTED_STORAGE is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_INTERNAL_TRUSTED_STORAGE is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_CRYPTO)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_CRYPTO is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_INITIAL_ATTESTATION)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_INITIAL_ATTESTATION is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_TEST_CORE)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_CORE is undefined. ")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_TEST_CORE_IPC)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_CORE_IPC is undefined.")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_TEST_SECURE_SERVICES)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_SECURE_SERVICES is undefined. ")
-endif()
-
-if (NOT DEFINED TFM_PARTITION_TEST_PS)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_PS is undefined.")
-endif()
-
-if (NOT DEFINED TEST_FRAMEWORK_S)
- message(FATAL_ERROR "Incomplete build configuration: TEST_FRAMEWORK_S is undefined.")
-endif()
-
-if (NOT DEFINED TEST_FRAMEWORK_NS)
- message(FATAL_ERROR "Incomplete build configuration: TEST_FRAMEWORK_NS is undefined.")
-endif()
-
-if (NOT DEFINED BL2)
- message(FATAL_ERROR "Incomplete build configuration: BL2 is undefined. ")
-endif()
-
-if (NOT DEFINED TFM_PSA_API)
- message(FATAL_ERROR "Incomplete build configuration: TFM_PSA_API is undefined. ")
-endif()
-
-if(NOT DEFINED PLATFORM_LINK_INCLUDES)
- message(FATAL_ERROR "ERROR: Incomplete Configuration: PLATFORM_LINK_INCLUDES is not defined.")
-endif()
-
-if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
- message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_ENABLE_IRQ_TEST is not defined.")
-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}/spm/cmsis_psa/CMakeLists.inc)
-else()
- include(${SECURE_FW_DIR}/spm/cmsis_func/CMakeLists.inc)
-endif()
-
-set(BUILD_CMSIS_CORE On)
-set(BUILD_RETARGET On)
-set(BUILD_NATIVE_DRIVERS On)
-set(BUILD_STARTUP On)
-set(BUILD_TARGET_CFG On)
-# FIXME: The following TARGET flags are platform dependent.
-# It is required to add a mechanism to expose the
-# target capabilities and, based on them, set the
-# flags properly.
-set(BUILD_TARGET_HARDWARE_KEYS On)
-set(BUILD_TARGET_NV_COUNTERS On)
-set(BUILD_CMSIS_DRIVERS On)
-set(BUILD_TIME Off)
-set(BUILD_UART_STDOUT On)
-set(BUILD_FLASH On)
-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()
-
-if(NOT DEFINED S_SCATTER_FILE_NAME)
- message(FATAL_ERROR "ERROR: Incomplete Configuration: S_SCATTER_FILE_NAME not defined, Include this file from a Config*.cmake")
-endif()
-embedded_set_target_linker_file(TARGET ${PROJECT_NAME} PATH "${S_SCATTER_FILE_NAME}")
-
-embedded_target_include_directories(TARGET ${PROJECT_NAME} PATH ${TFM_ROOT_DIR} ABSOLUTE APPEND)
-#Create an object library to avoid compiling all source files twice, when two executables
-#with different memory map need to be linked(BL2 non-swapping)
-set(PROJECT_OBJ_LIB ${PROJECT_NAME}_obj_lib)
-add_library(${PROJECT_OBJ_LIB} OBJECT ${ALL_SRC_C} ${ALL_SRC_C_S} ${ALL_SRC_ASM} ${ALL_SRC_ASM_S})
-
-#Add platform specific definitions in SPE
-if (DEFINED TFM_PLATFORM_SECURE_DEFS)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES ${TFM_PLATFORM_SECURE_DEFS} APPEND)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE ASM DEFINES ${TFM_PLATFORM_SECURE_DEFS} APPEND)
-endif()
-
-#Set common compiler flags
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
-config_setting_shared_compiler_flags(${PROJECT_OBJ_LIB})
-
-if (NOT DEFINED TARGET_NV_COUNTERS_ENABLE)
- set(TARGET_NV_COUNTERS_ENABLE OFF)
-endif()
-
-if (TARGET_NV_COUNTERS_ENABLE)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES TFM_NVCOUNTERS_ENABLE APPEND)
-endif()
-
-if (BOOT_DATA_AVAILABLE)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES BOOT_DATA_AVAILABLE APPEND)
-endif()
-
-if (LEGACY_TFM_TLV_HEADER)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES LEGACY_TFM_TLV_HEADER APPEND)
-endif()
-
-if (NOT DEFINED CORE_TEST)
- message(FATAL_ERROR "Incomplete build configuration: CORE_TEST is undefined.")
-elseif(CORE_TEST)
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES TFM_CORE_DEBUG APPEND)
-endif()
-
-if (NOT DEFINED TFM_NS_CLIENT_IDENTIFICATION)
- message(FATAL_ERROR "Incomplete build configuration: TFM_NS_CLIENT_IDENTIFICATION is undefined.")
-elseif (TFM_NS_CLIENT_IDENTIFICATION)
- target_compile_definitions(${PROJECT_OBJ_LIB} PRIVATE TFM_NS_CLIENT_IDENTIFICATION)
-endif()
-
-if (NOT DEFINED DEBUG_AUTHENTICATION)
- set(DEBUG_AUTHENTICATION "DAUTH_CHIP_DEFAULT")
-endif()
-
-#Set include directories
-embedded_target_include_directories(TARGET ${PROJECT_OBJ_LIB} PATH ${TFM_ROOT_DIR} ABSOLUTE APPEND)
-
-# For the non-swapping BL2 configuration two executables need to be built.
-# One can be executed from the primary slot flash partition and other from the
-# the secondary slot. Only the linking phase is different. This function
-# captures common settings and eliminates copy-paste.
-function(set_up_secure_fw_build)
- set( _OPTIONS_ARGS) #Option (on/off) arguments (e.g. IGNORE_CASE)
- set( _ONE_VALUE_ARGS S_TARGET VENEER_NAME POSTFIX) #Single option arguments (e.g. PATH "./foo/bar")
- set( _MULTI_VALUE_ARGS LINK_DEFINES) #List arguments (e.g. LANGUAGES C ASM CXX)
- cmake_parse_arguments(_MY_PARAMS "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN})
-
- if (NOT DEFINED _MY_PARAMS_S_TARGET)
- message(FATAL_ERROR "set_up_secure_fw_build(): mandatory parameter 'S_TARGET' missing.")
- endif()
-
- if (NOT DEFINED _MY_PARAMS_VENEER_NAME)
- message(FATAL_ERROR "set_up_secure_fw_build(): mandatory parameter 'VENEER_NAME' missing.")
- endif()
-
- set(EXE_NAME ${_MY_PARAMS_S_TARGET}${_MY_PARAMS_POSTFIX})
- set(VENEER_NAME ${_MY_PARAMS_VENEER_NAME}${_MY_PARAMS_POSTFIX}.o)
-
- #Create linker target: add object library to executable
- add_executable(${EXE_NAME} $<TARGET_OBJECTS:${PROJECT_OBJ_LIB}>)
-
- #Set common linker flags
- config_setting_shared_linker_flags(${EXE_NAME})
-
- #Set individual linker flags per linker target/executable
- foreach(flag ${_MY_PARAMS_LINK_DEFINES})
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "${flag}")
- endforeach(flag)
-
- embedded_set_target_linker_file(TARGET ${EXE_NAME} PATH "${S_SCATTER_FILE_NAME}")
-
- #Set macro definitions for the project.
- set(TARGET_COMPILE_DEFINITIONS __thumb2__ __DOMAIN_NS=0 DOMAIN_NS=__DOMAIN_NS TFM_LVL=${TFM_LVL} ${DEBUG_AUTHENTICATION})
- embedded_set_target_compile_defines(TARGET ${PROJECT_OBJ_LIB} LANGUAGE C DEFINES ${TARGET_COMPILE_DEFINITIONS} APPEND)
-
- # The order of the libraries linked below is important for GCC
- # Because the GCC linker will search an archive only once.
- # If the a library has some symbols that are defined in the library which is linked before it,
- # it will not cause the linker to search again.
- # So please put a library before what it relies on.
- # If the link dependency is complicated or it is difficult to sort out link
- # dependency by only adjusting the order, it is recommended to explicitly
- # add the dependency in the dedicated CMake file of corresponding module, to
- # simplify the ordering and avoid any potential linking issue.
- if (CORE_TEST OR TFM_PARTITION_TEST_SECURE_SERVICES)
- target_link_libraries(${EXE_NAME} tfm_secure_tests)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_TEST_SECURE_SERVICES")
- endif()
-
- if (TFM_PARTITION_INITIAL_ATTESTATION)
- target_link_libraries(${EXE_NAME} tfm_attest)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_INITIAL_ATTESTATION")
- endif()
-
- if (TFM_PARTITION_PROTECTED_STORAGE)
- target_link_libraries(${EXE_NAME} tfm_storage)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_PROTECTED_STORAGE")
- endif()
-
- if (TFM_PARTITION_CRYPTO)
- target_link_libraries(${EXE_NAME} tfm_crypto)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_CRYPTO")
- endif()
-
- if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
- target_link_libraries(${EXE_NAME} tfm_internal_trusted_storage)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_INTERNAL_TRUSTED_STORAGE")
- endif()
-
- if (TFM_PARTITION_AUDIT_LOG)
- target_link_libraries(${EXE_NAME} tfm_audit)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_AUDIT_LOG")
- endif()
-
- if (TFM_PARTITION_PLATFORM)
- target_link_libraries(${EXE_NAME} tfm_platform)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_PLATFORM")
- endif()
-
- #Add the PSA API compliance test secure libraries
- if(PSA_API_TEST_IPC)
- add_definitions(-DPSA_API_TEST_IPC)
- target_link_libraries(${EXE_NAME} "${PSA_API_TEST_BUILD_PATH}/partition/client_partition.a")
- target_link_libraries(${EXE_NAME} "${PSA_API_TEST_BUILD_PATH}/partition/server_partition.a")
- target_link_libraries(${EXE_NAME} "${PSA_API_TEST_BUILD_PATH}/partition/driver_partition.a")
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "PSA_API_TEST_IPC")
- endif()
-
- #Add the PSA API CRYPTO compliance test define if enabled
- if(PSA_API_TEST_CRYPTO)
- add_definitions(-DPSA_API_TEST_CRYPTO)
- endif()
-
- target_link_libraries(${EXE_NAME} libtfmsprt)
-
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_LVL=${TFM_LVL}")
-
- if (TFM_PARTITION_TEST_CORE)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_TEST_CORE")
- endif()
-
- if (TFM_PARTITION_TEST_CORE_IPC)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_TEST_CORE_IPC")
- endif()
-
- if (TFM_PARTITION_TEST_PS)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_TEST_PS")
- endif()
-
- if (TEST_FRAMEWORK_S)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TEST_FRAMEWORK_S")
- endif()
-
- if (TEST_FRAMEWORK_NS)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TEST_FRAMEWORK_NS")
- endif()
-
- if (BL2)
- #Add BL2 and MCUBOOT_IMAGE_NUMBER defines to linker to resolve symbols in region_defs.h and flash_layout.h
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "BL2" "MCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER}")
- endif()
-
- if (TFM_PSA_API)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PSA_API")
- if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_MULTI_CORE_TOPOLOGY")
- endif()
- endif()
-
- if(CORE_TEST)
- set(SECURE_AXF_DIR_PREFIX "${CMAKE_BINARY_DIR}/unit_test/")
- set_target_properties(${EXE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SECURE_AXF_DIR_PREFIX})
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_PARTITION_TEST_CORE")
- endif()
-
- embedded_set_target_link_includes(TARGET ${EXE_NAME} INCLUDES "${PLATFORM_LINK_INCLUDES}")
-
- if (TFM_ENABLE_IRQ_TEST)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_ENABLE_IRQ_TEST")
- endif()
-
- if (TFM_MULTI_CORE_TEST)
- add_definitions(-DTFM_MULTI_CORE_TEST)
- embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_MULTI_CORE_TEST")
- endif()
-
- #Generate binary file from executable
- compiler_generate_binary_output(${EXE_NAME})
-
- #Generate intel hex file from axf
- compiler_generate_hex_output(${EXE_NAME})
-
- #Generate elf file from axf
- compiler_generate_elf_output(${EXE_NAME})
-
- if (NOT DEFINED TFM_MULTI_CORE_TOPOLOGY OR NOT TFM_MULTI_CORE_TOPOLOGY)
- #Configure where we put the CMSE veneers generated by the compiler.
- set(S_VENEER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${VENEER_NAME}")
- compiler_set_cmse_output(${EXE_NAME} "${S_VENEER_FILE}")
- endif()
-
- #Configure what file shall be installed.
- #Set install location. Keep original value to avoid overriding command line settings.
- if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install location for secure_fw." FORCE)
- endif()
-
- #Export files needed to interface external applications at: <build_dir>/install/export/tfm/
- set(INTERFACE_INC_DIR "${INTERFACE_DIR}/include")
- set(INTERFACE_SRC_DIR "${INTERFACE_DIR}/src")
- set(EXPORT_INC_DIR "export/tfm/include")
- set(EXPORT_SRC_DIR "export/tfm/src")
- #Headers
- install(FILES ${INTERFACE_INC_DIR}/psa/client.h
- ${INTERFACE_INC_DIR}/psa/error.h
- DESTINATION ${EXPORT_INC_DIR}/psa)
-
- install(FILES ${INTERFACE_INC_DIR}/os_wrapper/common.h
- ${INTERFACE_INC_DIR}/os_wrapper/mutex.h
- DESTINATION ${EXPORT_INC_DIR}/os_wrapper)
-
- install(FILES ${INTERFACE_INC_DIR}/psa_manifest/sid.h
- DESTINATION ${EXPORT_INC_DIR}/psa_manifest)
-
- install(FILES ${INTERFACE_INC_DIR}/tfm_api.h
- ${INTERFACE_INC_DIR}/tfm_ns_interface.h
- ${INTERFACE_INC_DIR}/tfm_ns_svc.h
- DESTINATION ${EXPORT_INC_DIR})
-
- install(FILES ${INTERFACE_INC_DIR}/ext/tz_context.h
- DESTINATION ${EXPORT_INC_DIR}/ext)
-
- if (TFM_MULTI_CORE_TOPOLOGY)
- install(FILES ${INTERFACE_INC_DIR}/tfm_multi_core_api.h
- ${INTERFACE_INC_DIR}/tfm_ns_mailbox.h
- ${INTERFACE_INC_DIR}/tfm_mailbox.h
- DESTINATION ${EXPORT_INC_DIR})
- else()
- install(FILES ${INTERFACE_INC_DIR}/tfm_veneers.h
- DESTINATION ${EXPORT_INC_DIR})
- endif()
-
- #Sources
- if (TFM_MULTI_CORE_TOPOLOGY)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_ns_mailbox.c
- ${INTERFACE_SRC_DIR}/tfm_multi_core_api.c
- ${INTERFACE_SRC_DIR}/tfm_multi_core_psa_ns_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_ns_interface.c
- DESTINATION ${EXPORT_SRC_DIR})
-
- if(TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if (TFM_NS_CLIENT_IDENTIFICATION)
- install(FILES ${INTERFACE_INC_DIR}/tfm_nspm_api.h
- ${INTERFACE_INC_DIR}/tfm_nspm_svc_handler.h
- DESTINATION ${EXPORT_INC_DIR})
- install(FILES ${INTERFACE_SRC_DIR}/tfm_nspm_api.c
- ${INTERFACE_SRC_DIR}/tfm_nspm_svc_handler.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
-
- if (TFM_PARTITION_PROTECTED_STORAGE)
- install(FILES ${INTERFACE_INC_DIR}/psa/protected_storage.h
- DESTINATION ${EXPORT_INC_DIR}/psa)
- if (TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_ps_ipc_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_ps_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
- install(FILES ${INTERFACE_INC_DIR}/psa/internal_trusted_storage.h
- ${INTERFACE_INC_DIR}/psa/storage_common.h
- DESTINATION ${EXPORT_INC_DIR}/psa)
- if (TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_its_ipc_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_its_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if (TFM_PARTITION_CRYPTO)
- install(FILES ${INTERFACE_INC_DIR}/psa/crypto_extra.h
- ${INTERFACE_INC_DIR}/psa/crypto_compat.h
- ${INTERFACE_INC_DIR}/psa/crypto.h
- ${INTERFACE_INC_DIR}/psa/crypto_client_struct.h
- ${INTERFACE_INC_DIR}/psa/crypto_sizes.h
- ${INTERFACE_INC_DIR}/psa/crypto_struct.h
- ${INTERFACE_INC_DIR}/psa/crypto_types.h
- ${INTERFACE_INC_DIR}/psa/crypto_values.h
- DESTINATION ${EXPORT_INC_DIR}/psa)
- install(FILES ${INTERFACE_INC_DIR}/tfm_crypto_defs.h
- DESTINATION ${EXPORT_INC_DIR})
- if (TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_crypto_ipc_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_crypto_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if (TFM_PARTITION_INITIAL_ATTESTATION)
- install(FILES ${INTERFACE_INC_DIR}/psa/initial_attestation.h
- DESTINATION ${EXPORT_INC_DIR}/psa)
- if (TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_initial_attestation_ipc_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_initial_attestation_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if(TFM_PARTITION_AUDIT_LOG)
- install(FILES ${INTERFACE_INC_DIR}/psa_audit_api.h
- ${INTERFACE_INC_DIR}/psa_audit_defs.h
- DESTINATION ${EXPORT_INC_DIR})
- install(FILES ${INTERFACE_SRC_DIR}/tfm_audit_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
-
- if(TFM_PARTITION_PLATFORM)
- install(FILES ${INTERFACE_INC_DIR}/tfm_platform_api.h
- DESTINATION ${EXPORT_INC_DIR})
- if(TFM_PSA_API)
- install(FILES ${INTERFACE_SRC_DIR}/tfm_platform_ipc_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- else()
- install(FILES ${INTERFACE_SRC_DIR}/tfm_platform_func_api.c
- DESTINATION ${EXPORT_SRC_DIR})
- endif()
- endif()
-
- if (NOT DEFINED TFM_MULTI_CORE_TOPOLOGY OR NOT TFM_MULTI_CORE_TOPOLOGY)
- install(FILES ${S_VENEER_FILE} DESTINATION export/tfm/veneers)
- endif()
-
- #Collect executables to common location: <build_dir>/install/outputs/
- if (DEFINED SECURE_AXF_DIR_PREFIX)
- set(MY_BINARY_DIR ${SECURE_AXF_DIR_PREFIX})
- else()
- set(MY_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
- endif()
-
- install(FILES ${MY_BINARY_DIR}/${EXE_NAME}.axf
- ${MY_BINARY_DIR}/${EXE_NAME}.bin
- ${MY_BINARY_DIR}/${EXE_NAME}.hex
- ${MY_BINARY_DIR}/${EXE_NAME}.elf
- DESTINATION outputs/${TARGET_PLATFORM}/)
-
- install(FILES ${MY_BINARY_DIR}/${EXE_NAME}.axf
- ${MY_BINARY_DIR}/${EXE_NAME}.bin
- ${MY_BINARY_DIR}/${EXE_NAME}.hex
- ${MY_BINARY_DIR}/${EXE_NAME}.elf
- DESTINATION outputs/fvp/)
-endfunction()
-
-#Adds the test directory
-add_subdirectory(${TEST_DIR} ${CMAKE_BINARY_DIR}/test/secure_test)
-
-#Add the crypto library target
-if (TFM_PARTITION_CRYPTO)
- add_subdirectory(${SECURE_FW_DIR}/partitions/crypto)
-endif()
-
-#Add the protected storage library target
-if (TFM_PARTITION_PROTECTED_STORAGE)
- add_subdirectory(${SECURE_FW_DIR}/partitions/protected_storage)
-endif()
-
-#Add the internal trusted storage library target
-if (TFM_PARTITION_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}/partitions/platform)
-endif()
-
-#Add the initial attestation service library target
-if (TFM_PARTITION_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}/partitions/audit_logging)
-endif()
-
-#Add the secure runtime library target
-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
- set(S_VENEER_PATH "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "")
-endif()
-
-if (LINK_TO_BOTH_MEMORY_REGION)
- #Link to primary memory region
- set_up_secure_fw_build(S_TARGET ${PROJECT_NAME}
- VENEER_NAME s_veneers)
-
- #Link to secondary memory region(add extra linker flag)
- set_up_secure_fw_build(S_TARGET ${PROJECT_NAME}
- LINK_DEFINES "LINK_TO_SECONDARY_PARTITION"
- VENEER_NAME s_veneers
- POSTFIX "_1")
-else()
- #Link to primary memory region only
- set_up_secure_fw_build(S_TARGET ${PROJECT_NAME}
- VENEER_NAME s_veneers)
-endif()
-
-#Finally let CMake system apply changes after the whole project is defined.
-if (TARGET ${PROJECT_NAME})
- embedded_project_end(${PROJECT_NAME})
-endif()
-
-if (TARGET ${PROJECT_NAME}_1)
- embedded_project_end(${PROJECT_NAME}_1)
-endif()
-
-embedded_project_end(${PROJECT_OBJ_LIB})
diff --git a/secure_fw/partitions/audit_logging/CMakeLists.inc b/secure_fw/partitions/audit_logging/CMakeLists.inc
deleted file mode 100644
index 2f83b68..0000000
--- a/secure_fw/partitions/audit_logging/CMakeLists.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "audit_logging" 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(AUDIT_LOGGING_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 (AUDIT_LOGGING_C_SRC
- "${AUDIT_LOGGING_DIR}/tfm_audit_secure_api.c"
- "${AUDIT_LOGGING_DIR}/audit_core.c"
-)
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${AUDIT_LOGGING_C_SRC})
-unset(AUDIT_LOGGING_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}/platform/ext/common ABSOLUTE)
diff --git a/secure_fw/partitions/audit_logging/CMakeLists.txt b/secure_fw/partitions/audit_logging/CMakeLists.txt
index 70a60b0..b0cc32d 100644
--- a/secure_fw/partitions/audit_logging/CMakeLists.txt
+++ b/secure_fw/partitions/audit_logging/CMakeLists.txt
@@ -1,44 +1,63 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-###Some project global settings
-set (AUDIT_LOGGING_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${AUDIT_LOGGING_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_audit LANGUAGES ASM C)
-embedded_project_fixup()
-
-###Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
+if (NOT TFM_PARTITION_AUDIT_LOG)
+ return()
endif()
-#Specify what we build (for the audit logging service, build as a static library)
-add_library(tfm_audit STATIC ${ALL_SRC_ASM} ${ALL_SRC_C})
-embedded_set_target_compile_defines(TARGET tfm_audit LANGUAGE C DEFINES __thumb2__ TFM_LVL=${TFM_LVL})
-
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_audit LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
+#TODO AUDIT should support IPC
+if(TFM_PSA_API)
+ return()
endif()
-#Set common compiler and linker flags
-config_setting_shared_compiler_flags(tfm_audit)
-config_setting_shared_linker_flags(tfm_audit)
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-embedded_project_end(tfm_audit)
+add_library(tfm_partition_audit STATIC)
+
+target_sources(tfm_partition_audit
+ PRIVATE
+ audit_core.c
+)
+
+target_include_directories(tfm_partition_audit
+ PUBLIC
+ .
+)
+
+target_link_libraries(tfm_partition_audit
+ PRIVATE
+ platform_s
+ tfm_secure_api
+ psa_interface
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_audit_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_audit_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_audit
+)
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_AUDIT_LOG
+)
diff --git a/secure_fw/partitions/crypto/CMakeLists.inc b/secure_fw/partitions/crypto/CMakeLists.inc
deleted file mode 100644
index 7c1b880..0000000
--- a/secure_fw/partitions/crypto/CMakeLists.inc
+++ /dev/null
@@ -1,141 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "crypto" module.
-#This file assumes it will be included from a project specific cmakefile, and
-#will not create a library or executable.
-#Inputs:
-# MBEDCRYPTO_INSTALL_DIR - directory where mbed-crypto headers and libraries can be found. Needed only when using CRYPTO_ENGINE_MBEDCRYPTO ON.
-# 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(CRYPTO_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-#Check input variables
-if (NOT DEFINED ENABLE_CRYPTO)
- message(FATAL_ERROR "Incomplete build configuration: ENABLE_CRYPTO is undefined. ")
-endif()
-
-if (NOT DEFINED CRYPTO_ENGINE_MBEDTLS)
- message(FATAL_ERROR "Incomplete build configuration: CRYPTO_ENGINE_MBEDTLS is undefined. ")
-endif()
-
-if (ENABLE_CRYPTO)
- if (CRYPTO_ENGINE_MBEDTLS)
- if (NOT DEFINED MBEDCRYPTO_INSTALL_DIR)
- message(FATAL_ERROR "Please set MBEDCRYPTO_INSTALL_DIR before including this file.")
- endif()
- endif()
-
- if (NOT DEFINED TFM_ROOT_DIR)
- message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.")
- endif()
-
- set (CRYPTO_C_SRC "${CRYPTO_DIR}/crypto_init.c"
- "${CRYPTO_DIR}/crypto_alloc.c"
- "${CRYPTO_DIR}/crypto_cipher.c"
- "${CRYPTO_DIR}/crypto_hash.c"
- "${CRYPTO_DIR}/crypto_mac.c"
- "${CRYPTO_DIR}/crypto_key.c"
- "${CRYPTO_DIR}/crypto_aead.c"
- "${CRYPTO_DIR}/crypto_asymmetric.c"
- "${CRYPTO_DIR}/crypto_key_derivation.c"
- "${CRYPTO_DIR}/tfm_crypto_secure_api.c"
- )
-
- if (CRYPTO_ENGINE_MBEDTLS)
- list(APPEND CRYPTO_C_SRC "${CRYPTO_DIR}/tfm_mbedcrypto_alt.c")
- endif()
-
- #Append all our source files to global lists.
- list(APPEND ALL_SRC_C ${CRYPTO_C_SRC})
- unset(CRYPTO_C_SRC)
-
- #Setting include directories
- embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE)
- embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)
- if (CRYPTO_ENGINE_MBEDTLS)
- embedded_include_directories(PATH ${MBEDCRYPTO_INSTALL_DIR}/include ABSOLUTE)
- endif()
-
- #Inform the user about Crypto service features selected based on the Crypto service cmake flags
- message("The Crypto service compile configuration is as follows:")
- if (NOT DEFINED CRYPTO_ENGINE_BUF_SIZE)
- message("- CRYPTO_ENGINE_BUF_SIZE using default value")
- else()
- message("- CRYPTO_ENGINE_BUF_SIZE: " ${CRYPTO_ENGINE_BUF_SIZE})
- endif()
- if (NOT DEFINED CRYPTO_CONC_OPER_NUM)
- message("- CRYPTO_CONC_OPER_NUM using default value")
- else()
- message("- CRYPTO_CONC_OPER_NUM: " ${CRYPTO_CONC_OPER_NUM})
- endif()
-
- if (NOT DEFINED CRYPTO_KEY_MODULE_DISABLED)
- message("- KEY module enabled")
- set(CRYPTO_KEY_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_KEY_MODULE_DISABLED: " ${CRYPTO_KEY_MODULE_DISABLED})
- endif()
- if (NOT CRYPTO_KEY_MODULE_DISABLED AND
- NOT TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
- message(FATAL_ERROR "Internal trusted storage should be enabled for persistent key storage")
- endif()
-
- if (NOT DEFINED CRYPTO_AEAD_MODULE_DISABLED)
- message("- AEAD module enabled")
- set(CRYPTO_AEAD_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_AEAD_MODULE_DISABLED: " ${CRYPTO_AEAD_MODULE_DISABLED})
- endif()
- if (NOT DEFINED CRYPTO_MAC_MODULE_DISABLED)
- message("- MAC module enabled")
- set(CRYPTO_MAC_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_MAC_MODULE_DISABLED: " ${CRYPTO_MAC_MODULE_DISABLED})
- endif()
- if (NOT DEFINED CRYPTO_HASH_MODULE_DISABLED)
- message("- HASH module enabled")
- set(CRYPTO_HASH_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_HASH_MODULE_DISABLED: " ${CRYPTO_HASH_MODULE_DISABLED})
- endif()
- if (NOT DEFINED CRYPTO_CIPHER_MODULE_DISABLED)
- message("- CIPHER module enabled")
- set(CRYPTO_CIPHER_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_CIPHER_MODULE_DISABLED: " ${CRYPTO_CIPHER_MODULE_DISABLED})
- endif()
- if (NOT DEFINED CRYPTO_KEY_DERIVATION_MODULE_DISABLED)
- message("- KEY_DERIVATION module enabled")
- set(CRYPTO_KEY_DERIVATION_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_KEY_DERIVATION_MODULE_DISABLED: " ${CRYPTO_KEY_DERIVATION_MODULE_DISABLED})
- endif()
- if (NOT DEFINED CRYPTO_ASYMMETRIC_MODULE_DISABLED)
- message("- ASYMMETRIC module enabled")
- set(CRYPTO_ASYMMETRIC_MODULE_DISABLED 0)
- else()
- message("- CRYPTO_ASYMMETRIC_MODULE_DISABLED: " ${CRYPTO_ASYMMETRIC_MODULE_DISABLED})
- endif()
- if (TFM_PSA_API)
- if (NOT DEFINED CRYPTO_IOVEC_BUFFER_SIZE)
- message("- CRYPTO_IOVEC_BUFFER_SIZE using default value")
- else()
- message("- CRYPTO_IOVEC_BUFFER_SIZE: " ${CRYPTO_IOVEC_BUFFER_SIZE})
- endif()
- endif()
-
-else()
- message(FATAL_ERROR "Build system currently doesn't support selectively disabling of a service.")
-endif()
diff --git a/secure_fw/partitions/crypto/CMakeLists.txt b/secure_fw/partitions/crypto/CMakeLists.txt
index d076edc..e10de61 100644
--- a/secure_fw/partitions/crypto/CMakeLists.txt
+++ b/secure_fw/partitions/crypto/CMakeLists.txt
@@ -1,148 +1,156 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-#Some project global settings
-set (CRYPTO_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${CRYPTO_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_crypto LANGUAGES ASM C)
-embedded_project_fixup()
-
-#Get the definition of what files we need to build
-set (ENABLE_CRYPTO ON)
-#The backend of the service is based on Mbed Crypto
-set (CRYPTO_ENGINE_MBEDTLS ON)
-
-if (CRYPTO_ENGINE_MBEDTLS)
- if (NOT DEFINED MBEDTLS_CONFIG_FILE)
- set (MBEDTLS_CONFIG_FILE "tfm_mbedcrypto_config.h")
- endif()
-
- if (NOT DEFINED MBEDTLS_CONFIG_PATH)
- set (MBEDTLS_CONFIG_PATH "${PLATFORM_DIR}/common")
- endif()
-
- #Define location of Mbed-Crypto(MbedTLS) source, build, and installation directory.
- get_filename_component(MBEDCRYPTO_SOURCE_DIR "${TFM_ROOT_DIR}/../mbedtls" ABSOLUTE)
- set (MBEDCRYPTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/mbed-crypto/build")
- set (MBEDCRYPTO_INSTALL_DIR ${MBEDCRYPTO_BINARY_DIR}/../install)
- set (MBEDCRYPTO_TARGET_NAME "mbedcrypto_lib")
+if (NOT TFM_PARTITION_CRYPTO)
+ return()
endif()
-include(CMakeLists.inc)
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-if (CRYPTO_HW_ACCELERATOR)
- if(NOT DEFINED CRYPTO_HW_ACCELERATOR_CMAKE_BUILD)
- message(FATAL_ERROR "CRYPTO_HW_ACCELERATOR_CMAKE_BUILD not defined.")
- endif()
- include(${CRYPTO_HW_ACCELERATOR_CMAKE_BUILD})
+add_library(tfm_partition_crypto STATIC)
+
+target_sources(tfm_partition_crypto
+ PRIVATE
+ crypto_init.c
+ crypto_alloc.c
+ crypto_cipher.c
+ crypto_hash.c
+ crypto_mac.c
+ crypto_key.c
+ crypto_aead.c
+ crypto_asymmetric.c
+ crypto_key_derivation.c
+)
+
+target_include_directories(tfm_partition_crypto
+ PRIVATE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+)
+
+# Linking to external interfaces
+target_link_libraries(tfm_partition_crypto
+ PRIVATE
+ tfm_secure_api
+ platform_s
+ mbedcrypto_crypto_service
+ psa_interface
+)
+target_compile_definitions(tfm_partition_crypto
+ PRIVATE
+ $<$<BOOL:${CRYPTO_KEY_MODULE_DISABLED}>:CRYPTO_KEY_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_AEAD_MODULE_DISABLED}>:CRYPTO_AEAD_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_MAC_MODULE_DISABLED}>:CRYPTO_MAC_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_CIPHER_MODULE_DISABLED}>:CRYPTO_CIPHER_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_HASH_MODULE_DISABLED}>:CRYPTO_HASH_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_GENERATOR_MODULE_DISABLED}>:CRYPTO_GENERATOR_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_ASYMMETRIC_MODULE_DISABLED}>:CRYPTO_ASYMMETRIC_MODULE_DISABLED>
+ $<$<BOOL:${CRYPTO_ENGINE_BUF_SIZE}>:CRYPTO_ENGINE_BUF_SIZE=${CRYPTO_ENGINE_BUF_SIZE}>
+ $<$<BOOL:${CRYPTO_CONC_OPER_NUM}>:CRYPTO_CONC_OPER_NUM=${CRYPTO_CONC_OPER_NUM}>
+ $<$<AND:$<NOT:$<BOOL:${TFM_PSA_API}>>,$<BOOL:${CRYPTO_IOVEC_BUFFER_SIZE}>>:CRYPTO_IOVEC_BUFFER_SIZE=${CRYPTO_IOVEC_BUFFER_SIZE}>
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_crypto_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_partition_crypto_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_crypto
+)
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_CRYPTO
+)
+
+############################### MBEDCRYPTO #####################################
+
+add_library(mbedcrypto_crypto_service_config INTERFACE)
+
+target_compile_definitions(mbedcrypto_crypto_service_config
+ INTERFACE
+ MBEDTLS_CONFIG_FILE="${TFM_MBEDCRYPTO_CONFIG_PATH}"
+ $<$<BOOL:${TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH}>:MBEDTLS_USER_CONFIG_FILE="${TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH}">
+ PSA_CRYPTO_SECURE
+ # Workaround for https://github.com/ARMmbed/mbedtls/issues/1077
+ $<$<OR:$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv8-m.base>,$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv6-m>>:MULADDC_CANNOT_USE_R7>
+)
+cmake_policy(SET CMP0079 NEW)
+
+set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
+set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
+set(ENABLE_TESTING OFF)
+set(ENABLE_PROGRAMS OFF)
+set(MBEDTLS_FATAL_WARNINGS OFF)
+set(ENABLE_DOCS OFF)
+set(INSTALL_MBEDTLS OFF)
+set(INSTALL_MBEDTLS_HEADERS OFF)
+
+# Current variables
+set(mbedcrypto_static_target mbedcrypto_crypto_service)
+set(mbedcrypto_lib_target mbedcrypto_lib_crypto_service)
+# Future variables
+set(lib_target lib_crypto_service)
+set(mbedcrypto_target mbedcrypto_crypto_service)
+set(mbedtls_target mbedtls_crypto_service)
+set(mbedx509_target mbedx509_crypto_service)
+
+# Mbedcrypto is quite a large lib, and it uses too much memory for it to be
+# reasonable to build it in debug info. As a compromise, if `debug` build type
+# is selected mbedcrypto will build under `relwithdebinfo` which preserved debug
+# symbols whild optimizing space.
+set(SAVED_BUILD_TYPE ${CMAKE_BUILD_TYPE})
+set(CMAKE_BUILD_TYPE ${MBEDCRYPTO_BUILD_TYPE})
+add_subdirectory(${MBEDCRYPTO_PATH} ${CMAKE_CURRENT_BINARY_DIR}/mbedcrypto)
+set(CMAKE_BUILD_TYPE ${SAVED_BUILD_TYPE} CACHE STRING "Build type: [Debug, Release, RelWithDebInfo, MinSizeRel]" FORCE)
+
+if(NOT TARGET mbedcrypto_crypto_service)
+ message(FATAL_ERROR "Target mbedcrypto_crypto_service does not exist. Have the patches in ${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto been applied to the mbedcrypto repo at ${MBEDCRYPTO_PATH} ?
+ Hint: The command might be `cd ${MBEDCRYPTO_PATH} && git apply ${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/*.patch`")
endif()
-#Create a list of the C defines
-list(APPEND TFM_CRYPTO_C_DEFINES_LIST __thumb2__ TFM_LVL=${TFM_LVL})
+set_target_properties(${mbedtls_target} ${mbedx509_target}
+ PROPERTIES
+ EXCLUDE_FROM_ALL TRUE
+)
-if (CRYPTO_ENGINE_MBEDTLS)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_ENGINE_MBEDTLS MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
- if (DEFINED MBEDTLS_USER_CONFIG_FILE)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}")
- endif()
-endif()
+target_include_directories(mbedcrypto_crypto_service
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
-#Add module configuration parameters in case they are provided during CMake configuration step
-if (CRYPTO_KEY_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_KEY_MODULE_DISABLED)
-endif()
-if (CRYPTO_AEAD_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_AEAD_MODULE_DISABLED)
-endif()
-if (CRYPTO_MAC_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_MAC_MODULE_DISABLED)
-endif()
-if (CRYPTO_CIPHER_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_CIPHER_MODULE_DISABLED)
-endif()
-if (CRYPTO_HASH_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_HASH_MODULE_DISABLED)
-endif()
-if (CRYPTO_KEY_DERIVATION_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_KEY_DERIVATION_MODULE_DISABLED)
-endif()
-if (CRYPTO_ASYMMETRIC_MODULE_DISABLED)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_ASYMMETRIC_MODULE_DISABLED)
-endif()
+target_sources(mbedcrypto_crypto_service
+ PRIVATE
+ $<$<NOT:$<BOOL:${CRYPTO_HW_ACCELERATOR}>>:${CMAKE_CURRENT_SOURCE_DIR}/tfm_mbedcrypto_alt.c>
+)
-if (DEFINED CRYPTO_ENGINE_BUF_SIZE)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_ENGINE_BUF_SIZE=${CRYPTO_ENGINE_BUF_SIZE})
-endif()
-if (DEFINED CRYPTO_CONC_OPER_NUM)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_CONC_OPER_NUM=${CRYPTO_CONC_OPER_NUM})
-endif()
-if (TFM_PSA_API AND DEFINED CRYPTO_IOVEC_BUFFER_SIZE)
- list(APPEND TFM_CRYPTO_C_DEFINES_LIST TFM_CRYPTO_IOVEC_BUFFER_SIZE=${CRYPTO_IOVEC_BUFFER_SIZE})
-endif()
+target_compile_options(mbedcrypto_crypto_service
+ PRIVATE
+ -Wno-unused-parameter
+)
-if (CRYPTO_ENGINE_MBEDTLS)
- #Set Mbed Crypto compiler flags
- string(APPEND MBEDCRYPTO_C_FLAGS " ${MBEDCRYPTO_C_FLAGS_SERVICES}")
- string(APPEND MBEDCRYPTO_C_FLAGS " -DMBEDTLS_CONFIG_FILE=\\\\\\\"${MBEDTLS_CONFIG_FILE}\\\\\\\""
- " -I${CMAKE_CURRENT_LIST_DIR}")
- if ((DEFINED MBEDTLS_USER_CONFIG_FILE) AND (DEFINED MBEDTLS_USER_CONFIG_PATH))
- string(APPEND MBEDCRYPTO_C_FLAGS " -DMBEDTLS_USER_CONFIG_FILE=\\\\\\\"${MBEDTLS_USER_CONFIG_FILE}\\\\\\\""
- " -I${MBEDTLS_USER_CONFIG_PATH}")
- endif()
- #Add TF-M include directory so Mbed Crypto can include PSA ITS headers
- string(APPEND MBEDCRYPTO_C_FLAGS " -I${TFM_ROOT_DIR}/interface/include")
-
- #Build Mbed Crypto as external project.
- #This ensures Mbed Crypto is built with exactly defined settings.
- #Mbed Crypto will be used from its install location
- include(${TFM_ROOT_DIR}/BuildMbedCrypto.cmake)
-endif()
-
-#Specify what we build (for the crypto service, build as a static library)
-add_library(tfm_crypto STATIC ${ALL_SRC_ASM} ${ALL_SRC_C})
-embedded_set_target_compile_defines(TARGET tfm_crypto LANGUAGE C DEFINES ${TFM_CRYPTO_C_DEFINES_LIST})
-
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_crypto LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
-
-if (CRYPTO_ENGINE_MBEDTLS)
- #Add a dependency on the Mbed Crypto install target.
- add_dependencies(tfm_crypto ${MBEDCRYPTO_TARGET_NAME}_install)
- #Ask the compiler to merge the Mbed Crypto and crypto service libraries.
- compiler_merge_library(DEST tfm_crypto LIBS "${MBEDCRYPTO_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX_C}mbedcrypto${CMAKE_STATIC_LIBRARY_SUFFIX_C}")
-
- #Link crypto accelerator libraries if applicable
- if (CRYPTO_HW_ACCELERATOR)
- if(NOT DEFINED CRYPTO_HW_ACCELERATOR_CMAKE_LINK)
- message(FATAL_ERROR "CRYPTO_HW_ACCELERATOR_CMAKE_LINK not defined.")
- endif()
- include(${CRYPTO_HW_ACCELERATOR_CMAKE_LINK})
- endif()
-endif()
-
-#Persistent key requires ITS service
-if (NOT CRYPTO_KEY_MODULE_DISABLED)
- target_link_libraries(tfm_crypto PRIVATE tfm_internal_trusted_storage)
-endif()
-
-#Set common compiler and linker flags
-config_setting_shared_compiler_flags(tfm_crypto)
-config_setting_shared_linker_flags(tfm_crypto)
-
-embedded_project_end(tfm_crypto)
+target_link_libraries(mbedcrypto_crypto_service
+ PRIVATE
+ psa_interface
+ tfm_secure_api
+ platform_s
+ PUBLIC
+ mbedcrypto_crypto_service_config
+)
diff --git a/secure_fw/partitions/crypto/tfm_mbedcrypto_include.h b/secure_fw/partitions/crypto/tfm_mbedcrypto_include.h
index 69342b1..7bb7f46 100644
--- a/secure_fw/partitions/crypto/tfm_mbedcrypto_include.h
+++ b/secure_fw/partitions/crypto/tfm_mbedcrypto_include.h
@@ -14,6 +14,6 @@
* Mbed Crypto
*/
#include "crypto_spe.h"
-#include "mbedcrypto/psa/crypto.h"
+#include "psa/crypto.h"
#endif /* __TFM_MBEDCRYPTO_INCLUDE_H__ */
diff --git a/secure_fw/partitions/initial_attestation/CMakeLists.inc b/secure_fw/partitions/initial_attestation/CMakeLists.inc
deleted file mode 100644
index abd6cd2..0000000
--- a/secure_fw/partitions/initial_attestation/CMakeLists.inc
+++ /dev/null
@@ -1,111 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "initial_attestation" 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(INITIAL_ATTESTATION_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-if (NOT DEFINED ATTEST_INCLUDE_OPTIONAL_CLAIMS)
- message(FATAL_ERROR "Incomplete build configuration: ATTEST_INCLUDE_OPTIONAL_CLAIMS is undefined.")
-endif()
-
-if (NOT DEFINED ATTEST_INCLUDE_TEST_CODE)
- message(FATAL_ERROR "Incomplete build configuration: ATTEST_INCLUDE_TEST_CODE is undefined.")
-endif()
-
-if (NOT DEFINED ATTEST_INCLUDE_COSE_KEY_ID)
- message(FATAL_ERROR "Incomplete build configuration: ATTEST_INCLUDE_COSE_KEY_ID is undefined.")
-endif()
-
-if (NOT DEFINED ATTEST_CLAIM_VALUE_CHECK)
- message(FATAL_ERROR "Incomplete build configuration: ATTEST_CLAIM_VALUE_CHECK is undefined.")
-endif()
-
-list(APPEND ATTEST_C_SRC
- "${INITIAL_ATTESTATION_DIR}/tfm_attest_secure_api.c"
- "${INITIAL_ATTESTATION_DIR}/tfm_attest.c"
- "${INITIAL_ATTESTATION_DIR}/tfm_attest_req_mngr.c"
- "${INITIAL_ATTESTATION_DIR}/attest_core.c"
- "${INITIAL_ATTESTATION_DIR}/attest_token_encode.c"
- )
-
-if (SYMMETRIC_INITIAL_ATTESTATION)
- list(APPEND ATTEST_C_SRC "${INITIAL_ATTESTATION_DIR}/attest_symmetric_key.c")
-else()
- list(APPEND ATTEST_C_SRC "${INITIAL_ATTESTATION_DIR}/attest_asymmetric_key.c")
-endif()
-
-if (ATTEST_INCLUDE_OPTIONAL_CLAIMS)
- set_property(SOURCE ${ATTEST_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS INCLUDE_OPTIONAL_CLAIMS)
-endif()
-
-if (ATTEST_INCLUDE_TEST_CODE)
- set_property(SOURCE ${ATTEST_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS INCLUDE_TEST_CODE)
-endif()
-
-if (ATTEST_INCLUDE_COSE_KEY_ID)
- set_property(SOURCE ${ATTEST_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS INCLUDE_COSE_KEY_ID)
-endif()
-
-if (LEGACY_TFM_TLV_HEADER)
- set_property(SOURCE ${ATTEST_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS LEGACY_TFM_TLV_HEADER)
-endif()
-
-#Inform the user about attestation service features selected based on the cmake flags
-message("The Initial Attestation service compile configuration is as follows:")
-message("- ATTEST_INCLUDE_OPTIONAL_CLAIMS: ${ATTEST_INCLUDE_OPTIONAL_CLAIMS}")
-message("- ATTEST_INCLUDE_TEST_CODE: ${ATTEST_INCLUDE_TEST_CODE}")
-message("- ATTEST_INCLUDE_COSE_KEY_ID: ${ATTEST_INCLUDE_COSE_KEY_ID}")
-message("- ATTEST_CLAIM_VALUE_CHECK: ${ATTEST_CLAIM_VALUE_CHECK}")
-
-#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/ext/common ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/include ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/bl2/include ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/partitions/lib/sprt/include ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/lib/ext/qcbor/inc ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/lib/ext/t_cose/inc ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/lib/ext/t_cose/src ABSOLUTE)
-embedded_include_directories(PATH ${INITIAL_ATTESTATION_DIR} ABSOLUTE)
-
-set(BUILD_CMSIS_CORE Off)
-set(BUILD_RETARGET Off)
-set(BUILD_NATIVE_DRIVERS Off)
-set(BUILD_STARTUP Off)
-set(BUILD_TARGET_CFG Off)
-set(BUILD_TARGET_HARDWARE_KEYS Off)
-set(BUILD_TARGET_NV_COUNTERS Off)
-set(BUILD_CMSIS_DRIVERS Off)
-set(BUILD_TIME Off)
-set(BUILD_UART_STDOUT Off)
-set(BUILD_FLASH Off)
-set(BUILD_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()
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${ATTEST_C_SRC})
-unset(ATTEST_C_SRC)
diff --git a/secure_fw/partitions/initial_attestation/CMakeLists.txt b/secure_fw/partitions/initial_attestation/CMakeLists.txt
index af89337..509b3a9 100644
--- a/secure_fw/partitions/initial_attestation/CMakeLists.txt
+++ b/secure_fw/partitions/initial_attestation/CMakeLists.txt
@@ -1,51 +1,86 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-#Some project global settings
-set (INITIAL_ATTESTATION_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${INITIAL_ATTESTATION_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_attest LANGUAGES ASM C)
-embedded_project_fixup()
-
-#Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined.")
+if (NOT TFM_PARTITION_INITIAL_ATTESTATION)
+ return()
endif()
-if (NOT TARGET tfm_qcbor_encode)
- add_subdirectory(${TFM_ROOT_DIR}/lib/ext/qcbor ${CMAKE_CURRENT_BINARY_DIR}/qcbor)
-endif()
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-if (NOT TARGET tfm_t_cose_sign)
- add_subdirectory(${TFM_ROOT_DIR}/lib/ext/t_cose ${CMAKE_CURRENT_BINARY_DIR}/t_cose)
-endif()
+add_library(tfm_partition_attestation STATIC)
-#Specify what we build (for the initial attestation service, build as a static library)
-add_library(tfm_attest STATIC ${ALL_SRC_ASM} ${ALL_SRC_C} $<TARGET_OBJECTS:tfm_qcbor_encode> $<TARGET_OBJECTS:tfm_t_cose_sign>)
-embedded_set_target_compile_defines(TARGET tfm_attest LANGUAGE C DEFINES __thumb2__ TFM_LVL=${TFM_LVL})
+target_sources(tfm_partition_attestation PRIVATE
+ tfm_attest.c
+ tfm_attest_req_mngr.c
+ attest_core.c
+ $<$<NOT:$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>>:attest_asymmetric_key.c>
+ $<$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>:attest_symmetric_key.c>
+ attest_token_encode.c
+)
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_attest LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
+target_include_directories(tfm_partition_attestation
+ PUBLIC
+ .
+)
-#Set common compiler flags
-config_setting_shared_compiler_flags(tfm_attest)
+target_link_libraries(tfm_partition_attestation
+ PRIVATE
+ tfm_secure_api
+ platform_s
+ tfm_qcbor
+ tfm_t_cose
+ secure_fw
+ psa_interface
+ tfm_sprt
+)
-embedded_project_end(tfm_attest)
+target_compile_definitions(tfm_partition_attestation
+ PRIVATE
+ $<$<BOOL:${TFM_INTERNAL_MCUBOOT}>:LEGACY_TFM_TLV_HEADER>
+ $<$<CONFIG:Debug>:INCLUDE_TEST_CODE>
+ $<$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>:SYMMETRIC_INITIAL_ATTESTATION>
+ $<$<BOOL:${ATTEST_INCLUDE_OPTIONAL_CLAIMS}>:INCLUDE_OPTIONAL_CLAIMS>
+ $<$<BOOL:${ATTEST_INCLUDE_COSE_KEY_ID}>:INCLUDE_COSE_KEY_ID>
+ $<$<NOT:$<BOOL:${PLATFORM_DUMMY_ATTEST_HAL}>>:CLAIM_VALUE_CHECK>
+)
+
+########################### Attest defs ########################################
+
+add_library(tfm_attestation_defs INTERFACE)
+
+target_include_directories(tfm_attestation_defs
+ INTERFACE
+ .
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_attest_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_attest_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_attestation
+)
+
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_INITIAL_ATTESTATION
+)
diff --git a/secure_fw/partitions/initial_attestation/attest_symmetric_key.c b/secure_fw/partitions/initial_attestation/attest_symmetric_key.c
index 601e390..4fa24a4 100644
--- a/secure_fw/partitions/initial_attestation/attest_symmetric_key.c
+++ b/secure_fw/partitions/initial_attestation/attest_symmetric_key.c
@@ -10,7 +10,7 @@
#include <stdint.h>
#include "attest_key.h"
-#include "platform/include/tfm_plat_crypto_keys.h"
+#include "tfm_plat_crypto_keys.h"
#include "psa/crypto.h"
#include "tfm_memory_utils.h"
diff --git a/secure_fw/partitions/internal_trusted_storage/CMakeLists.inc b/secure_fw/partitions/internal_trusted_storage/CMakeLists.inc
deleted file mode 100644
index a044be0..0000000
--- a/secure_fw/partitions/internal_trusted_storage/CMakeLists.inc
+++ /dev/null
@@ -1,129 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "internal_trusted_storage" 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(INTERNAL_TRUSTED_STORAGE_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-#Check input variables
-if (NOT DEFINED TFM_ROOT_DIR)
- message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.")
-endif()
-
-if (NOT DEFINED ITS_CREATE_FLASH_LAYOUT)
- message(FATAL_ERROR "Incomplete build configuration: ITS_CREATE_FLASH_LAYOUT is undefined. ")
-endif()
-
-if (NOT DEFINED ITS_VALIDATE_METADATA_FROM_FLASH)
- message(FATAL_ERROR "Incomplete build configuration: ITS_VALIDATE_METADATA_FROM_FLASH is undefined. ")
-endif()
-
-if (NOT DEFINED ITS_RAM_FS)
- message(FATAL_ERROR "Incomplete build configuration: ITS_RAM_FS is undefined. ")
-endif()
-
-set(INTERNAL_TRUSTED_STORAGE_C_SRC
- "${INTERNAL_TRUSTED_STORAGE_DIR}/tfm_its_secure_api.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/tfm_its_req_mngr.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/tfm_internal_trusted_storage.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/its_utils.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash_nand.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash_nor.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash_ram.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash_info_internal.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash/its_flash_info_external.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash_fs/its_flash_fs.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash_fs/its_flash_fs_dblock.c"
- "${INTERNAL_TRUSTED_STORAGE_DIR}/flash_fs/its_flash_fs_mblock.c"
-)
-
-# If either ITS or PS requires metadata to be validated, then compile the
-# validation code.
-if (ITS_VALIDATE_METADATA_FROM_FLASH OR PS_VALIDATE_METADATA_FROM_FLASH)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS ITS_VALIDATE_METADATA_FROM_FLASH)
-endif()
-
-if (ITS_CREATE_FLASH_LAYOUT)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS ITS_CREATE_FLASH_LAYOUT)
-endif()
-
-if (ITS_RAM_FS)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS ITS_RAM_FS)
-endif()
-
-if (DEFINED ITS_BUF_SIZE)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS ITS_BUF_SIZE=${ITS_BUF_SIZE})
-endif()
-
-# Also set PS definitions
-if (PS_ENCRYPTION)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_ENCRYPTION)
- if (PS_ROLLBACK_PROTECTION)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_ROLLBACK_PROTECTION)
- endif()
-endif()
-
-if (PS_CREATE_FLASH_LAYOUT)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_CREATE_FLASH_LAYOUT)
-endif()
-
-if (PS_RAM_FS)
- set_property(SOURCE ${INTERNAL_TRUSTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_RAM_FS)
-endif()
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${INTERNAL_TRUSTED_STORAGE_C_SRC})
-unset(INTERNAL_TRUSTED_STORAGE_C_SRC)
-
-#Inform the user about ITS service features selected based on the ITS service CMake flags
-message("The ITS service compile configuration is as follows:")
-message("- ITS_VALIDATE_METADATA_FROM_FLASH: " ${ITS_VALIDATE_METADATA_FROM_FLASH})
-message("- ITS_CREATE_FLASH_LAYOUT: " ${ITS_CREATE_FLASH_LAYOUT})
-message("- ITS_RAM_FS: " ${ITS_RAM_FS})
-if (DEFINED ITS_BUF_SIZE)
- message("- ITS_BUF_SIZE: " ${ITS_BUF_SIZE})
-else()
- message("- ITS_BUF_SIZE using default value")
-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/protected_storage 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)
-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/partitions/internal_trusted_storage/CMakeLists.txt b/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
index 569a255..b776b30 100644
--- a/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
+++ b/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
@@ -1,44 +1,87 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-# Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-###Some project global settings
-set (INTERNAL_TRUSTED_STORAGE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${INTERNAL_TRUSTED_STORAGE_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_internal_trusted_storage LANGUAGES ASM C)
-embedded_project_fixup()
-
-###Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
+if (NOT TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
+ return()
endif()
-# Specify what we build (for the internal trusted storage service, build as a static library)
-add_library(tfm_internal_trusted_storage STATIC ${ALL_SRC_ASM} ${ALL_SRC_C})
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-#Set common compiler and linker flags
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_internal_trusted_storage LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
-config_setting_shared_compiler_flags(tfm_internal_trusted_storage)
-config_setting_shared_linker_flags(tfm_internal_trusted_storage)
+add_library(tfm_partition_its STATIC)
-embedded_set_target_compile_defines(TARGET tfm_internal_trusted_storage LANGUAGE C DEFINES __thumb2__ TFM_LVL=${TFM_LVL})
+target_include_directories(tfm_partition_its
+ PRIVATE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ PUBLIC
+ # Required for ps_object_defs.h
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/../protected_storage
+)
-embedded_project_end(tfm_internal_trusted_storage)
+target_sources(tfm_partition_its
+ PRIVATE
+ tfm_its_req_mngr.c
+ tfm_internal_trusted_storage.c
+ its_utils.c
+ flash/its_flash.c
+ flash/its_flash_nand.c
+ flash/its_flash_nor.c
+ flash/its_flash_ram.c
+ flash/its_flash_info_internal.c
+ flash/its_flash_info_external.c
+ flash_fs/its_flash_fs.c
+ flash_fs/its_flash_fs_dblock.c
+ flash_fs/its_flash_fs_mblock.c
+)
+
+target_link_libraries(tfm_partition_its
+ PRIVATE
+ tfm_secure_api
+ platform_s
+ psa_interface
+)
+
+target_compile_definitions(tfm_partition_its
+ PUBLIC
+ $<$<BOOL:${PS_CREATE_FLASH_LAYOUT}>:PS_CREATE_FLASH_LAYOUT>
+ $<$<BOOL:${PS_ENCRYPTION}>:PS_ENCRYPTION>
+ $<$<BOOL:${PS_RAM_FS}>:PS_RAM_FS>
+ $<$<BOOL:${PS_ROLLBACK_PROTECTION}>:PS_ROLLBACK_PROTECTION>
+ $<$<BOOL:${PS_VALIDATE_METADATA_FROM_FLASH}>:PS_VALIDATE_METADATA_FROM_FLASH>
+ $<$<BOOL:${PS_CRYPTO_AEAD_ALG}>:PS_CRYPTO_AEAD_ALG=${PS_CRYPTO_AEAD_ALG}>
+ PRIVATE
+ $<$<BOOL:${ITS_CREATE_FLASH_LAYOUT}>:ITS_CREATE_FLASH_LAYOUT>
+ $<$<BOOL:${ITS_RAM_FS}>:ITS_RAM_FS>
+ $<$<OR:$<BOOL:${ITS_VALIDATE_METADATA_FROM_FLASH}>,$<BOOL:PS_VALIDATE_METADATA_FROM_FLASH>>:ITS_VALIDATE_METADATA_FROM_FLASH>
+ $<$<BOOL:${ITS_BUF_SIZE}>:ITS_BUF_SIZE>
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_its_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_its_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_its
+)
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
+)
diff --git a/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c
index f6e86d0..5d31646 100644
--- a/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nand.c
@@ -7,7 +7,7 @@
*/
#include "its_flash_nand.h"
-#include "Driver_Flash.h"
+#include "driver/Driver_Flash.h"
#include "tfm_memory_utils.h"
static uint32_t buf_block_id = ITS_BLOCK_INVALID_ID;
diff --git a/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c
index 6d9ac10..2665380 100644
--- a/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c
+++ b/secure_fw/partitions/internal_trusted_storage/flash/its_flash_nor.c
@@ -7,7 +7,7 @@
*/
#include "its_flash_nor.h"
-#include "Driver_Flash.h"
+#include "driver/Driver_Flash.h"
/**
* \brief Gets physical address of the given block ID.
diff --git a/secure_fw/partitions/lib/sprt/CMakeLists.inc b/secure_fw/partitions/lib/sprt/CMakeLists.inc
deleted file mode 100644
index e4f1bd7..0000000
--- a/secure_fw/partitions/lib/sprt/CMakeLists.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definations to compile the "libtfmsprt" 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_S: 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_S: C++ source files to be compiled will be added to this list. This shaall be added to your add_executable or add_library command.
-# ALL_SRC_ASM_S: 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(LIBSPRT_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 (LIBSPRT_C_SRC
- "${LIBSPRT_DIR}/crt_memcpy.c"
- "${LIBSPRT_DIR}/crt_memmove.c"
- "${LIBSPRT_DIR}/crt_memcmp.c"
- "${LIBSPRT_DIR}/crt_memset.c"
- "${LIBSPRT_DIR}/service_api.c"
- "${TFM_ROOT_DIR}/interface/src/log/tfm_log_raw.c")
-
-if (TFM_PSA_API)
- list(APPEND LIBSPRT_C_SRC
- "${TFM_ROOT_DIR}/interface/src/psa/psa_client.c"
- "${TFM_ROOT_DIR}/interface/src/psa/psa_service.c"
- "${TFM_ROOT_DIR}/interface/src/psa/psa_lifecycle.c"
- )
-endif()
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C_S ${LIBSPRT_C_SRC})
-unset(LIBSPRT_C_SRC)
-
-#Setting include directories
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)
-embedded_include_directories(PATH ${LIBSPRT_DIR}/include ABSOLUTE)
diff --git a/secure_fw/partitions/lib/sprt/CMakeLists.txt b/secure_fw/partitions/lib/sprt/CMakeLists.txt
index a183397..626559f 100644
--- a/secure_fw/partitions/lib/sprt/CMakeLists.txt
+++ b/secure_fw/partitions/lib/sprt/CMakeLists.txt
@@ -1,38 +1,31 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
+cmake_minimum_required(VERSION 3.13)
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+add_library(tfm_sprt STATIC)
-#Some project global settings
-set (LIBSPRT_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${CMAKE_SOURCE_DIR}" ABSOLUTE)
+target_include_directories(tfm_sprt
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
-#Include common stuff to control cmake.
-include("Common/BuildSys")
+target_sources(tfm_sprt
+ PRIVATE
+ ./crt_memcmp.c
+ ./crt_memcpy.c
+ ./crt_memmove.c
+ ./crt_memset.c
+ ./service_api.c
+)
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(libtfmsprt LANGUAGES ASM C)
-embedded_project_fixup()
-
-#Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-#Build secure partition runtime library as a static library
-add_library(libtfmsprt STATIC ${ALL_SRC_ASM_S} ${ALL_SRC_C_S})
-embedded_set_target_compile_defines(TARGET libtfmsprt LANGUAGE C DEFINES __thumb2__)
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET libtfmsprt LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
-#Set common compiler and linker flags
-config_setting_shared_compiler_flags(libtfmsprt)
-config_setting_shared_linker_flags(libtfmsprt)
-
-embedded_project_end(libtfmsprt)
+target_link_libraries(tfm_sprt
+ platform_s
+ psa_interface
+ tfm_boot_status
+ tfm_secure_api
+)
diff --git a/secure_fw/partitions/platform/CMakeLists.inc b/secure_fw/partitions/platform/CMakeLists.inc
deleted file mode 100644
index d71f8a6..0000000
--- a/secure_fw/partitions/platform/CMakeLists.inc
+++ /dev/null
@@ -1,39 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "Platform" 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(PLATFORM_SERVICE_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 (PLATFORM_SERVICE_C_SRC
- "${PLATFORM_SERVICE_DIR}/platform_sp.c"
- "${PLATFORM_SERVICE_DIR}/tfm_platform_secure_api.c")
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${PLATFORM_SERVICE_C_SRC})
-unset(PLATFORM_SERVICE_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}/platform/ext/common ABSOLUTE)
diff --git a/secure_fw/partitions/platform/CMakeLists.txt b/secure_fw/partitions/platform/CMakeLists.txt
index d5ebd54..9012057 100644
--- a/secure_fw/partitions/platform/CMakeLists.txt
+++ b/secure_fw/partitions/platform/CMakeLists.txt
@@ -1,43 +1,57 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-###Some project global settings
-set (PLATFORM_SP_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${PLATFORM_SP_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_platform LANGUAGES ASM C)
-embedded_project_fixup()
-
-###Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
+if (NOT TFM_PARTITION_PLATFORM)
+ return()
endif()
-#Specify what we build (for the platform service, build as a static library)
-add_library(tfm_platform STATIC ${ALL_SRC_ASM} ${ALL_SRC_C})
-embedded_set_target_compile_defines(TARGET tfm_platform LANGUAGE C DEFINES __thumb2__ TFM_LVL=${TFM_LVL})
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_platform LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-#Set common compiler and linker flags
-config_setting_shared_compiler_flags(tfm_platform)
-config_setting_shared_linker_flags(tfm_platform)
+add_library(tfm_partition_platform STATIC
+ platform_sp.c
+)
-embedded_project_end(tfm_platform)
+target_include_directories(tfm_partition_platform
+ PRIVATE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+)
+
+target_link_libraries(tfm_partition_platform
+ PRIVATE
+ platform_s
+ psa_interface
+ tfm_secure_api
+ tfm_arch
+ tfm_spm
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_platform_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_platform_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_platform
+)
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_PLATFORM
+)
diff --git a/secure_fw/partitions/protected_storage/CMakeLists.inc b/secure_fw/partitions/protected_storage/CMakeLists.inc
deleted file mode 100644
index 1462877..0000000
--- a/secure_fw/partitions/protected_storage/CMakeLists.inc
+++ /dev/null
@@ -1,141 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "protected_storage" 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(PROTECTED_STORAGE_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-#Check input variables
-if (NOT DEFINED TFM_ROOT_DIR)
- message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.")
-endif()
-
-if (NOT DEFINED PS_ENCRYPTION)
- message(FATAL_ERROR "Incomplete build configuration: PS_ENCRYPTION is undefined. ")
-endif()
-
-if (NOT DEFINED PS_ROLLBACK_PROTECTION)
- message(FATAL_ERROR "Incomplete build configuration: PS_ROLLBACK_PROTECTION is undefined.")
-endif()
-
-if (NOT DEFINED PS_CREATE_FLASH_LAYOUT)
- message(FATAL_ERROR "Incomplete build configuration: PS_CREATE_FLASH_LAYOUT is undefined. ")
-endif()
-
-if (NOT DEFINED PS_VALIDATE_METADATA_FROM_FLASH)
- message(FATAL_ERROR "Incomplete build configuration: PS_VALIDATE_METADATA_FROM_FLASH is undefined. ")
-endif()
-
-if (NOT DEFINED PS_RAM_FS)
- message(FATAL_ERROR "Incomplete build configuration: PS_RAM_FS is undefined. ")
-endif()
-
-if (NOT DEFINED PS_TEST_NV_COUNTERS)
- message(FATAL_ERROR "Incomplete build configuration: PS_TEST_NV_COUNTERS is undefined.")
-endif()
-
-set (PROTECTED_STORAGE_C_SRC
- "${PROTECTED_STORAGE_DIR}/tfm_ps_secure_api.c"
- "${PROTECTED_STORAGE_DIR}/tfm_ps_req_mngr.c"
- "${PROTECTED_STORAGE_DIR}/tfm_protected_storage.c"
- "${PROTECTED_STORAGE_DIR}/ps_object_system.c"
- "${PROTECTED_STORAGE_DIR}/ps_object_table.c"
- "${PROTECTED_STORAGE_DIR}/ps_utils.c"
-)
-
-if (PS_ENCRYPTION)
- list(APPEND PROTECTED_STORAGE_C_SRC
- "${PROTECTED_STORAGE_DIR}/crypto/ps_crypto_interface.c"
- "${PROTECTED_STORAGE_DIR}/ps_encrypted_object.c"
- )
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_ENCRYPTION)
-
- if (PS_ROLLBACK_PROTECTION)
- # Only build the NV counters implementation if the PS_TEST_NV_COUNTERS
- # flag is off. When this flag is on, a virtual implementation of the PS
- # NV counters interface is used instead. Full documentation for this
- # flag can be found in the PS Integration Guide.
- if (NOT PS_TEST_NV_COUNTERS)
- list(APPEND PROTECTED_STORAGE_C_SRC
- "${PROTECTED_STORAGE_DIR}/nv_counters/ps_nv_counters.c")
- endif()
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_ROLLBACK_PROTECTION)
- endif()
-endif()
-
-if (PS_VALIDATE_METADATA_FROM_FLASH)
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_VALIDATE_METADATA_FROM_FLASH)
-endif()
-
-if (PS_CREATE_FLASH_LAYOUT)
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_CREATE_FLASH_LAYOUT)
-endif()
-
-if (PS_RAM_FS)
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_RAM_FS)
-endif()
-
-if (DEFINED PS_CRYPTO_AEAD_ALG)
- set_property(SOURCE ${PROTECTED_STORAGE_C_SRC} APPEND PROPERTY COMPILE_DEFINITIONS PS_CRYPTO_AEAD_ALG=${PS_CRYPTO_AEAD_ALG})
-endif()
-
-#Append all our source files to global lists.
-list(APPEND ALL_SRC_C ${PROTECTED_STORAGE_C_SRC})
-unset(PROTECTED_STORAGE_C_SRC)
-
-#Inform the user about PS service features selected based on the PS service cmake flags
-message("The PS service compile configuration is as follows:")
-message("- PS_ENCRYPTION: " ${PS_ENCRYPTION})
-if (PS_ENCRYPTION)
- message("- PS_ROLLBACK_PROTECTION: " ${PS_ROLLBACK_PROTECTION})
-else()
- message("- PS_ROLLBACK_PROTECTION: N/A")
-endif()
-message("- PS_VALIDATE_METADATA_FROM_FLASH: " ${PS_VALIDATE_METADATA_FROM_FLASH})
-message("- PS_CREATE_FLASH_LAYOUT: " ${PS_CREATE_FLASH_LAYOUT})
-message("- PS_RAM_FS: " ${PS_RAM_FS})
-message("- PS_TEST_NV_COUNTERS: " ${PS_TEST_NV_COUNTERS})
-if (DEFINED PS_CRYPTO_AEAD_ALG)
- message("- PS_CRYPTO_AEAD_ALG: " ${PS_CRYPTO_AEAD_ALG})
-endif()
-
-#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}/platform/ext/common ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/ext/driver 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/partitions/protected_storage/CMakeLists.txt b/secure_fw/partitions/protected_storage/CMakeLists.txt
index c376ce1..5d5cebc 100644
--- a/secure_fw/partitions/protected_storage/CMakeLists.txt
+++ b/secure_fw/partitions/protected_storage/CMakeLists.txt
@@ -1,44 +1,67 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-cmake_minimum_required(VERSION 3.7)
-
-# Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
-
-###Some project global settings
-set (PROTECTED_STORAGE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${PROTECTED_STORAGE_DIR}/../../.." ABSOLUTE)
-
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
-project(tfm_storage LANGUAGES ASM C)
-embedded_project_fixup()
-
-###Get the definition of what files we need to build
-include(CMakeLists.inc)
-
-if (NOT DEFINED TFM_LVL)
- message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
+if (NOT TFM_PARTITION_PROTECTED_STORAGE)
+ return()
endif()
-# Specify what we build (for the protected storage service, build as a static library)
-add_library(tfm_storage STATIC ${ALL_SRC_ASM} ${ALL_SRC_C})
+cmake_minimum_required(VERSION 3.13)
+cmake_policy(SET CMP0079 NEW)
-#Set common compiler and linker flags
-if (DEFINED CMSE_FLAGS)
- embedded_set_target_compile_flags(TARGET tfm_storage LANGUAGE C APPEND FLAGS ${CMSE_FLAGS})
-endif()
-config_setting_shared_compiler_flags(tfm_storage)
-config_setting_shared_linker_flags(tfm_storage)
+add_library(tfm_partition_ps STATIC)
-embedded_set_target_compile_defines(TARGET tfm_storage LANGUAGE C DEFINES __thumb2__ TFM_LVL=${TFM_LVL})
+target_include_directories(tfm_partition_ps
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+)
-embedded_project_end(tfm_storage)
+target_sources(tfm_partition_ps
+ PRIVATE
+ tfm_ps_req_mngr.c
+ tfm_protected_storage.c
+ ps_object_system.c
+ ps_object_table.c
+ ps_utils.c
+ $<$<BOOL:${PS_ENCRYPTION}>:crypto/ps_crypto_interface.c>
+ $<$<BOOL:${PS_ENCRYPTION}>:ps_encrypted_object.c>
+ $<$<NOT:$<BOOL:${PS_TEST_NV_COUNTERS}>>:nv_counters/ps_nv_counters.c>
+)
+
+target_link_libraries(tfm_partition_ps
+ PRIVATE
+ tfm_secure_api
+ psa_interface
+ secure_fw
+ platform_s
+ tfm_partition_its
+)
+
+############################ Secure API ########################################
+
+target_sources(tfm_secure_api
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfm_ps_secure_api.c
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_ps_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ Partition Defs ####################################
+
+target_link_libraries(tfm_partitions
+ INTERFACE
+ tfm_partition_ps
+)
+
+target_compile_definitions(tfm_partition_defs
+ INTERFACE
+ TFM_PARTITION_PROTECTED_STORAGE
+)
diff --git a/secure_fw/partitions/tfm_service_list.inc b/secure_fw/partitions/tfm_service_list.inc
deleted file mode 100644
index d68be93..0000000
--- a/secure_fw/partitions/tfm_service_list.inc
+++ /dev/null
@@ -1,848 +0,0 @@
-/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#ifndef __TFM_SERVICE_LIST_INC__
-#define __TFM_SERVICE_LIST_INC__
-
-#include "secure_fw/partitions/protected_storage/psa_manifest/tfm_protected_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 "../tf-m-tests/test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
-#include "../tf-m-tests/test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_service/psa_manifest/tfm_ipc_service_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_client/psa_manifest/tfm_ipc_client_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h"
-#include "../tf-m-tests/test/test_services/tfm_ps_test_service/psa_manifest/tfm_ps_test_service.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_2/psa_manifest/tfm_secure_client_2.h"
-
-const struct tfm_spm_service_db_t service_db[] =
-{
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- /******** TFM_SP_PS ********/
- {
- .name = "TFM_PS_SET",
- .partition_id = TFM_SP_PS,
- .signal = TFM_PS_SET_SIGNAL,
- .sid = 0x00000060,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_PS_GET",
- .partition_id = TFM_SP_PS,
- .signal = TFM_PS_GET_SIGNAL,
- .sid = 0x00000061,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_PS_GET_INFO",
- .partition_id = TFM_SP_PS,
- .signal = TFM_PS_GET_INFO_SIGNAL,
- .sid = 0x00000062,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_PS_REMOVE",
- .partition_id = TFM_SP_PS,
- .signal = TFM_PS_REMOVE_SIGNAL,
- .sid = 0x00000063,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_PS_GET_SUPPORT",
- .partition_id = TFM_SP_PS,
- .signal = TFM_PS_GET_SUPPORT_SIGNAL,
- .sid = 0x00000064,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- /******** TFM_SP_ITS ********/
- {
- .name = "TFM_ITS_SET",
- .partition_id = TFM_SP_ITS,
- .signal = TFM_ITS_SET_SIGNAL,
- .sid = 0x00000070,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_ITS_GET",
- .partition_id = TFM_SP_ITS,
- .signal = TFM_ITS_GET_SIGNAL,
- .sid = 0x00000071,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_ITS_GET_INFO",
- .partition_id = TFM_SP_ITS,
- .signal = TFM_ITS_GET_INFO_SIGNAL,
- .sid = 0x00000072,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_ITS_REMOVE",
- .partition_id = TFM_SP_ITS,
- .signal = TFM_ITS_REMOVE_SIGNAL,
- .sid = 0x00000073,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_CRYPTO
- /******** TFM_SP_CRYPTO ********/
- {
- .name = "TFM_CRYPTO",
- .partition_id = TFM_SP_CRYPTO,
- .signal = TFM_CRYPTO_SIGNAL,
- .sid = 0x00000080,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- /******** TFM_SP_PLATFORM ********/
- {
- .name = "TFM_SP_PLATFORM_SYSTEM_RESET",
- .partition_id = TFM_SP_PLATFORM,
- .signal = TFM_SP_PLATFORM_SYSTEM_RESET_SIGNAL,
- .sid = 0x00000040,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_SP_PLATFORM_IOCTL",
- .partition_id = TFM_SP_PLATFORM,
- .signal = TFM_SP_PLATFORM_IOCTL_SIGNAL,
- .sid = 0x00000041,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_SP_PLATFORM_NV_COUNTER",
- .partition_id = TFM_SP_PLATFORM,
- .signal = TFM_SP_PLATFORM_NV_COUNTER_SIGNAL,
- .sid = 0x00000042,
- .non_secure_client = false,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- /******** TFM_SP_INITIAL_ATTESTATION ********/
- {
- .name = "TFM_ATTEST_GET_TOKEN",
- .partition_id = TFM_SP_INITIAL_ATTESTATION,
- .signal = TFM_ATTEST_GET_TOKEN_SIGNAL,
- .sid = 0x00000020,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_ATTEST_GET_TOKEN_SIZE",
- .partition_id = TFM_SP_INITIAL_ATTESTATION,
- .signal = TFM_ATTEST_GET_TOKEN_SIZE_SIGNAL,
- .sid = 0x00000021,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "TFM_ATTEST_GET_PUBLIC_KEY",
- .partition_id = TFM_SP_INITIAL_ATTESTATION,
- .signal = TFM_ATTEST_GET_PUBLIC_KEY_SIGNAL,
- .sid = 0x00000022,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- /******** TFM_SP_CORE_TEST ********/
- {
- .name = "SPM_CORE_TEST_INIT_SUCCESS",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_INIT_SUCCESS_SIGNAL,
- .sid = 0x0000F020,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_DIRECT_RECURSION",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_DIRECT_RECURSION_SIGNAL,
- .sid = 0x0000F021,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_SS_TO_SS",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_SS_TO_SS_SIGNAL,
- .sid = 0x0000F024,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_SS_TO_SS_BUFFER",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_SS_TO_SS_BUFFER_SIGNAL,
- .sid = 0x0000F025,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_OUTVEC_WRITE",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_OUTVEC_WRITE_SIGNAL,
- .sid = 0x0000F026,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_PERIPHERAL_ACCESS",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_PERIPHERAL_ACCESS_SIGNAL,
- .sid = 0x0000F027,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_GET_CALLER_CLIENT_ID",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SIGNAL,
- .sid = 0x0000F028,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_SPM_REQUEST",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_SPM_REQUEST_SIGNAL,
- .sid = 0x0000F029,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_BLOCK",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_BLOCK_SIGNAL,
- .sid = 0x0000F02A,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_NS_THREAD",
- .partition_id = TFM_SP_CORE_TEST,
- .signal = SPM_CORE_TEST_NS_THREAD_SIGNAL,
- .sid = 0x0000F02B,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- /******** TFM_SP_CORE_TEST_2 ********/
- {
- .name = "SPM_CORE_TEST_2_SLAVE_SERVICE",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_SLAVE_SERVICE_SIGNAL,
- .sid = 0x0000F040,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_2_CHECK_CALLER_CLIENT_ID",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_CHECK_CALLER_CLIENT_ID_SIGNAL,
- .sid = 0x0000F041,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SIGNAL,
- .sid = 0x0000F042,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_2_INVERT",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_INVERT_SIGNAL,
- .sid = 0x0000F043,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_SIGNAL,
- .sid = 0x0000F044,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO",
- .partition_id = TFM_SP_CORE_TEST_2,
- .signal = SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_SIGNAL,
- .sid = 0x0000F045,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- /******** TFM_SP_SECURE_TEST_PARTITION ********/
- {
- .name = "TFM_SECURE_CLIENT_SFN_RUN_TESTS",
- .partition_id = TFM_SP_SECURE_TEST_PARTITION,
- .signal = TFM_SECURE_CLIENT_SFN_RUN_TESTS_SIGNAL,
- .sid = 0x0000F000,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- /******** TFM_SP_IPC_SERVICE_TEST ********/
- {
- .name = "IPC_SERVICE_TEST_BASIC",
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .signal = IPC_SERVICE_TEST_BASIC_SIGNAL,
- .sid = 0x0000F080,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM",
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .signal = IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SIGNAL,
- .sid = 0x0000F081,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM",
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .signal = IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SIGNAL,
- .sid = 0x0000F082,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM",
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .signal = IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SIGNAL,
- .sid = 0x0000F083,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_SERVICE_TEST_CLIENT_PROGRAMMER_ERROR",
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .signal = IPC_SERVICE_TEST_CLIENT_PROGRAMMER_ERROR_SIGNAL,
- .sid = 0x0000F084,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- /******** TFM_SP_IPC_CLIENT_TEST ********/
- {
- .name = "IPC_CLIENT_TEST_BASIC",
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .signal = IPC_CLIENT_TEST_BASIC_SIGNAL,
- .sid = 0x0000F060,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM",
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .signal = IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_SIGNAL,
- .sid = 0x0000F061,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM",
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .signal = IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SIGNAL,
- .sid = 0x0000F062,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM",
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .signal = IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_SIGNAL,
- .sid = 0x0000F063,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "IPC_CLIENT_TEST_MEM_CHECK",
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .signal = IPC_CLIENT_TEST_MEM_CHECK_SIGNAL,
- .sid = 0x0000F064,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- /******** TFM_IRQ_TEST_1 ********/
- {
- .name = "SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO",
- .partition_id = TFM_IRQ_TEST_1,
- .signal = SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SIGNAL,
- .sid = 0x0000F0A0,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
- {
- .name = "SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO",
- .partition_id = TFM_IRQ_TEST_1,
- .signal = SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SIGNAL,
- .sid = 0x0000F0A1,
- .non_secure_client = true,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- /******** TFM_SP_PS_TEST ********/
- {
- .name = "TFM_PS_TEST_PREPARE",
- .partition_id = TFM_SP_PS_TEST,
- .signal = TFM_PS_TEST_PREPARE_SIGNAL,
- .sid = 0x0000F0C0,
- .non_secure_client = false,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- /******** TFM_SP_SECURE_CLIENT_2 ********/
- {
- .name = "TFM_SECURE_CLIENT_2",
- .partition_id = TFM_SP_SECURE_CLIENT_2,
- .signal = TFM_SECURE_CLIENT_2_SIGNAL,
- .sid = 0x0000F0E0,
- .non_secure_client = false,
- .version = 1,
- .version_policy = TFM_VERSION_POLICY_STRICT
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The service list */
-/**************************************************************************/
-struct tfm_spm_service_t service[] =
-{
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- /******** TFM_SP_PS ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- /******** TFM_SP_ITS ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_CRYPTO
- /******** TFM_SP_CRYPTO ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- /******** TFM_SP_PLATFORM ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- /******** TFM_SP_INITIAL_ATTESTATION ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- /******** TFM_SP_CORE_TEST ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- /******** TFM_SP_CORE_TEST_2 ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- /******** TFM_SP_SECURE_TEST_PARTITION ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- /******** TFM_SP_IPC_SERVICE_TEST ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- /******** TFM_SP_IPC_CLIENT_TEST ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- /******** TFM_IRQ_TEST_1 ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- /******** TFM_SP_PS_TEST ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- /******** TFM_SP_SECURE_CLIENT_2 ********/
- {
- .service_db = NULL,
- .partition = NULL,
- .handle_list = {0},
- .list = {0},
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-#endif /* __TFM_SERVICE_LIST_INC__ */
diff --git a/secure_fw/spm/CMakeLists.txt b/secure_fw/spm/CMakeLists.txt
new file mode 100644
index 0000000..2caf429
--- /dev/null
+++ b/secure_fw/spm/CMakeLists.txt
@@ -0,0 +1,144 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+cmake_minimum_required(VERSION 3.13)
+
+add_library(tfm_spm STATIC)
+add_library(tfm_boot_status INTERFACE)
+add_library(tfm_arch INTERFACE)
+add_library(tfm_utilities INTERFACE)
+
+set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable the TF-M Platform partition")
+
+target_include_directories(tfm_spm
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_psa>
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_psa/include>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_func>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_func/include>
+ PRIVATE
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/generated
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_BINARY_DIR}/generated/secure_fw/spm/cmsis_psa>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:${CMAKE_BINARY_DIR}/generated/secure_fw/spm/cmsis_func>
+)
+
+target_sources(tfm_spm
+ PRIVATE
+ $<$<BOOL:${TFM_PARTITION_INITIAL_ATTESTATION}>:common/tfm_boot_data.c>
+ common/tfm_core_utils.c
+ common/utilities.c
+ $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:cmsis_psa/tfm_multi_core.c>
+ $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:cmsis_psa/tfm_multi_core_mem_check.c>
+ $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:cmsis_psa/tfm_rpc.c>
+ $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:cmsis_psa/tfm_spe_mailbox.c>
+ $<$<NOT:$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>:common/tfm_core_mem_check.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/arch/tfm_arch.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/main.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/spm_ipc.c>
+ $<$<BOOL:${TFM_PSA_API}>:common/spm_psa_client_call.c>
+ $<$<BOOL:${TFM_PSA_API}>:common/psa_client_service_apis.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/tfm_core_svcalls_ipc.c>
+ $<$<AND:$<BOOL:${TFM_PSA_API}>,$<NOT:$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>>:cmsis_psa/tfm_nspm_ipc.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/tfm_pools.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/tfm_thread.c>
+ $<$<BOOL:${TFM_PSA_API}>:cmsis_psa/tfm_wait.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/main.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/arch.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/spm_func.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/tfm_core_svcalls_func.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/tfm_nspm_func.c>
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:cmsis_func/tfm_secure_api.c>
+ #TODO add other arches
+ $<$<AND:$<BOOL:${TFM_PSA_API}>,$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv8-m.base>>:cmsis_psa/arch/tfm_arch_v8m_base.c>
+ $<$<AND:$<BOOL:${TFM_PSA_API}>,$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv8-m.main>>:cmsis_psa/arch/tfm_arch_v8m_main.c>
+ $<$<AND:$<BOOL:${TFM_PSA_API}>,$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv6-m>>:cmsis_psa/arch/tfm_arch_v6m_v7m.c>
+ $<$<AND:$<BOOL:${TFM_PSA_API}>,$<STREQUAL:${CMAKE_SYSTEM_ARCHITECTURE},armv7-m>>:cmsis_psa/arch/tfm_arch_v6m_v7m.c>
+)
+
+target_link_libraries(tfm_spm
+ PUBLIC
+ tfm_arch
+ PRIVATE
+ psa_interface
+ platform_s
+ tfm_boot_status
+ tfm_secure_api
+ tfm_partitions
+)
+
+target_compile_definitions(tfm_spm
+ PRIVATE
+ $<$<CONFIG:Debug>:TFM_CORE_DEBUG>
+ $<$<AND:$<BOOL:${BL2}>,$<BOOL:${MCUBOOT_MEASURED_BOOT}>>:BOOT_DATA_AVAILABLE>
+ $<$<BOOL:${TFM_INTERNAL_MCUBOOT}>:LEGACY_TFM_TLV_HEADER>
+)
+
+# With constant optimizations on tfm_nspc_func emits a symbol that the linker
+# doesn't like. It's unclear why this is, so I'll put a TODO here, but for the
+# moment this fixes it with mimimal impact.
+set_source_files_properties(tfm_nspm_func.c
+ PROPERTIES
+ COMPILE_FLAGS -fno-ipa-cp
+)
+
+# The veneers give warnings about not being properly declared so they get hidden
+# to not overshadow _real_ warnings.
+set_source_files_properties(tfm_secure_api.c
+ PROPERTIES
+ COMPILE_FLAGS -Wno-implicit-function-declaration
+)
+
+############################ TFM arch ##########################################
+
+target_include_directories(tfm_arch
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_psa/arch>
+)
+
+############################ Boot Status #######################################
+
+target_include_directories(tfm_boot_status
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
+
+############################ TFM utilities #####################################
+
+target_include_directories(tfm_utilities
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
+
+############################ Secure API ########################################
+
+target_link_libraries(tfm_secure_api
+ PRIVATE
+ tfm_partitions
+)
+
+target_include_directories(tfm_secure_api
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/model_ipc/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/arch/include>
+)
+
+############################# Secure veneers ###################################
+
+if(NOT TFM_MULTI_CORE_TOPOLOGY)
+ # If this is added to the spm, it is discarded as it is not used. Since the
+ # spm is a static library it can't generate veneers under all compilers so
+ # instead this single file is added to the tfm_s target.
+ target_sources(tfm_s
+ PRIVATE
+ $<$<NOT:$<BOOL:${TFM_PSA_API}>>:${CMAKE_BINARY_DIR}/generated/secure_fw/spm/cmsis_func/tfm_veneers.c>
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/cmsis_psa/tfm_psa_api_veneers.c>
+ )
+endif()
diff --git a/secure_fw/spm/cmsis_func/CMakeLists.inc b/secure_fw/spm/cmsis_func/CMakeLists.inc
deleted file mode 100644
index 1fb4f39..0000000
--- a/secure_fw/spm/cmsis_func/CMakeLists.inc
+++ /dev/null
@@ -1,60 +0,0 @@
-#-------------------------------------------------------------------------------
-# 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_COMMON_DIR "${SFW_SPM_DIR}/common")
-
-set (SFW_FUNC_SPM_SRC
- "${SFW_SPM_COMMON_DIR}/tfm_boot_data.c"
- "${SFW_SPM_COMMON_DIR}/tfm_core_mem_check.c"
- "${SFW_SPM_COMMON_DIR}/tfm_core_utils.c"
- "${SFW_SPM_COMMON_DIR}/utilities.c"
- "${SFW_FUNC_SPM_DIR}/main.c"
- "${SFW_FUNC_SPM_DIR}/tfm_core_svcalls_func.c"
- "${SFW_FUNC_SPM_DIR}/tfm_secure_api.c"
- "${SFW_FUNC_SPM_DIR}/spm_func.c"
- "${SFW_FUNC_SPM_DIR}/tfm_nspm_func.c"
- "${SFW_FUNC_SPM_DIR}/tfm_veneers.c"
- "${SFW_FUNC_SPM_DIR}/arch.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_SPM_DIR} ABSOLUTE)
-embedded_include_directories(PATH ${SFW_FUNC_SPM_DIR} ABSOLUTE)
-embedded_include_directories(PATH ${SFW_FUNC_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}/bl2/include ABSOLUTE)
diff --git a/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc b/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc
deleted file mode 100644
index 78e113e..0000000
--- a/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#include "secure_fw/partitions/protected_storage/psa_manifest/tfm_protected_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 "../tf-m-tests/test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
-#include "../tf-m-tests/test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_service/psa_manifest/tfm_ipc_service_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_client/psa_manifest/tfm_ipc_client_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h"
-#include "../tf-m-tests/test/test_services/tfm_ps_test_service/psa_manifest/tfm_ps_test_service.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_2/psa_manifest/tfm_secure_client_2.h"
-#include "psa_manifest/pid.h"
-
-/* Definitions of the signals of the IRQs */
-const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[] = {
-#ifdef TFM_ENABLE_IRQ_TEST
- { TFM_IRQ_TEST_1, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ, 64 },
-#endif /* TFM_ENABLE_IRQ_TEST */
- {0, 0, (IRQn_Type) 0, 0} /* add dummy element to avoid non-standard empty array */
-};
-
-const size_t tfm_core_irq_signals_count = (sizeof(tfm_core_irq_signals) /
- sizeof(*tfm_core_irq_signals)) - 1; /* adjust for the dummy element */
-
-extern void priv_irq_handler_main(uint32_t partition_id,
- uint32_t unpriv_handler,
- uint32_t irq_signal,
- uint32_t irq_line);
-
-/* Forward declarations of unpriv IRQ handlers*/
-#ifdef TFM_ENABLE_IRQ_TEST
-extern void SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ_isr(void);
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-
-/* Definitions of privileged IRQ handlers */
-#ifdef TFM_ENABLE_IRQ_TEST
-void TFM_TIMER0_IRQ_Handler(void)
-{
- priv_irq_handler_main(TFM_IRQ_TEST_1,
- (uint32_t)SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ_isr,
- SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ,
- TFM_TIMER0_IRQ);
-}
-
-#endif /* TFM_ENABLE_IRQ_TEST */
-
diff --git a/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc b/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc
deleted file mode 100644
index 369ef41..0000000
--- a/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#ifndef __TFM_SPM_DB_FUNC_INC__
-#define __TFM_SPM_DB_FUNC_INC__
-
-#include "psa_manifest/sid.h"
-
-/**************************************************************************/
-/** IRQ count per partition */
-/**************************************************************************/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-#define TFM_PARTITION_TFM_SP_PS_IRQ_COUNT 0
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-#define TFM_PARTITION_TFM_SP_ITS_IRQ_COUNT 0
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-#define TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT 0
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-#define TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT 0
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-#define TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT 0
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-#define TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT 0
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-#define TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-#define TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-#define TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-#define TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-#define TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-#define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-#define TFM_PARTITION_TFM_SP_PS_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-#define TFM_PARTITION_TFM_SP_SECURE_CLIENT_2_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** Declarations of partition init functions */
-/**************************************************************************/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-extern void tfm_ps_req_mngr_init(void);
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-extern void tfm_its_req_mngr_init(void);
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-extern void audit_core_init(void);
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-extern void tfm_crypto_init(void);
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-extern void platform_sp_init(void);
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-extern void attest_partition_init(void);
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-extern void core_test_init(void);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-extern void core_test_2_init(void);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-extern void tfm_secure_client_service_init(void);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-extern void ipc_service_test_main(void);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-extern void ipc_client_test_main(void);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-extern void tfm_irq_test_1_init(void);
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-extern void tfm_ps_test_init(void);
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-extern void tfm_secure_client_2_init(void);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** Context stacks for IRQ handling */
-/**************************************************************************/
-/* The max size of the context stack can be calculated as a function of the IRQ
- * count of the secure partition:
- *
- * max_stack_size = intr_ctx_size + (IRQ_CNT * (intr_ctx_size + hndl_ctx_size))
- *
- * where:
- * intr_ctx: Frame pushed when the partition is interrupted
- * hndl_ctx: Frame pushed when the partition is handling an interrupt
- */
-static uint32_t ns_interrupt_ctx_stack[
- sizeof(struct interrupted_ctx_stack_frame_t) / sizeof(uint32_t)];
-
-static uint32_t tfm_core_interrupt_ctx_stack[
- sizeof(struct interrupted_ctx_stack_frame_t) / sizeof(uint32_t)];
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-static uint32_t ctx_stack_TFM_SP_PS[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_PS_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-static uint32_t ctx_stack_TFM_SP_ITS[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_ITS_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-static uint32_t ctx_stack_TFM_SP_AUDIT_LOG[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-static uint32_t ctx_stack_TFM_SP_CRYPTO[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-static uint32_t ctx_stack_TFM_SP_PLATFORM[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-static uint32_t ctx_stack_TFM_SP_INITIAL_ATTESTATION[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-static uint32_t ctx_stack_TFM_SP_CORE_TEST[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-static uint32_t ctx_stack_TFM_SP_CORE_TEST_2[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static uint32_t ctx_stack_TFM_SP_SECURE_TEST_PARTITION[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-static uint32_t ctx_stack_TFM_SP_IPC_SERVICE_TEST[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-static uint32_t ctx_stack_TFM_SP_IPC_CLIENT_TEST[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-static uint32_t ctx_stack_TFM_IRQ_TEST_1[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-static uint32_t ctx_stack_TFM_SP_PS_TEST[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_PS_TEST_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static uint32_t ctx_stack_TFM_SP_SECURE_CLIENT_2[
- (sizeof(struct interrupted_ctx_stack_frame_t) +
- (TFM_PARTITION_TFM_SP_SECURE_CLIENT_2_IRQ_COUNT) * (
- sizeof(struct interrupted_ctx_stack_frame_t) +
- sizeof(struct handler_ctx_stack_frame_t)
- )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-uint32_t *ctx_stack_list[] =
-{
- ns_interrupt_ctx_stack,
- tfm_core_interrupt_ctx_stack,
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- ctx_stack_TFM_SP_PS,
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- ctx_stack_TFM_SP_ITS,
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-#ifdef TFM_PARTITION_AUDIT_LOG
- ctx_stack_TFM_SP_AUDIT_LOG,
-#endif /* TFM_PARTITION_AUDIT_LOG */
-#ifdef TFM_PARTITION_CRYPTO
- ctx_stack_TFM_SP_CRYPTO,
-#endif /* TFM_PARTITION_CRYPTO */
-#ifdef TFM_PARTITION_PLATFORM
- ctx_stack_TFM_SP_PLATFORM,
-#endif /* TFM_PARTITION_PLATFORM */
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- ctx_stack_TFM_SP_INITIAL_ATTESTATION,
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-#ifdef TFM_PARTITION_TEST_CORE
- ctx_stack_TFM_SP_CORE_TEST,
-#endif /* TFM_PARTITION_TEST_CORE */
-#ifdef TFM_PARTITION_TEST_CORE
- ctx_stack_TFM_SP_CORE_TEST_2,
-#endif /* TFM_PARTITION_TEST_CORE */
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- ctx_stack_TFM_SP_SECURE_TEST_PARTITION,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- ctx_stack_TFM_SP_IPC_SERVICE_TEST,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- ctx_stack_TFM_SP_IPC_CLIENT_TEST,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-#ifdef TFM_ENABLE_IRQ_TEST
- ctx_stack_TFM_IRQ_TEST_1,
-#endif /* TFM_ENABLE_IRQ_TEST */
-#ifdef TFM_PARTITION_TEST_PS
- ctx_stack_TFM_SP_PS_TEST,
-#endif /* TFM_PARTITION_TEST_PS */
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- ctx_stack_TFM_SP_SECURE_CLIENT_2,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-};
-
-/**************************************************************************/
-/** Dependencies array for Secure Partition */
-/**************************************************************************/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-static int32_t dependencies_TFM_SP_PS[] =
-{
- TFM_CRYPTO_SID,
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
- TFM_SP_PLATFORM_NV_COUNTER_SID,
-};
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_CRYPTO
-static int32_t dependencies_TFM_SP_CRYPTO[] =
-{
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
-};
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-static int32_t dependencies_TFM_SP_INITIAL_ATTESTATION[] =
-{
- TFM_CRYPTO_SID,
-};
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-static int32_t dependencies_TFM_SP_CORE_TEST[] =
-{
- SPM_CORE_TEST_2_INVERT_SID,
- SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
-};
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static int32_t dependencies_TFM_SP_SECURE_TEST_PARTITION[] =
-{
- TFM_SECURE_CLIENT_2_SID,
- TFM_CRYPTO_SID,
- TFM_PS_SET_SID,
- TFM_PS_GET_SID,
- TFM_PS_GET_INFO_SID,
- TFM_PS_REMOVE_SID,
- TFM_PS_GET_SUPPORT_SID,
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
- TFM_ATTEST_GET_TOKEN_SID,
- TFM_ATTEST_GET_TOKEN_SIZE_SID,
- TFM_ATTEST_GET_PUBLIC_KEY_SID,
- TFM_PS_TEST_PREPARE_SID,
- TFM_SP_PLATFORM_SYSTEM_RESET_SID,
- TFM_SP_PLATFORM_IOCTL_SID,
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-static int32_t dependencies_TFM_SP_IPC_CLIENT_TEST[] =
-{
- IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID,
- IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SID,
- IPC_SERVICE_TEST_BASIC_SID,
- IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID,
-};
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_PS
-static int32_t dependencies_TFM_SP_PS_TEST[] =
-{
- TFM_CRYPTO_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_REMOVE_SID,
-};
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static int32_t dependencies_TFM_SP_SECURE_CLIENT_2[] =
-{
- TFM_ITS_GET_SID,
- TFM_CRYPTO_SID,
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** The static data of the partition list */
-/**************************************************************************/
-const struct spm_partition_static_data_t static_data_list[] =
-{
- {
- .partition_id = TFM_SP_NON_SECURE_ID,
- .partition_flags = 0,
- },
-
- {
- .partition_id = TFM_SP_CORE_ID,
- .partition_flags = SPM_PART_FLAG_APP_ROT | SPM_PART_FLAG_PSA_ROT,
- },
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- {
- .partition_id = TFM_SP_PS,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_ps_req_mngr_init,
- .dependencies_num = 6,
- .p_dependencies = dependencies_TFM_SP_PS,
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- {
- .partition_id = TFM_SP_ITS,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_its_req_mngr_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
- {
- .partition_id = TFM_SP_AUDIT_LOG,
- .partition_flags = 0
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = audit_core_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
- {
- .partition_id = TFM_SP_CRYPTO,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_crypto_init,
- .dependencies_num = 4,
- .p_dependencies = dependencies_TFM_SP_CRYPTO,
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- {
- .partition_id = TFM_SP_PLATFORM,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = platform_sp_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- {
- .partition_id = TFM_SP_INITIAL_ATTESTATION,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = attest_partition_init,
- .dependencies_num = 1,
- .p_dependencies = dependencies_TFM_SP_INITIAL_ATTESTATION,
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .partition_id = TFM_SP_CORE_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = core_test_init,
- .dependencies_num = 3,
- .p_dependencies = dependencies_TFM_SP_CORE_TEST,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .partition_id = TFM_SP_CORE_TEST_2,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = core_test_2_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .partition_id = TFM_SP_SECURE_TEST_PARTITION,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_secure_client_service_init,
- .dependencies_num = 17,
- .p_dependencies = dependencies_TFM_SP_SECURE_TEST_PARTITION,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(HIGH),
- .partition_init = ipc_service_test_main,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = ipc_client_test_main,
- .dependencies_num = 4,
- .p_dependencies = dependencies_TFM_SP_IPC_CLIENT_TEST,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- {
- .partition_id = TFM_IRQ_TEST_1,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_irq_test_1_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- {
- .partition_id = TFM_SP_PS_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_ps_test_init,
- .dependencies_num = 3,
- .p_dependencies = dependencies_TFM_SP_PS_TEST,
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .partition_id = TFM_SP_SECURE_CLIENT_2,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_secure_client_2_init,
- .dependencies_num = 2,
- .p_dependencies = dependencies_TFM_SP_SECURE_CLIENT_2,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The platform data of the partition list */
-/**************************************************************************/
-#ifdef TFM_PARTITION_AUDIT_LOG
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_AUDIT_LOG[] =
-{
-#ifdef AUDIT_UART_REDIRECTION
- TFM_PERIPHERAL_UART1,
-#endif /* AUDIT_UART_REDIRECTION */
- NULL
-};
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_TEST_CORE
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_CORE_TEST[] =
-{
- TFM_PERIPHERAL_FPGA_IO,
- NULL
-};
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_SECURE_TEST_PARTITION[] =
-{
- TFM_PERIPHERAL_STD_UART,
- NULL
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_IRQ_TEST_1[] =
-{
- TFM_PERIPHERAL_TIMER0,
- NULL
-};
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-const struct tfm_spm_partition_platform_data_t **platform_data_list_list[] =
-{
- NULL,
- NULL,
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- NULL,
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- NULL,
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
- platform_data_list_TFM_SP_AUDIT_LOG,
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
- NULL,
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- NULL,
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- NULL,
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- platform_data_list_TFM_SP_CORE_TEST,
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- platform_data_list_TFM_SP_SECURE_TEST_PARTITION,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- platform_data_list_TFM_IRQ_TEST_1,
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- NULL,
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- NULL,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The partition list for the DB */
-/**************************************************************************/
-static struct spm_partition_desc_t partition_list [] =
-{
- {{0}}, /* placeholder for Non-secure internal partition */
- {{0}}, /* placeholder for TF-M Core internal partition */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PS */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_ITS */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_AUDIT_LOG */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_AUDIT_LOG
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CRYPTO */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_CRYPTO
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PLATFORM */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_PLATFORM
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_INITIAL_ATTESTATION */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CORE_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CORE_TEST_2 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_SECURE_TEST_PARTITION */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_IPC_SERVICE_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_IPC_CLIENT_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_IRQ_TEST_1 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_ENABLE_IRQ_TEST
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PS_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_PS
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_SECURE_CLIENT_2 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- /* Runtime data */
- .runtime_data = {0},
- .static_data = NULL,
- .platform_data_list = NULL,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-struct spm_partition_db_t g_spm_partition_db = {
- .is_init = 0,
- .partition_count = sizeof(partition_list) / sizeof(partition_list[0]),
- .running_partition_idx = 0,
- .partitions = partition_list,
-};
-
-#endif /* __TFM_SPM_DB_FUNC_INC__ */
diff --git a/secure_fw/spm/cmsis_func/tfm_veneers.c b/secure_fw/spm/cmsis_func/tfm_veneers.c
deleted file mode 100644
index 315f752..0000000
--- a/secure_fw/spm/cmsis_func/tfm_veneers.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#include "tfm_secure_api.h"
-#include "spm_partition_defs.h"
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-/******** TFM_SP_PS ********/
-psa_status_t tfm_ps_set_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_ps_get_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_ps_get_info_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_ps_remove_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_ps_get_support_req(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-/******** TFM_SP_ITS ********/
-psa_status_t tfm_its_set_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_its_get_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_its_get_info_req(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_its_remove_req(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-/******** TFM_SP_AUDIT_LOG ********/
-psa_status_t audit_core_retrieve_record(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t audit_core_add_record(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t audit_core_get_info(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t audit_core_get_record_info(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t audit_core_delete_record(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-/******** TFM_SP_CRYPTO ********/
-psa_status_t tfm_crypto_get_key_attributes(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_open_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_close_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_reset_key_attributes(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_import_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_destroy_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_export_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_export_public_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_copy_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_compute(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_compare(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_update(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_finish(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_verify(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_abort(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_hash_clone(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_compute(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_verify(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_sign_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_verify_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_update(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_sign_finish(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_verify_finish(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_mac_abort(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_encrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_decrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_encrypt_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_decrypt_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_generate_iv(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_set_iv(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_update(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_finish(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_cipher_abort(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_encrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_decrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_encrypt_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_decrypt_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_generate_nonce(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_set_nonce(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_set_lengths(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_update_ad(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_update(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_finish(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_verify(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_aead_abort(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_sign_hash(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_verify_hash(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_asymmetric_encrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_asymmetric_decrypt(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_setup(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_get_capacity(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_set_capacity(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_input_bytes(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_input_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_key_agreement(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_output_bytes(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_output_key(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_key_derivation_abort(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_raw_key_agreement(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_generate_random(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t tfm_crypto_generate_key(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-/******** TFM_SP_PLATFORM ********/
-psa_status_t platform_sp_system_reset(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t platform_sp_ioctl(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t platform_sp_nv_counter_read(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t platform_sp_nv_counter_increment(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-/******** TFM_SP_INITIAL_ATTESTATION ********/
-psa_status_t initial_attest_get_token(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t initial_attest_get_token_size(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t initial_attest_get_public_key(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-/******** TFM_SP_CORE_TEST ********/
-psa_status_t spm_core_test_sfn(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_sfn_init_success(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_sfn_direct_recursion(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-/******** TFM_SP_CORE_TEST_2 ********/
-psa_status_t spm_core_test_2_slave_service(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_2_sfn_invert(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_2_check_caller_client_id(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_2_get_every_second_byte(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_2_prepare_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_core_test_2_execute_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-/******** TFM_SP_SECURE_TEST_PARTITION ********/
-psa_status_t tfm_secure_client_service_sfn_run_tests(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-/******** TFM_SP_IPC_SERVICE_TEST ********/
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-/******** TFM_SP_IPC_CLIENT_TEST ********/
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-/******** TFM_IRQ_TEST_1 ********/
-psa_status_t spm_irq_test_1_prepare_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
-psa_status_t spm_irq_test_1_execute_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-/******** TFM_SP_PS_TEST ********/
-psa_status_t tfm_ps_test_prepare(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-/******** TFM_SP_SECURE_CLIENT_2 ********/
-psa_status_t tfm_secure_client_2_call(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-
-#define TFM_VENEER_FUNCTION(partition_name, sfn_name) \
- __tfm_secure_gateway_attributes__ \
- psa_status_t tfm_##sfn_name##_veneer(psa_invec *in_vec, \
- size_t in_len, \
- psa_outvec *out_vec, \
- size_t out_len) \
- { \
- bool is_ns = tfm_core_is_ns_client(); \
- \
- TFM_CORE_IOVEC_SFN_REQUEST(partition_name, \
- is_ns, \
- (void *) sfn_name, \
- in_vec, in_len, out_vec, out_len); \
- }
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-/******** TFM_SP_PS ********/
-TFM_VENEER_FUNCTION(TFM_SP_PS, tfm_ps_set_req)
-TFM_VENEER_FUNCTION(TFM_SP_PS, tfm_ps_get_req)
-TFM_VENEER_FUNCTION(TFM_SP_PS, tfm_ps_get_info_req)
-TFM_VENEER_FUNCTION(TFM_SP_PS, tfm_ps_remove_req)
-TFM_VENEER_FUNCTION(TFM_SP_PS, tfm_ps_get_support_req)
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-/******** TFM_SP_ITS ********/
-TFM_VENEER_FUNCTION(TFM_SP_ITS, tfm_its_set_req)
-TFM_VENEER_FUNCTION(TFM_SP_ITS, tfm_its_get_req)
-TFM_VENEER_FUNCTION(TFM_SP_ITS, tfm_its_get_info_req)
-TFM_VENEER_FUNCTION(TFM_SP_ITS, tfm_its_remove_req)
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-/******** TFM_SP_AUDIT_LOG ********/
-TFM_VENEER_FUNCTION(TFM_SP_AUDIT_LOG, audit_core_retrieve_record)
-TFM_VENEER_FUNCTION(TFM_SP_AUDIT_LOG, audit_core_add_record)
-TFM_VENEER_FUNCTION(TFM_SP_AUDIT_LOG, audit_core_get_info)
-TFM_VENEER_FUNCTION(TFM_SP_AUDIT_LOG, audit_core_get_record_info)
-TFM_VENEER_FUNCTION(TFM_SP_AUDIT_LOG, audit_core_delete_record)
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-/******** TFM_SP_CRYPTO ********/
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_get_key_attributes)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_open_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_close_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_reset_key_attributes)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_import_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_destroy_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_export_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_export_public_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_copy_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_compute)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_compare)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_update)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_finish)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_verify)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_abort)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_hash_clone)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_compute)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_verify)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_sign_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_verify_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_update)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_sign_finish)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_verify_finish)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_mac_abort)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_encrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_decrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_encrypt_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_decrypt_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_generate_iv)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_set_iv)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_update)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_finish)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_cipher_abort)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_encrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_decrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_encrypt_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_decrypt_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_generate_nonce)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_set_nonce)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_set_lengths)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_update_ad)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_update)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_finish)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_verify)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_aead_abort)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_sign_hash)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_verify_hash)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_asymmetric_encrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_asymmetric_decrypt)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_setup)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_get_capacity)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_set_capacity)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_input_bytes)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_input_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_key_agreement)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_output_bytes)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_output_key)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_key_derivation_abort)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_raw_key_agreement)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_generate_random)
-TFM_VENEER_FUNCTION(TFM_SP_CRYPTO, tfm_crypto_generate_key)
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-/******** TFM_SP_PLATFORM ********/
-TFM_VENEER_FUNCTION(TFM_SP_PLATFORM, platform_sp_system_reset)
-TFM_VENEER_FUNCTION(TFM_SP_PLATFORM, platform_sp_ioctl)
-TFM_VENEER_FUNCTION(TFM_SP_PLATFORM, platform_sp_nv_counter_read)
-TFM_VENEER_FUNCTION(TFM_SP_PLATFORM, platform_sp_nv_counter_increment)
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-/******** TFM_SP_INITIAL_ATTESTATION ********/
-TFM_VENEER_FUNCTION(TFM_SP_INITIAL_ATTESTATION, initial_attest_get_token)
-TFM_VENEER_FUNCTION(TFM_SP_INITIAL_ATTESTATION, initial_attest_get_token_size)
-TFM_VENEER_FUNCTION(TFM_SP_INITIAL_ATTESTATION, initial_attest_get_public_key)
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-/******** TFM_SP_CORE_TEST ********/
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST, spm_core_test_sfn)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST, spm_core_test_sfn_init_success)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST, spm_core_test_sfn_direct_recursion)
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-/******** TFM_SP_CORE_TEST_2 ********/
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_slave_service)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_sfn_invert)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_check_caller_client_id)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_get_every_second_byte)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_prepare_test_scenario)
-TFM_VENEER_FUNCTION(TFM_SP_CORE_TEST_2, spm_core_test_2_execute_test_scenario)
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-/******** TFM_SP_SECURE_TEST_PARTITION ********/
-TFM_VENEER_FUNCTION(TFM_SP_SECURE_TEST_PARTITION, tfm_secure_client_service_sfn_run_tests)
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-/******** TFM_SP_IPC_SERVICE_TEST ********/
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-/******** TFM_SP_IPC_CLIENT_TEST ********/
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-/******** TFM_IRQ_TEST_1 ********/
-TFM_VENEER_FUNCTION(TFM_IRQ_TEST_1, spm_irq_test_1_prepare_test_scenario)
-TFM_VENEER_FUNCTION(TFM_IRQ_TEST_1, spm_irq_test_1_execute_test_scenario)
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-/******** TFM_SP_PS_TEST ********/
-TFM_VENEER_FUNCTION(TFM_SP_PS_TEST, tfm_ps_test_prepare)
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-/******** TFM_SP_SECURE_CLIENT_2 ********/
-TFM_VENEER_FUNCTION(TFM_SP_SECURE_CLIENT_2, tfm_secure_client_2_call)
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
diff --git a/secure_fw/spm/cmsis_psa/CMakeLists.inc b/secure_fw/spm/cmsis_psa/CMakeLists.inc
deleted file mode 100644
index 0756062..0000000
--- a/secure_fw/spm/cmsis_psa/CMakeLists.inc
+++ /dev/null
@@ -1,77 +0,0 @@
-#-------------------------------------------------------------------------------
-# 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_IPC_SPM_DIR}/arch")
-set(SFW_SPM_COMMON_DIR "${SFW_SPM_DIR}/common")
-
-set (SFW_IPC_SPM_SRC
- "${SFW_SPM_COMMON_DIR}/psa_client_service_apis.c"
- "${SFW_SPM_COMMON_DIR}/spm_psa_client_call.c"
- "${SFW_SPM_COMMON_DIR}/tfm_boot_data.c"
- "${SFW_SPM_COMMON_DIR}/tfm_core_utils.c"
- "${SFW_SPM_COMMON_DIR}/utilities.c"
- "${SFW_IPC_SPM_DIR}/main.c"
- "${SFW_IPC_SPM_DIR}/spm_ipc.c"
- "${SFW_IPC_SPM_DIR}/tfm_core_svcalls_ipc.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_SPM_COMMON_DIR}/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_SPM_DIR} ABSOLUTE)
-embedded_include_directories(PATH ${SFW_IPC_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/cmsis_psa/arch ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/bl2/include ABSOLUTE)
-
-#Involve all IPC related sources in psa CMakeLists.inc
-include(${SFW_IPC_SPM_DIR}/arch/CMakeLists.inc)
diff --git a/secure_fw/spm/cmsis_psa/arch/CMakeLists.inc b/secure_fw/spm/cmsis_psa/arch/CMakeLists.inc
deleted file mode 100644
index c0616cd..0000000
--- a/secure_fw/spm/cmsis_psa/arch/CMakeLists.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#Definitions to compile the "arch" 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 TF-M soure code is located.
-#
-#Outputs:
-# Will modify include directories to make the source compile.
-# ALL_SRC_C_S: 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_S: 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(TFM_ARCH_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 ARM_CPU_ARCHITECTURE)
- message(FATAL_ERROR "Incomplete build configuration: architecture is not specified.")
-elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8.1-M.MAIN")
- set(TFM_ARCH_C_SRC "${TFM_ARCH_DIR}/tfm_arch_v8m_main.c")
-elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
- set(TFM_ARCH_C_SRC "${TFM_ARCH_DIR}/tfm_arch_v8m_main.c")
-elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
- set(TFM_ARCH_C_SRC "${TFM_ARCH_DIR}/tfm_arch_v8m_base.c")
-elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M" OR
- ${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6-M" OR
- ${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6S-M")
- if (NOT DEFINED TFM_MULTI_CORE_TOPOLOGY OR NOT TFM_MULTI_CORE_TOPOLOGY)
- message(FATAL_ERROR "Armv6-M/Armv7-M can only support multi-core TF-M.")
- endif()
-
- set(TFM_ARCH_C_SRC "${TFM_ARCH_DIR}/tfm_arch_v6m_v7m.c")
-else ()
- message(FATAL_ERROR "Unsupported architecture.")
-endif()
-
-list(APPEND TFM_ARCH_C_SRC "${TFM_ARCH_DIR}/tfm_arch.c")
-
-#Append all our source files to global secure source code lists.
-list(APPEND ALL_SRC_C_S ${TFM_ARCH_C_SRC})
-unset(TFM_ARCH_C_SRC)
-
-#Setting include directories
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/platform/ext/cmsis ABSOLUTE)
-embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/include ABSOLUTE)
diff --git a/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc b/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc
deleted file mode 100644
index bdd6def..0000000
--- a/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#include "secure_fw/partitions/protected_storage/psa_manifest/tfm_protected_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 "../tf-m-tests/test/test_services/tfm_core_test/psa_manifest/tfm_test_core.h"
-#include "../tf-m-tests/test/test_services/tfm_core_test_2/psa_manifest/tfm_test_core_2.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_service/psa_manifest/tfm_test_client_service.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_service/psa_manifest/tfm_ipc_service_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_ipc_client/psa_manifest/tfm_ipc_client_partition.h"
-#include "../tf-m-tests/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h"
-#include "../tf-m-tests/test/test_services/tfm_ps_test_service/psa_manifest/tfm_ps_test_service.h"
-#include "../tf-m-tests/test/test_services/tfm_secure_client_2/psa_manifest/tfm_secure_client_2.h"
-#include "cmsis_compiler.h"
-
-/* Definitions of the signals of the IRQs (if any) */
-const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[] = {
-#ifdef TFM_ENABLE_IRQ_TEST
- { TFM_IRQ_TEST_1, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ, 64 },
-#endif /* TFM_ENABLE_IRQ_TEST */
- {0, 0, (IRQn_Type) 0, 0} /* add dummy element to avoid non-standard empty array */
-};
-
-const size_t tfm_core_irq_signals_count = (sizeof(tfm_core_irq_signals) /
- sizeof(*tfm_core_irq_signals)) - 1; /* adjust for the dummy element */
-
-/* Definitions of privileged IRQ handlers (if any) */
-#ifdef TFM_ENABLE_IRQ_TEST
-void TFM_TIMER0_IRQ_Handler(void)
-{
- __disable_irq();
- /* It is OK to call tfm_irq_handler directly from here, as we are already
- * in handler mode, and we will not be pre-empted as we disabled interrupts
- */
- tfm_irq_handler(TFM_IRQ_TEST_1, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ);
- __enable_irq();
-}
-
-#endif /* TFM_ENABLE_IRQ_TEST */
-
diff --git a/secure_fw/spm/cmsis_psa/tfm_spm_db_ipc.inc b/secure_fw/spm/cmsis_psa/tfm_spm_db_ipc.inc
deleted file mode 100644
index eb6b980..0000000
--- a/secure_fw/spm/cmsis_psa/tfm_spm_db_ipc.inc
+++ /dev/null
@@ -1,1067 +0,0 @@
-/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
-
-#ifndef __TFM_SPM_DB_IPC_INC__
-#define __TFM_SPM_DB_IPC_INC__
-
-#include "psa_manifest/sid.h"
-
-/**************************************************************************/
-/** IRQ count per partition */
-/**************************************************************************/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-#define TFM_PARTITION_TFM_SP_PS_IRQ_COUNT 0
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-#define TFM_PARTITION_TFM_SP_ITS_IRQ_COUNT 0
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-#define TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT 0
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-#define TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT 0
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-#define TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT 0
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-#define TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT 0
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-#define TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-#define TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-#define TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-#define TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-#define TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-#define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-#define TFM_PARTITION_TFM_SP_PS_TEST_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-#define TFM_PARTITION_TFM_SP_SECURE_CLIENT_2_IRQ_COUNT 0
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** Declarations of partition init functions */
-/**************************************************************************/
-extern void tfm_nspm_thread_entry(void);
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-extern void tfm_ps_req_mngr_init(void);
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-extern void tfm_its_req_mngr_init(void);
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-extern void audit_core_init(void);
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-extern void tfm_crypto_init(void);
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-extern void platform_sp_init(void);
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-extern void attest_partition_init(void);
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-extern void core_test_init(void);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-extern void core_test_2_init(void);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-extern void tfm_secure_client_service_init(void);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-extern void ipc_service_test_main(void);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-extern void ipc_client_test_main(void);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-extern void tfm_irq_test_1_init(void);
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-extern void tfm_ps_test_init(void);
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-extern void tfm_secure_client_2_init(void);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** Memory region declarations */
-/**************************************************************************/
-REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Base);
-REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Limit);
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_ITS_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CRYPTO_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PLATFORM_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_IRQ_TEST_1_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_PS_TEST_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, $$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, $$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, $$RO$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, $$RO$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$RW$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$RW$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$ZI$$Limit);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _STACK$$ZI$$Base);
-REGION_DECLARE(Image$$, TFM_SP_SECURE_CLIENT_2_LINKER, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** Dependencies array for Secure Partition */
-/**************************************************************************/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
-static uint32_t dependencies_TFM_SP_PS[] =
-{
- TFM_CRYPTO_SID,
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
- TFM_SP_PLATFORM_NV_COUNTER_SID,
-};
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_CRYPTO
-static uint32_t dependencies_TFM_SP_CRYPTO[] =
-{
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
-};
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
-static uint32_t dependencies_TFM_SP_INITIAL_ATTESTATION[] =
-{
- TFM_CRYPTO_SID,
-};
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
-static uint32_t dependencies_TFM_SP_CORE_TEST[] =
-{
- SPM_CORE_TEST_2_INVERT_SID,
- SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
-};
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static uint32_t dependencies_TFM_SP_SECURE_TEST_PARTITION[] =
-{
- TFM_SECURE_CLIENT_2_SID,
- TFM_CRYPTO_SID,
- TFM_PS_SET_SID,
- TFM_PS_GET_SID,
- TFM_PS_GET_INFO_SID,
- TFM_PS_REMOVE_SID,
- TFM_PS_GET_SUPPORT_SID,
- TFM_ITS_SET_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_GET_INFO_SID,
- TFM_ITS_REMOVE_SID,
- TFM_ATTEST_GET_TOKEN_SID,
- TFM_ATTEST_GET_TOKEN_SIZE_SID,
- TFM_ATTEST_GET_PUBLIC_KEY_SID,
- TFM_PS_TEST_PREPARE_SID,
- TFM_SP_PLATFORM_SYSTEM_RESET_SID,
- TFM_SP_PLATFORM_IOCTL_SID,
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
-static uint32_t dependencies_TFM_SP_IPC_CLIENT_TEST[] =
-{
- IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID,
- IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SID,
- IPC_SERVICE_TEST_BASIC_SID,
- IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID,
-};
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_PS
-static uint32_t dependencies_TFM_SP_PS_TEST[] =
-{
- TFM_CRYPTO_SID,
- TFM_ITS_GET_SID,
- TFM_ITS_REMOVE_SID,
-};
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-static uint32_t dependencies_TFM_SP_SECURE_CLIENT_2[] =
-{
- TFM_ITS_GET_SID,
- TFM_CRYPTO_SID,
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-/**************************************************************************/
-/** The static data of the partition list */
-/**************************************************************************/
-const struct partition_static_t static_data_list[] =
-{
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_NON_SECURE_ID,
-#if TFM_MULTI_CORE_TOPOLOGY
- .partition_flags = SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_IPC,
-#else
- .partition_flags = SPM_PART_FLAG_APP_ROT | SPM_PART_FLAG_IPC,
-#endif
- .partition_priority = TFM_PRIORITY_LOW,
- .partition_init = tfm_nspm_thread_entry,
- },
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_PS,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_ps_req_mngr_init,
- .dependencies_num = 6,
- .p_dependencies = dependencies_TFM_SP_PS,
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_ITS,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_its_req_mngr_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_AUDIT_LOG,
- .partition_flags = 0
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = audit_core_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_CRYPTO,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_crypto_init,
- .dependencies_num = 4,
- .p_dependencies = dependencies_TFM_SP_CRYPTO,
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_PLATFORM,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = platform_sp_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_INITIAL_ATTESTATION,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = attest_partition_init,
- .dependencies_num = 1,
- .p_dependencies = dependencies_TFM_SP_INITIAL_ATTESTATION,
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_CORE_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = core_test_init,
- .dependencies_num = 3,
- .p_dependencies = dependencies_TFM_SP_CORE_TEST,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_CORE_TEST_2,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = core_test_2_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_SECURE_TEST_PARTITION,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_secure_client_service_init,
- .dependencies_num = 17,
- .p_dependencies = dependencies_TFM_SP_SECURE_TEST_PARTITION,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_IPC_SERVICE_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(HIGH),
- .partition_init = ipc_service_test_main,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_IPC_CLIENT_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = ipc_client_test_main,
- .dependencies_num = 4,
- .p_dependencies = dependencies_TFM_SP_IPC_CLIENT_TEST,
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_IRQ_TEST_1,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_irq_test_1_init,
- .dependencies_num = 0,
- .p_dependencies = NULL,
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_PS_TEST,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_ps_test_init,
- .dependencies_num = 3,
- .p_dependencies = dependencies_TFM_SP_PS_TEST,
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .psa_framework_version = 0x0100,
- .partition_id = TFM_SP_SECURE_CLIENT_2,
- .partition_flags = SPM_PART_FLAG_IPC
- | SPM_PART_FLAG_APP_ROT
- ,
- .partition_priority = TFM_PRIORITY(NORMAL),
- .partition_init = tfm_secure_client_2_init,
- .dependencies_num = 2,
- .p_dependencies = dependencies_TFM_SP_SECURE_CLIENT_2,
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The platform data of the partition list */
-/**************************************************************************/
-#ifdef TFM_PARTITION_AUDIT_LOG
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_AUDIT_LOG[] =
-{
-#ifdef AUDIT_UART_REDIRECTION
- TFM_PERIPHERAL_UART1,
-#endif /* AUDIT_UART_REDIRECTION */
- NULL
-};
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_TEST_CORE
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_CORE_TEST[] =
-{
- TFM_PERIPHERAL_FPGA_IO,
- NULL
-};
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_SP_SECURE_TEST_PARTITION[] =
-{
- TFM_PERIPHERAL_STD_UART,
- NULL
-};
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_ENABLE_IRQ_TEST
-const struct tfm_spm_partition_platform_data_t *
- platform_data_list_TFM_IRQ_TEST_1[] =
-{
- TFM_PERIPHERAL_TIMER0,
- NULL
-};
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-const struct tfm_spm_partition_platform_data_t **platform_data_list_list[] =
-{
- NULL,
-
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- NULL,
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- NULL,
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
- platform_data_list_TFM_SP_AUDIT_LOG,
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
- NULL,
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- NULL,
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- NULL,
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- platform_data_list_TFM_SP_CORE_TEST,
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- platform_data_list_TFM_SP_SECURE_TEST_PARTITION,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- NULL,
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- platform_data_list_TFM_IRQ_TEST_1,
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- NULL,
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- NULL,
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The memory data of the partition list */
-/**************************************************************************/
-const struct tfm_spm_partition_memory_data_t memory_data_list[] =
-{
- {
- .stack_bottom = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Base),
- .stack_top = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Limit),
- .rw_start = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Base),
- },
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- {
- .code_start = PART_REGION_ADDR(TFM_SP_PS_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_PS_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_PS_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_PS_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_PS_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_PS_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_PS_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_PS_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_PS_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_PS_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- {
- .code_start = PART_REGION_ADDR(TFM_SP_ITS_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_ITS_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_ITS_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_ITS_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_ITS_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
-#ifdef TFM_PARTITION_AUDIT_LOG
- {
- .code_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_AUDIT_LOG_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
-#ifdef TFM_PARTITION_CRYPTO
- {
- .code_start = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_CRYPTO_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_CRYPTO */
-
-#ifdef TFM_PARTITION_PLATFORM
- {
- .code_start = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_PLATFORM_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_PLATFORM */
-
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- {
- .code_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_CORE
- {
- .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST_2_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_CORE */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .code_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .code_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {
- .code_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
-#ifdef TFM_ENABLE_IRQ_TEST
- {
- .code_start = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_IRQ_TEST_1_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_ENABLE_IRQ_TEST */
-
-#ifdef TFM_PARTITION_TEST_PS
- {
- .code_start = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_PS_TEST_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_PS */
-
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {
- .code_start = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, $$Base),
- .code_limit = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, $$Limit),
- .ro_start = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, $$RO$$Base),
- .ro_limit = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, $$RO$$Limit),
- .rw_start = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$RW$$Base),
- .rw_limit = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$RW$$Limit),
- .zi_start = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$ZI$$Base),
- .zi_limit = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _DATA$$ZI$$Limit),
- .stack_bottom = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _STACK$$ZI$$Base),
- .stack_top = PART_REGION_ADDR(TFM_SP_SECURE_CLIENT_2_LINKER, _STACK$$ZI$$Limit),
- },
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-/**************************************************************************/
-/** The partition list for the DB */
-/**************************************************************************/
-static struct partition_t partition_list [] =
-{
- {0}, /* placeholder for Non-secure internal partition */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PS */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_PROTECTED_STORAGE
- {0},
-#endif /* TFM_PARTITION_PROTECTED_STORAGE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_ITS */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
- {0},
-#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_AUDIT_LOG */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_AUDIT_LOG
- {0},
-#endif /* TFM_PARTITION_AUDIT_LOG */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CRYPTO */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_CRYPTO
- {0},
-#endif /* TFM_PARTITION_CRYPTO */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PLATFORM */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_PLATFORM
- {0},
-#endif /* TFM_PARTITION_PLATFORM */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_INITIAL_ATTESTATION */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_INITIAL_ATTESTATION
- {0},
-#endif /* TFM_PARTITION_INITIAL_ATTESTATION */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CORE_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE
- {0},
-#endif /* TFM_PARTITION_TEST_CORE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_CORE_TEST_2 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE
- {0},
-#endif /* TFM_PARTITION_TEST_CORE */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_SECURE_TEST_PARTITION */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {0},
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_IPC_SERVICE_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {0},
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_IPC_CLIENT_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE_IPC
- {0},
-#endif /* TFM_PARTITION_TEST_CORE_IPC */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_IRQ_TEST_1 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_ENABLE_IRQ_TEST
- {0},
-#endif /* TFM_ENABLE_IRQ_TEST */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_PS_TEST */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_PS
- {0},
-#endif /* TFM_PARTITION_TEST_PS */
-
- /* -----------------------------------------------------------------------*/
- /* - Partition DB record for TFM_SP_SECURE_CLIENT_2 */
- /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_SECURE_SERVICES
- {0},
-#endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
-
-};
-
-struct spm_partition_db_t g_spm_partition_db = {
- .is_init = 0,
- .partition_count = sizeof(partition_list) / sizeof(partition_list[0]),
- .partitions = partition_list,
-};
-
-#endif /* __TFM_SPM_DB_IPC_INC__ */
\ No newline at end of file
diff --git a/secure_fw/spm/include/tfm_boot_status.h b/secure_fw/spm/include/tfm_boot_status.h
new file mode 100644
index 0000000..27ce6cb
--- /dev/null
+++ b/secure_fw/spm/include/tfm_boot_status.h
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_BOOT_STATUS_H__
+#define __TFM_BOOT_STATUS_H__
+
+#include <stdint.h>
+#include <stddef.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Major numbers (4 bit) to identify
+ * the consumer of shared data in runtime SW
+ */
+#define TLV_MAJOR_CORE 0x0
+#define TLV_MAJOR_IAS 0x1
+
+/**
+ * The shared data between boot loader and runtime SW is TLV encoded. The
+ * shared data is stored in a well known location in secure memory and this is
+ * a contract between boot loader and runtime SW.
+ *
+ * The structure of shared data must be the following:
+ * - At the beginning there must be a header: struct shared_data_tlv_header
+ * This contains a magic number and a size field which covers the entire
+ * size of the shared data area including this header.
+ * - After the header there come the entries which are composed from an entry
+ * header structure: struct shared_data_tlv_entry and the data. In the entry
+ * header is a type field (tly_type) which identify the consumer of the
+ * entry in the runtime SW and specify the subtype of that data item. There
+ * is a size field (tlv_len) which covers the size of the entry header and
+ * the data. After this structure comes the actual data.
+ * - Arbitrary number and size of data entry can be in the shared memory area.
+ *
+ * This table gives of overview about the tlv_type field in the entry header.
+ * The tlv_type always composed from a major and minor number. Major number
+ * identifies the addressee in runtime SW, who should process the data entry.
+ * Minor number used to encode more info about the data entry. The actual
+ * definition of minor number could change per major number. In case of boot
+ * status data, which is going to be processed by initial attestation service
+ * the minor number is split further to two part: sw_module and claim. The
+ * sw_module identifies the SW component in the system which the data item
+ * belongs to and the claim part identifies the exact type of the data.
+ *
+ * |---------------------------------------|
+ * | tlv_type (16) |
+ * |---------------------------------------|
+ * | tlv_major(4)| tlv_minor(12) |
+ * |---------------------------------------|
+ * | MAJOR_IAS | sw_module(6) | claim(6) |
+ * |---------------------------------------|
+ * | MAJOR_CORE | TBD |
+ * |---------------------------------------|
+ */
+
+/* Initial attestation: SW components / SW modules
+ * This list is intended to be adjusted per device. It contains more SW
+ * components than currently available in TF-M project. It serves as an example,
+ * what kind of SW components might be available.
+ */
+#define SW_GENERAL 0x00
+#define SW_BL2 0x01
+#define SW_PROT 0x02
+#define SW_AROT 0x03
+#define SW_SPE 0x04
+#define SW_NSPE 0x05
+#define SW_S_NS 0x06
+#define SW_MAX 0x07
+
+/* Initial attestation: Claim per SW components / SW modules */
+/* Bits: 0-2 */
+#define SW_VERSION 0x00
+#define SW_SIGNER_ID 0x01
+/* Reserved 0x02 */
+#define SW_TYPE 0x03
+/* Bits: 3-5 */
+#define SW_MEASURE_VALUE 0x08
+#define SW_MEASURE_TYPE 0x09
+#define SW_BOOT_RECORD 0x3F
+
+/* Initial attestation: General claim does not belong any particular SW
+ * component. But they might be part of the boot status.
+ */
+#define BOOT_SEED 0x00
+#define HW_VERSION 0x01
+#define SECURITY_LIFECYCLE 0x02
+
+/* Minor numbers (12 bit) to identify attestation service related data */
+#define TLV_MINOR_IAS_BOOT_SEED ((SW_GENERAL << 6) | BOOT_SEED)
+#define TLV_MINOR_IAS_HW_VERSION ((SW_GENERAL << 6) | HW_VERSION)
+#define TLV_MINOR_IAS_SLC ((SW_GENERAL << 6) | SECURITY_LIFECYCLE)
+
+/* Bootloader - It can be more stage */
+#define TLV_MINOR_IAS_BL2_MEASURE_VALUE ((SW_BL2 << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_BL2_MEASURE_TYPE ((SW_BL2 << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_BL2_VERSION ((SW_BL2 << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_BL2_SIGNER_ID ((SW_BL2 << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_BL2_TYPE ((SW_BL2 << 6) | SW_TYPE)
+
+/* PROT: PSA Root of Trust */
+#define TLV_MINOR_IAS_PROT_MEASURE_VALUE ((SW_PROT << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_PROT_MEASURE_TYPE ((SW_PROT << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_PROT_VERSION ((SW_PROT << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_PROT_SIGNER_ID ((SW_PROT << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_PROT_TYPE ((SW_PROT << 6) | SW_TYPE)
+
+/* AROT: Application Root of Trust */
+#define TLV_MINOR_IAS_AROT_MEASURE_VALUE ((SW_AROT << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_AROT_MEASURE_TYPE ((SW_AROT << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_AROT_VERSION ((SW_AROT << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_AROT_SIGNER_ID ((SW_AROT << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_AROT_TYPE ((SW_AROT << 6) | SW_TYPE)
+
+/* Non-secure processing environment - single non-secure image */
+#define TLV_MINOR_IAS_NSPE_MEASURE_VALUE ((SW_NSPE << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_NSPE_MEASURE_TYPE ((SW_NSPE << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_NSPE_VERSION ((SW_NSPE << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_NSPE_SIGNER_ID ((SW_NSPE << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_NSPE_TYPE ((SW_NSPE << 6) | SW_TYPE)
+
+/* Secure processing environment (ARoT + PRoT) - single secure image */
+#define TLV_MINOR_IAS_SPE_MEASURE_VALUE ((SW_SPE << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_SPE_MEASURE_TYPE ((SW_SPE << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_SPE_VERSION ((SW_SPE << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_SPE_SIGNER_ID ((SW_SPE << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_SPE_TYPE ((SW_SPE << 6) | SW_TYPE)
+
+/* SPE + NSPE - combined secure and non-secure image */
+#define TLV_MINOR_IAS_S_NS_MEASURE_VALUE ((SW_S_NS << 6) | SW_MEASURE_VALUE)
+#define TLV_MINOR_IAS_S_NS_MEASURE_TYPE ((SW_S_NS << 6) | SW_MEASURE_TYPE)
+#define TLV_MINOR_IAS_S_NS_VERSION ((SW_S_NS << 6) | SW_VERSION)
+#define TLV_MINOR_IAS_S_NS_SIGNER_ID ((SW_S_NS << 6) | SW_SIGNER_ID)
+#define TLV_MINOR_IAS_S_NS_TYPE ((SW_S_NS << 6) | SW_TYPE)
+
+/* General macros to handle TLV type */
+#define MAJOR_MASK 0xF /* 4 bit */
+#define MAJOR_POS 12 /* 12 bit */
+#define MINOR_MASK 0xFFF /* 12 bit */
+
+#define SET_TLV_TYPE(major, minor) \
+ ((((major) & MAJOR_MASK) << MAJOR_POS) | ((minor) & MINOR_MASK))
+#define GET_MAJOR(tlv_type) ((tlv_type) >> MAJOR_POS)
+#define GET_MINOR(tlv_type) ((tlv_type) & MINOR_MASK)
+
+/* Initial attestation specific macros */
+#define MODULE_POS 6 /* 6 bit */
+#define CLAIM_MASK 0x3F /* 6 bit */
+#define MEASUREMENT_CLAIM_POS 3 /* 3 bit */
+
+#define GET_IAS_MODULE(tlv_type) (GET_MINOR(tlv_type) >> MODULE_POS)
+#define GET_IAS_CLAIM(tlv_type) (GET_MINOR(tlv_type) & CLAIM_MASK)
+#define SET_IAS_MINOR(sw_module, claim) (((sw_module) << 6) | (claim))
+
+#define GET_IAS_MEASUREMENT_CLAIM(ias_claim) ((ias_claim) >> \
+ MEASUREMENT_CLAIM_POS)
+
+/* Magic value which marks the beginning of shared data area in memory */
+#define SHARED_DATA_TLV_INFO_MAGIC 0x2016
+
+/**
+ * Shared data TLV header. All fields in little endian.
+ *
+ * -----------------------------------
+ * | tlv_magic(16) | tlv_tot_len(16) |
+ * -----------------------------------
+ */
+struct shared_data_tlv_header {
+ uint16_t tlv_magic;
+ uint16_t tlv_tot_len; /* size of whole TLV area (including this header) */
+};
+
+#define SHARED_DATA_HEADER_SIZE sizeof(struct shared_data_tlv_header)
+
+/**
+ * Shared data TLV entry header format. All fields in little endian.
+ *
+ * -------------------------------
+ * | tlv_type(16) | tlv_len(16) |
+ * -------------------------------
+ * | Raw data |
+ * -------------------------------
+ */
+struct shared_data_tlv_entry {
+ uint16_t tlv_type;
+ uint16_t tlv_len; /* size of single TLV entry (including this header). */
+};
+
+/**
+ * \struct tfm_boot_data
+ *
+ * \brief Store the data for the runtime SW
+ */
+struct tfm_boot_data {
+ struct shared_data_tlv_header header;
+ uint8_t data[];
+};
+
+#define SHARED_DATA_ENTRY_HEADER_SIZE sizeof(struct shared_data_tlv_entry)
+#define SHARED_DATA_ENTRY_SIZE(size) (size + SHARED_DATA_ENTRY_HEADER_SIZE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TFM_BOOT_STATUS_H__ */