From 8991eed7439cb565da505a2bf88e9ac87ad79c1c Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Thu, 23 Oct 2014 10:35:34 +0100 Subject: Rework the PSCI migrate APIs This patch reworks the PSCI MIGRATE, MIGRATE_INFO_TYPE and MIGRATE_INFO_UP_CPU support for Trusted Firmware. The implementation does the appropriate validation of parameters and invokes the appropriate hook exported by the SPD. The TSP is a MP Trusted OS. Hence the ability to actually migrate a Trusted OS has not been implemented. The corresponding function is not populated in the spd_pm_hooks structure for the TSPD. The `spd_pm_ops_t` has undergone changes with this patch. SPD PORTS MAY NEED TO BE UPDATED. Fixes ARM-software/tf-issues#249 Change-Id: Iabd87521bf7c530a5e4506b6d3bfd4f1bf87604f --- include/bl31/services/psci.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/bl31/services/psci.h') diff --git a/include/bl31/services/psci.h b/include/bl31/services/psci.h index 3804bf2c..de6fe4b8 100644 --- a/include/bl31/services/psci.h +++ b/include/bl31/services/psci.h @@ -191,8 +191,8 @@ typedef struct spd_pm_ops { void (*svc_suspend)(uint64_t __unused); void (*svc_on_finish)(uint64_t __unused); void (*svc_suspend_finish)(uint64_t suspend_level); - void (*svc_migrate)(uint64_t __unused1, uint64_t __unused2); - int32_t (*svc_migrate_info)(uint64_t *__unused); + int32_t (*svc_migrate)(uint64_t from_cpu, uint64_t to_cpu); + int32_t (*svc_migrate_info)(uint64_t *resident_cpu); void (*svc_system_off)(void); void (*svc_system_reset)(void); } spd_pm_ops_t; @@ -202,9 +202,9 @@ typedef struct spd_pm_ops { ******************************************************************************/ unsigned int psci_version(void); int psci_affinity_info(unsigned long, unsigned int); -int psci_migrate(unsigned int); -unsigned int psci_migrate_info_type(void); -unsigned long psci_migrate_info_up_cpu(void); +int psci_migrate(unsigned long); +int psci_migrate_info_type(void); +long psci_migrate_info_up_cpu(void); int psci_cpu_on(unsigned long, unsigned long, unsigned long); -- cgit v1.2.3 From 90e8258eec95bcad556426597489a34208232e39 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Wed, 7 Jan 2015 11:10:22 +0000 Subject: Implement PSCI_FEATURES API This patch implements the PSCI_FEATURES function which is a mandatory API in the PSCI 1.0 specification. A capability variable is constructed during initialization by examining the plat_pm_ops and spd_pm_ops exported by the platform and the Secure Payload Dispatcher. This is used by the PSCI FEATURES function to determine which PSCI APIs are supported by the platform. Change-Id: I147ffc1bd5d90b469bd3cc4bbe0a20e95c247df7 --- include/bl31/services/psci.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/bl31/services/psci.h') diff --git a/include/bl31/services/psci.h b/include/bl31/services/psci.h index de6fe4b8..59675810 100644 --- a/include/bl31/services/psci.h +++ b/include/bl31/services/psci.h @@ -61,11 +61,15 @@ #define PSCI_MIG_INFO_UP_CPU_AARCH64 0xc4000007 #define PSCI_SYSTEM_OFF 0x84000008 #define PSCI_SYSTEM_RESET 0x84000009 +#define PSCI_FEATURES 0x8400000A + +/* Macro to help build the psci capabilities bitfield */ +#define define_psci_cap(x) (1 << (x & 0x1f)) /* * Number of PSCI calls (above) implemented */ -#define PSCI_NUM_CALLS 15 +#define PSCI_NUM_CALLS 16 /******************************************************************************* * PSCI Migrate and friends @@ -96,6 +100,18 @@ #define psci_get_pstate_afflvl(pstate) ((pstate >> PSTATE_AFF_LVL_SHIFT) & \ PSTATE_AFF_LVL_MASK) +/******************************************************************************* + * PSCI CPU_FEATURES feature flag specific defines + ******************************************************************************/ +/* Features flags for CPU SUSPEND power state parameter format. Bits [1:1] */ +#define FF_PSTATE_SHIFT 1 +#define FF_PSTATE_ORIG 0 +#define FF_PSTATE_EXTENDED 1 + +/* Features flags for CPU SUSPEND OS Initiated mode support. Bits [0:0] */ +#define FF_MODE_SUPPORT_SHIFT 0 +#define FF_SUPPORTS_OS_INIT_MODE 1 + /******************************************************************************* * PSCI version ******************************************************************************/ -- cgit v1.2.3