aboutsummaryrefslogtreecommitdiff
path: root/common/psci/psci_setup.c
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-02-01 18:53:26 +0000
committerDan Handley <dan.handley@arm.com>2014-02-17 18:51:44 +0000
commit7421b4653dcfe6b10be5ca7167d2a5f3584c95c1 (patch)
treebf378cb2f1bdefbdc209200997aa2cc1ddc1ff40 /common/psci/psci_setup.c
parentef7a28c92b3587e2572eab1a30f1e99e854c9d62 (diff)
downloadarm-trusted-firmware-7421b4653dcfe6b10be5ca7167d2a5f3584c95c1.tar.gz
Add runtime services framework
This patch introduces the framework to enable registration and initialisation of runtime services. PSCI is registered and initialised as a runtime service. Handling of runtime service requests will be implemented in subsequent patches. Change-Id: Id21e7ddc5a33d42b7d6e455b41155fc5441a9547
Diffstat (limited to 'common/psci/psci_setup.c')
-rw-r--r--common/psci/psci_setup.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/common/psci/psci_setup.c b/common/psci/psci_setup.c
index 91de1ab..c471d1f 100644
--- a/common/psci/psci_setup.c
+++ b/common/psci/psci_setup.c
@@ -36,6 +36,7 @@
#include <platform.h>
#include <psci_private.h>
#include <context_mgmt.h>
+#include <runtime_svc.h>
/*******************************************************************************
* Per cpu non-secure contexts used to program the architectural state prior
@@ -275,8 +276,9 @@ static unsigned int psci_init_aff_map(unsigned long mpidr,
* level within the 'psci_aff_map' array. This allows restricting search of a
* node at an affinity level between the indices in the limits array.
******************************************************************************/
-void psci_setup(unsigned long mpidr)
+int32_t psci_setup(void)
{
+ unsigned long mpidr = read_mpidr();
int afflvl, affmap_idx, max_afflvl;
aff_map_node *node;
@@ -335,5 +337,16 @@ void psci_setup(unsigned long mpidr)
platform_setup_pm(&psci_plat_pm_ops);
assert(psci_plat_pm_ops);
- return;
+ return 0;
}
+
+/* Register PSCI as a run time service */
+DECLARE_RT_SVC(
+ psci,
+
+ OEN_STD_START,
+ OEN_STD_END,
+ SMC_TYPE_FAST,
+ psci_setup,
+ NULL
+);