Twincpu: Support building multi-core TF-M in a single building execution

Enable building multi-core TF-M in a single building execution.
- Add MultiCore.cmake to support bulding in multi-core scenario.
  Provide functions to platform specific cmake script to select
  secure or non-secure configuration, including cpu type and
  platform specific definitions.
- Add a building flag TFM_BUILD_IN_SPE to indicate whether current
  building is for SPE or not.
- According to TFM_BUILD_IN_SPE flag value, select corresponding
  configuration.

Change-Id: Ic1aca49190af9a9a5ec8ef1b855239a839fabe65
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index f08a355..4fb7b06 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -56,6 +56,19 @@
 	include(${PLATFORM_CMAKE_FILE})
 endif()
 
+# Select the corresponding CPU type and configuration according to current
+# building status in multi-core scenario.
+# The updated configuration will be used in following compiler setting.
+if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
+	include("Common/MultiCore")
+
+	if (NOT DEFINED TFM_BUILD_IN_SPE)
+		message(FATAL_ERROR "Flag of building in SPE is not specified. Please set TFM_BUILD_IN_SPE.")
+	else()
+		select_arm_cpu_type(${TFM_BUILD_IN_SPE})
+	endif()
+endif()
+
 if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
 	# CMSE is unnecessary in multi-core scenarios.
 	# TODO: Need further discussion about if CMSE is required when an Armv8-M