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/tools/cmake/common/ExportSp.cmake b/tools/cmake/common/ExportSp.cmake
index 78701b9..ceb7700 100644
--- a/tools/cmake/common/ExportSp.cmake
+++ b/tools/cmake/common/ExportSp.cmake
@@ -15,6 +15,7 @@
 		export_sp(
 			SP_FFA_UUID_CANON <uuid_str_canon>
 			SP_NAME <name> MK_IN <.mk path>
+			SP_BOOT_ORDER <number>
 			DTS_IN <DTS path>
 			DTS_MEM_REGIONS <Memory region manifest path>
 			JSON_IN <JSON path>
@@ -29,6 +30,9 @@
 	The UUID of the SP binary a canonical string. When not set use the
 	SP_FFA_UUID_CANON as the SP_BIN_UUID_CANON.
 
+	``SP_BOOT_ORDER``
+	Boot-order of the SP. 0 will be booted first.
+
 	``SP_NAME``
 	The name of the SP.
 
@@ -47,7 +51,7 @@
 #]===]
 function (export_sp)
 	set(options)
-	set(oneValueArgs SP_FFA_UUID_CANON SP_BIN_UUID_CANON SP_NAME MK_IN DTS_IN DTS_MEM_REGIONS JSON_IN)
+	set(oneValueArgs SP_FFA_UUID_CANON SP_BIN_UUID_CANON SP_BOOT_ORDER SP_NAME MK_IN DTS_IN DTS_MEM_REGIONS JSON_IN)
 	set(multiValueArgs)
 	cmake_parse_arguments(EXPORT "${options}" "${oneValueArgs}"
 						"${multiValueArgs}" ${ARGN} )
@@ -59,6 +63,9 @@
 		# We use the same UUID for the binary and FF-A if the UUID of the SP binary is not set
 		set(EXPORT_SP_BIN_UUID_CANON ${EXPORT_SP_FFA_UUID_CANON})
 	endif()
+	if(NOT DEFINED EXPORT_SP_BOOT_ORDER)
+		message(FATAL_ERROR "export_sp: mandatory parameter SP_BOOT_ORDER not defined!")
+	endif()
 	if(NOT DEFINED EXPORT_SP_NAME)
 		message(FATAL_ERROR "export_sp: mandatory parameter SP_NAME not defined!")
 	endif()