Refactor SPs to use the TS RPC UUID as FF-A UUID

Change all SPs to use the same RPC UUID as their FF-A UUID. The SPs will
keep their SP UUID as the name of the binary but the UUID stored in the
SP manifest will be the protocol UUID. This means all clients will
discover TS SPs build with this option with the same UUID.

Signed-off-by: Jelle Sels <jelle.sels@arm.com>
Signed-off-by: Imre Kis <imre.kis@arm.com>
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Change-Id: I662b6209cd9526b058016a907308a880c1944e7d
diff --git a/components/rpc/ffarpc/endpoint/component.cmake b/components/rpc/ffarpc/endpoint/component.cmake
index 9e43ac5..24434ee 100644
--- a/components/rpc/ffarpc/endpoint/component.cmake
+++ b/components/rpc/ffarpc/endpoint/component.cmake
@@ -12,3 +12,13 @@
 	"${CMAKE_CURRENT_LIST_DIR}/ffarpc_call_ep.c"
 	)
 
+if(NOT ((TS_ENV STREQUAL "linux-pc") OR (TS_ENV STREQUAL "arm-linux")))
+	if(NOT DEFINED TS_RPC_UUID_CANON)
+		message(FATAL_ERROR "Mandatory parameter TS_RPC_UUID_CANON is not defined.")
+	endif()
+
+	# Verify that SP is using the TS protocol.
+	if (NOT "${SP_FFA_UUID_CANON}" STREQUAL "${TS_RPC_UUID_CANON}")
+		message(FATAL_ERROR "The code is using TS RPC, but the SP_FFA_UUID_CANON is not matching the RPC UUID.")
+	endif()
+endif()
diff --git a/components/rpc/mm_communicate/endpoint/sp/component.cmake b/components/rpc/mm_communicate/endpoint/sp/component.cmake
index 456b9a7..ca453ce 100644
--- a/components/rpc/mm_communicate/endpoint/sp/component.cmake
+++ b/components/rpc/mm_communicate/endpoint/sp/component.cmake
@@ -11,3 +11,14 @@
 target_sources(${TGT} PRIVATE
 	"${CMAKE_CURRENT_LIST_DIR}/mm_communicate_call_ep.c"
 )
+
+if(NOT ((TS_ENV STREQUAL "linux-pc") OR (TS_ENV STREQUAL "arm-linux")))
+	if(NOT DEFINED SP_BIN_UUID_CANON)
+		message(FATAL_ERROR "Mandatory parameter SP_BIN_UUID_CANON is not defined.")
+	endif()
+
+	# Verify that SP is using the TS protocol.
+	if ("${SP_FFA_UUID_CANON}" STREQUAL "${TS_RPC_UUID_CANON}")
+		message(FATAL_ERROR "The code is using MM RPC, but the SP_FFA_UUID_CANON is matching the TS RPC UUID.")
+	endif()
+endif()
\ No newline at end of file
diff --git a/components/service/spm_test/spm_test.cmake b/components/service/spm_test/spm_test.cmake
index c595370..e8a1ccd 100644
--- a/components/service/spm_test/spm_test.cmake
+++ b/components/service/spm_test/spm_test.cmake
@@ -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
 #
@@ -64,7 +64,7 @@
 
 include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
 export_sp(
-	SP_UUID_CANON ${SP_UUID_CANON}
+	SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
 	SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
 	SP_NAME "spm-test${SP_NUMBER}"
 	MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in