Platform: Create files for spm hal

 - Create spm_hal.c and spm_hal.h files to later contain platform
   dependent isolation hardware code
 - Move isolation hardware specific partition database fields to
   spm_hal.h
 - Move the code from spm_db.h that have to be included only once to
   spm_db_setup.h
 - Adapt cmake system to the new file structure

Change-Id: Ib80e4b3c366b2b4038739bc28a02b165d3402832
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/platform/ext/Mps2AN519.cmake b/platform/ext/Mps2AN519.cmake
index 18da2bf..74cbb9a 100755
--- a/platform/ext/Mps2AN519.cmake
+++ b/platform/ext/Mps2AN519.cmake
@@ -96,6 +96,7 @@
   message(FATAL_ERROR "Configuration variable BUILD_TARGET_CFG (true|false) is undefined!")
 elseif(BUILD_TARGET_CFG)
   list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/mps2/an519/target_cfg.c")
+  list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/mps2/an519/spm_hal.c")
 endif()
 
 if (NOT DEFINED BUILD_TARGET_HARDWARE_KEYS)
diff --git a/platform/ext/Mps2AN521.cmake b/platform/ext/Mps2AN521.cmake
index 1865d03..f44db7b 100755
--- a/platform/ext/Mps2AN521.cmake
+++ b/platform/ext/Mps2AN521.cmake
@@ -113,6 +113,7 @@
   message(FATAL_ERROR "Configuration variable BUILD_TARGET_CFG (true|false) is undefined!")
 elseif(BUILD_TARGET_CFG)
   list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/mps2/an521/target_cfg.c")
+  list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/mps2/an521/spm_hal.c")
 endif()
 
 if (NOT DEFINED BUILD_TARGET_HARDWARE_KEYS)
diff --git a/platform/ext/musca_a.cmake b/platform/ext/musca_a.cmake
index 0110b53..3789170 100755
--- a/platform/ext/musca_a.cmake
+++ b/platform/ext/musca_a.cmake
@@ -96,6 +96,7 @@
   message(FATAL_ERROR "Configuration variable BUILD_TARGET_CFG (true|false) is undefined!")
 elseif(BUILD_TARGET_CFG)
   list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/target_cfg.c")
+  list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/spm_hal.c")
 endif()
 
 if (NOT DEFINED BUILD_TARGET_HARDWARE_KEYS)
diff --git a/platform/ext/target/mps2/an519/spm_hal.c b/platform/ext/target/mps2/an519/spm_hal.c
new file mode 100644
index 0000000..6f98696
--- /dev/null
+++ b/platform/ext/target/mps2/an519/spm_hal.c
@@ -0,0 +1,19 @@
+/*

+ * Copyright (c) 2018, Arm Limited. All rights reserved.

+ *

+ * SPDX-License-Identifier: BSD-3-Clause

+ *

+ */

+

+#include "platform/include/tfm_spm_hal.h"

+#include "spm_api.h"

+#include "spm_db.h"

+

+void tfm_spm_hal_init_platform_data(uint32_t partition_id,

+        struct tfm_spm_partition_platform_data_t *platform_data)

+{

+    platform_data->periph_start = 0;

+    platform_data->periph_limit = 0;

+    platform_data->periph_ppc_bank = 0;

+    platform_data->periph_ppc_loc = 0;

+}

diff --git a/platform/ext/target/mps2/an521/spm_hal.c b/platform/ext/target/mps2/an521/spm_hal.c
new file mode 100644
index 0000000..6f98696
--- /dev/null
+++ b/platform/ext/target/mps2/an521/spm_hal.c
@@ -0,0 +1,19 @@
+/*

+ * Copyright (c) 2018, Arm Limited. All rights reserved.

+ *

+ * SPDX-License-Identifier: BSD-3-Clause

+ *

+ */

+

+#include "platform/include/tfm_spm_hal.h"

+#include "spm_api.h"

+#include "spm_db.h"

+

+void tfm_spm_hal_init_platform_data(uint32_t partition_id,

+        struct tfm_spm_partition_platform_data_t *platform_data)

+{

+    platform_data->periph_start = 0;

+    platform_data->periph_limit = 0;

+    platform_data->periph_ppc_bank = 0;

+    platform_data->periph_ppc_loc = 0;

+}

diff --git a/platform/ext/target/musca_a/spm_hal.c b/platform/ext/target/musca_a/spm_hal.c
new file mode 100644
index 0000000..6f98696
--- /dev/null
+++ b/platform/ext/target/musca_a/spm_hal.c
@@ -0,0 +1,19 @@
+/*

+ * Copyright (c) 2018, Arm Limited. All rights reserved.

+ *

+ * SPDX-License-Identifier: BSD-3-Clause

+ *

+ */

+

+#include "platform/include/tfm_spm_hal.h"

+#include "spm_api.h"

+#include "spm_db.h"

+

+void tfm_spm_hal_init_platform_data(uint32_t partition_id,

+        struct tfm_spm_partition_platform_data_t *platform_data)

+{

+    platform_data->periph_start = 0;

+    platform_data->periph_limit = 0;

+    platform_data->periph_ppc_bank = 0;

+    platform_data->periph_ppc_loc = 0;

+}