ADAC: Authenticated Debug Access Control

The commit adds the impelementation of ADAC protocol towards the
target side.

Following components are part of the commit:-
    Core   : ADAC protocol core
    SDA    : Secure Debug Agent

The commit also demonstrates the porting of a platform from
trusted-firmware-m. Corstone1000 platform is used for the purpose.

Change-Id: I50b93f9e48789cf5927736b4d1cb35b9a47c38db
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
diff --git a/cmake/toolchain.cmake b/cmake/toolchain.cmake
new file mode 100644
index 0000000..3f01947
--- /dev/null
+++ b/cmake/toolchain.cmake
@@ -0,0 +1,52 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+set(CMAKE_C_COMPILER_FORCED true)
+set(CROSS_COMPILE arm-none-eabi CACHE STRING "Cross-compilation triplet")
+
+if (NOT (COMPILER))
+    set(COMPILER "GNUARM")
+endif ()
+
+if (COMPILER STREQUAL "GNUARM")
+
+    include(${PSA_ADAC_ROOT}/cmake/toolchain_GNUARM.cmake)
+
+    if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+        add_compile_options(-flto -Os)
+        add_link_options(-Wl,--as-needed -flto -flto-partition=none -Os -ffunction-sections -fuse-linker-plugin)
+        add_compile_options($<$<COMPILE_LANGUAGE:C>:-DNDEBUG>)
+    endif ()
+
+elseif(COMPILER STREQUAL "ARMCLANG")
+
+    include(${PSA_ADAC_ROOT}/cmake/toolchain_ARMCLANG.cmake)
+
+    if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+        add_compile_options($<$<COMPILE_LANGUAGE:C>:-Oz>)
+        # # Can't enable LTO for all targets because static libraries (like mbedcrypto)
+        # # are not supported.
+        # add_compile_options(-flto)
+        # add_link_options(--lto)
+        add_compile_options($<$<COMPILE_LANGUAGE:C>:-DNDEBUG>)
+    endif ()
+
+elseif(COMPILER STREQUAL "IARARM")
+
+    include(${PSA_ADAC_ROOT}/cmake/toolchain_IARARM.cmake)
+
+    if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+        add_compile_options(--mfc)
+        add_link_options(--vfe)
+        add_compile_options($<$<COMPILE_LANGUAGE:C>:-DNDEBUG>)
+    endif()
+
+else()
+
+    message(FATAL_ERROR "\nValid values for COMPILER are 'GNUARM' (default), 'ARMCLANG' and 'IARARM'\n")
+
+endif()