summaryrefslogtreecommitdiff
path: root/plat/common/aarch64/plat_common.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2015-07-13 16:26:11 +0100
committerAchin Gupta <achin.gupta@arm.com>2015-08-13 23:48:06 +0100
commit5c8babcd70149db57734a38be432fe6625f3888f (patch)
treef64760007309c083896eac83638a5df9b57f3de1 /plat/common/aarch64/plat_common.c
parent674878464a93bb6d6bf6cb746fc4b9dba6e101ac (diff)
downloadarm-trusted-firmware-5c8babcd70149db57734a38be432fe6625f3888f.tar.gz
PSCI: Add deprecated API for SPD when compatibility is disabled
This patch defines deprecated platform APIs to enable Trusted Firmware components like Secure Payload and their dispatchers(SPD) to continue to build and run when platform compatibility is disabled. This decouples the migration of platform ports to the new platform API from SPD and enables them to be migrated independently. The deprecated platform APIs defined in this patch are : platform_get_core_pos(), platform_get_stack() and platform_set_stack(). The patch also deprecates MPIDR based context management helpers like cm_get_context_by_mpidr(), cm_set_context_by_mpidr() and cm_init_context(). A mechanism to deprecate APIs and identify callers of these APIs during build is introduced, which is controlled by the build flag WARN_DEPRECATED. If WARN_DEPRECATED is defined to 1, the users of the deprecated APIs will be flagged either as a link error for assembly files or compile time warning for C files during build. Change-Id: Ib72c7d5dc956e1a74d2294a939205b200f055613
Diffstat (limited to 'plat/common/aarch64/plat_common.c')
-rw-r--r--plat/common/aarch64/plat_common.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index 90574fd66..a6a847655 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -27,7 +27,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
+#include <assert.h>
+#include <platform.h>
#include <xlat_tables.h>
/*
@@ -47,3 +48,18 @@ void bl32_plat_enable_mmu(uint32_t flags)
{
enable_mmu_el1(flags);
}
+
+#if !ENABLE_PLAT_COMPAT
+/*
+ * Helper function for platform_get_pos() when platform compatibility is
+ * disabled. This is to enable SPDs using the older platform API to continue
+ * to work.
+ */
+unsigned int platform_core_pos_helper(unsigned long mpidr)
+{
+ int idx = plat_core_pos_by_mpidr(mpidr);
+ assert(idx >= 0);
+ return idx;
+}
+#endif
+