summaryrefslogtreecommitdiff
path: root/plat/common
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2015-06-10 13:49:59 +0100
committerAchin Gupta <achin.gupta@arm.com>2015-08-13 20:08:19 +0100
commit32bc85f2d5234fbc4d1f724db3d033b8e1be5dd3 (patch)
tree3f225586e975d04f768dc3126e0544abe929f39d /plat/common
parenteb975f52ea2e70216d214efcff3154f3cf081cb0 (diff)
PSCI: Implement platform compatibility layer
The new PSCI topology framework and PSCI extended State framework introduces a breaking change in the platform port APIs. To ease the migration of the platform ports to the new porting interface, a compatibility layer is introduced which essentially defines the new platform API in terms of the old API. The old PSCI helpers to retrieve the power-state, its associated fields and the highest coordinated physical OFF affinity level of a core are also implemented for compatibility. This allows the existing platform ports to work with the new PSCI framework without significant rework. This layer will be enabled by default once the switch to the new PSCI framework is done and is controlled by the build flag ENABLE_PLAT_COMPAT. Change-Id: I4b17cac3a4f3375910a36dba6b03d8f1700d07e3
Diffstat (limited to 'plat/common')
-rw-r--r--plat/common/aarch64/platform_mp_stack.S48
1 files changed, 46 insertions, 2 deletions
diff --git a/plat/common/aarch64/platform_mp_stack.S b/plat/common/aarch64/platform_mp_stack.S
index 0cea9ac3..b1f7b6dc 100644
--- a/plat/common/aarch64/platform_mp_stack.S
+++ b/plat/common/aarch64/platform_mp_stack.S
@@ -30,16 +30,58 @@
#include <arch.h>
#include <asm_macros.S>
+#include <assert_macros.S>
#include <platform_def.h>
-
.local platform_normal_stacks
- .weak platform_set_stack
+#if ENABLE_PLAT_COMPAT
+ .globl plat_get_my_stack
+ .globl plat_set_my_stack
+#else
.weak platform_get_stack
+ .weak platform_set_stack
.weak plat_get_my_stack
.weak plat_set_my_stack
+#endif /*__ENABLE_PLAT_COMPAT__*/
+
+
+#if ENABLE_PLAT_COMPAT
+ /* ---------------------------------------------------------------------
+ * When the compatility layer is enabled, the new platform APIs
+ * viz plat_get_my_stack() and plat_set_my_stack() need to be
+ * defined using the previous APIs platform_get_stack() and
+ * platform_set_stack(). Also we need to provide weak definitions
+ * of platform_get_stack() and platform_set_stack() for the platforms
+ * to reuse.
+ * --------------------------------------------------------------------
+ */
/* -----------------------------------------------------
+ * unsigned long plat_get_my_stack ()
+ *
+ * For the current CPU, this function returns the stack
+ * pointer for a stack allocated in device memory.
+ * -----------------------------------------------------
+ */
+func plat_get_my_stack
+ mrs x0, mpidr_el1
+ b platform_get_stack
+endfunc plat_get_my_stack
+
+ /* -----------------------------------------------------
+ * void plat_set_my_stack ()
+ *
+ * For the current CPU, this function sets the stack
+ * pointer to a stack allocated in normal memory.
+ * -----------------------------------------------------
+ */
+func plat_set_my_stack
+ mrs x0, mpidr_el1
+ b platform_set_stack
+endfunc plat_set_my_stack
+
+#else
+ /* -----------------------------------------------------
* unsigned long platform_get_stack (unsigned long mpidr)
*
* For a given CPU, this function returns the stack
@@ -93,6 +135,8 @@ func plat_set_my_stack
ret x9
endfunc plat_set_my_stack
+#endif /*__ENABLE_PLAT_COMPAT__*/
+
/* -----------------------------------------------------
* Per-cpu stacks in normal memory. Each cpu gets a
* stack of PLATFORM_STACK_SIZE bytes.