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/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
new file mode 100644
index 0000000..bbd0001
--- /dev/null
+++ b/platform/include/tfm_spm_hal.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_SPM_HAL_H__
+#define __TFM_SPM_HAL_H__
+
+#include <stdint.h>
+
+/**
+ * Holds the data necessary to do isolation for a specific peripheral.
+ */
+struct tfm_spm_partition_platform_data_t
+{
+ uint32_t periph_start;
+ uint32_t periph_limit;
+ uint16_t periph_ppc_bank;
+ uint16_t periph_ppc_loc;
+};
+
+/**
+ * \brief Initialise the platform related fields of a partition DB record.
+ *
+ * \param[in] partition_id The id of the partition
+ * \param[in] platform_data The platform fields of the partition DB record to
+ * init
+ */
+void tfm_spm_hal_init_platform_data(uint32_t partition_id,
+ struct tfm_spm_partition_platform_data_t *platform_data);
+
+#endif /* __TFM_SPM_HAL_H__ */