Add platform support

TS project structure and build system extended to accommodate
hardware specific drivers. The concept of a platform is introduced
to allow hardware specific drivers from external providers to be
used. This change implements the Portability Model described in
the project documentation.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I61e678ae103e0bf139f2c440ba6cd010620af37e
diff --git a/deployments/deployment.cmake b/deployments/deployment.cmake
index 6543318..ca2a5e1 100644
--- a/deployments/deployment.cmake
+++ b/deployments/deployment.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -22,6 +22,7 @@
 # Common utilities used by the build system
 include(${TS_ROOT}/tools/cmake/common/Utils.cmake REQUIRED)
 include(${TS_ROOT}/tools/cmake/common/AddComponents.cmake REQUIRED)
+include(${TS_ROOT}/tools/cmake/common/AddPlatform.cmake REQUIRED)
 
 # Check build environment requirements are met
 ts_verify_build_env()
@@ -31,3 +32,26 @@
   "${TS_ROOT}"
   "${TS_ROOT}/components"
   )
+
+# Set platform provider root default to use if no commandline variable value has been specified.
+# The root path may be specified to allow an external project to provide platform definitions.
+if (DEFINED ENV{TS_PLATFORM_ROOT})
+  set(_default_platform_root ENV{TS_PLATFORM_ROOT})
+else()
+  set(_default_platform_root "${TS_ROOT}/platform/providers")
+endif()
+set(TS_PLATFORM_ROOT ${_default_platform_root} CACHE STRING "Platform provider path")
+
+# Set the default platform to use if no explict platform has been specified on the cmake commandline.
+if (DEFINED ENV{TS_PLATFORM})
+  set(_default_platform ENV{TS_PLATFORM})
+else()
+  set(_default_platform "ts/vanilla")
+endif()
+set(TS_PLATFORM ${_default_platform} CACHE STRING "Selected platform")
+
+# Custom property for defining platform feature dependencies based on components used in a deployment
+define_property(TARGET PROPERTY TS_PLATFORM_DRIVER_DEPENDENCIES
+  BRIEF_DOCS "List of platform driver interfaces used for a deployment."
+  FULL_DOCS "Used by the platform specific builder to specify a configuration for the built platform components."
+  )
\ No newline at end of file