Merge 'integration' into 'topics/corstone1000'
Refresh the topic branch from integration. Refactor se-proxy
deployment to align with deployment structure changes:
- introduce a CS1K specific infrastructure to se-proxy
deployment
- restore HW independence of "stub" infra of se-proxy
- clean up components added from se-proxy.cmake and
se_proxy_sp.cmake (remove duplicates and add what's missing)
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Change-Id: Ib7f2c25c5057e95771cc16c3774759933e3f2c9c
diff --git a/deployments/attestation/attestation.cmake b/deployments/attestation/attestation.cmake
index 307de3b..cf00a33 100644
--- a/deployments/attestation/attestation.cmake
+++ b/deployments/attestation/attestation.cmake
@@ -8,48 +8,21 @@
add_components(TARGET "attestation"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
"components/common/tlv"
- "components/common/trace"
- "components/common/utils"
"components/common/endian"
- "components/common/uuid"
- "components/config/ramstore"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/rpc/ffarpc/caller/sp"
- "components/rpc/common/caller"
"components/rpc/common/interface"
"components/service/common/include"
- "components/service/common/client"
"components/service/common/provider"
- "components/service/locator"
- "components/service/locator/interface"
- "components/service/locator/sp"
- "components/service/locator/sp/ffa"
"components/service/attestation/include"
"components/service/attestation/claims"
- "components/service/attestation/claims/sources/boot_seed_generator"
- "components/service/attestation/claims/sources/null_lifecycle"
- "components/service/attestation/claims/sources/instance_id"
- "components/service/attestation/claims/sources/implementation_id"
- "components/service/attestation/claims/sources/event_log"
- "components/service/attestation/claims/sources/event_log/mock"
"components/service/attestation/reporter/local"
"components/service/attestation/reporter/eat"
"components/service/attestation/key_mngr/local"
"components/service/attestation/provider"
"components/service/attestation/provider/serializer/packed-c"
- "components/service/crypto/include"
- "components/service/crypto/client/psa"
"protocols/rpc/common/packed-c"
)
-target_sources(attestation PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/attestation_sp.c
-)
-
#-------------------------------------------------------------------------------
# Components used from external projects
#
diff --git a/deployments/attestation/opteesp/CMakeLists.txt b/deployments/attestation/config/default-opteesp/CMakeLists.txt
similarity index 82%
rename from deployments/attestation/opteesp/CMakeLists.txt
rename to deployments/attestation/config/default-opteesp/CMakeLists.txt
index fa58a4d..8cc8347 100644
--- a/deployments/attestation/opteesp/CMakeLists.txt
+++ b/deployments/attestation/config/default-opteesp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the attestation deployment for opteesp
@@ -29,6 +29,10 @@
SP_NAME "attestation"
)
+target_include_directories(attestation PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
# Default deployment specific configuration
#
@@ -36,7 +40,7 @@
set(TS_NO_FLOAT_HW ON)
#-------------------------------------------------------------------------------
-# Components that are specific to deployment in the opteesp environment.
+# Deployment specific components
#
#-------------------------------------------------------------------------------
add_components(TARGET "attestation"
@@ -45,7 +49,9 @@
"environments/opteesp"
)
-include(../attestation.cmake REQUIRED)
+include(../../env/commonsp/attestation_sp.cmake REQUIRED)
+include(../../infra/tpm-eventlog-psa.cmake REQUIRED)
+include(../../attestation.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -53,14 +59,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "attestation")
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(attestation PRIVATE
ARM64=1
)
-target_include_directories(attestation PRIVATE
- ${TS_ROOT}/deployments/attestation/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(attestation PRIVATE
-std=c99
@@ -70,7 +75,9 @@
compiler_generate_stripped_elf(TARGET attestation NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/attestation/opteesp/default_attestation.dts.in b/deployments/attestation/config/default-opteesp/default_attestation.dts.in
similarity index 89%
rename from deployments/attestation/opteesp/default_attestation.dts.in
rename to deployments/attestation/config/default-opteesp/default_attestation.dts.in
index 97e0006..287942d 100644
--- a/deployments/attestation/opteesp/default_attestation.dts.in
+++ b/deployments/attestation/config/default-opteesp/default_attestation.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,7 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
boot-params {
compatible = "arm,ffa-manifest-boot-params";
diff --git a/deployments/attestation/opteesp/optee_sp_user_defines.h b/deployments/attestation/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/attestation/opteesp/optee_sp_user_defines.h
rename to deployments/attestation/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/attestation/sp/CMakeLists.txt b/deployments/attestation/config/default-sp/CMakeLists.txt
similarity index 84%
rename from deployments/attestation/sp/CMakeLists.txt
rename to deployments/attestation/config/default-sp/CMakeLists.txt
index 08d130e..3c7ccd7 100644
--- a/deployments/attestation/sp/CMakeLists.txt
+++ b/deployments/attestation/config/default-sp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the attestation deployment for generic sp
@@ -45,7 +45,9 @@
environments/sp
)
-include(../attestation.cmake REQUIRED)
+include(../../env/commonsp/attestation_sp.cmake REQUIRED)
+include(../../infra/tpm-eventlog-psa.cmake REQUIRED)
+include(../../attestation.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -53,6 +55,9 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "attestation")
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(attestation PRIVATE
ARM64=1
)
@@ -70,7 +75,9 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET attestation NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/attestation/opteesp/default_attestation.dts.in b/deployments/attestation/config/default-sp/default_attestation.dts.in
similarity index 80%
copy from deployments/attestation/opteesp/default_attestation.dts.in
copy to deployments/attestation/config/default-sp/default_attestation.dts.in
index 97e0006..1478855 100644
--- a/deployments/attestation/opteesp/default_attestation.dts.in
+++ b/deployments/attestation/config/default-sp/default_attestation.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,12 +16,10 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
boot-params {
compatible = "arm,ffa-manifest-boot-params";
- /* Legacy node to keep compatibility with psa-development SPMC. */
event-log {
param = "EVENT_LOG"; /* The init parameter name */
tag = "arm,event-log"; /* Object identifier */
@@ -33,4 +31,10 @@
tpm_event_log_addr = <0x0 0x0>;
tpm_event_log_size = <0x0>;
};
+
+ memory-regions {
+ compatible = "arm,ffa-manifest-memory-regions";
+
+ #include "@EXPORT_DTS_MEM_REGIONS@"
+ };
};
diff --git a/deployments/attestation/common/attestation_sp.c b/deployments/attestation/env/commonsp/attestation_sp.c
similarity index 100%
rename from deployments/attestation/common/attestation_sp.c
rename to deployments/attestation/env/commonsp/attestation_sp.c
diff --git a/deployments/attestation/env/commonsp/attestation_sp.cmake b/deployments/attestation/env/commonsp/attestation_sp.cmake
new file mode 100644
index 0000000..e483184
--- /dev/null
+++ b/deployments/attestation/env/commonsp/attestation_sp.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the attestation service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for attestation sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "attestation"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/common/interface"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(attestation PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/attestation_sp.c
+)
diff --git a/deployments/attestation/common/attestation_sp.h b/deployments/attestation/env/commonsp/attestation_sp.h
similarity index 100%
rename from deployments/attestation/common/attestation_sp.h
rename to deployments/attestation/env/commonsp/attestation_sp.h
diff --git a/deployments/attestation/infra/tpm-eventlog-psa.cmake b/deployments/attestation/infra/tpm-eventlog-psa.cmake
new file mode 100644
index 0000000..b734ac9
--- /dev/null
+++ b/deployments/attestation/infra/tpm-eventlog-psa.cmake
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Defines an infrastructure for the attestation service provider that uses a
+# a TPM eventlog to collect claims about the booted firmware. Uses PSA crypto
+# for EAT token signing.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "attestation"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/uuid"
+ "components/rpc/ffarpc/caller/sp"
+ "components/rpc/common/caller"
+ "components/service/common/client"
+ "components/service/locator"
+ "components/service/locator/interface"
+ "components/service/locator/sp"
+ "components/service/locator/sp/ffa"
+ "components/service/attestation/claims/sources/boot_seed_generator"
+ "components/service/attestation/claims/sources/null_lifecycle"
+ "components/service/attestation/claims/sources/instance_id"
+ "components/service/attestation/claims/sources/implementation_id"
+ "components/service/attestation/claims/sources/event_log"
+ "components/service/attestation/claims/sources/event_log/mock"
+ "components/service/crypto/include"
+ "components/service/crypto/client/psa"
+)
diff --git a/deployments/attestation/sp/default_attestation.dts.in b/deployments/attestation/sp/default_attestation.dts.in
deleted file mode 100644
index ef26e0e..0000000
--- a/deployments/attestation/sp/default_attestation.dts.in
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-@DTS_TAG@
-
-@DTS_NODE@ {
- compatible = "arm,ffa-manifest-1.0";
- ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
- uuid = <@EXPORT_SP_UUID_DT@>;
- description = "Attestation";
- execution-ctx-count = <1>;
- exception-level = <1>; /* S-EL0 */
- execution-state = <0>; /* AArch64 */
- xlat-granule = <0>; /* 4KiB */
- messaging-method = <3>; /* Direct messaging only */
-
- boot-params {
- compatible = "arm,ffa-manifest-boot-params";
-
- event-log {
- param = "EVENT_LOG"; /* The init parameter name */
- tag = "arm,event-log"; /* Object identifier */
- };
- };
-
- memory-regions {
- compatible = "arm,ffa-manifest-memory-regions";
-
- #include "@EXPORT_DTS_MEM_REGIONS@"
- };
-};
diff --git a/deployments/block-storage/block-storage.cmake b/deployments/block-storage/block-storage.cmake
new file mode 100644
index 0000000..22760f5
--- /dev/null
+++ b/deployments/block-storage/block-storage.cmake
@@ -0,0 +1,28 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Common components used for any deployment of the block-storage service
+# provider.
+#-------------------------------------------------------------------------------
+
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/tlv"
+ "components/common/uuid"
+ "components/common/endian"
+ "components/service/common/include"
+ "components/service/common/provider"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/provider"
+ "components/service/block_storage/provider/serializer/packed-c"
+)
+
+#################################################################
+
+target_include_directories(block-storage PRIVATE
+ ${TS_ROOT}
+ ${TS_ROOT}/components
+)
diff --git a/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt b/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt
new file mode 100644
index 0000000..156cfb1
--- /dev/null
+++ b/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt
@@ -0,0 +1,108 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+
+#-------------------------------------------------------------------------------
+# Set default platform. TS_PLATFORM should be set externally to build for
+# an alternative platform from the default one.
+#
+#-------------------------------------------------------------------------------
+set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
+
+include(../../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the block_storage deployment for opteesp
+#
+# Builds the block_storage service provider for running in an SEL0 secure partition
+# hosted by OPTEE in the role of SPM.
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+project(trusted-services LANGUAGES C ASM)
+add_executable(block-storage)
+target_include_directories(block-storage PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
+set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
+include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
+set_target_uuids(
+ SP_UUID ${SP_UUID_CANON}
+ SP_NAME "block-storage"
+)
+
+target_include_directories(block-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Deployment specific components. This deployment uses an infrastructure that
+# that provides ram-backed block stoarged, configured with storage partitions
+# that conform to the 'ref' scheme used for test.
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "environments/opteesp"
+)
+
+include(../../env/commonsp/block_storage_sp.cmake REQUIRED)
+include(../../block-storage.cmake REQUIRED)
+
+# Replace with suitable infrastructure when suitable nor flash adapter is implemented
+include(../../infra/ref-ram.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# External project dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET "block-storage")
+
+#-------------------------------------------------------------------------------
+# Set target platform to provide drivers needed by the deployment
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "block-storage")
+
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
+target_compile_definitions(block-storage PRIVATE
+ ARM64=1
+)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(block-storage PRIVATE
+ -std=c99
+ )
+
+endif()
+
+compiler_generate_stripped_elf(TARGET block-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
+
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+
+install(TARGETS block-storage
+ PUBLIC_HEADER DESTINATION ${TS_ENV}/include
+ RUNTIME DESTINATION ${TS_ENV}/bin
+ )
+install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
+
+include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
+export_sp(
+ SP_UUID_CANON ${SP_UUID_CANON}
+ SP_UUID_LE ${SP_UUID_LE}
+ SP_NAME "block-storage"
+ MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
+ DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_block-storage.dts.in
+ JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
+)
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/block-storage/config/cfi-flash-optee/default_block-storage.dts.in
similarity index 77%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/block-storage/config/cfi-flash-optee/default_block-storage.dts.in
index 3285835..02179d7 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/block-storage/config/cfi-flash-optee/default_block-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,11 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "BlockStorage";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/block-storage/config/cfi-flash-optee/optee_sp_user_defines.h b/deployments/block-storage/config/cfi-flash-optee/optee_sp_user_defines.h
new file mode 100644
index 0000000..798e873
--- /dev/null
+++ b/deployments/block-storage/config/cfi-flash-optee/optee_sp_user_defines.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef OPTEE_SP_USER_DEFINES_H
+#define OPTEE_SP_USER_DEFINES_H
+
+#define OPTEE_SP_FLAGS 0
+
+/* Provisioned stack size */
+#define OPTEE_SP_STACK_SIZE (64 * 1024)
+
+#endif /* SP_HEADER_DEFINES_H */
diff --git a/deployments/block-storage/config/default-opteesp/CMakeLists.txt b/deployments/block-storage/config/default-opteesp/CMakeLists.txt
new file mode 100644
index 0000000..e565233
--- /dev/null
+++ b/deployments/block-storage/config/default-opteesp/CMakeLists.txt
@@ -0,0 +1,86 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+
+include(../../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the block_storage deployment for opteesp
+#
+# Builds the block_storage service provider for running in an SEL0 secure partition
+# hosted by OPTEE in the role of SPM.
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+project(trusted-services LANGUAGES C ASM)
+add_executable(block-storage)
+target_include_directories(block-storage PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
+set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
+include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
+set_target_uuids(
+ SP_UUID ${SP_UUID_CANON}
+ SP_NAME "block-storage"
+)
+
+target_include_directories(block-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Deployment specific components. This deployment uses an infrastructure that
+# that provides ram-backed block stoarged, configured with storage partitions
+# that conform to the 'ref' scheme used for test.
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "environments/opteesp"
+)
+
+include(../../env/commonsp/block_storage_sp.cmake REQUIRED)
+include(../../block-storage.cmake REQUIRED)
+include(../../infra/ref-ram.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
+target_compile_definitions(block-storage PRIVATE
+ ARM64=1
+)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(block-storage PRIVATE
+ -std=c99
+ )
+
+endif()
+
+compiler_generate_stripped_elf(TARGET block-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
+
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+
+install(TARGETS block-storage
+ PUBLIC_HEADER DESTINATION ${TS_ENV}/include
+ RUNTIME DESTINATION ${TS_ENV}/bin
+ )
+install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
+
+include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
+export_sp(
+ SP_UUID_CANON ${SP_UUID_CANON}
+ SP_UUID_LE ${SP_UUID_LE}
+ SP_NAME "block-storage"
+ MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
+ DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_block-storage.dts.in
+ JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
+)
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in
similarity index 77%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/block-storage/config/default-opteesp/default_block-storage.dts.in
index 3285835..02179d7 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/block-storage/config/default-opteesp/default_block-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,11 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "BlockStorage";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/block-storage/config/default-opteesp/optee_sp_user_defines.h b/deployments/block-storage/config/default-opteesp/optee_sp_user_defines.h
new file mode 100644
index 0000000..798e873
--- /dev/null
+++ b/deployments/block-storage/config/default-opteesp/optee_sp_user_defines.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef OPTEE_SP_USER_DEFINES_H
+#define OPTEE_SP_USER_DEFINES_H
+
+#define OPTEE_SP_FLAGS 0
+
+/* Provisioned stack size */
+#define OPTEE_SP_STACK_SIZE (64 * 1024)
+
+#endif /* SP_HEADER_DEFINES_H */
diff --git a/deployments/block-storage/config/default-sp/CMakeLists.txt b/deployments/block-storage/config/default-sp/CMakeLists.txt
new file mode 100644
index 0000000..626cb0c
--- /dev/null
+++ b/deployments/block-storage/config/default-sp/CMakeLists.txt
@@ -0,0 +1,85 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+
+include(../../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the block-storage deployment for generic sp
+# environment.
+#
+# Builds the block storage service provider for running in an SEL0 secure partition
+# hosted by any SPM.
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/sp/env.cmake)
+set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
+project(trusted-services LANGUAGES C ASM)
+add_executable(block-storage)
+target_include_directories(block-storage PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+
+set(SP_NAME "block-storage")
+set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
+set(SP_UUID_LE "0x806e6463 0x2f4652eb 0xdf8c4fac 0x9c518739")
+set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
+set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
+set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
+
+#-------------------------------------------------------------------------------
+# Deployment specific components. This deployment uses an infrastructure that
+# that provides ram-backed block stoarged, configured with storage partitions
+# that conform to the 'ref' scheme used for test.
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ environments/sp
+)
+
+include(../../env/commonsp/block_storage_sp.cmake REQUIRED)
+include(../../block-storage.cmake REQUIRED)
+include(../../infra/ref-ram.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
+target_compile_definitions(block-storage PRIVATE
+ ARM64=1
+)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(block-storage PRIVATE
+ -std=c99
+ )
+
+endif()
+
+compiler_generate_binary_output(TARGET block-storage NAME "${SP_UUID_CANON}.bin" SP_BINARY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
+
+include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
+export_memory_regions_to_manifest(TARGET block-storage NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
+
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+install(TARGETS block-storage
+ PUBLIC_HEADER DESTINATION ${TS_ENV}/include
+ RUNTIME DESTINATION ${TS_ENV}/bin
+ )
+
+include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED)
+export_sp(
+ SP_UUID_CANON ${SP_UUID_CANON}
+ SP_UUID_LE ${SP_UUID_LE}
+ SP_NAME ${SP_NAME}
+ DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
+ DTS_MEM_REGIONS ${SP_UUID_CANON}_memory_regions.dtsi
+ JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
+)
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/block-storage/config/default-sp/default_block-storage.dts.in
similarity index 64%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/block-storage/config/default-sp/default_block-storage.dts.in
index 3285835..fd4b539 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/block-storage/config/default-sp/default_block-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,16 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "BlockStorage";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+
+ memory-regions {
+ compatible = "arm,ffa-manifest-memory-regions";
+
+ #include "@EXPORT_DTS_MEM_REGIONS@"
+ };
};
diff --git a/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt b/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt
new file mode 100644
index 0000000..0d14694
--- /dev/null
+++ b/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt
@@ -0,0 +1,109 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+
+#-------------------------------------------------------------------------------
+# Set default platform. TS_PLATFORM should be set externally to build for
+# an alternative platform from the default one.
+#
+#-------------------------------------------------------------------------------
+set(TS_PLATFORM "arm/n1sdp" CACHE STRING "Target platform location.")
+include(../../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the block_storage service for opteesp on a
+# platform with a dedicated secure flash device with driver support from the
+# EDK2 project. Platform drivers that the deployment depends on are fetched
+# from the edk2-platforms upstream repo and built into the SP image genereated
+# by the build process.
+#
+# NOTE: In its current state, this configuration doesn't yet build successfully
+# as problems such as resolving EDK2 header file dependencies still need to
+# be resolved.
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+project(trusted-services LANGUAGES C ASM)
+add_executable(block-storage)
+target_include_directories(block-storage PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
+set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
+include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
+set_target_uuids(
+ SP_UUID ${SP_UUID_CANON}
+ SP_NAME "block-storage"
+)
+
+target_include_directories(block-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Deployment specific components.
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "environments/opteesp"
+)
+
+include(../../env/commonsp/block_storage_sp.cmake REQUIRED)
+include(../../block-storage.cmake REQUIRED)
+
+# Replace with suitable infrastructure when edk2 driver building in TS is supported
+include(../../infra/ref-ram.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# External project dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/edk2_platforms/morello.cmake)
+
+#-------------------------------------------------------------------------------
+# Set target platform to provide drivers needed by the deployment
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "block-storage")
+
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
+target_compile_definitions(block-storage PRIVATE
+ ARM64=1
+)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(block-storage PRIVATE
+ -std=c99
+ )
+
+endif()
+
+compiler_generate_stripped_elf(TARGET block-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
+
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+
+install(TARGETS block-storage
+ PUBLIC_HEADER DESTINATION ${TS_ENV}/include
+ RUNTIME DESTINATION ${TS_ENV}/bin
+ )
+install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
+
+include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
+export_sp(
+ SP_UUID_CANON ${SP_UUID_CANON}
+ SP_UUID_LE ${SP_UUID_LE}
+ SP_NAME "block-storage"
+ MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
+ DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_block-storage.dts.in
+ JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
+)
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/block-storage/config/edk2-secure-flash-opteesp/default_block-storage.dts.in
similarity index 77%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/block-storage/config/edk2-secure-flash-opteesp/default_block-storage.dts.in
index 3285835..02179d7 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/block-storage/config/edk2-secure-flash-opteesp/default_block-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,11 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "BlockStorage";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/block-storage/config/edk2-secure-flash-opteesp/optee_sp_user_defines.h b/deployments/block-storage/config/edk2-secure-flash-opteesp/optee_sp_user_defines.h
new file mode 100644
index 0000000..798e873
--- /dev/null
+++ b/deployments/block-storage/config/edk2-secure-flash-opteesp/optee_sp_user_defines.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef OPTEE_SP_USER_DEFINES_H
+#define OPTEE_SP_USER_DEFINES_H
+
+#define OPTEE_SP_FLAGS 0
+
+/* Provisioned stack size */
+#define OPTEE_SP_STACK_SIZE (64 * 1024)
+
+#endif /* SP_HEADER_DEFINES_H */
diff --git a/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt b/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt
new file mode 100644
index 0000000..1dbe0e0
--- /dev/null
+++ b/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt
@@ -0,0 +1,105 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+
+#-------------------------------------------------------------------------------
+# Set default platform.
+#
+#-------------------------------------------------------------------------------
+set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
+
+include(../../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the block_storage deployment for opteesp
+#
+# Builds the block_storage service provider for running in an SEL0 secure partition
+# hosted by OPTEE in the role of SPM.
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+project(trusted-services LANGUAGES C ASM)
+add_executable(block-storage)
+target_include_directories(block-storage PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
+set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
+include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
+set_target_uuids(
+ SP_UUID ${SP_UUID_CANON}
+ SP_NAME "block-storage"
+)
+
+target_include_directories(block-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# External project source-level dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET "block-storage")
+
+#-------------------------------------------------------------------------------
+# Deployment specific components. This deployment uses an infrastructure that
+# that provides NV storage backed by a semihosted file residing in a host
+# device filesystem.
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "environments/opteesp"
+)
+
+include(../../env/commonsp/block_storage_sp.cmake REQUIRED)
+include(../../block-storage.cmake REQUIRED)
+include(../../infra/semihosted.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# Set target platform to provide drivers needed by the deployment
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "block-storage")
+
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
+target_compile_definitions(block-storage PRIVATE
+ ARM64=1
+)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(block-storage PRIVATE
+ -std=c99
+ )
+
+endif()
+
+compiler_generate_stripped_elf(TARGET block-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
+
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+
+install(TARGETS block-storage
+ PUBLIC_HEADER DESTINATION ${TS_ENV}/include
+ RUNTIME DESTINATION ${TS_ENV}/bin
+ )
+install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
+
+include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
+export_sp(
+ SP_UUID_CANON ${SP_UUID_CANON}
+ SP_UUID_LE ${SP_UUID_LE}
+ SP_NAME "block-storage"
+ MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
+ DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_block-storage.dts.in
+ JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
+)
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/block-storage/config/semihosted-opteesp/default_block-storage.dts.in
similarity index 77%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/block-storage/config/semihosted-opteesp/default_block-storage.dts.in
index 3285835..02179d7 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/block-storage/config/semihosted-opteesp/default_block-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,11 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "BlockStorage";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/block-storage/config/semihosted-opteesp/optee_sp_user_defines.h b/deployments/block-storage/config/semihosted-opteesp/optee_sp_user_defines.h
new file mode 100644
index 0000000..798e873
--- /dev/null
+++ b/deployments/block-storage/config/semihosted-opteesp/optee_sp_user_defines.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef OPTEE_SP_USER_DEFINES_H
+#define OPTEE_SP_USER_DEFINES_H
+
+#define OPTEE_SP_FLAGS 0
+
+/* Provisioned stack size */
+#define OPTEE_SP_STACK_SIZE (64 * 1024)
+
+#endif /* SP_HEADER_DEFINES_H */
diff --git a/deployments/env-test/common/env_test.c b/deployments/block-storage/env/commonsp/block_storage_sp.c
similarity index 63%
copy from deployments/env-test/common/env_test.c
copy to deployments/block-storage/env/commonsp/block_storage_sp.c
index 2754ebf..ccefaaa 100644
--- a/deployments/env-test/common/env_test.c
+++ b/deployments/block-storage/env/commonsp/block_storage_sp.c
@@ -1,36 +1,36 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*/
-#include "rpc/ffarpc/caller/sp/ffarpc_caller.h"
#include "rpc/ffarpc/endpoint/ffarpc_call_ep.h"
-#include "service/test_runner/provider/test_runner_provider.h"
-#include "service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.h"
#include "protocols/rpc/common/packed-c/status.h"
#include "config/ramstore/config_ramstore.h"
#include "config/loader/sp/sp_config_loader.h"
-#include "ffa_api.h"
+#include "service/block_storage/provider/block_storage_provider.h"
+#include "service/block_storage/provider/serializer/packed-c/packedc_block_storage_serializer.h"
+#include "service/block_storage/factory/block_store_factory.h"
#include "sp_api.h"
#include "sp_discovery.h"
+#include "sp_messaging.h"
#include "sp_rxtx.h"
#include "trace.h"
-#include "env_test_tests.h"
+
static bool sp_init(uint16_t *own_sp_id);
void __noreturn sp_main(struct ffa_init_info *init_info)
{
- struct test_runner_provider test_runner_provider = { 0 };
struct ffa_call_ep ffarpc_call_ep = { 0 };
- struct rpc_interface *test_runner_iface = NULL;
- struct ffarpc_caller ffarpc_caller = { 0 };
+ struct block_storage_provider service_provider = { 0 };
+ struct block_store *backend = NULL;
+ struct rpc_interface *service_iface = NULL;
struct sp_msg req_msg = { 0 };
struct sp_msg resp_msg = { 0 };
uint16_t own_id = 0;
sp_result result = SP_RESULT_INTERNAL_ERROR;
- /* Boot */
+ /* Boot phase */
if (!sp_init(&own_id)) {
EMSG("Failed to init SP");
goto fatal_error;
@@ -43,21 +43,30 @@
goto fatal_error;
}
- /* Initialize the test_runner service */
- test_runner_iface = test_runner_provider_init(&test_runner_provider);
- if (!test_runner_iface) {
- EMSG("Failed to initialize test runner provider");
+ /* Initialise the service provider and backend block store */
+ backend = block_store_factory_create();
+ if (!backend) {
+ EMSG("Failed to create block store");
goto fatal_error;
}
- test_runner_provider_register_serializer(&test_runner_provider,
- TS_RPC_ENCODING_PACKED_C, packedc_test_runner_provider_serializer_instance());
+ service_iface = block_storage_provider_init(
+ &service_provider,
+ backend);
+ if (!service_iface) {
+ EMSG("Failed to init service provider");
+ goto fatal_error;
+ }
- env_test_register_tests(&test_runner_provider);
+ block_storage_provider_register_serializer(
+ &service_provider,
+ TS_RPC_ENCODING_PACKED_C,
+ packedc_block_storage_serializer_instance());
- ffa_call_ep_init(&ffarpc_call_ep, test_runner_iface, own_id);
+ /* Associate service interface with FFA call endpoint */
+ ffa_call_ep_init(&ffarpc_call_ep, service_iface, own_id);
- /* End of boot phase */
+ /* End of boot phase */
result = sp_msg_wait(&req_msg);
if (result != SP_RESULT_OK) {
EMSG("Failed to send message wait %d", result);
@@ -67,9 +76,6 @@
while (1) {
ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_msg);
- resp_msg.source_id = req_msg.destination_id;
- resp_msg.destination_id = req_msg.source_id;
-
result = sp_msg_send_direct_resp(&resp_msg, &req_msg);
if (result != SP_RESULT_OK) {
EMSG("Failed to send direct response %d", result);
@@ -83,7 +89,7 @@
fatal_error:
/* SP is not viable */
- EMSG("environment-test SP error");
+ EMSG("Block storage SP error");
while (1) {}
}
diff --git a/deployments/block-storage/env/commonsp/block_storage_sp.cmake b/deployments/block-storage/env/commonsp/block_storage_sp.cmake
new file mode 100644
index 0000000..0dea2a8
--- /dev/null
+++ b/deployments/block-storage/env/commonsp/block_storage_sp.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the block-storage service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for block-storage sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/common/interface"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(block-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/block_storage_sp.c
+)
diff --git a/deployments/block-storage/env/commonsp/block_storage_sp.h b/deployments/block-storage/env/commonsp/block_storage_sp.h
new file mode 100644
index 0000000..97ec07d
--- /dev/null
+++ b/deployments/block-storage/env/commonsp/block_storage_sp.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef BLOCK_STORAGE_SP_H
+#define BLOCK_STORAGE_SP_H
+
+#endif /* BLOCK_STORAGE_SP_H */
diff --git a/deployments/block-storage/infra/ref-ram.cmake b/deployments/block-storage/infra/ref-ram.cmake
new file mode 100644
index 0000000..2e1ca55
--- /dev/null
+++ b/deployments/block-storage/infra/ref-ram.cmake
@@ -0,0 +1,24 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the block-storage
+# service provider that uses a ram-backed block store, partitioned by default
+# using the 'ref' configuration. This infrastructure is intended for test
+# purposes.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/block_storage/block_store/device"
+ "components/service/block_storage/block_store/device/ram"
+ "components/service/block_storage/block_store/partitioned"
+ "components/service/block_storage/config/ref"
+ "components/service/block_storage/factory/ref_ram"
+)
diff --git a/deployments/block-storage/infra/semihosted.cmake b/deployments/block-storage/infra/semihosted.cmake
new file mode 100644
index 0000000..c58e7e5
--- /dev/null
+++ b/deployments/block-storage/infra/semihosted.cmake
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# A block-storage infrastructure for use on virtual platforms where storage
+# is provided by file residing in the host's filesystem. If the file contains
+# a GPT, it will be used to configure storage partitions.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "block-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/block_storage/block_store/device"
+ "components/service/block_storage/block_store/device/semihosting"
+ "components/service/block_storage/block_store/partitioned"
+ "components/service/block_storage/factory/semihosting"
+ "components/service/block_storage/config/gpt"
+ "components/media/disk"
+ "components/media/volume/index"
+ "components/media/volume/base_io_dev"
+ "components/media/volume/block_io_dev"
+ "components/common/crc32/native"
+)
+
+#-------------------------------------------------------------------------------
+# This infrastructure depends on platform specific drivers
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "block-storage")
\ No newline at end of file
diff --git a/deployments/component-test/component-test.cmake b/deployments/component-test/component-test.cmake
index c742e6b..f8ffe9f 100644
--- a/deployments/component-test/component-test.cmake
+++ b/deployments/component-test/component-test.cmake
@@ -10,6 +10,18 @@
# different environments. Used for running standalone component tests
# contained within a single executable.
#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# External project source-level dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET "component-test")
+
+#-------------------------------------------------------------------------------
+# Common components from TS project
+#
+#-------------------------------------------------------------------------------
add_components(
TARGET "component-test"
BASE_DIR ${TS_ROOT}
@@ -24,6 +36,8 @@
"components/common/trace"
"components/common/endian"
"components/common/endian/test"
+ "components/common/crc32/native"
+ "components/common/crc32/test"
"components/config/ramstore"
"components/config/ramstore/test"
"components/messaging/ffa/libsp/mock"
@@ -52,6 +66,7 @@
"components/service/locator/standalone/services/protected-storage"
"components/service/locator/standalone/services/test-runner"
"components/service/locator/standalone/services/attestation"
+ "components/service/locator/standalone/services/block-storage"
"components/service/locator/standalone/services/smm-variable"
"components/service/discovery/client"
"components/service/discovery/provider"
@@ -76,6 +91,21 @@
"components/service/attestation/client/provision"
"components/service/attestation/test/component"
"components/service/attestation/test/service"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/device"
+ "components/service/block_storage/block_store/device/ram"
+ "components/service/block_storage/block_store/device/ram/test"
+ "components/service/block_storage/block_store/device/null"
+ "components/service/block_storage/block_store/client"
+ "components/service/block_storage/block_store/partitioned"
+ "components/service/block_storage/block_store/partitioned/test"
+ "components/service/block_storage/provider"
+ "components/service/block_storage/provider/serializer/packed-c"
+ "components/service/block_storage/config/ref"
+ "components/service/block_storage/config/gpt"
+ "components/service/block_storage/factory/ref_ram"
+ "components/service/block_storage/factory/ref_ram_gpt"
+ "components/service/block_storage/factory/client"
"components/service/crypto/client/cpp"
"components/service/crypto/client/cpp/protocol/protobuf"
"components/service/crypto/client/cpp/protocol/packed-c"
@@ -125,12 +155,22 @@
"components/service/secure_storage/backend/secure_flash_store/test"
"components/service/secure_storage/backend/secure_flash_store/flash_fs"
"components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/ram"
+ "components/service/secure_storage/backend/secure_flash_store/flash/block_store_adapter"
"components/service/test_runner/provider"
"components/service/test_runner/provider/serializer/packed-c"
"components/service/test_runner/provider/backend/null"
"components/service/smm_variable/provider"
"components/service/smm_variable/backend"
"components/service/smm_variable/backend/test"
+ "components/media/disk"
+ "components/media/disk/disk_images"
+ "components/media/disk/formatter"
+ "components/media/disk/test"
+ "components/media/volume/index"
+ "components/media/volume/base_io_dev"
+ "components/media/volume/block_io_dev"
+ "components/media/volume/block_io_dev/test"
"protocols/rpc/common/protobuf"
"protocols/rpc/common/packed-c"
"protocols/service/crypto/packed-c"
diff --git a/deployments/crypto/opteesp/CMakeLists.txt b/deployments/crypto/config/default-opteesp/CMakeLists.txt
similarity index 82%
rename from deployments/crypto/opteesp/CMakeLists.txt
rename to deployments/crypto/config/default-opteesp/CMakeLists.txt
index 6909fd5..6d92c79 100644
--- a/deployments/crypto/opteesp/CMakeLists.txt
+++ b/deployments/crypto/config/default-opteesp/CMakeLists.txt
@@ -15,7 +15,7 @@
set(CMAKE_BUILD_TYPE "MinSizWithDebInfo" CACHE STRING "Build type.")
endif()
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the crypto deployment for opteesp
@@ -36,8 +36,12 @@
SP_NAME "crypto"
)
+target_include_directories(crypto PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
-# Components that are specific to deployment in the opteesp environment.
+# Deployment specific components
#
#-------------------------------------------------------------------------------
add_components(TARGET "crypto"
@@ -46,7 +50,9 @@
"environments/opteesp"
)
-include(../crypto.cmake REQUIRED)
+include(../../env/commonsp/crypto_sp.cmake REQUIRED)
+include(../../crypto.cmake REQUIRED)
+include(../../infra/baremetal-psa.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -54,16 +60,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "crypto")
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(crypto PRIVATE
ARM64=1
)
-target_include_directories(crypto PRIVATE
- ${TS_ROOT}/deployments/crypto/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(crypto PRIVATE
-std=c99
@@ -73,7 +76,9 @@
compiler_generate_stripped_elf(TARGET crypto NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/crypto/opteesp/default_crypto.dts.in b/deployments/crypto/config/default-opteesp/default_crypto.dts.in
similarity index 88%
rename from deployments/crypto/opteesp/default_crypto.dts.in
rename to deployments/crypto/config/default-opteesp/default_crypto.dts.in
index 5190ee7..75c98aa 100644
--- a/deployments/crypto/opteesp/default_crypto.dts.in
+++ b/deployments/crypto/config/default-opteesp/default_crypto.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,7 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
device-regions {
compatible = "arm,ffa-manifest-device-regions";
diff --git a/deployments/crypto/opteesp/optee_sp_user_defines.h b/deployments/crypto/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/crypto/opteesp/optee_sp_user_defines.h
rename to deployments/crypto/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/crypto/sp/CMakeLists.txt b/deployments/crypto/config/default-sp/CMakeLists.txt
similarity index 84%
rename from deployments/crypto/sp/CMakeLists.txt
rename to deployments/crypto/config/default-sp/CMakeLists.txt
index 943b9a6..964fd60 100644
--- a/deployments/crypto/sp/CMakeLists.txt
+++ b/deployments/crypto/config/default-sp/CMakeLists.txt
@@ -15,7 +15,7 @@
set(CMAKE_BUILD_TYPE "MinSizWithDebInfo" CACHE STRING "Build type.")
endif()
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the crypto deployment for generic sp
@@ -46,7 +46,9 @@
environments/sp
)
-include(../crypto.cmake REQUIRED)
+include(../../env/commonsp/crypto_sp.cmake REQUIRED)
+include(../../crypto.cmake REQUIRED)
+include(../../infra/baremetal-psa.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -54,8 +56,9 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "crypto")
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(crypto PRIVATE
ARM64=1
)
@@ -73,7 +76,9 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET crypto NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/crypto/sp/default_crypto.dts.in b/deployments/crypto/config/default-sp/default_crypto.dts.in
similarity index 100%
rename from deployments/crypto/sp/default_crypto.dts.in
rename to deployments/crypto/config/default-sp/default_crypto.dts.in
diff --git a/deployments/crypto/crypto.cmake b/deployments/crypto/crypto.cmake
index 3285ffd..9020cc0 100644
--- a/deployments/crypto/crypto.cmake
+++ b/deployments/crypto/crypto.cmake
@@ -8,19 +8,9 @@
add_components(TARGET "crypto"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
"components/common/tlv"
- "components/common/trace"
- "components/common/utils"
- "components/config/ramstore"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/rpc/ffarpc/caller/sp"
- "components/rpc/common/caller"
"components/rpc/common/interface"
"components/service/common/include"
- "components/service/common/client"
"components/service/common/serializer/protobuf"
"components/service/common/provider"
"components/service/discovery/provider"
@@ -40,33 +30,22 @@
"components/service/crypto/provider/extension/aead/serializer/packed-c"
"components/service/crypto/factory/full"
"components/service/crypto/backend/mbedcrypto"
- "components/service/crypto/backend/mbedcrypto/trng_adapter/platform"
- "components/service/secure_storage/include"
- "components/service/secure_storage/frontend/psa/its"
- "components/service/secure_storage/backend/secure_storage_client"
- "components/service/secure_storage/backend/null_store"
- "components/service/secure_storage/factory/sp/rot_store"
"protocols/rpc/common/packed-c"
- "protocols/service/secure_storage/packed-c"
"protocols/service/crypto/protobuf"
)
-target_sources(crypto PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/crypto_sp.c
-)
-
#-------------------------------------------------------------------------------
# Components used from external projects
#
#-------------------------------------------------------------------------------
# Nanopb
-include(../../../external/nanopb/nanopb.cmake)
+include(${TS_ROOT}/external/nanopb/nanopb.cmake)
target_link_libraries(crypto PRIVATE nanopb::protobuf-nanopb-static)
protobuf_generate_all(TGT "crypto" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
# Mbed TLS provides libmbedcrypto
-include(../../../external/MbedTLS/MbedTLS.cmake)
+include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
target_link_libraries(crypto PRIVATE mbedcrypto)
target_link_libraries(mbedcrypto INTERFACE stdlib::c)
diff --git a/deployments/crypto/common/crypto_sp.c b/deployments/crypto/env/commonsp/crypto_sp.c
similarity index 100%
rename from deployments/crypto/common/crypto_sp.c
rename to deployments/crypto/env/commonsp/crypto_sp.c
diff --git a/deployments/crypto/env/commonsp/crypto_sp.cmake b/deployments/crypto/env/commonsp/crypto_sp.cmake
new file mode 100644
index 0000000..10e7e3c
--- /dev/null
+++ b/deployments/crypto/env/commonsp/crypto_sp.cmake
@@ -0,0 +1,28 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the crypto service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for crypto sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "crypto"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(crypto PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/crypto_sp.c
+)
diff --git a/deployments/crypto/common/crypto_sp.h b/deployments/crypto/env/commonsp/crypto_sp.h
similarity index 100%
rename from deployments/crypto/common/crypto_sp.h
rename to deployments/crypto/env/commonsp/crypto_sp.h
diff --git a/deployments/crypto/infra/baremetal-psa.cmake b/deployments/crypto/infra/baremetal-psa.cmake
new file mode 100644
index 0000000..afd3bbe
--- /dev/null
+++ b/deployments/crypto/infra/baremetal-psa.cmake
@@ -0,0 +1,33 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Defines an infrastructure for the crypto service provider that uses a
+# baremetal platform TRNG driver and PSA storage for persistent key storage.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "crypto"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/rpc/ffarpc/caller/sp"
+ "components/rpc/common/caller"
+ "components/service/common/client"
+ "components/service/crypto/backend/mbedcrypto/trng_adapter/platform"
+ "components/service/secure_storage/include"
+ "components/service/secure_storage/frontend/psa/its"
+ "components/service/secure_storage/backend/secure_storage_client"
+ "components/service/secure_storage/backend/null_store"
+ "components/service/secure_storage/factory/sp/rot_store"
+ "protocols/service/secure_storage/packed-c"
+)
+
+#-------------------------------------------------------------------------------
+# This infrastructure depends on platform specific drivers
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "crypto")
diff --git a/deployments/crypto/opteesp/.gitignore b/deployments/crypto/opteesp/.gitignore
deleted file mode 100644
index 378eac2..0000000
--- a/deployments/crypto/opteesp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/deployments/env-test/common/env_test_tests.c b/deployments/env-test/common/env_test_tests.c
deleted file mode 100644
index 11c1f42..0000000
--- a/deployments/env-test/common/env_test_tests.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause
-/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
- */
-
-#include <service/test_runner/provider/backend/simple_c/simple_c_test_runner.h>
-#include <config/test/sp/sp_config_tests.h>
-#include <service/crypto/backend/mbedcrypto/trng_adapter/test/trng_env_tests.h>
-
-void env_test_register_tests(struct test_runner_provider *context)
-{
- simple_c_test_runner_init(context);
-
- sp_config_tests_register();
- trng_env_tests_register();
-}
diff --git a/deployments/env-test/common/env_test_tests.h b/deployments/env-test/common/env_test_tests.h
deleted file mode 100644
index 305fc45..0000000
--- a/deployments/env-test/common/env_test_tests.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ENV_TEST_TESTS_H
-#define ENV_TEST_TESTS_H
-
-struct test_runner_provider;
-
-/**
- * Registers test cases for this deployment
- */
-void env_test_register_tests(struct test_runner_provider *context);
-
-
-#endif /* ENV_TEST_TESTS_H */
diff --git a/deployments/env-test/opteesp/CMakeLists.txt b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
similarity index 75%
copy from deployments/env-test/opteesp/CMakeLists.txt
copy to deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
index 4b3a246..b885cac 100644
--- a/deployments/env-test/opteesp/CMakeLists.txt
+++ b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
@@ -8,14 +8,13 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the env-test deployment for opteesp
#
-# Builds the test_runner service provider for running in an SEL0 secure partition
-# hosted by OPTEE in the role of SPM. Environment tests are added and CppUnit
-# test cases.
+# Builds the test_runner service provider with a set of baremetal drivers
+# and test cases for testing drivers from within an SEL0 SP.
#-------------------------------------------------------------------------------
include(${TS_ROOT}/environments/opteesp/env.cmake)
project(trusted-services LANGUAGES C ASM)
@@ -30,29 +29,31 @@
SP_NAME "env-test"
)
+target_include_directories(env-test PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
-# Components that are env-test specific to deployment in the opteesp
-# environment.
+# Deployment specific components
+# External project source-level dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET "env-test")
+
+#-------------------------------------------------------------------------------
+# Defines environment and test suites for env-test deployment
+#
#-------------------------------------------------------------------------------
add_components(TARGET "env-test"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
- "components/common/trace"
- "components/common/utils"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/config/test/sp"
"environments/opteesp"
)
-#-------------------------------------------------------------------------------
-# Extend with components that are common across all deployments of
-# env-test
-#
-#-------------------------------------------------------------------------------
-include(../env-test.cmake REQUIRED)
+include(../../env/commonsp/env_test_sp.cmake REQUIRED)
+include(../../env-test.cmake REQUIRED)
+include(../../suites/baremetal-tests.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -60,16 +61,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET env-test)
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(env-test PRIVATE
ARM64=1
)
-target_include_directories(env-test PRIVATE
- ${TS_ROOT}/deployments/env-test/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(env-test PRIVATE
-std=c99
@@ -78,7 +76,9 @@
compiler_generate_stripped_elf(TARGET env-test NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/env-test/opteesp/default_env-test.dts.in b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/default_env-test.dts.in
similarity index 93%
rename from deployments/env-test/opteesp/default_env-test.dts.in
rename to deployments/env-test/config/baremetal-fvp_base_revc-opteesp/default_env-test.dts.in
index d2685d7..c537ce5 100644
--- a/deployments/env-test/opteesp/default_env-test.dts.in
+++ b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/default_env-test.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,6 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
+ elf-format = <1>;
memory-regions {
compatible = "arm,ffa-manifest-memory-regions";
diff --git a/deployments/env-test/opteesp/optee_sp_user_defines.h b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/optee_sp_user_defines.h
similarity index 100%
copy from deployments/env-test/opteesp/optee_sp_user_defines.h
copy to deployments/env-test/config/baremetal-fvp_base_revc-opteesp/optee_sp_user_defines.h
diff --git a/deployments/env-test/sp/CMakeLists.txt b/deployments/env-test/config/baremetal-fvp_base_revc-sp/CMakeLists.txt
similarity index 75%
rename from deployments/env-test/sp/CMakeLists.txt
rename to deployments/env-test/config/baremetal-fvp_base_revc-sp/CMakeLists.txt
index 99aa8f8..85e325f 100644
--- a/deployments/env-test/sp/CMakeLists.txt
+++ b/deployments/env-test/config/baremetal-fvp_base_revc-sp/CMakeLists.txt
@@ -8,15 +8,13 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
-# The CMakeLists.txt for building the env-test deployment for generic sp
-# environment.
+# The CMakeLists.txt for building the env-test deployment for sp
#
-# Builds the test_runner service provider for running in an SEL0 secure
-# partition hosted by any SPM. Environment tests are added and CppUnit test
-# cases.
+# Builds the test_runner service provider with a set of baremetal drivers
+# and test cases for testing drivers from within an SEL0 SP.
#-------------------------------------------------------------------------------
include(${TS_ROOT}/environments/sp/env.cmake)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
@@ -30,33 +28,29 @@
set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size")
+#-------------------------------------------------------------------------------
+# Components that are specific to deployment in the opteesp environment.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "env-test"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/trace"
- "components/common/utils"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/config/test/sp"
- "environments/sp"
+ environments/sp
)
-#-------------------------------------------------------------------------------
-# Extend with components that are common across all deployments of
-# env-test
-#
-#-------------------------------------------------------------------------------
-include(../env-test.cmake REQUIRED)
+include(../../env/commonsp/env_test_sp.cmake REQUIRED)
+include(../../env-test.cmake REQUIRED)
+include(../../suites/baremetal-tests.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
#
#-------------------------------------------------------------------------------
-add_platform(TARGET env-test)
+add_platform(TARGET "env-test")
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(env-test PRIVATE
ARM64=1
)
@@ -74,7 +68,9 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET env-test NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/env-test/sp/default_env-test.dts.in b/deployments/env-test/config/baremetal-fvp_base_revc-sp/default_env-test.dts.in
similarity index 98%
rename from deployments/env-test/sp/default_env-test.dts.in
rename to deployments/env-test/config/baremetal-fvp_base_revc-sp/default_env-test.dts.in
index 44a2dac..ced902c 100644
--- a/deployments/env-test/sp/default_env-test.dts.in
+++ b/deployments/env-test/config/baremetal-fvp_base_revc-sp/default_env-test.dts.in
@@ -3,9 +3,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-
@DTS_TAG@
-
@DTS_NODE@ {
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
@@ -16,12 +14,9 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
-
memory-regions {
compatible = "arm,ffa-manifest-memory-regions";
-
#include "@EXPORT_DTS_MEM_REGIONS@"
-
/* Without optional base-address */
test-memory {
description = "test-memory";
@@ -29,10 +24,8 @@
attributes = <0x7>; /* read-write-execute */
};
};
-
device-regions {
compatible = "arm,ffa-manifest-device-regions";
-
trng {
/* Armv8 A Foundation Platform values */
base-address = <0x00000000 0x7fe60000>;
@@ -40,10 +33,8 @@
attributes = <0x3>; /* read-write */
};
};
-
boot-params {
compatible = "arm,ffa-manifest-boot-params";
-
event-log {
param = "EVENT_LOG"; /* The init parameter name */
tag = "arm,event-log"; /* Object identifier */
diff --git a/deployments/env-test/opteesp/CMakeLists.txt b/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
similarity index 83%
rename from deployments/env-test/opteesp/CMakeLists.txt
rename to deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
index 4b3a246..68758e4 100644
--- a/deployments/env-test/opteesp/CMakeLists.txt
+++ b/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the env-test deployment for opteesp
@@ -30,29 +30,23 @@
SP_NAME "env-test"
)
+target_include_directories(env-test PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
-# Components that are env-test specific to deployment in the opteesp
-# environment.
+# Deployment specific components
+#
#-------------------------------------------------------------------------------
add_components(TARGET "env-test"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
- "components/common/trace"
- "components/common/utils"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/config/test/sp"
"environments/opteesp"
)
-#-------------------------------------------------------------------------------
-# Extend with components that are common across all deployments of
-# env-test
-#
-#-------------------------------------------------------------------------------
-include(../env-test.cmake REQUIRED)
+include(../../env/commonsp/env_test_sp.cmake REQUIRED)
+include(../../env-test.cmake REQUIRED)
+include(../../suites/edk2-platform-tests.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -60,16 +54,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET env-test)
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(env-test PRIVATE
ARM64=1
)
-target_include_directories(env-test PRIVATE
- ${TS_ROOT}/deployments/env-test/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(env-test PRIVATE
-std=c99
@@ -78,7 +69,9 @@
compiler_generate_stripped_elf(TARGET env-test NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/env-test/opteesp/default_env-test.dts.in b/deployments/env-test/config/n1sdp-opteesp/default_env-test.dts.in
similarity index 93%
copy from deployments/env-test/opteesp/default_env-test.dts.in
copy to deployments/env-test/config/n1sdp-opteesp/default_env-test.dts.in
index d2685d7..c537ce5 100644
--- a/deployments/env-test/opteesp/default_env-test.dts.in
+++ b/deployments/env-test/config/n1sdp-opteesp/default_env-test.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,6 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
+ elf-format = <1>;
memory-regions {
compatible = "arm,ffa-manifest-memory-regions";
diff --git a/deployments/env-test/opteesp/optee_sp_user_defines.h b/deployments/env-test/config/n1sdp-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/env-test/opteesp/optee_sp_user_defines.h
rename to deployments/env-test/config/n1sdp-opteesp/optee_sp_user_defines.h
diff --git a/deployments/env-test/env-test.cmake b/deployments/env-test/env-test.cmake
index cf75d90..c81810c 100644
--- a/deployments/env-test/env-test.cmake
+++ b/deployments/env-test/env-test.cmake
@@ -19,45 +19,19 @@
TARGET "env-test"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
"components/common/tlv"
- "components/config/ramstore"
"components/rpc/common/interface"
- "components/rpc/common/caller"
"components/service/common/include"
- "components/service/common/client"
"components/service/common/provider"
"components/service/test_runner/provider"
"components/service/test_runner/provider/serializer/packed-c"
"components/service/test_runner/provider/backend/null"
"components/service/test_runner/provider/backend/simple_c"
- "components/service/crypto/backend/mbedcrypto"
- "components/service/crypto/backend/mbedcrypto/trng_adapter/platform"
- "components/service/crypto/backend/mbedcrypto/trng_adapter/test"
- "components/service/secure_storage/include"
- "components/service/secure_storage/frontend/psa/its"
- "components/service/secure_storage/backend/secure_storage_client"
"protocols/rpc/common/packed-c"
)
-#-------------------------------------------------------------------------------
-# Deployment specific source files
-#-------------------------------------------------------------------------------
-target_sources(env-test PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/env_test.c
- ${CMAKE_CURRENT_LIST_DIR}/common/env_test_tests.c
-)
-
target_include_directories(env-test PRIVATE
${TS_ROOT}
${TS_ROOT}/components
)
-#-------------------------------------------------------------------------------
-# Components used from external projects
-#
-#-------------------------------------------------------------------------------
-
-# Mbed TLS provides libmbedcrypto
-include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
-target_link_libraries(env-test PRIVATE mbedcrypto)
diff --git a/deployments/env-test/common/env_test.c b/deployments/env-test/env/commonsp/env_test_sp.c
similarity index 95%
rename from deployments/env-test/common/env_test.c
rename to deployments/env-test/env/commonsp/env_test_sp.c
index 2754ebf..3b1f472 100644
--- a/deployments/env-test/common/env_test.c
+++ b/deployments/env-test/env/commonsp/env_test_sp.c
@@ -3,7 +3,6 @@
* Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*/
-#include "rpc/ffarpc/caller/sp/ffarpc_caller.h"
#include "rpc/ffarpc/endpoint/ffarpc_call_ep.h"
#include "service/test_runner/provider/test_runner_provider.h"
#include "service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.h"
@@ -15,7 +14,7 @@
#include "sp_discovery.h"
#include "sp_rxtx.h"
#include "trace.h"
-#include "env_test_tests.h"
+#include "deployments/env-test/suites/registration/env_test_register.h"
static bool sp_init(uint16_t *own_sp_id);
@@ -24,7 +23,6 @@
struct test_runner_provider test_runner_provider = { 0 };
struct ffa_call_ep ffarpc_call_ep = { 0 };
struct rpc_interface *test_runner_iface = NULL;
- struct ffarpc_caller ffarpc_caller = { 0 };
struct sp_msg req_msg = { 0 };
struct sp_msg resp_msg = { 0 };
uint16_t own_id = 0;
diff --git a/deployments/env-test/env/commonsp/env_test_sp.cmake b/deployments/env-test/env/commonsp/env_test_sp.cmake
new file mode 100644
index 0000000..df57ef2
--- /dev/null
+++ b/deployments/env-test/env/commonsp/env_test_sp.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the env-test service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for env-test sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "env-test"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/common/interface"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(env-test PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/env_test_sp.c
+)
diff --git a/deployments/env-test/common/env_test.h b/deployments/env-test/env/commonsp/env_test_sp.h
similarity index 100%
rename from deployments/env-test/common/env_test.h
rename to deployments/env-test/env/commonsp/env_test_sp.h
diff --git a/deployments/env-test/opteesp/.gitignore b/deployments/env-test/opteesp/.gitignore
deleted file mode 100644
index 378eac2..0000000
--- a/deployments/env-test/opteesp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/deployments/env-test/suites/baremetal-tests.cmake b/deployments/env-test/suites/baremetal-tests.cmake
new file mode 100644
index 0000000..6baf1f6
--- /dev/null
+++ b/deployments/env-test/suites/baremetal-tests.cmake
@@ -0,0 +1,48 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Baremetal driver test cases to test paltform driver operation from within
+# a secure execution environment.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Components-under-test and test cases baremetal platform tests.
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "env-test"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/uuid"
+ "components/service/crypto/backend/mbedcrypto"
+ "components/service/crypto/backend/mbedcrypto/trng_adapter/platform"
+ "components/service/crypto/backend/mbedcrypto/trng_adapter/test"
+ "components/service/secure_storage/include"
+ "components/service/secure_storage/frontend/psa/its"
+ "components/service/secure_storage/backend/secure_storage_client"
+ "components/config/test/sp"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/device"
+ "components/service/block_storage/block_store/device/semihosting"
+ "components/service/block_storage/block_store/device/semihosting/test"
+)
+
+target_sources(env-test PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/registration/baremetal_tests.c
+)
+
+#-------------------------------------------------------------------------------
+# Components used from external projects
+#
+#-------------------------------------------------------------------------------
+
+# Mbed TLS provides libmbedcrypto
+include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
+target_link_libraries(env-test PRIVATE mbedcrypto)
+
+#-------------------------------------------------------------------------------
+# This test suite depends on platform specific drivers
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "env-test")
diff --git a/deployments/env-test/suites/edk2-platform-tests.cmake b/deployments/env-test/suites/edk2-platform-tests.cmake
new file mode 100644
index 0000000..dab56ed
--- /dev/null
+++ b/deployments/env-test/suites/edk2-platform-tests.cmake
@@ -0,0 +1,27 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Test for drivers reused from edk2-platforms
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Components-under-test and test cases edk2 platform tests.
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "env-test"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/config/test/sp"
+)
+
+target_sources(env-test PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/registration/edk2_platform_tests.c
+)
+
+#-------------------------------------------------------------------------------
+# This test suite depends on platform specific drivers
+#
+#-------------------------------------------------------------------------------
+add_platform(TARGET "env-test")
\ No newline at end of file
diff --git a/deployments/env-test/suites/registration/baremetal_tests.c b/deployments/env-test/suites/registration/baremetal_tests.c
new file mode 100644
index 0000000..d7695a5
--- /dev/null
+++ b/deployments/env-test/suites/registration/baremetal_tests.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#include <service/test_runner/provider/backend/simple_c/simple_c_test_runner.h>
+#include <config/test/sp/sp_config_tests.h>
+#include <service/crypto/backend/mbedcrypto/trng_adapter/test/trng_env_tests.h>
+#include <service/block_storage/block_store/device/semihosting/test/sh_block_store_tests.h>
+
+/**
+ * Register tests that constitute the 'baremetal-tests' suite. Used for testing
+ * platform drivers that conform to the 'baremetal' driver model.
+ */
+void env_test_register_tests(struct test_runner_provider *context)
+{
+ simple_c_test_runner_init(context);
+
+ sp_config_tests_register();
+ trng_env_tests_register();
+ sh_block_store_tests_register();
+}
diff --git a/deployments/env-test/suites/registration/edk2_platform_tests.c b/deployments/env-test/suites/registration/edk2_platform_tests.c
new file mode 100644
index 0000000..7b0fa44
--- /dev/null
+++ b/deployments/env-test/suites/registration/edk2_platform_tests.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#include <service/test_runner/provider/backend/simple_c/simple_c_test_runner.h>
+#include <config/test/sp/sp_config_tests.h>
+
+/**
+ * Register tests that constitute the 'edk2-platform-tests' suite. Used for testing
+ * platform drivers that conform to the 'edk2 (UEFI)' driver model.
+ */
+void env_test_register_tests(struct test_runner_provider *context)
+{
+ simple_c_test_runner_init(context);
+
+ sp_config_tests_register();
+}
diff --git a/deployments/env-test/suites/registration/env_test_register.h b/deployments/env-test/suites/registration/env_test_register.h
new file mode 100644
index 0000000..d455f5a
--- /dev/null
+++ b/deployments/env-test/suites/registration/env_test_register.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ENV_TEST_REGISTER_H
+#define ENV_TEST_REGISTER_H
+
+struct test_runner_provider;
+
+/**
+ * Registers test cases for this deployment
+ */
+void env_test_register_tests(struct test_runner_provider *context);
+
+
+#endif /* ENV_TEST_REGISTER_H */
diff --git a/deployments/internal-trusted-storage/opteesp/CMakeLists.txt b/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
similarity index 73%
rename from deployments/internal-trusted-storage/opteesp/CMakeLists.txt
rename to deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
index 5f4b911..693ebf5 100644
--- a/deployments/internal-trusted-storage/opteesp/CMakeLists.txt
+++ b/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the internal-trusted-storage deployment for opteesp
@@ -26,22 +26,33 @@
SP_NAME "internal-trusted-storage"
)
+target_include_directories(internal-trusted-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# ram backed storage for SFS.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "internal-trusted-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/opteesp
)
-include(../internal-trusted-storage.cmake REQUIRED)
+include(../../env/commonsp/its_sp.cmake REQUIRED)
+include(../../internal-trusted-storage.cmake REQUIRED)
+include(../../infra/sfs-ram.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(internal-trusted-storage PRIVATE
ARM64=1
)
-target_include_directories(internal-trusted-storage PRIVATE
- ${TS_ROOT}/deployments/internal-trusted-storage/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(internal-trusted-storage PRIVATE
-std=c99
@@ -51,7 +62,10 @@
compiler_generate_stripped_elf(TARGET internal-trusted-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in b/deployments/internal-trusted-storage/config/default-opteesp/default_internal-trusted-storage.dts.in
similarity index 82%
rename from deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in
rename to deployments/internal-trusted-storage/config/default-opteesp/default_internal-trusted-storage.dts.in
index 9046fcb..071d11f 100644
--- a/deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in
+++ b/deployments/internal-trusted-storage/config/default-opteesp/default_internal-trusted-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,5 +16,5 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/internal-trusted-storage/opteesp/optee_sp_user_defines.h b/deployments/internal-trusted-storage/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/internal-trusted-storage/opteesp/optee_sp_user_defines.h
rename to deployments/internal-trusted-storage/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/internal-trusted-storage/sp/CMakeLists.txt b/deployments/internal-trusted-storage/config/default-sp/CMakeLists.txt
similarity index 75%
rename from deployments/internal-trusted-storage/sp/CMakeLists.txt
rename to deployments/internal-trusted-storage/config/default-sp/CMakeLists.txt
index 90a84dd..e04a183 100644
--- a/deployments/internal-trusted-storage/sp/CMakeLists.txt
+++ b/deployments/internal-trusted-storage/config/default-sp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the internal-trusted-storage deployment for
@@ -26,14 +26,25 @@
set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size")
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# ram backed storage for SFS.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "internal-trusted-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/sp
)
-include(../internal-trusted-storage.cmake REQUIRED)
+include(../../env/commonsp/its_sp.cmake REQUIRED)
+include(../../internal-trusted-storage.cmake REQUIRED)
+include(../../infra/sfs-ram.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(internal-trusted-storage PRIVATE
ARM64=1
)
@@ -51,7 +62,10 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET internal-trusted-storage NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/internal-trusted-storage/sp/default_internal-trusted-storage.dts.in b/deployments/internal-trusted-storage/config/default-sp/default_internal-trusted-storage.dts.in
similarity index 100%
rename from deployments/internal-trusted-storage/sp/default_internal-trusted-storage.dts.in
rename to deployments/internal-trusted-storage/config/default-sp/default_internal-trusted-storage.dts.in
diff --git a/deployments/internal-trusted-storage/opteesp/CMakeLists.txt b/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
similarity index 72%
copy from deployments/internal-trusted-storage/opteesp/CMakeLists.txt
copy to deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
index 5f4b911..449e369 100644
--- a/deployments/internal-trusted-storage/opteesp/CMakeLists.txt
+++ b/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the internal-trusted-storage deployment for opteesp
@@ -26,22 +26,33 @@
SP_NAME "internal-trusted-storage"
)
+target_include_directories(internal-trusted-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# access to a storage partition in a shared secure flash device.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "internal-trusted-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/opteesp
)
-include(../internal-trusted-storage.cmake REQUIRED)
+include(../../env/commonsp/its_sp.cmake REQUIRED)
+include(../../internal-trusted-storage.cmake REQUIRED)
+include(../../infra/sfs-shared-flash.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(internal-trusted-storage PRIVATE
ARM64=1
)
-target_include_directories(internal-trusted-storage PRIVATE
- ${TS_ROOT}/deployments/internal-trusted-storage/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(internal-trusted-storage PRIVATE
-std=c99
@@ -51,7 +62,10 @@
compiler_generate_stripped_elf(TARGET internal-trusted-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in b/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in
similarity index 82%
copy from deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in
copy to deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in
index 9046fcb..071d11f 100644
--- a/deployments/internal-trusted-storage/opteesp/default_internal-trusted-storage.dts.in
+++ b/deployments/internal-trusted-storage/config/shared-flash-opteesp/default_internal-trusted-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,5 +16,5 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/internal-trusted-storage/opteesp/optee_sp_user_defines.h b/deployments/internal-trusted-storage/config/shared-flash-opteesp/optee_sp_user_defines.h
similarity index 100%
copy from deployments/internal-trusted-storage/opteesp/optee_sp_user_defines.h
copy to deployments/internal-trusted-storage/config/shared-flash-opteesp/optee_sp_user_defines.h
diff --git a/deployments/internal-trusted-storage/common/its_sp.c b/deployments/internal-trusted-storage/env/commonsp/its_sp.c
similarity index 97%
rename from deployments/internal-trusted-storage/common/its_sp.c
rename to deployments/internal-trusted-storage/env/commonsp/its_sp.c
index e8b2655..4c694ef 100644
--- a/deployments/internal-trusted-storage/common/its_sp.c
+++ b/deployments/internal-trusted-storage/env/commonsp/its_sp.c
@@ -45,7 +45,7 @@
storage_backend = storage_factory_create(storage_factory_security_class_INTERNAL_TRUSTED);
if (!storage_backend) {
- EMSG("Failed to create storage factory");
+ EMSG("Failed to create storage backend");
goto fatal_error;
}
diff --git a/deployments/internal-trusted-storage/env/commonsp/its_sp.cmake b/deployments/internal-trusted-storage/env/commonsp/its_sp.cmake
new file mode 100644
index 0000000..56cefc9
--- /dev/null
+++ b/deployments/internal-trusted-storage/env/commonsp/its_sp.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the internal-trusted-storage service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for internal-trusted-storage sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "internal-trusted-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/common/interface"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(internal-trusted-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/its_sp.c
+)
diff --git a/deployments/internal-trusted-storage/common/its_sp.h b/deployments/internal-trusted-storage/env/commonsp/its_sp.h
similarity index 100%
rename from deployments/internal-trusted-storage/common/its_sp.h
rename to deployments/internal-trusted-storage/env/commonsp/its_sp.h
diff --git a/deployments/internal-trusted-storage/infra/sfs-ram.cmake b/deployments/internal-trusted-storage/infra/sfs-ram.cmake
new file mode 100644
index 0000000..03af4f1
--- /dev/null
+++ b/deployments/internal-trusted-storage/infra/sfs-ram.cmake
@@ -0,0 +1,23 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the
+# internal-trusted-storage service provider that uses the SFS component
+# backed by ram storage. Not intended to production deployments.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "internal-trusted-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/secure_storage/backend/secure_flash_store"
+ "components/service/secure_storage/backend/secure_flash_store/flash_fs"
+ "components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/ram"
+ "components/service/secure_storage/factory/common/sfs"
+)
diff --git a/deployments/internal-trusted-storage/infra/sfs-shared-flash.cmake b/deployments/internal-trusted-storage/infra/sfs-shared-flash.cmake
new file mode 100644
index 0000000..3f91b10
--- /dev/null
+++ b/deployments/internal-trusted-storage/infra/sfs-shared-flash.cmake
@@ -0,0 +1,33 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the
+# internal-trusted-storage service provider that uses the SFS component
+# backed by a storage partition provided by the block storage service.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "internal-trusted-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/uuid"
+ "components/rpc/common/caller"
+ "components/rpc/ffarpc/caller/sp"
+ "components/service/locator"
+ "components/service/locator/interface"
+ "components/service/locator/sp"
+ "components/service/locator/sp/ffa"
+ "components/service/secure_storage/backend/secure_flash_store"
+ "components/service/secure_storage/backend/secure_flash_store/flash_fs"
+ "components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/block_store_adapter"
+ "components/service/secure_storage/factory/sp/sfs_shared_block_store"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/client"
+ "components/service/block_storage/factory/client"
+)
diff --git a/deployments/internal-trusted-storage/internal-trusted-storage.cmake b/deployments/internal-trusted-storage/internal-trusted-storage.cmake
index 3ce5564..0858000 100644
--- a/deployments/internal-trusted-storage/internal-trusted-storage.cmake
+++ b/deployments/internal-trusted-storage/internal-trusted-storage.cmake
@@ -8,29 +8,17 @@
add_components(TARGET "internal-trusted-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
- components/common/trace
- components/common/utils
- components/messaging/ffa/libsp
- components/rpc/ffarpc/endpoint
- components/rpc/common/interface
+ components/common/tlv
components/service/common/include
+ components/service/common/client
components/service/common/provider
components/service/secure_storage/include
components/service/secure_storage/frontend/secure_storage_provider
- components/service/secure_storage/backend/secure_flash_store
- components/service/secure_storage/backend/secure_flash_store/flash_fs
- components/service/secure_storage/backend/secure_flash_store/flash
- components/service/secure_storage/factory/common/sfs
protocols/rpc/common/packed-c
protocols/service/secure_storage/packed-c
)
-target_sources(internal-trusted-storage PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/its_sp.c
-)
-
target_include_directories(internal-trusted-storage PRIVATE
${TS_ROOT}
${TS_ROOT}/components
- ${TS_ROOT}/deployments/internal-trusted-storage/common
)
diff --git a/deployments/internal-trusted-storage/opteesp/.gitignore b/deployments/internal-trusted-storage/opteesp/.gitignore
deleted file mode 100644
index 378eac2..0000000
--- a/deployments/internal-trusted-storage/opteesp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/deployments/libts/linux-pc/CMakeLists.txt b/deployments/libts/linux-pc/CMakeLists.txt
index 2fe21ec..ecc72ef 100644
--- a/deployments/libts/linux-pc/CMakeLists.txt
+++ b/deployments/libts/linux-pc/CMakeLists.txt
@@ -22,6 +22,13 @@
target_include_directories(ts PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
#-------------------------------------------------------------------------------
+# External project source-level dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET "ts")
+
+#-------------------------------------------------------------------------------
# Components that are specific to deployment in the linux-pc environment.
#
#-------------------------------------------------------------------------------
@@ -31,9 +38,11 @@
COMPONENTS
"components/rpc/direct"
"components/common/tlv"
+ "components/common/uuid"
"components/common/endian"
"components/common/utils"
"components/common/trace"
+ "components/common/crc32/native"
"components/config/ramstore"
"components/service/common/include"
"components/service/common/client"
@@ -47,6 +56,7 @@
"components/service/locator/standalone/services/protected-storage"
"components/service/locator/standalone/services/test-runner"
"components/service/locator/standalone/services/attestation"
+ "components/service/locator/standalone/services/block-storage"
"components/service/locator/standalone/services/smm-variable"
"components/service/attestation/include"
"components/service/attestation/claims"
@@ -61,6 +71,17 @@
"components/service/attestation/key_mngr/local"
"components/service/attestation/provider"
"components/service/attestation/provider/serializer/packed-c"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/device"
+ "components/service/block_storage/block_store/device/ram"
+ "components/service/block_storage/block_store/partitioned"
+ "components/service/block_storage/block_store/client"
+ "components/service/block_storage/provider"
+ "components/service/block_storage/provider/serializer/packed-c"
+ "components/service/block_storage/config/gpt"
+ "components/service/block_storage/config/ref"
+ "components/service/block_storage/factory/ref_ram_gpt"
+ "components/service/block_storage/factory/client"
"components/service/crypto/provider"
"components/service/crypto/provider/serializer/protobuf"
"components/service/crypto/provider/serializer/packed-c"
@@ -83,12 +104,22 @@
"components/service/secure_storage/backend/secure_storage_client"
"components/service/secure_storage/backend/mock_store"
"components/service/secure_storage/backend/null_store"
+ "components/service/secure_storage/backend/secure_flash_store"
+ "components/service/secure_storage/backend/secure_flash_store/flash_fs"
+ "components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/block_store_adapter"
"components/service/test_runner/provider"
"components/service/test_runner/provider/serializer/packed-c"
"components/service/test_runner/provider/backend/mock"
"components/service/test_runner/provider/backend/simple_c"
"components/service/smm_variable/backend"
"components/service/smm_variable/provider"
+ "components/media/disk"
+ "components/media/disk/disk_images"
+ "components/media/disk/formatter"
+ "components/media/volume/index"
+ "components/media/volume/base_io_dev"
+ "components/media/volume/block_io_dev"
"protocols/rpc/common/packed-c"
"protocols/service/crypto/packed-c"
"protocols/service/crypto/protobuf"
diff --git a/deployments/protected-storage/opteesp/CMakeLists.txt b/deployments/protected-storage/config/default-opteesp/CMakeLists.txt
similarity index 72%
rename from deployments/protected-storage/opteesp/CMakeLists.txt
rename to deployments/protected-storage/config/default-opteesp/CMakeLists.txt
index 44b7a2b..47f1f53 100644
--- a/deployments/protected-storage/opteesp/CMakeLists.txt
+++ b/deployments/protected-storage/config/default-opteesp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the protected-storage deployment for opteesp
@@ -26,22 +26,33 @@
SP_NAME "protected-storage"
)
+target_include_directories(protected-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# ram backed storage for SFS.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "protected-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/opteesp
)
-include(../protected-storage.cmake REQUIRED)
+include(../../env/commonsp/ps_sp.cmake REQUIRED)
+include(../../protected-storage.cmake REQUIRED)
+include(../../infra/sfs-ram.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(protected-storage PRIVATE
ARM64=1
)
-target_include_directories(protected-storage PRIVATE
- ${TS_ROOT}/deployments/protected-storage/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(protected-storage PRIVATE
-std=c99
@@ -50,7 +61,10 @@
compiler_generate_stripped_elf(TARGET protected-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/protected-storage/config/default-opteesp/default_protected-storage.dts.in
similarity index 82%
rename from deployments/protected-storage/opteesp/default_protected-storage.dts.in
rename to deployments/protected-storage/config/default-opteesp/default_protected-storage.dts.in
index 3285835..f57bf2e 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/protected-storage/config/default-opteesp/default_protected-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,5 +16,5 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/protected-storage/opteesp/optee_sp_user_defines.h b/deployments/protected-storage/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/protected-storage/opteesp/optee_sp_user_defines.h
rename to deployments/protected-storage/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/protected-storage/sp/CMakeLists.txt b/deployments/protected-storage/config/default-sp/CMakeLists.txt
similarity index 74%
rename from deployments/protected-storage/sp/CMakeLists.txt
rename to deployments/protected-storage/config/default-sp/CMakeLists.txt
index 05d2a00..3bae2c9 100644
--- a/deployments/protected-storage/sp/CMakeLists.txt
+++ b/deployments/protected-storage/config/default-sp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the protected-storage deployment for generic
@@ -26,14 +26,25 @@
set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size")
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# ram backed storage for SFS.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "protected-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/sp
)
-include(../protected-storage.cmake REQUIRED)
+include(../../env/commonsp/ps_sp.cmake REQUIRED)
+include(../../protected-storage.cmake REQUIRED)
+include(../../infra/sfs-ram.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(protected-storage PRIVATE
ARM64=1
)
@@ -51,7 +62,10 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET protected-storage NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/protected-storage/sp/default_protected-storage.dts.in b/deployments/protected-storage/config/default-sp/default_protected-storage.dts.in
similarity index 100%
rename from deployments/protected-storage/sp/default_protected-storage.dts.in
rename to deployments/protected-storage/config/default-sp/default_protected-storage.dts.in
diff --git a/deployments/protected-storage/opteesp/CMakeLists.txt b/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
similarity index 71%
copy from deployments/protected-storage/opteesp/CMakeLists.txt
copy to deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
index 44b7a2b..02b8a9e 100644
--- a/deployments/protected-storage/opteesp/CMakeLists.txt
+++ b/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the protected-storage deployment for opteesp
@@ -26,22 +26,33 @@
SP_NAME "protected-storage"
)
+target_include_directories(protected-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
+#-------------------------------------------------------------------------------
+# Add components - this deployment uses an infrastructure that provides
+# access to a storage partition in a shared secure flash device.
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "protected-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
environments/opteesp
)
-include(../protected-storage.cmake REQUIRED)
+include(../../env/commonsp/ps_sp.cmake REQUIRED)
+include(../../protected-storage.cmake REQUIRED)
+include(../../infra/sfs-shared-flash.cmake REQUIRED)
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#
+#-------------------------------------------------------------------------------
target_compile_definitions(protected-storage PRIVATE
ARM64=1
)
-target_include_directories(protected-storage PRIVATE
- ${TS_ROOT}/deployments/protected-storage/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(protected-storage PRIVATE
-std=c99
@@ -50,7 +61,10 @@
compiler_generate_stripped_elf(TARGET protected-storage NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in
similarity index 82%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in
index 3285835..f57bf2e 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/protected-storage/config/shared-flash-opteesp/default_protected-storage.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,5 +16,5 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/protected-storage/opteesp/optee_sp_user_defines.h b/deployments/protected-storage/config/shared-flash-opteesp/optee_sp_user_defines.h
similarity index 100%
copy from deployments/protected-storage/opteesp/optee_sp_user_defines.h
copy to deployments/protected-storage/config/shared-flash-opteesp/optee_sp_user_defines.h
diff --git a/deployments/protected-storage/common/ps_sp.c b/deployments/protected-storage/env/commonsp/ps_sp.c
similarity index 97%
rename from deployments/protected-storage/common/ps_sp.c
rename to deployments/protected-storage/env/commonsp/ps_sp.c
index 35c6c85..d4db0af 100644
--- a/deployments/protected-storage/common/ps_sp.c
+++ b/deployments/protected-storage/env/commonsp/ps_sp.c
@@ -45,7 +45,7 @@
storage_backend = storage_factory_create(storage_factory_security_class_PROTECTED);
if (!storage_backend) {
- EMSG("Failed to create storage factory");
+ EMSG("Failed to create storage backend");
goto fatal_error;
}
diff --git a/deployments/protected-storage/env/commonsp/ps_sp.cmake b/deployments/protected-storage/env/commonsp/ps_sp.cmake
new file mode 100644
index 0000000..55ac94b
--- /dev/null
+++ b/deployments/protected-storage/env/commonsp/ps_sp.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the protected-storage service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for protected-storage sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "protected-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/common/interface"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(protected-storage PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/ps_sp.c
+)
diff --git a/deployments/protected-storage/common/ps_sp.h b/deployments/protected-storage/env/commonsp/ps_sp.h
similarity index 100%
rename from deployments/protected-storage/common/ps_sp.h
rename to deployments/protected-storage/env/commonsp/ps_sp.h
diff --git a/deployments/protected-storage/infra/sfs-ram.cmake b/deployments/protected-storage/infra/sfs-ram.cmake
new file mode 100644
index 0000000..dc73cd4
--- /dev/null
+++ b/deployments/protected-storage/infra/sfs-ram.cmake
@@ -0,0 +1,23 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the
+# protected-storage service provider that uses the SFS component
+# backed by ram storage. Not intended to production deployments.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "protected-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/secure_storage/backend/secure_flash_store"
+ "components/service/secure_storage/backend/secure_flash_store/flash_fs"
+ "components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/ram"
+ "components/service/secure_storage/factory/common/sfs"
+)
diff --git a/deployments/protected-storage/infra/sfs-shared-flash.cmake b/deployments/protected-storage/infra/sfs-shared-flash.cmake
new file mode 100644
index 0000000..6674e16
--- /dev/null
+++ b/deployments/protected-storage/infra/sfs-shared-flash.cmake
@@ -0,0 +1,33 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the
+# protected-storage service provider that uses the SFS component
+# backed by a storage partition provided by the block storage service.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "protected-storage"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/uuid"
+ "components/rpc/common/caller"
+ "components/rpc/ffarpc/caller/sp"
+ "components/service/locator"
+ "components/service/locator/interface"
+ "components/service/locator/sp"
+ "components/service/locator/sp/ffa"
+ "components/service/secure_storage/backend/secure_flash_store"
+ "components/service/secure_storage/backend/secure_flash_store/flash_fs"
+ "components/service/secure_storage/backend/secure_flash_store/flash"
+ "components/service/secure_storage/backend/secure_flash_store/flash/block_store_adapter"
+ "components/service/secure_storage/factory/sp/sfs_shared_block_store"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/client"
+ "components/service/block_storage/factory/client"
+)
diff --git a/deployments/protected-storage/protected-storage.cmake b/deployments/protected-storage/protected-storage.cmake
index 48b3bde..5822b57 100644
--- a/deployments/protected-storage/protected-storage.cmake
+++ b/deployments/protected-storage/protected-storage.cmake
@@ -8,30 +8,16 @@
add_components(TARGET "protected-storage"
BASE_DIR ${TS_ROOT}
COMPONENTS
- components/common/trace
- components/common/utils
- components/messaging/ffa/libsp
- components/rpc/ffarpc/endpoint
- components/rpc/common/interface
- components/rpc/ffarpc/caller/sp
- components/rpc/common/caller
+ components/common/tlv
components/service/common/include
components/service/common/client
components/service/common/provider
components/service/secure_storage/include
components/service/secure_storage/frontend/secure_storage_provider
- components/service/secure_storage/backend/secure_flash_store
- components/service/secure_storage/backend/secure_flash_store/flash_fs
- components/service/secure_storage/backend/secure_flash_store/flash
- components/service/secure_storage/factory/common/sfs
protocols/rpc/common/packed-c
protocols/service/secure_storage/packed-c
)
-target_sources(protected-storage PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/ps_sp.c
-)
-
target_include_directories(protected-storage PRIVATE
${TS_ROOT}
${TS_ROOT}/components
diff --git a/deployments/se-proxy/opteesp/CMakeLists.txt b/deployments/se-proxy/config/corstone-1000-opteesp/CMakeLists.txt
similarity index 75%
copy from deployments/se-proxy/opteesp/CMakeLists.txt
copy to deployments/se-proxy/config/corstone-1000-opteesp/CMakeLists.txt
index fadbf72..4e26c53 100644
--- a/deployments/se-proxy/opteesp/CMakeLists.txt
+++ b/deployments/se-proxy/config/corstone-1000-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -7,15 +7,13 @@
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
# Set default platform.
-set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+set(TS_PLATFORM "arm/corstone1000" CACHE STRING "Target platform location.")
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
-# The CMakeLists.txt for building the se-proxy deployment for opteesp
+# The CMakeLists.txt for building the se-proxy deployment for Corstone-1000
+# using the "opteesp" environment.
#
-# Builds proxy service providers that communicate with a separate secure element
-# that hosts a set of service endpoints. This deployment is for running in an
-# SEL0 secure partition hosted by OPTEE in the role of SPM.
#-------------------------------------------------------------------------------
include(${TS_ROOT}/environments/opteesp/env.cmake)
project(trusted-services LANGUAGES C ASM)
@@ -30,6 +28,10 @@
SP_NAME "se-proxy"
)
+target_include_directories(se-proxy PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
# Components that are specific to deployment in the opteesp environment.
#
@@ -40,7 +42,9 @@
"environments/opteesp"
)
-include(../se-proxy.cmake REQUIRED)
+include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
+include(../../infra/corstone-1000/infra.cmake REQUIRED)
+include(../../se-proxy.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -48,15 +52,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "se-proxy")
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(se-proxy PRIVATE
ARM64=1
)
-target_include_directories(se-proxy PRIVATE
- ${TS_ROOT}/deployments/se-proxy/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(se-proxy PRIVATE
-std=c99
@@ -66,7 +68,9 @@
compiler_generate_stripped_elf(TARGET se-proxy NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/se-proxy/opteesp/default_se-proxy.dts.in b/deployments/se-proxy/config/corstone-1000-opteesp/default_se-proxy.dts.in
similarity index 90%
rename from deployments/se-proxy/opteesp/default_se-proxy.dts.in
rename to deployments/se-proxy/config/corstone-1000-opteesp/default_se-proxy.dts.in
index a191c76..d0fa26a 100644
--- a/deployments/se-proxy/opteesp/default_se-proxy.dts.in
+++ b/deployments/se-proxy/config/corstone-1000-opteesp/default_se-proxy.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,7 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
device-regions {
compatible = "arm,ffa-manifest-device-regions";
diff --git a/deployments/se-proxy/config/corstone-1000-opteesp/optee_sp_user_defines.h b/deployments/se-proxy/config/corstone-1000-opteesp/optee_sp_user_defines.h
new file mode 100644
index 0000000..efc1dfa
--- /dev/null
+++ b/deployments/se-proxy/config/corstone-1000-opteesp/optee_sp_user_defines.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef SP_HEADER_DEFINES_H
+#define SP_HEADER_DEFINES_H
+
+#define OPTEE_SP_FLAGS 0
+
+/* Provisioned stack size */
+#define OPTEE_SP_STACK_SIZE (64 * 1024)
+
+#endif /* SP_HEADER_DEFINES_H */
diff --git a/deployments/se-proxy/opteesp/CMakeLists.txt b/deployments/se-proxy/config/default-opteesp/CMakeLists.txt
similarity index 83%
rename from deployments/se-proxy/opteesp/CMakeLists.txt
rename to deployments/se-proxy/config/default-opteesp/CMakeLists.txt
index fadbf72..5ecef65 100644
--- a/deployments/se-proxy/opteesp/CMakeLists.txt
+++ b/deployments/se-proxy/config/default-opteesp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the se-proxy deployment for opteesp
@@ -30,6 +30,10 @@
SP_NAME "se-proxy"
)
+target_include_directories(se-proxy PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
# Components that are specific to deployment in the opteesp environment.
#
@@ -40,7 +44,9 @@
"environments/opteesp"
)
-include(../se-proxy.cmake REQUIRED)
+include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
+include(../../infra/stub/stub.cmake REQUIRED)
+include(../../se-proxy.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -48,15 +54,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "se-proxy")
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(se-proxy PRIVATE
ARM64=1
)
-target_include_directories(se-proxy PRIVATE
- ${TS_ROOT}/deployments/se-proxy/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(se-proxy PRIVATE
-std=c99
@@ -66,7 +70,9 @@
compiler_generate_stripped_elf(TARGET se-proxy NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/protected-storage/opteesp/default_protected-storage.dts.in b/deployments/se-proxy/config/default-opteesp/default_se-proxy.dts.in
similarity index 78%
copy from deployments/protected-storage/opteesp/default_protected-storage.dts.in
copy to deployments/se-proxy/config/default-opteesp/default_se-proxy.dts.in
index 3285835..732bae3 100644
--- a/deployments/protected-storage/opteesp/default_protected-storage.dts.in
+++ b/deployments/se-proxy/config/default-opteesp/default_se-proxy.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,11 +10,11 @@
compatible = "arm,ffa-manifest-1.0";
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <@EXPORT_SP_UUID_DT@>;
- description = "PS";
+ description = "SE Proxy";
execution-ctx-count = <1>;
exception-level = <1>; /* S-EL0 */
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/se-proxy/opteesp/optee_sp_user_defines.h b/deployments/se-proxy/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/se-proxy/opteesp/optee_sp_user_defines.h
rename to deployments/se-proxy/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/se-proxy/sp/CMakeLists.txt b/deployments/se-proxy/config/default-sp/CMakeLists.txt
similarity index 84%
rename from deployments/se-proxy/sp/CMakeLists.txt
rename to deployments/se-proxy/config/default-sp/CMakeLists.txt
index ea95008..f6c1f0d 100644
--- a/deployments/se-proxy/sp/CMakeLists.txt
+++ b/deployments/se-proxy/config/default-sp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the se-proxy deployment for generic sp
@@ -40,7 +40,9 @@
environments/sp
)
-include(../se-proxy.cmake REQUIRED)
+include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
+include(../../infra/stub/stub.cmake REQUIRED)
+include(../../se-proxy.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -48,7 +50,9 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "se-proxy")
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(se-proxy PRIVATE
ARM64=1
)
@@ -66,7 +70,9 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/se-proxy/sp/default_se-proxy.dts.in b/deployments/se-proxy/config/default-sp/default_se-proxy.dts.in
similarity index 100%
rename from deployments/se-proxy/sp/default_se-proxy.dts.in
rename to deployments/se-proxy/config/default-sp/default_se-proxy.dts.in
diff --git a/deployments/se-proxy/common/se_proxy_sp.c b/deployments/se-proxy/env/commonsp/se_proxy_sp.c
similarity index 96%
rename from deployments/se-proxy/common/se_proxy_sp.c
rename to deployments/se-proxy/env/commonsp/se_proxy_sp.c
index a37396f..45fcb38 100644
--- a/deployments/se-proxy/common/se_proxy_sp.c
+++ b/deployments/se-proxy/env/commonsp/se_proxy_sp.c
@@ -11,8 +11,8 @@
#include "sp_discovery.h"
#include "sp_rxtx.h"
#include "trace.h"
-#include "service_proxy_factory.h"
-#include "../se_proxy_interfaces.h"
+#include "deployments/se-proxy/infra/service_proxy_factory.h"
+#include "deployments/se-proxy/se_proxy_interfaces.h"
static bool sp_init(uint16_t *own_sp_id);
diff --git a/deployments/se-proxy/env/commonsp/se_proxy_sp.cmake b/deployments/se-proxy/env/commonsp/se_proxy_sp.cmake
new file mode 100644
index 0000000..32bb8e9
--- /dev/null
+++ b/deployments/se-proxy/env/commonsp/se_proxy_sp.cmake
@@ -0,0 +1,28 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the se-proxy service provider
+# within a secure partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for se-proxy sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/ffarpc/endpoint"
+)
+
+target_sources(se-proxy PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/se_proxy_sp.c
+)
diff --git a/deployments/se-proxy/common/se_proxy_sp.h b/deployments/se-proxy/env/commonsp/se_proxy_sp.h
similarity index 100%
rename from deployments/se-proxy/common/se_proxy_sp.h
rename to deployments/se-proxy/env/commonsp/se_proxy_sp.h
diff --git a/deployments/se-proxy/infra/corstone-1000/infra.cmake b/deployments/se-proxy/infra/corstone-1000/infra.cmake
new file mode 100644
index 0000000..675f2cd
--- /dev/null
+++ b/deployments/se-proxy/infra/corstone-1000/infra.cmake
@@ -0,0 +1,37 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# A stub infrastructure for the se-proxy. Infrastructure dependencies are all
+# realized with stub components that do absolutely nothing.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/rpc/common/caller"
+ "components/rpc/psa_ipc"
+ "components/messaging/openamp/sp"
+ "components/service/attestation/client/psa_ipc"
+ "components/service/attestation/key_mngr/local"
+ "components/service/attestation/reporter/psa_ipc"
+ "components/service/crypto/backend/psa_ipc"
+ "components/service/secure_storage/backend/secure_storage_ipc"
+)
+
+# libmetal
+include(${TS_ROOT}/external/openamp/libmetal.cmake)
+
+# OpenAMP
+include(${TS_ROOT}/external/openamp/openamp.cmake)
+target_link_libraries(se-proxy PRIVATE openamp libmetal)
+
+target_sources(se-proxy PRIVATE
+
+ ${CMAKE_CURRENT_LIST_DIR}/service_proxy_factory.c
+)
diff --git a/deployments/se-proxy/common/service_proxy_factory.c b/deployments/se-proxy/infra/corstone-1000/service_proxy_factory.c
similarity index 100%
rename from deployments/se-proxy/common/service_proxy_factory.c
rename to deployments/se-proxy/infra/corstone-1000/service_proxy_factory.c
diff --git a/deployments/se-proxy/common/service_proxy_factory.h b/deployments/se-proxy/infra/service_proxy_factory.h
similarity index 100%
rename from deployments/se-proxy/common/service_proxy_factory.h
rename to deployments/se-proxy/infra/service_proxy_factory.h
diff --git a/deployments/se-proxy/infra/stub/service_proxy_factory.c b/deployments/se-proxy/infra/stub/service_proxy_factory.c
new file mode 100644
index 0000000..acfb6e8
--- /dev/null
+++ b/deployments/se-proxy/infra/stub/service_proxy_factory.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stddef.h>
+#include <rpc/common/endpoint/rpc_interface.h>
+#include <service/attestation/provider/attest_provider.h>
+#include <service/attestation/provider/serializer/packed-c/packedc_attest_provider_serializer.h>
+#include <service/crypto/factory/crypto_provider_factory.h>
+#include <service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.h>
+
+/* Stub backends */
+#include <service/crypto/backend/stub/stub_crypto_backend.h>
+#include <service/secure_storage/backend/mock_store/mock_store.h>
+
+struct rpc_interface *attest_proxy_create(void)
+{
+ struct rpc_interface *attest_iface;
+
+ /* Static objects for proxy instance */
+ static struct attest_provider attest_provider;
+
+ /* Initialize the service provider */
+ attest_iface = attest_provider_init(&attest_provider);
+
+ attest_provider_register_serializer(&attest_provider,
+ TS_RPC_ENCODING_PACKED_C, packedc_attest_provider_serializer_instance());
+
+ return attest_iface;
+}
+
+struct rpc_interface *crypto_proxy_create(void)
+{
+ struct rpc_interface *crypto_iface = NULL;
+ struct crypto_provider *crypto_provider;
+
+ if (stub_crypto_backend_init() == PSA_SUCCESS) {
+
+ crypto_provider = crypto_provider_factory_create();
+ crypto_iface = service_provider_get_rpc_interface(&crypto_provider->base_provider);
+ }
+
+ return crypto_iface;
+}
+
+struct rpc_interface *ps_proxy_create(void)
+{
+ static struct mock_store ps_backend;
+ static struct secure_storage_provider ps_provider;
+
+ struct storage_backend *backend = mock_store_init(&ps_backend);
+
+ return secure_storage_provider_init(&ps_provider, backend);
+}
+
+struct rpc_interface *its_proxy_create(void)
+{
+ static struct mock_store its_backend;
+ static struct secure_storage_provider its_provider;
+
+ struct storage_backend *backend = mock_store_init(&its_backend);
+
+ return secure_storage_provider_init(&its_provider, backend);
+}
diff --git a/deployments/se-proxy/infra/stub/stub.cmake b/deployments/se-proxy/infra/stub/stub.cmake
new file mode 100644
index 0000000..a364f8d
--- /dev/null
+++ b/deployments/se-proxy/infra/stub/stub.cmake
@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# A stub infrastructure for the se-proxy. Infrastructure dependencies are all
+# realized with stub components that do absolutely nothing.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/rpc/dummy"
+ "components/rpc/common/caller"
+ "components/service/attestation/reporter/stub"
+ "components/service/attestation/key_mngr/stub"
+ "components/service/crypto/backend/stub"
+ "components/service/crypto/client/psa"
+ "components/service/secure_storage/backend/mock_store"
+)
+
+target_sources(se-proxy PRIVATE
+
+ ${CMAKE_CURRENT_LIST_DIR}/service_proxy_factory.c
+)
diff --git a/deployments/se-proxy/se-proxy.cmake b/deployments/se-proxy/se-proxy.cmake
index 76056c1..2643cfb 100644
--- a/deployments/se-proxy/se-proxy.cmake
+++ b/deployments/se-proxy/se-proxy.cmake
@@ -8,18 +8,7 @@
add_components(TARGET "se-proxy"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
- "components/common/trace"
- "components/common/utils"
- "protocols/rpc/common/packed-c"
- "protocols/service/secure_storage/packed-c"
- "protocols/service/crypto/protobuf"
"components/common/tlv"
- "components/config/ramstore"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/rpc/psa_ipc"
"components/rpc/common/interface"
"components/rpc/common/demux"
"components/service/common/include"
@@ -28,6 +17,7 @@
"components/service/common/provider"
"components/service/discovery/provider"
"components/service/discovery/provider/serializer/packed-c"
+ "components/service/crypto/client/psa"
"components/service/crypto/include"
"components/service/crypto/provider"
"components/service/crypto/provider/serializer/protobuf"
@@ -45,26 +35,12 @@
"components/service/crypto/factory/full"
"components/service/secure_storage/include"
"components/service/secure_storage/frontend/secure_storage_provider"
- "components/service/secure_storage/backend/secure_storage_ipc"
"components/service/attestation/include"
"components/service/attestation/provider"
"components/service/attestation/provider/serializer/packed-c"
- "components/service/attestation/reporter/psa_ipc"
- "components/service/attestation/client/psa_ipc"
- "components/messaging/openamp/sp"
-
- # Stub service provider backends
- "components/rpc/dummy"
- "components/rpc/common/caller"
- "components/service/attestation/key_mngr/local"
- "components/service/crypto/backend/psa_ipc"
- "components/service/crypto/client/psa"
- "components/service/secure_storage/backend/mock_store"
-)
-
-target_sources(se-proxy PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/se_proxy_sp.c
- ${CMAKE_CURRENT_LIST_DIR}/common/service_proxy_factory.c
+ "protocols/rpc/common/packed-c"
+ "protocols/service/secure_storage/packed-c"
+ "protocols/service/crypto/protobuf"
)
#-------------------------------------------------------------------------------
@@ -73,17 +49,10 @@
#-------------------------------------------------------------------------------
# Nanopb
-include(../../../external/nanopb/nanopb.cmake)
+include(${TS_ROOT}/external/nanopb/nanopb.cmake)
target_link_libraries(se-proxy PRIVATE nanopb::protobuf-nanopb-static)
protobuf_generate_all(TGT "se-proxy" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
-# libmetal
-include(../../../external/openamp/libmetal.cmake)
-
-# OpenAMP
-include(../../../external/openamp/openamp.cmake)
-target_link_libraries(se-proxy PRIVATE openamp libmetal)
-
#################################################################
target_include_directories(se-proxy PRIVATE
diff --git a/deployments/sfs-demo/opteesp/default_sfs-demo.dts.in b/deployments/sfs-demo/opteesp/default_sfs-demo.dts.in
index e8e6614..8bf81ff 100644
--- a/deployments/sfs-demo/opteesp/default_sfs-demo.dts.in
+++ b/deployments/sfs-demo/opteesp/default_sfs-demo.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,5 +16,5 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/smm-gateway/opteesp/CMakeLists.txt b/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
similarity index 84%
rename from deployments/smm-gateway/opteesp/CMakeLists.txt
rename to deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
index ac7369f..be5f293 100644
--- a/deployments/smm-gateway/opteesp/CMakeLists.txt
+++ b/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the smm-gateway deployment for opteesp
@@ -33,6 +33,10 @@
set(MM_COMM_BUFFER_ADDRESS "0x00000008 0x81000000" CACHE STRING "Address of MM communicte buffer in 64 bit DTS format")
set(MM_COMM_BUFFER_PAGE_COUNT "8" CACHE STRING "Size of the MM communicate buffer in 4k pages")
+target_include_directories(smm-gateway PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
+
#-------------------------------------------------------------------------------
# Components that are specific to deployment in the opteesp environment.
#
@@ -43,7 +47,9 @@
"environments/opteesp"
)
-include(../smm-gateway.cmake REQUIRED)
+include(../../env/commonsp/smm_gateway_sp.cmake REQUIRED)
+include(../../infra/psa-varstore.cmake REQUIRED)
+include(../../smm-gateway.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -51,16 +57,13 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "smm-gateway")
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(smm-gateway PRIVATE
ARM64=1
)
-target_include_directories(smm-gateway PRIVATE
- ${TS_ROOT}/deployments/smm-gateway/opteesp
-)
-
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(smm-gateway PRIVATE
-std=c99
@@ -70,7 +73,9 @@
compiler_generate_stripped_elf(TARGET smm-gateway NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/smm-gateway/opteesp/default_smm-gateway.dts.in b/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in
similarity index 88%
rename from deployments/smm-gateway/opteesp/default_smm-gateway.dts.in
rename to deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in
index 6b5c6aa..0d629b8 100644
--- a/deployments/smm-gateway/opteesp/default_smm-gateway.dts.in
+++ b/deployments/smm-gateway/config/default-opteesp/default_smm-gateway.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,7 +16,7 @@
execution-state = <0>; /* AArch64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
memory-regions {
compatible = "arm,ffa-manifest-memory-regions";
diff --git a/deployments/smm-gateway/opteesp/optee_sp_user_defines.h b/deployments/smm-gateway/config/default-opteesp/optee_sp_user_defines.h
similarity index 100%
rename from deployments/smm-gateway/opteesp/optee_sp_user_defines.h
rename to deployments/smm-gateway/config/default-opteesp/optee_sp_user_defines.h
diff --git a/deployments/smm-gateway/sp/CMakeLists.txt b/deployments/smm-gateway/config/default-sp/CMakeLists.txt
similarity index 84%
rename from deployments/smm-gateway/sp/CMakeLists.txt
rename to deployments/smm-gateway/config/default-sp/CMakeLists.txt
index 38db310..d313461 100644
--- a/deployments/smm-gateway/sp/CMakeLists.txt
+++ b/deployments/smm-gateway/config/default-sp/CMakeLists.txt
@@ -8,7 +8,7 @@
# Set default platform.
set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
#-------------------------------------------------------------------------------
# The CMakeLists.txt for building the smm-gateway deployment for generic sp
@@ -43,7 +43,9 @@
environments/sp
)
-include(../smm-gateway.cmake REQUIRED)
+include(../../env/commonsp/smm_gateway_sp.cmake REQUIRED)
+include(../../infra/psa-varstore.cmake REQUIRED)
+include(../../smm-gateway.cmake REQUIRED)
#-------------------------------------------------------------------------------
# Set target platform to provide drivers needed by the deployment
@@ -51,8 +53,9 @@
#-------------------------------------------------------------------------------
add_platform(TARGET "smm-gateway")
-#################################################################
-
+#-------------------------------------------------------------------------------
+# Deployment specific build options
+#-------------------------------------------------------------------------------
target_compile_definitions(smm-gateway PRIVATE
ARM64=1
)
@@ -70,7 +73,9 @@
include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
export_memory_regions_to_manifest(TARGET smm-gateway NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
-######################################## install
+#-------------------------------------------------------------------------------
+# Deployment specific install options
+#-------------------------------------------------------------------------------
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
endif()
diff --git a/deployments/smm-gateway/sp/default_smm-gateway.dts.in b/deployments/smm-gateway/config/default-sp/default_smm-gateway.dts.in
similarity index 100%
rename from deployments/smm-gateway/sp/default_smm-gateway.dts.in
rename to deployments/smm-gateway/config/default-sp/default_smm-gateway.dts.in
diff --git a/deployments/smm-gateway/linux-pc/CMakeLists.txt b/deployments/smm-gateway/config/linux-pc/CMakeLists.txt
similarity index 97%
rename from deployments/smm-gateway/linux-pc/CMakeLists.txt
rename to deployments/smm-gateway/config/linux-pc/CMakeLists.txt
index bec5921..9ee6e49 100644
--- a/deployments/smm-gateway/linux-pc/CMakeLists.txt
+++ b/deployments/smm-gateway/config/linux-pc/CMakeLists.txt
@@ -5,7 +5,7 @@
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
-include(../../deployment.cmake REQUIRED)
+include(../../../deployment.cmake REQUIRED)
project(smm-gateway-unit-tests LANGUAGES CXX C)
diff --git a/deployments/smm-gateway/common/smm_gateway_sp.c b/deployments/smm-gateway/env/commonsp/smm_gateway_sp.c
similarity index 98%
rename from deployments/smm-gateway/common/smm_gateway_sp.c
rename to deployments/smm-gateway/env/commonsp/smm_gateway_sp.c
index 90350da..98388bb 100644
--- a/deployments/smm-gateway/common/smm_gateway_sp.c
+++ b/deployments/smm-gateway/env/commonsp/smm_gateway_sp.c
@@ -4,7 +4,7 @@
*/
#include "rpc/ffarpc/endpoint/ffarpc_call_ep.h"
-#include "smm_gateway.h"
+#include "deployments/smm-gateway/common/smm_gateway.h"
#include "config/ramstore/config_ramstore.h"
#include "config/interface/config_store.h"
#include "config/loader/sp/sp_config_loader.h"
diff --git a/deployments/smm-gateway/env/commonsp/smm_gateway_sp.cmake b/deployments/smm-gateway/env/commonsp/smm_gateway_sp.cmake
new file mode 100644
index 0000000..1602522
--- /dev/null
+++ b/deployments/smm-gateway/env/commonsp/smm_gateway_sp.cmake
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Includes components needed for deploying the smm-gateway within a secure
+# partition.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Common components for smm-gateway sp deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "smm-gateway"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/ramstore"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "components/rpc/ffarpc/endpoint"
+ "components/rpc/ffarpc/caller/sp"
+ "components/rpc/mm_communicate/endpoint/sp"
+ "components/service/locator/sp"
+ "components/service/locator/sp/ffa"
+ "components/service/smm_variable/frontend/mm_communicate"
+)
+
+target_sources(smm-gateway PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/smm_gateway_sp.c
+ ${TS_ROOT}/deployments/smm-gateway/common/smm_gateway.c
+)
diff --git a/deployments/smm-gateway/common/smm_gateway_sp.h b/deployments/smm-gateway/env/commonsp/smm_gateway_sp.h
similarity index 100%
rename from deployments/smm-gateway/common/smm_gateway_sp.h
rename to deployments/smm-gateway/env/commonsp/smm_gateway_sp.h
diff --git a/deployments/smm-gateway/infra/psa-varstore.cmake b/deployments/smm-gateway/infra/psa-varstore.cmake
new file mode 100644
index 0000000..2c33178
--- /dev/null
+++ b/deployments/smm-gateway/infra/psa-varstore.cmake
@@ -0,0 +1,23 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# An infrastrucure to support the smm-gateway. Uses PSA storage for persistent
+# storage of NV UEFI variables.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET "smm-gateway"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/rpc/common/caller"
+ "components/service/common/client"
+ "components/service/locator"
+ "components/service/locator/interface"
+ "components/service/secure_storage/backend/secure_storage_client"
+ "protocols/service/secure_storage/packed-c"
+)
diff --git a/deployments/smm-gateway/smm-gateway.cmake b/deployments/smm-gateway/smm-gateway.cmake
index 70cb805..e3eca34 100644
--- a/deployments/smm-gateway/smm-gateway.cmake
+++ b/deployments/smm-gateway/smm-gateway.cmake
@@ -8,38 +8,15 @@
add_components(TARGET "smm-gateway"
BASE_DIR ${TS_ROOT}
COMPONENTS
- "components/common/fdt"
- "components/common/trace"
- "components/common/utils"
"components/common/uuid"
- "components/config/ramstore"
- "components/config/loader/sp"
- "components/messaging/ffa/libsp"
- "components/rpc/ffarpc/endpoint"
- "components/rpc/ffarpc/caller/sp"
- "components/rpc/mm_communicate/endpoint/sp"
- "components/rpc/common/caller"
"components/rpc/common/interface"
"components/service/common/include"
- "components/service/common/client"
"components/service/common/provider"
- "components/service/locator"
- "components/service/locator/interface"
- "components/service/locator/sp"
- "components/service/locator/sp/ffa"
"components/service/smm_variable/backend"
- "components/service/smm_variable/frontend/mm_communicate"
"components/service/smm_variable/provider"
"components/service/secure_storage/include"
- "components/service/secure_storage/backend/secure_storage_client"
"components/service/secure_storage/backend/mock_store"
"protocols/rpc/common/packed-c"
- "protocols/service/secure_storage/packed-c"
-)
-
-target_sources(smm-gateway PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/common/smm_gateway_sp.c
- ${CMAKE_CURRENT_LIST_DIR}/common/smm_gateway.c
)
target_include_directories(smm-gateway PRIVATE
diff --git a/deployments/spm-test1/opteesp/default_spm_test1.dts.in b/deployments/spm-test1/opteesp/default_spm_test1.dts.in
index 88311ec..213c341 100644
--- a/deployments/spm-test1/opteesp/default_spm_test1.dts.in
+++ b/deployments/spm-test1/opteesp/default_spm_test1.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,6 @@
execution-state = <0>; /* AARCH64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
run-time-model = <1>; /* Run to completion */
};
diff --git a/deployments/spm-test2/opteesp/default_spm_test2.dts.in b/deployments/spm-test2/opteesp/default_spm_test2.dts.in
index 94073bd..07beddb 100644
--- a/deployments/spm-test2/opteesp/default_spm_test2.dts.in
+++ b/deployments/spm-test2/opteesp/default_spm_test2.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,6 @@
execution-state = <0>; /* AARCH64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
run-time-model = <1>; /* Run to completion */
};
diff --git a/deployments/spm-test3/opteesp/default_spm_test3.dts.in b/deployments/spm-test3/opteesp/default_spm_test3.dts.in
index 58b2251..3203d76 100644
--- a/deployments/spm-test3/opteesp/default_spm_test3.dts.in
+++ b/deployments/spm-test3/opteesp/default_spm_test3.dts.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,5 +18,5 @@
execution-state = <0>; /* AARCH64 */
xlat-granule = <0>; /* 4KiB */
messaging-method = <3>; /* Direct messaging only */
- legacy-elf-format = <1>;
+ elf-format = <1>;
};
diff --git a/deployments/ts-service-test/linux-pc/CMakeLists.txt b/deployments/ts-service-test/linux-pc/CMakeLists.txt
index b3739c0..99c1db2 100644
--- a/deployments/ts-service-test/linux-pc/CMakeLists.txt
+++ b/deployments/ts-service-test/linux-pc/CMakeLists.txt
@@ -82,6 +82,11 @@
"components/service/test_runner/test/service"
"components/service/smm_variable/client/cpp"
"components/service/smm_variable/test/service"
+ "components/service/block_storage/block_store"
+ "components/service/block_storage/block_store/client"
+ "components/service/block_storage/factory/client"
+ "components/service/block_storage/test/service"
+ "components/common/uuid"
)
#-------------------------------------------------------------------------------