diff options
| author | Soby Mathew <soby.mathew@arm.com> | 2015-01-07 11:10:22 +0000 |
|---|---|---|
| committer | Dan Handley <dan.handley@arm.com> | 2015-01-26 12:42:45 +0000 |
| commit | 90e8258eec95bcad556426597489a34208232e39 (patch) | |
| tree | 6dbd2e17c713c92cee5596be16d659cfd249c355 /include/bl31 | |
| parent | 8991eed7439cb565da505a2bf88e9ac87ad79c1c (diff) | |
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
Diffstat (limited to 'include/bl31')
| -rw-r--r-- | include/bl31/runtime_svc.h | 8 | ||||
| -rw-r--r-- | include/bl31/services/psci.h | 18 |
2 files changed, 25 insertions, 1 deletions
diff --git a/include/bl31/runtime_svc.h b/include/bl31/runtime_svc.h index 2d849863..f1124183 100644 --- a/include/bl31/runtime_svc.h +++ b/include/bl31/runtime_svc.h @@ -176,6 +176,14 @@ typedef int32_t (*rt_svc_init_t)(void); #define SMC_SET_EL3(_h, _e, _v) \ write_ctx_reg(get_el3state_ctx(_h), (_e), (_v)); +/* The macro below is used to identify a Standard Service SMC call */ +#define is_std_svc_call(_fid) ((((_fid) >> FUNCID_OEN_SHIFT) & \ + FUNCID_OEN_MASK) == OEN_STD_START) + +/* The macro below is used to identify a valid Fast SMC call */ +#define is_valid_fast_smc(_fid) ((!(((_fid) >> 16) & 0xff)) && \ + (GET_SMC_TYPE(_fid) == SMC_TYPE_FAST)) + /* * Prototype for runtime service SMC handler function. x0 (SMC Function ID) to * x4 are as passed by the caller. Rest of the arguments to SMC and the context 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 @@ -97,6 +101,18 @@ 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 ******************************************************************************/ #define PSCI_MAJOR_VER (0 << 16) |
