Add boot-order property to SP manifests

Capture the boot-order in the SP manifest files for each SP to help
portability. The legacy way to set the boot order is integration
system, packaging method and SPMC implementation specific.

The boot order of SP is dictated by service dependency and relative
boot order of TS SPs should be as follows:
0 - logging
1 - block-storage
1 - se-proxy (corstone1000-opteesp)
2 - se-proxy (default-opteesp or default-sp)
2 - internal-trusted-storage
3 - protected-storage
4 - crypto
5 - attestation
6 - se-proxy
7 - fwu
8 - smm-gateway

Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: I4b93015c68e7261fdc87434a6c7f4ec86965af54
diff --git a/deployments/crypto/config/default-opteesp/CMakeLists.txt b/deployments/crypto/config/default-opteesp/CMakeLists.txt
index 1e4069d..11e2dfb 100644
--- a/deployments/crypto/config/default-opteesp/CMakeLists.txt
+++ b/deployments/crypto/config/default-opteesp/CMakeLists.txt
@@ -30,6 +30,7 @@
 set(SP_BIN_UUID_CANON "d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0")
 set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}")
 set(SP_HEAP_SIZE "490 * 1024" CACHE STRING "SP heap size in bytes")
+set(SP_BOOT_ORDER "4")
 set(TRACE_PREFIX "CRYPTO" CACHE STRING "Trace prefix")
 
 target_include_directories(crypto PRIVATE
@@ -91,6 +92,7 @@
 export_sp(
 	SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
 	SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
+	SP_BOOT_ORDER ${SP_BOOT_ORDER}
 	SP_NAME "crypto"
 	MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
 	DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_crypto.dts.in
diff --git a/deployments/crypto/config/default-opteesp/default_crypto.dts.in b/deployments/crypto/config/default-opteesp/default_crypto.dts.in
index c900636..729dca7 100644
--- a/deployments/crypto/config/default-opteesp/default_crypto.dts.in
+++ b/deployments/crypto/config/default-opteesp/default_crypto.dts.in
@@ -15,6 +15,7 @@
 	exception-level = <1>; /* S-EL0 */
 	execution-state = <0>; /* AArch64 */
 	xlat-granule = <0>; /* 4KiB */
+	boot-order = /bits/ 16 <@EXPORT_SP_BOOT_ORDER@>;
 	messaging-method = <3>; /* Direct messaging only */
 	ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */
 	elf-format = <1>;
diff --git a/deployments/crypto/config/default-sp/CMakeLists.txt b/deployments/crypto/config/default-sp/CMakeLists.txt
index 83594c5..b327728 100644
--- a/deployments/crypto/config/default-sp/CMakeLists.txt
+++ b/deployments/crypto/config/default-sp/CMakeLists.txt
@@ -35,6 +35,7 @@
 set(TRACE_PREFIX "CRYPTO" CACHE STRING "Trace prefix")
 set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
 set(SP_HEAP_SIZE "490 * 1024" CACHE STRING "Heap size")
+set(SP_BOOT_ORDER "4")
 
 #-------------------------------------------------------------------------------
 #  Components that are specific to deployment in the opteesp environment.
@@ -91,6 +92,7 @@
 export_sp(
 	SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
 	SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
+	SP_BOOT_ORDER ${SP_BOOT_ORDER}
 	SP_NAME ${SP_NAME}
 	DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
 	DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi
diff --git a/deployments/crypto/config/default-sp/default_crypto.dts.in b/deployments/crypto/config/default-sp/default_crypto.dts.in
index fcc7ce5..ef63c63 100644
--- a/deployments/crypto/config/default-sp/default_crypto.dts.in
+++ b/deployments/crypto/config/default-sp/default_crypto.dts.in
@@ -15,6 +15,7 @@
 	exception-level = <1>; /* S-EL0 */
 	execution-state = <0>; /* AArch64 */
 	xlat-granule = <0>; /* 4KiB */
+	boot-order = /bits/ 16 <@EXPORT_SP_BOOT_ORDER@>;
 	messaging-method = <3>; /* Direct messaging only */
 	ns-interrupts-action = <2>; /* Non-secure interrupts are signaled */