Add SPM test for OP_TEE
Add test for testing the SPM component. We added a linux arm host
application and 3 SPs. The SPs share the same code but are only build
with different UUIDs.
The test performs the following tests:
-Test the communication between the Normal World and a SP and SP to SP
communication.
-Test memory sharing between Normal World and SP and SP to SP.
The tests can be ran by running the coresponding xtests
xtest 90
Signed-off-by: Jelle Sels <jelle.sels@arm.com>
Change-Id: Iebb7d4242bc3def233cf00675aaae5a5d9c3b578
diff --git a/deployments/spm-test1/opteesp/CMakeLists.txt b/deployments/spm-test1/opteesp/CMakeLists.txt
new file mode 100644
index 0000000..7a2d614
--- /dev/null
+++ b/deployments/spm-test1/opteesp/CMakeLists.txt
@@ -0,0 +1,32 @@
+#-------------------------------------------------------------------------------
+# 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(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
+include(../../deployment.cmake REQUIRED)
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+
+project(trusted-services LANGUAGES C ASM)
+add_executable(spm-test1)
+
+set(SP_UUID_CANON "5c9edbc3-7b3a-4367-9f83-7c191ae86a37")
+set(SP_NUMBER 1)
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+#-------------------------------------------------------------------------------
+# Components that are spm-test specific to deployment in the opteesp
+# environment.
+#-------------------------------------------------------------------------------
+add_components(TARGET "spm-test${SP_NUMBER}"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "environments/opteesp"
+)
+
diff --git a/deployments/spm-test1/opteesp/default_spm_test1.dts.in b/deployments/spm-test1/opteesp/default_spm_test1.dts.in
new file mode 100644
index 0000000..88311ec
--- /dev/null
+++ b/deployments/spm-test1/opteesp/default_spm_test1.dts.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 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 */
+
+ /* Properties */
+ description = "SPMC test SP1";
+ uuid = <@EXPORT_SP_UUID_DT@>;
+ 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>;
+ run-time-model = <1>; /* Run to completion */
+};
diff --git a/deployments/spm-test2/opteesp/CMakeLists.txt b/deployments/spm-test2/opteesp/CMakeLists.txt
new file mode 100644
index 0000000..a3c3408
--- /dev/null
+++ b/deployments/spm-test2/opteesp/CMakeLists.txt
@@ -0,0 +1,31 @@
+#-------------------------------------------------------------------------------
+# 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(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
+include(../../deployment.cmake REQUIRED)
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+
+project(trusted-services LANGUAGES C ASM)
+add_executable(spm-test2)
+
+set(SP_UUID_CANON "7817164c-c40c-4d1a-867a-9bb2278cf41a")
+set(SP_NUMBER 2)
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+#-------------------------------------------------------------------------------
+# Components that are spm-test specific to deployment in the opteesp
+# environment.
+#-------------------------------------------------------------------------------
+add_components(TARGET "spm-test${SP_NUMBER}"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "environments/opteesp"
+)
diff --git a/deployments/spm-test2/opteesp/default_spm_test2.dts.in b/deployments/spm-test2/opteesp/default_spm_test2.dts.in
new file mode 100644
index 0000000..94073bd
--- /dev/null
+++ b/deployments/spm-test2/opteesp/default_spm_test2.dts.in
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 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 */
+
+ /* Properties */
+ description = "SPMC test SP2";
+ uuid = <@EXPORT_SP_UUID_DT@>;
+ 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>;
+ run-time-model = <1>; /* Run to completion */
+};
diff --git a/deployments/spm-test3/opteesp/CMakeLists.txt b/deployments/spm-test3/opteesp/CMakeLists.txt
new file mode 100644
index 0000000..f756bb7
--- /dev/null
+++ b/deployments/spm-test3/opteesp/CMakeLists.txt
@@ -0,0 +1,31 @@
+#-------------------------------------------------------------------------------
+# 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(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
+include(../../deployment.cmake REQUIRED)
+include(${TS_ROOT}/environments/opteesp/env.cmake)
+
+project(trusted-services LANGUAGES C ASM)
+add_executable(spm-test3)
+
+set(SP_UUID_CANON "23eb0100-e32a-4497-9052-2f11e584afa6")
+set(SP_NUMBER 3)
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+#-------------------------------------------------------------------------------
+# Components that are spm-test specific to deployment in the opteesp
+# environment.
+#-------------------------------------------------------------------------------
+add_components(TARGET "spm-test${SP_NUMBER}"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/common/fdt"
+ "components/common/trace"
+ "components/common/utils"
+ "components/config/loader/sp"
+ "components/messaging/ffa/libsp"
+ "environments/opteesp"
+)
diff --git a/deployments/spm-test3/opteesp/default_spm_test3.dts.in b/deployments/spm-test3/opteesp/default_spm_test3.dts.in
new file mode 100644
index 0000000..58b2251
--- /dev/null
+++ b/deployments/spm-test3/opteesp/default_spm_test3.dts.in
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 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 */
+
+ /* Properties */
+ description = "SPMC test SP3";
+ uuid = <@EXPORT_SP_UUID_DT@>;
+ 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>;
+};