SPM: Common partition runtime entry point

Involve the common partition runtime entry point to perform generic
runtime initialization jobs such as heap initialization before the
practical partition entry point get called. This entry point is part
of SPRTL which is shared for all partitions.

This patch involves the 'sprt_main' as the first step. And, if one
partition is light enough (no heap, no other extra settings), it is
optional to apply the common partition runtime entry as partition
first entry, and the real partition entry is put under 'sub_entry'.

This patch also fixes region address alignments in link scripts.

Change-Id: I9169f6377d476a3e1dad025c75a790aba6b6ad10
Signed-off-by: Summer Qin <summer.qin@arm.com>
Co-authored-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/partitions/lib/sprt/sprt_main.c b/secure_fw/partitions/lib/sprt/sprt_main.c
new file mode 100644
index 0000000..7ca6039
--- /dev/null
+++ b/secure_fw/partitions/lib/sprt/sprt_main.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2022, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include "compiler_ext_defs.h"
+#include "runtime_defs.h"
+#include "sprt_partition_metadata_indicator.h"
+#include "sprt_main.h"
+
+#if defined(__ICCARM__)
+#pragma required = meta_init_c
+#endif
+
+__used static uintptr_t runtime_init_c(void)
+{
+    return PART_METADATA()->entry;
+}
+
+__naked void sprt_main(void)
+{
+    __asm volatile(
+#if !defined(__ICCARM__)
+        ".syntax unified    \n"
+#endif
+        "bl runtime_init_c  \n"
+        "bx r0              \n"
+    );
+}