1532ed618SSoby Mathew /* 2*97373c33SAntonio Nino Diaz * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. 3532ed618SSoby Mathew * 482cb2c1aSdp-arm * SPDX-License-Identifier: BSD-3-Clause 5532ed618SSoby Mathew */ 6532ed618SSoby Mathew 7*97373c33SAntonio Nino Diaz #ifndef PSCI_H 8*97373c33SAntonio Nino Diaz #define PSCI_H 9532ed618SSoby Mathew 10532ed618SSoby Mathew #include <bakery_lock.h> 11f426fc05SSoby Mathew #include <bl_common.h> 12532ed618SSoby Mathew #include <platform_def.h> /* for PLAT_NUM_PWR_DOMAINS */ 13532ed618SSoby Mathew #if ENABLE_PLAT_COMPAT 14532ed618SSoby Mathew #include <psci_compat.h> 15532ed618SSoby Mathew #endif 165dffb46cSSoby Mathew #include <psci_lib.h> /* To maintain compatibility for SPDs */ 17030567e6SVarun Wadekar #include <utils_def.h> 18532ed618SSoby Mathew 19532ed618SSoby Mathew /******************************************************************************* 20532ed618SSoby Mathew * Number of power domains whose state this PSCI implementation can track 21532ed618SSoby Mathew ******************************************************************************/ 22532ed618SSoby Mathew #ifdef PLAT_NUM_PWR_DOMAINS 23532ed618SSoby Mathew #define PSCI_NUM_PWR_DOMAINS PLAT_NUM_PWR_DOMAINS 24532ed618SSoby Mathew #else 25030567e6SVarun Wadekar #define PSCI_NUM_PWR_DOMAINS (U(2) * PLATFORM_CORE_COUNT) 26532ed618SSoby Mathew #endif 27532ed618SSoby Mathew 28532ed618SSoby Mathew #define PSCI_NUM_NON_CPU_PWR_DOMAINS (PSCI_NUM_PWR_DOMAINS - \ 29532ed618SSoby Mathew PLATFORM_CORE_COUNT) 30532ed618SSoby Mathew 31532ed618SSoby Mathew /* This is the power level corresponding to a CPU */ 32030567e6SVarun Wadekar #define PSCI_CPU_PWR_LVL (0) 33532ed618SSoby Mathew 34532ed618SSoby Mathew /* 35532ed618SSoby Mathew * The maximum power level supported by PSCI. Since PSCI CPU_SUSPEND 36532ed618SSoby Mathew * uses the old power_state parameter format which has 2 bits to specify the 37532ed618SSoby Mathew * power level, this constant is defined to be 3. 38532ed618SSoby Mathew */ 39030567e6SVarun Wadekar #define PSCI_MAX_PWR_LVL U(3) 40532ed618SSoby Mathew 41532ed618SSoby Mathew /******************************************************************************* 42532ed618SSoby Mathew * Defines for runtime services function ids 43532ed618SSoby Mathew ******************************************************************************/ 44030567e6SVarun Wadekar #define PSCI_VERSION U(0x84000000) 45030567e6SVarun Wadekar #define PSCI_CPU_SUSPEND_AARCH32 U(0x84000001) 46030567e6SVarun Wadekar #define PSCI_CPU_SUSPEND_AARCH64 U(0xc4000001) 47030567e6SVarun Wadekar #define PSCI_CPU_OFF U(0x84000002) 48030567e6SVarun Wadekar #define PSCI_CPU_ON_AARCH32 U(0x84000003) 49030567e6SVarun Wadekar #define PSCI_CPU_ON_AARCH64 U(0xc4000003) 50030567e6SVarun Wadekar #define PSCI_AFFINITY_INFO_AARCH32 U(0x84000004) 51030567e6SVarun Wadekar #define PSCI_AFFINITY_INFO_AARCH64 U(0xc4000004) 52030567e6SVarun Wadekar #define PSCI_MIG_AARCH32 U(0x84000005) 53030567e6SVarun Wadekar #define PSCI_MIG_AARCH64 U(0xc4000005) 54030567e6SVarun Wadekar #define PSCI_MIG_INFO_TYPE U(0x84000006) 55030567e6SVarun Wadekar #define PSCI_MIG_INFO_UP_CPU_AARCH32 U(0x84000007) 56030567e6SVarun Wadekar #define PSCI_MIG_INFO_UP_CPU_AARCH64 U(0xc4000007) 57030567e6SVarun Wadekar #define PSCI_SYSTEM_OFF U(0x84000008) 58030567e6SVarun Wadekar #define PSCI_SYSTEM_RESET U(0x84000009) 59030567e6SVarun Wadekar #define PSCI_FEATURES U(0x8400000A) 60030567e6SVarun Wadekar #define PSCI_NODE_HW_STATE_AARCH32 U(0x8400000d) 61030567e6SVarun Wadekar #define PSCI_NODE_HW_STATE_AARCH64 U(0xc400000d) 62030567e6SVarun Wadekar #define PSCI_SYSTEM_SUSPEND_AARCH32 U(0x8400000E) 63030567e6SVarun Wadekar #define PSCI_SYSTEM_SUSPEND_AARCH64 U(0xc400000E) 64030567e6SVarun Wadekar #define PSCI_STAT_RESIDENCY_AARCH32 U(0x84000010) 65030567e6SVarun Wadekar #define PSCI_STAT_RESIDENCY_AARCH64 U(0xc4000010) 66030567e6SVarun Wadekar #define PSCI_STAT_COUNT_AARCH32 U(0x84000011) 67030567e6SVarun Wadekar #define PSCI_STAT_COUNT_AARCH64 U(0xc4000011) 6836a8f8fdSRoberto Vargas #define PSCI_SYSTEM_RESET2_AARCH32 U(0x84000012) 6936a8f8fdSRoberto Vargas #define PSCI_SYSTEM_RESET2_AARCH64 U(0xc4000012) 70d4c596beSRoberto Vargas #define PSCI_MEM_PROTECT U(0x84000013) 71d4c596beSRoberto Vargas #define PSCI_MEM_CHK_RANGE_AARCH32 U(0x84000014) 72d4c596beSRoberto Vargas #define PSCI_MEM_CHK_RANGE_AARCH64 U(0xc4000014) 73532ed618SSoby Mathew 74532ed618SSoby Mathew /* 75532ed618SSoby Mathew * Number of PSCI calls (above) implemented 76532ed618SSoby Mathew */ 77532ed618SSoby Mathew #if ENABLE_PSCI_STAT 78030567e6SVarun Wadekar #define PSCI_NUM_CALLS U(22) 79532ed618SSoby Mathew #else 80030567e6SVarun Wadekar #define PSCI_NUM_CALLS U(18) 81532ed618SSoby Mathew #endif 82532ed618SSoby Mathew 83cf0b1492SSoby Mathew /* The macros below are used to identify PSCI calls from the SMC function ID */ 84030567e6SVarun Wadekar #define PSCI_FID_MASK U(0xffe0) 85030567e6SVarun Wadekar #define PSCI_FID_VALUE U(0) 86cf0b1492SSoby Mathew #define is_psci_fid(_fid) \ 87cf0b1492SSoby Mathew (((_fid) & PSCI_FID_MASK) == PSCI_FID_VALUE) 88cf0b1492SSoby Mathew 89532ed618SSoby Mathew /******************************************************************************* 90532ed618SSoby Mathew * PSCI Migrate and friends 91532ed618SSoby Mathew ******************************************************************************/ 92030567e6SVarun Wadekar #define PSCI_TOS_UP_MIG_CAP U(0) 93030567e6SVarun Wadekar #define PSCI_TOS_NOT_UP_MIG_CAP U(1) 94030567e6SVarun Wadekar #define PSCI_TOS_NOT_PRESENT_MP U(2) 95532ed618SSoby Mathew 96532ed618SSoby Mathew /******************************************************************************* 97532ed618SSoby Mathew * PSCI CPU_SUSPEND 'power_state' parameter specific defines 98532ed618SSoby Mathew ******************************************************************************/ 99030567e6SVarun Wadekar #define PSTATE_ID_SHIFT U(0) 100532ed618SSoby Mathew 101532ed618SSoby Mathew #if PSCI_EXTENDED_STATE_ID 102030567e6SVarun Wadekar #define PSTATE_VALID_MASK U(0xB0000000) 103030567e6SVarun Wadekar #define PSTATE_TYPE_SHIFT U(30) 104030567e6SVarun Wadekar #define PSTATE_ID_MASK U(0xfffffff) 105532ed618SSoby Mathew #else 106030567e6SVarun Wadekar #define PSTATE_VALID_MASK U(0xFCFE0000) 107030567e6SVarun Wadekar #define PSTATE_TYPE_SHIFT U(16) 108030567e6SVarun Wadekar #define PSTATE_PWR_LVL_SHIFT U(24) 109030567e6SVarun Wadekar #define PSTATE_ID_MASK U(0xffff) 110030567e6SVarun Wadekar #define PSTATE_PWR_LVL_MASK U(0x3) 111532ed618SSoby Mathew 112532ed618SSoby Mathew #define psci_get_pstate_pwrlvl(pstate) (((pstate) >> PSTATE_PWR_LVL_SHIFT) & \ 113532ed618SSoby Mathew PSTATE_PWR_LVL_MASK) 114532ed618SSoby Mathew #define psci_make_powerstate(state_id, type, pwrlvl) \ 115532ed618SSoby Mathew (((state_id) & PSTATE_ID_MASK) << PSTATE_ID_SHIFT) |\ 116532ed618SSoby Mathew (((type) & PSTATE_TYPE_MASK) << PSTATE_TYPE_SHIFT) |\ 117532ed618SSoby Mathew (((pwrlvl) & PSTATE_PWR_LVL_MASK) << PSTATE_PWR_LVL_SHIFT) 118532ed618SSoby Mathew #endif /* __PSCI_EXTENDED_STATE_ID__ */ 119532ed618SSoby Mathew 120030567e6SVarun Wadekar #define PSTATE_TYPE_STANDBY U(0x0) 121030567e6SVarun Wadekar #define PSTATE_TYPE_POWERDOWN U(0x1) 122030567e6SVarun Wadekar #define PSTATE_TYPE_MASK U(0x1) 123532ed618SSoby Mathew 124532ed618SSoby Mathew /******************************************************************************* 125532ed618SSoby Mathew * PSCI CPU_FEATURES feature flag specific defines 126532ed618SSoby Mathew ******************************************************************************/ 127532ed618SSoby Mathew /* Features flags for CPU SUSPEND power state parameter format. Bits [1:1] */ 128030567e6SVarun Wadekar #define FF_PSTATE_SHIFT U(1) 129030567e6SVarun Wadekar #define FF_PSTATE_ORIG U(0) 130030567e6SVarun Wadekar #define FF_PSTATE_EXTENDED U(1) 131532ed618SSoby Mathew #if PSCI_EXTENDED_STATE_ID 132532ed618SSoby Mathew #define FF_PSTATE FF_PSTATE_EXTENDED 133532ed618SSoby Mathew #else 134532ed618SSoby Mathew #define FF_PSTATE FF_PSTATE_ORIG 135532ed618SSoby Mathew #endif 136532ed618SSoby Mathew 137532ed618SSoby Mathew /* Features flags for CPU SUSPEND OS Initiated mode support. Bits [0:0] */ 138030567e6SVarun Wadekar #define FF_MODE_SUPPORT_SHIFT U(0) 139030567e6SVarun Wadekar #define FF_SUPPORTS_OS_INIT_MODE U(1) 140532ed618SSoby Mathew 141532ed618SSoby Mathew /******************************************************************************* 142532ed618SSoby Mathew * PSCI version 143532ed618SSoby Mathew ******************************************************************************/ 144030567e6SVarun Wadekar #define PSCI_MAJOR_VER (U(1) << 16) 145829e97d7SRoberto Vargas #define PSCI_MINOR_VER U(0x1) 146532ed618SSoby Mathew 147532ed618SSoby Mathew /******************************************************************************* 148532ed618SSoby Mathew * PSCI error codes 149532ed618SSoby Mathew ******************************************************************************/ 150532ed618SSoby Mathew #define PSCI_E_SUCCESS 0 151532ed618SSoby Mathew #define PSCI_E_NOT_SUPPORTED -1 152532ed618SSoby Mathew #define PSCI_E_INVALID_PARAMS -2 153532ed618SSoby Mathew #define PSCI_E_DENIED -3 154532ed618SSoby Mathew #define PSCI_E_ALREADY_ON -4 155532ed618SSoby Mathew #define PSCI_E_ON_PENDING -5 156532ed618SSoby Mathew #define PSCI_E_INTERN_FAIL -6 157532ed618SSoby Mathew #define PSCI_E_NOT_PRESENT -7 158532ed618SSoby Mathew #define PSCI_E_DISABLED -8 159532ed618SSoby Mathew #define PSCI_E_INVALID_ADDRESS -9 160532ed618SSoby Mathew 161532ed618SSoby Mathew #define PSCI_INVALID_MPIDR ~((u_register_t)0) 162532ed618SSoby Mathew 16336a8f8fdSRoberto Vargas /* 16436a8f8fdSRoberto Vargas * SYSTEM_RESET2 macros 16536a8f8fdSRoberto Vargas */ 16636a8f8fdSRoberto Vargas #define PSCI_RESET2_TYPE_VENDOR_SHIFT 31 16736a8f8fdSRoberto Vargas #define PSCI_RESET2_TYPE_VENDOR (1U << PSCI_RESET2_TYPE_VENDOR_SHIFT) 16836a8f8fdSRoberto Vargas #define PSCI_RESET2_TYPE_ARCH (0U << PSCI_RESET2_TYPE_VENDOR_SHIFT) 16936a8f8fdSRoberto Vargas #define PSCI_RESET2_SYSTEM_WARM_RESET (PSCI_RESET2_TYPE_ARCH | 0) 17036a8f8fdSRoberto Vargas 171532ed618SSoby Mathew #ifndef __ASSEMBLY__ 172532ed618SSoby Mathew 173532ed618SSoby Mathew #include <stdint.h> 174532ed618SSoby Mathew #include <types.h> 175532ed618SSoby Mathew 176*97373c33SAntonio Nino Diaz /* Function to help build the psci capabilities bitfield */ 177*97373c33SAntonio Nino Diaz 178*97373c33SAntonio Nino Diaz static inline unsigned int define_psci_cap(unsigned int x) 179*97373c33SAntonio Nino Diaz { 180*97373c33SAntonio Nino Diaz return U(1) << (x & U(0x1f)); 181*97373c33SAntonio Nino Diaz } 182*97373c33SAntonio Nino Diaz 183*97373c33SAntonio Nino Diaz 184*97373c33SAntonio Nino Diaz /* Power state helper functions */ 185*97373c33SAntonio Nino Diaz 186*97373c33SAntonio Nino Diaz static inline unsigned int psci_get_pstate_id(unsigned int power_state) 187*97373c33SAntonio Nino Diaz { 188*97373c33SAntonio Nino Diaz return ((power_state) >> PSTATE_ID_SHIFT) & PSTATE_ID_MASK; 189*97373c33SAntonio Nino Diaz } 190*97373c33SAntonio Nino Diaz 191*97373c33SAntonio Nino Diaz static inline unsigned int psci_get_pstate_type(unsigned int power_state) 192*97373c33SAntonio Nino Diaz { 193*97373c33SAntonio Nino Diaz return ((power_state) >> PSTATE_TYPE_SHIFT) & PSTATE_TYPE_MASK; 194*97373c33SAntonio Nino Diaz } 195*97373c33SAntonio Nino Diaz 196*97373c33SAntonio Nino Diaz static inline unsigned int psci_check_power_state(unsigned int power_state) 197*97373c33SAntonio Nino Diaz { 198*97373c33SAntonio Nino Diaz return ((power_state) & PSTATE_VALID_MASK); 199*97373c33SAntonio Nino Diaz } 200*97373c33SAntonio Nino Diaz 201532ed618SSoby Mathew /* 202532ed618SSoby Mathew * These are the states reported by the PSCI_AFFINITY_INFO API for the specified 203532ed618SSoby Mathew * CPU. The definitions of these states can be found in Section 5.7.1 in the 204532ed618SSoby Mathew * PSCI specification (ARM DEN 0022C). 205532ed618SSoby Mathew */ 206532ed618SSoby Mathew typedef enum { 207030567e6SVarun Wadekar AFF_STATE_ON = U(0), 208030567e6SVarun Wadekar AFF_STATE_OFF = U(1), 209030567e6SVarun Wadekar AFF_STATE_ON_PENDING = U(2) 210532ed618SSoby Mathew } aff_info_state_t; 211532ed618SSoby Mathew 212532ed618SSoby Mathew /* 21328d3d614SJeenu Viswambharan * These are the power states reported by PSCI_NODE_HW_STATE API for the 21428d3d614SJeenu Viswambharan * specified CPU. The definitions of these states can be found in Section 5.15.3 21528d3d614SJeenu Viswambharan * of PSCI specification (ARM DEN 0022C). 21628d3d614SJeenu Viswambharan */ 21728d3d614SJeenu Viswambharan typedef enum { 218030567e6SVarun Wadekar HW_ON = U(0), 219030567e6SVarun Wadekar HW_OFF = U(1), 220030567e6SVarun Wadekar HW_STANDBY = U(2) 22128d3d614SJeenu Viswambharan } node_hw_state_t; 22228d3d614SJeenu Viswambharan 22328d3d614SJeenu Viswambharan /* 224532ed618SSoby Mathew * Macro to represent invalid affinity level within PSCI. 225532ed618SSoby Mathew */ 226030567e6SVarun Wadekar #define PSCI_INVALID_PWR_LVL (PLAT_MAX_PWR_LVL + U(1)) 227532ed618SSoby Mathew 228532ed618SSoby Mathew /* 229532ed618SSoby Mathew * Type for representing the local power state at a particular level. 230532ed618SSoby Mathew */ 231532ed618SSoby Mathew typedef uint8_t plat_local_state_t; 232532ed618SSoby Mathew 233532ed618SSoby Mathew /* The local state macro used to represent RUN state. */ 234030567e6SVarun Wadekar #define PSCI_LOCAL_STATE_RUN U(0) 235532ed618SSoby Mathew 236532ed618SSoby Mathew /* 237*97373c33SAntonio Nino Diaz * Function to test whether the plat_local_state is RUN state 238532ed618SSoby Mathew */ 239*97373c33SAntonio Nino Diaz static inline int is_local_state_run(unsigned int plat_local_state) 240*97373c33SAntonio Nino Diaz { 241*97373c33SAntonio Nino Diaz return (plat_local_state == PSCI_LOCAL_STATE_RUN) ? 1 : 0; 242*97373c33SAntonio Nino Diaz } 243532ed618SSoby Mathew 244532ed618SSoby Mathew /* 245*97373c33SAntonio Nino Diaz * Function to test whether the plat_local_state is RETENTION state 246532ed618SSoby Mathew */ 247*97373c33SAntonio Nino Diaz static inline int is_local_state_retn(unsigned int plat_local_state) 248*97373c33SAntonio Nino Diaz { 249*97373c33SAntonio Nino Diaz return ((plat_local_state > PSCI_LOCAL_STATE_RUN) && 250*97373c33SAntonio Nino Diaz (plat_local_state <= PLAT_MAX_RET_STATE)) ? 1 : 0; 251*97373c33SAntonio Nino Diaz } 252532ed618SSoby Mathew 253532ed618SSoby Mathew /* 254*97373c33SAntonio Nino Diaz * Function to test whether the plat_local_state is OFF state 255532ed618SSoby Mathew */ 256*97373c33SAntonio Nino Diaz static inline int is_local_state_off(unsigned int plat_local_state) 257*97373c33SAntonio Nino Diaz { 258*97373c33SAntonio Nino Diaz return ((plat_local_state > PLAT_MAX_RET_STATE) && 259*97373c33SAntonio Nino Diaz (plat_local_state <= PLAT_MAX_OFF_STATE)) ? 1 : 0; 260*97373c33SAntonio Nino Diaz } 261532ed618SSoby Mathew 262532ed618SSoby Mathew /***************************************************************************** 263532ed618SSoby Mathew * This data structure defines the representation of the power state parameter 264532ed618SSoby Mathew * for its exchange between the generic PSCI code and the platform port. For 265532ed618SSoby Mathew * example, it is used by the platform port to specify the requested power 266532ed618SSoby Mathew * states during a power management operation. It is used by the generic code to 267532ed618SSoby Mathew * inform the platform about the target power states that each level should 268532ed618SSoby Mathew * enter. 269532ed618SSoby Mathew ****************************************************************************/ 270532ed618SSoby Mathew typedef struct psci_power_state { 271532ed618SSoby Mathew /* 272532ed618SSoby Mathew * The pwr_domain_state[] stores the local power state at each level 273532ed618SSoby Mathew * for the CPU. 274532ed618SSoby Mathew */ 275030567e6SVarun Wadekar plat_local_state_t pwr_domain_state[PLAT_MAX_PWR_LVL + U(1)]; 276532ed618SSoby Mathew } psci_power_state_t; 277532ed618SSoby Mathew 278532ed618SSoby Mathew /******************************************************************************* 279532ed618SSoby Mathew * Structure used to store per-cpu information relevant to the PSCI service. 280532ed618SSoby Mathew * It is populated in the per-cpu data array. In return we get a guarantee that 281532ed618SSoby Mathew * this information will not reside on a cache line shared with another cpu. 282532ed618SSoby Mathew ******************************************************************************/ 283532ed618SSoby Mathew typedef struct psci_cpu_data { 284532ed618SSoby Mathew /* State as seen by PSCI Affinity Info API */ 285532ed618SSoby Mathew aff_info_state_t aff_info_state; 286532ed618SSoby Mathew 287532ed618SSoby Mathew /* 288532ed618SSoby Mathew * Highest power level which takes part in a power management 289532ed618SSoby Mathew * operation. 290532ed618SSoby Mathew */ 291532ed618SSoby Mathew unsigned char target_pwrlvl; 292532ed618SSoby Mathew 293532ed618SSoby Mathew /* The local power state of this CPU */ 294532ed618SSoby Mathew plat_local_state_t local_state; 295532ed618SSoby Mathew } psci_cpu_data_t; 296532ed618SSoby Mathew 297532ed618SSoby Mathew /******************************************************************************* 298532ed618SSoby Mathew * Structure populated by platform specific code to export routines which 299532ed618SSoby Mathew * perform common low level power management functions 300532ed618SSoby Mathew ******************************************************************************/ 301532ed618SSoby Mathew typedef struct plat_psci_ops { 302532ed618SSoby Mathew void (*cpu_standby)(plat_local_state_t cpu_state); 303532ed618SSoby Mathew int (*pwr_domain_on)(u_register_t mpidr); 304532ed618SSoby Mathew void (*pwr_domain_off)(const psci_power_state_t *target_state); 3051862d620SVarun Wadekar void (*pwr_domain_suspend_pwrdown_early)( 3061862d620SVarun Wadekar const psci_power_state_t *target_state); 307532ed618SSoby Mathew void (*pwr_domain_suspend)(const psci_power_state_t *target_state); 308532ed618SSoby Mathew void (*pwr_domain_on_finish)(const psci_power_state_t *target_state); 309532ed618SSoby Mathew void (*pwr_domain_suspend_finish)( 310532ed618SSoby Mathew const psci_power_state_t *target_state); 311532ed618SSoby Mathew void (*pwr_domain_pwr_down_wfi)( 312532ed618SSoby Mathew const psci_power_state_t *target_state) __dead2; 313532ed618SSoby Mathew void (*system_off)(void) __dead2; 314532ed618SSoby Mathew void (*system_reset)(void) __dead2; 315532ed618SSoby Mathew int (*validate_power_state)(unsigned int power_state, 316532ed618SSoby Mathew psci_power_state_t *req_state); 317532ed618SSoby Mathew int (*validate_ns_entrypoint)(uintptr_t ns_entrypoint); 318532ed618SSoby Mathew void (*get_sys_suspend_power_state)( 319532ed618SSoby Mathew psci_power_state_t *req_state); 320532ed618SSoby Mathew int (*get_pwr_lvl_state_idx)(plat_local_state_t pwr_domain_state, 321532ed618SSoby Mathew int pwrlvl); 322532ed618SSoby Mathew int (*translate_power_state_by_mpidr)(u_register_t mpidr, 323532ed618SSoby Mathew unsigned int power_state, 324532ed618SSoby Mathew psci_power_state_t *output_state); 32528d3d614SJeenu Viswambharan int (*get_node_hw_state)(u_register_t mpidr, unsigned int power_level); 326d4c596beSRoberto Vargas int (*mem_protect_chk)(uintptr_t base, u_register_t length); 327d4c596beSRoberto Vargas int (*read_mem_protect)(int *val); 328d4c596beSRoberto Vargas int (*write_mem_protect)(int val); 32936a8f8fdSRoberto Vargas int (*system_reset2)(int is_vendor, 33036a8f8fdSRoberto Vargas int reset_type, u_register_t cookie); 331532ed618SSoby Mathew } plat_psci_ops_t; 332532ed618SSoby Mathew 333532ed618SSoby Mathew /******************************************************************************* 334532ed618SSoby Mathew * Function & Data prototypes 335532ed618SSoby Mathew ******************************************************************************/ 336532ed618SSoby Mathew unsigned int psci_version(void); 337532ed618SSoby Mathew int psci_cpu_on(u_register_t target_cpu, 338532ed618SSoby Mathew uintptr_t entrypoint, 339532ed618SSoby Mathew u_register_t context_id); 340532ed618SSoby Mathew int psci_cpu_suspend(unsigned int power_state, 341532ed618SSoby Mathew uintptr_t entrypoint, 342532ed618SSoby Mathew u_register_t context_id); 343532ed618SSoby Mathew int psci_system_suspend(uintptr_t entrypoint, u_register_t context_id); 344532ed618SSoby Mathew int psci_cpu_off(void); 345532ed618SSoby Mathew int psci_affinity_info(u_register_t target_affinity, 346532ed618SSoby Mathew unsigned int lowest_affinity_level); 347532ed618SSoby Mathew int psci_migrate(u_register_t target_cpu); 348532ed618SSoby Mathew int psci_migrate_info_type(void); 349532ed618SSoby Mathew long psci_migrate_info_up_cpu(void); 35028d3d614SJeenu Viswambharan int psci_node_hw_state(u_register_t target_cpu, 35128d3d614SJeenu Viswambharan unsigned int power_level); 352532ed618SSoby Mathew int psci_features(unsigned int psci_fid); 353532ed618SSoby Mathew void __dead2 psci_power_down_wfi(void); 354cf0b1492SSoby Mathew void psci_arch_setup(void); 355cf0b1492SSoby Mathew 356cf0b1492SSoby Mathew /* 357cf0b1492SSoby Mathew * The below API is deprecated. This is now replaced by bl31_warmboot_entry in 358cf0b1492SSoby Mathew * AArch64. 359cf0b1492SSoby Mathew */ 360cf0b1492SSoby Mathew void psci_entrypoint(void) __deprecated; 361cf0b1492SSoby Mathew 362532ed618SSoby Mathew #endif /*__ASSEMBLY__*/ 363532ed618SSoby Mathew 364*97373c33SAntonio Nino Diaz #endif /* PSCI_H */ 365