Build: Add the tfm NS log library

This part is missed for the new build system.
The NS log implementations have been seperated from the TF-M.
The NS is using the one in TF-M.

This patch adds the NS log library.
Corresponding changes are required in TF-M repo to
1. Add the NS log library to build
2. Remove the build for the log implementation in NS interface

Change-Id: Ic71b244fb93651974422b49a24d08e5a270dd5f5
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 9770d20..93790ab 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -119,6 +119,7 @@
         $<$<BOOL:${TEST_PSA_API}>:test_combine>
         $<$<NOT:$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>:tfm_s_veneers>
         psa_api_ns
+        tfm_ns_log
 )
 
 target_compile_definitions(tfm_ns
diff --git a/app/tfm_log.h b/app/tfm_log.h
index 5b8a06f..5563434 100644
--- a/app/tfm_log.h
+++ b/app/tfm_log.h
@@ -8,7 +8,7 @@
 #ifndef __TFM_LOG_H__
 #define __TFM_LOG_H__
 
-#include "log/tfm_log_raw.h"
+#include "tfm_log_raw.h"
 
 /* Functions and macros in this file is for 'thread mode' usage. */
 
diff --git a/log/CMakeLists.txt b/log/CMakeLists.txt
new file mode 100644
index 0000000..1993428
--- /dev/null
+++ b/log/CMakeLists.txt
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+cmake_minimum_required(VERSION 3.13)
+
+# For multi-core projects, the NS app can be run on a different CPU to the
+# Secure code. To facilitate this, we once again reload the compiler to load the
+# setting for the NS CPU. Cmake settings are directory scoped so this affects
+# anything loaded from or declared in this dir.
+if (TFM_MULTI_CORE_TOPOLOGY)
+    include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
+endif()
+
+############################# Ns Log ###########################################
+add_library(tfm_ns_log STATIC EXCLUDE_FROM_ALL)
+
+target_sources(tfm_ns_log
+    PRIVATE
+        tfm_log_raw.c
+)
+
+target_include_directories(tfm_ns_log
+    PUBLIC
+        .
+)
+
+target_link_libraries(tfm_ns_log
+    PRIVATE
+        platform_ns
+)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6bd79e0..6803644 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -51,6 +51,7 @@
 target_link_libraries(tfm_test_framework
     INTERFACE
         psa_interface
+        tfm_ns_log
 )
 
 target_sources(tfm_ns_tests
diff --git a/test/framework/test_framework.h b/test/framework/test_framework.h
index 9772875..605fda1 100644
--- a/test/framework/test_framework.h
+++ b/test/framework/test_framework.h
@@ -12,7 +12,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include "log/tfm_log_raw.h"
+#include "tfm_log_raw.h"
 #include "test_framework_helpers.h"
 
 #ifdef __cplusplus