summaryrefslogtreecommitdiff
path: root/services/std_svc/psci/psci_common.c
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2015-01-26 12:46:55 +0000
committerdanh-arm <dan.handley@arm.com>2015-01-26 12:46:55 +0000
commit126866f0110c6096256cd580bc778539d16b06fd (patch)
tree850b407b7cfbfe76f8c6822fd26d85e2cf81147f /services/std_svc/psci/psci_common.c
parent860331aa15ab251c515c396a5c095662de4ae5e6 (diff)
parentb234b2c4a06169aa965b77dd40c17be454a9f609 (diff)
Merge pull request #244 from danh-arm/sm/psci_mig_feat
Rework PSCI migrate APIs and implement the FEATURES API v2
Diffstat (limited to 'services/std_svc/psci/psci_common.c')
-rw-r--r--services/std_svc/psci/psci_common.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/services/std_svc/psci/psci_common.c b/services/std_svc/psci/psci_common.c
index d8c8618f..a31643e4 100644
--- a/services/std_svc/psci/psci_common.c
+++ b/services/std_svc/psci/psci_common.c
@@ -558,10 +558,41 @@ void psci_afflvl_power_on_finish(int start_afflvl,
******************************************************************************/
void psci_register_spd_pm_hook(const spd_pm_ops_t *pm)
{
+ assert(pm);
psci_spd_pm = pm;
+
+ if (pm->svc_migrate)
+ psci_caps |= define_psci_cap(PSCI_MIG_AARCH64);
+
+ if (pm->svc_migrate_info)
+ psci_caps |= define_psci_cap(PSCI_MIG_INFO_UP_CPU_AARCH64)
+ | define_psci_cap(PSCI_MIG_INFO_TYPE);
}
/*******************************************************************************
+ * This function invokes the migrate info hook in the spd_pm_ops. It performs
+ * the necessary return value validation. If the Secure Payload is UP and
+ * migrate capable, it returns the mpidr of the CPU on which the Secure payload
+ * is resident through the mpidr parameter. Else the value of the parameter on
+ * return is undefined.
+ ******************************************************************************/
+int psci_spd_migrate_info(uint64_t *mpidr)
+{
+ int rc;
+
+ if (!psci_spd_pm || !psci_spd_pm->svc_migrate_info)
+ return PSCI_E_NOT_SUPPORTED;
+
+ rc = psci_spd_pm->svc_migrate_info(mpidr);
+
+ assert(rc == PSCI_TOS_UP_MIG_CAP || rc == PSCI_TOS_NOT_UP_MIG_CAP \
+ || rc == PSCI_TOS_NOT_PRESENT_MP || rc == PSCI_E_NOT_SUPPORTED);
+
+ return rc;
+}
+
+
+/*******************************************************************************
* This function prints the state of all affinity instances present in the
* system
******************************************************************************/