blob: b389287b003ea98279913afd28015dbe4047a757 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Dan Handleye83b0ca2014-01-14 18:17:09 +00002 * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
Dan Handley2bd4ef22014-04-09 13:14:54 +010031#include <arch.h>
Achin Gupta4f6ad662013-10-25 09:08:21 +010032#include <arch_helpers.h>
Dan Handley2bd4ef22014-04-09 13:14:54 +010033#include <assert.h>
Soby Mathew96168382014-12-17 14:47:57 +000034#include <debug.h>
35#include <platform.h>
Jeenu Viswambharancaa84932014-02-06 10:36:15 +000036#include <runtime_svc.h>
Soby Mathew6cdddaf2015-01-07 11:10:22 +000037#include <std_svc.h>
Dan Handley714a0d22014-04-09 13:13:04 +010038#include "psci_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010039
40/*******************************************************************************
41 * PSCI frontend api for servicing SMCs. Described in the PSCI spec.
42 ******************************************************************************/
43int psci_cpu_on(unsigned long target_cpu,
44 unsigned long entrypoint,
45 unsigned long context_id)
46
47{
48 int rc;
Achin Gupta0959db52013-12-02 17:33:04 +000049 unsigned int start_afflvl, end_afflvl;
Soby Mathew8595b872015-01-06 15:36:38 +000050 entry_point_info_t ep;
Achin Gupta4f6ad662013-10-25 09:08:21 +010051
52 /* Determine if the cpu exists of not */
53 rc = psci_validate_mpidr(target_cpu, MPIDR_AFFLVL0);
54 if (rc != PSCI_E_SUCCESS) {
Soby Mathew74e52a72014-10-02 16:56:51 +010055 return PSCI_E_INVALID_PARAMS;
56 }
57
58 /* Validate the entrypoint using platform pm_ops */
59 if (psci_plat_pm_ops->validate_ns_entrypoint) {
60 rc = psci_plat_pm_ops->validate_ns_entrypoint(entrypoint);
61 if (rc != PSCI_E_SUCCESS) {
62 assert(rc == PSCI_E_INVALID_PARAMS);
63 return PSCI_E_INVALID_PARAMS;
64 }
Achin Gupta4f6ad662013-10-25 09:08:21 +010065 }
66
Achin Gupta0959db52013-12-02 17:33:04 +000067 /*
Soby Mathew8595b872015-01-06 15:36:38 +000068 * Verify and derive the re-entry information for
69 * the non-secure world from the non-secure state from
70 * where this call originated.
71 */
72 rc = psci_get_ns_ep_info(&ep, entrypoint, context_id);
73 if (rc != PSCI_E_SUCCESS)
74 return rc;
75
76
77 /*
Achin Gupta0959db52013-12-02 17:33:04 +000078 * To turn this cpu on, specify which affinity
79 * levels need to be turned on
80 */
81 start_afflvl = MPIDR_AFFLVL0;
Soby Mathew2b7de2b2015-02-12 14:45:02 +000082 end_afflvl = PLATFORM_MAX_AFFLVL;
Achin Gupta4f6ad662013-10-25 09:08:21 +010083 rc = psci_afflvl_on(target_cpu,
Soby Mathew8595b872015-01-06 15:36:38 +000084 &ep,
Achin Gupta4f6ad662013-10-25 09:08:21 +010085 start_afflvl,
Achin Gupta0959db52013-12-02 17:33:04 +000086 end_afflvl);
Achin Gupta4f6ad662013-10-25 09:08:21 +010087
Achin Gupta4f6ad662013-10-25 09:08:21 +010088 return rc;
89}
90
91unsigned int psci_version(void)
92{
93 return PSCI_MAJOR_VER | PSCI_MINOR_VER;
94}
95
96int psci_cpu_suspend(unsigned int power_state,
97 unsigned long entrypoint,
98 unsigned long context_id)
99{
100 int rc;
Achin Gupta0959db52013-12-02 17:33:04 +0000101 unsigned int target_afflvl, pstate_type;
Soby Mathew8595b872015-01-06 15:36:38 +0000102 entry_point_info_t ep;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100103
Vikram Kanigirif100f412014-04-01 19:26:26 +0100104 /* Check SBZ bits in power state are zero */
105 if (psci_validate_power_state(power_state))
106 return PSCI_E_INVALID_PARAMS;
107
Achin Gupta4f6ad662013-10-25 09:08:21 +0100108 /* Sanity check the requested state */
Achin Gupta0959db52013-12-02 17:33:04 +0000109 target_afflvl = psci_get_pstate_afflvl(power_state);
Soby Mathew2b7de2b2015-02-12 14:45:02 +0000110 if (target_afflvl > PLATFORM_MAX_AFFLVL)
Vikram Kanigiri3b7c59b2014-03-21 11:57:10 +0000111 return PSCI_E_INVALID_PARAMS;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100112
Soby Mathew74e52a72014-10-02 16:56:51 +0100113 /* Validate the power_state using platform pm_ops */
114 if (psci_plat_pm_ops->validate_power_state) {
115 rc = psci_plat_pm_ops->validate_power_state(power_state);
116 if (rc != PSCI_E_SUCCESS) {
117 assert(rc == PSCI_E_INVALID_PARAMS);
118 return PSCI_E_INVALID_PARAMS;
119 }
120 }
121
122 /* Validate the entrypoint using platform pm_ops */
123 if (psci_plat_pm_ops->validate_ns_entrypoint) {
124 rc = psci_plat_pm_ops->validate_ns_entrypoint(entrypoint);
125 if (rc != PSCI_E_SUCCESS) {
126 assert(rc == PSCI_E_INVALID_PARAMS);
127 return PSCI_E_INVALID_PARAMS;
128 }
129 }
130
Achin Gupta42c52802014-05-09 19:32:25 +0100131 /* Determine the 'state type' in the 'power_state' parameter */
Vikram Kanigiri3b7c59b2014-03-21 11:57:10 +0000132 pstate_type = psci_get_pstate_type(power_state);
Achin Gupta42c52802014-05-09 19:32:25 +0100133
134 /*
135 * Ensure that we have a platform specific handler for entering
136 * a standby state.
137 */
Vikram Kanigiri3b7c59b2014-03-21 11:57:10 +0000138 if (pstate_type == PSTATE_TYPE_STANDBY) {
Achin Gupta42c52802014-05-09 19:32:25 +0100139 if (!psci_plat_pm_ops->affinst_standby)
Vikram Kanigiri3b7c59b2014-03-21 11:57:10 +0000140 return PSCI_E_INVALID_PARAMS;
Achin Gupta42c52802014-05-09 19:32:25 +0100141
Soby Mathew74e52a72014-10-02 16:56:51 +0100142 psci_plat_pm_ops->affinst_standby(power_state);
143 return PSCI_E_SUCCESS;
Vikram Kanigiri3b7c59b2014-03-21 11:57:10 +0000144 }
Achin Gupta4f6ad662013-10-25 09:08:21 +0100145
Achin Gupta42c52802014-05-09 19:32:25 +0100146 /*
Soby Mathew8595b872015-01-06 15:36:38 +0000147 * Verify and derive the re-entry information for
148 * the non-secure world from the non-secure state from
149 * where this call originated.
150 */
151 rc = psci_get_ns_ep_info(&ep, entrypoint, context_id);
152 if (rc != PSCI_E_SUCCESS)
153 return rc;
154
Soby Mathewf5121572014-09-30 11:19:51 +0100155 /* Save PSCI power state parameter for the core in suspend context */
156 psci_set_suspend_power_state(power_state);
157
Soby Mathew8595b872015-01-06 15:36:38 +0000158 /*
Achin Gupta42c52802014-05-09 19:32:25 +0100159 * Do what is needed to enter the power down state. Upon success,
Soby Mathew74e52a72014-10-02 16:56:51 +0100160 * enter the final wfi which will power down this CPU.
Achin Gupta42c52802014-05-09 19:32:25 +0100161 */
Soby Mathew74e52a72014-10-02 16:56:51 +0100162 psci_afflvl_suspend(&ep,
163 MPIDR_AFFLVL0,
164 target_afflvl);
165
Soby Mathewf5121572014-09-30 11:19:51 +0100166 /* Reset PSCI power state parameter for the core. */
167 psci_set_suspend_power_state(PSCI_INVALID_DATA);
Soby Mathew74e52a72014-10-02 16:56:51 +0100168 return PSCI_E_SUCCESS;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100169}
170
Soby Mathew96168382014-12-17 14:47:57 +0000171int psci_system_suspend(unsigned long entrypoint,
172 unsigned long context_id)
173{
174 int rc;
175 unsigned int power_state;
176 entry_point_info_t ep;
177
178 /* Validate the entrypoint using platform pm_ops */
179 if (psci_plat_pm_ops->validate_ns_entrypoint) {
180 rc = psci_plat_pm_ops->validate_ns_entrypoint(entrypoint);
181 if (rc != PSCI_E_SUCCESS) {
182 assert(rc == PSCI_E_INVALID_PARAMS);
183 return PSCI_E_INVALID_PARAMS;
184 }
185 }
186
187 /* Check if the current CPU is the last ON CPU in the system */
188 if (!psci_is_last_on_cpu())
189 return PSCI_E_DENIED;
190
191 /*
192 * Verify and derive the re-entry information for
193 * the non-secure world from the non-secure state from
194 * where this call originated.
195 */
196 rc = psci_get_ns_ep_info(&ep, entrypoint, context_id);
197 if (rc != PSCI_E_SUCCESS)
198 return rc;
199
200 /*
201 * Assert that the required pm_ops hook is implemented to ensure that
202 * the capability detected during psci_setup() is valid.
203 */
204 assert(psci_plat_pm_ops->get_sys_suspend_power_state);
205
206 /*
207 * Query the platform for the power_state required for system suspend
208 */
209 power_state = psci_plat_pm_ops->get_sys_suspend_power_state();
210
211 /* Save PSCI power state parameter for the core in suspend context */
212 psci_set_suspend_power_state(power_state);
213
214 /*
215 * Do what is needed to enter the power down state. Upon success,
216 * enter the final wfi which will power down this cpu.
217 */
218 psci_afflvl_suspend(&ep,
219 MPIDR_AFFLVL0,
220 PLATFORM_MAX_AFFLVL);
221
222 /* Reset PSCI power state parameter for the core. */
223 psci_set_suspend_power_state(PSCI_INVALID_DATA);
224 return PSCI_E_SUCCESS;
225}
226
Achin Gupta4f6ad662013-10-25 09:08:21 +0100227int psci_cpu_off(void)
228{
229 int rc;
Soby Mathew2b7de2b2015-02-12 14:45:02 +0000230 int target_afflvl = PLATFORM_MAX_AFFLVL;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100231
Achin Gupta4f6ad662013-10-25 09:08:21 +0100232 /*
233 * Traverse from the highest to the lowest affinity level. When the
234 * lowest affinity level is hit, all the locks are acquired. State
235 * management is done immediately followed by cpu, cluster ...
236 * ..target_afflvl specific actions as this function unwinds back.
237 */
Andrew Thoelke2bc07852014-06-09 12:44:21 +0100238 rc = psci_afflvl_off(MPIDR_AFFLVL0, target_afflvl);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100239
Achin Gupta3140a9e2013-12-02 16:23:12 +0000240 /*
241 * The only error cpu_off can return is E_DENIED. So check if that's
242 * indeed the case.
243 */
Achin Gupta42c52802014-05-09 19:32:25 +0100244 assert (rc == PSCI_E_DENIED);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100245
246 return rc;
247}
248
249int psci_affinity_info(unsigned long target_affinity,
250 unsigned int lowest_affinity_level)
251{
252 int rc = PSCI_E_INVALID_PARAMS;
253 unsigned int aff_state;
Dan Handleye2712bc2014-04-10 15:37:22 +0100254 aff_map_node_t *node;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100255
Soby Mathew2b7de2b2015-02-12 14:45:02 +0000256 if (lowest_affinity_level > PLATFORM_MAX_AFFLVL)
Achin Gupta75f73672013-12-05 16:33:10 +0000257 return rc;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100258
259 node = psci_get_aff_map_node(target_affinity, lowest_affinity_level);
260 if (node && (node->state & PSCI_AFF_PRESENT)) {
Achin Gupta75f73672013-12-05 16:33:10 +0000261
262 /*
263 * TODO: For affinity levels higher than 0 i.e. cpu, the
264 * state will always be either ON or OFF. Need to investigate
265 * how critical is it to support ON_PENDING here.
266 */
267 aff_state = psci_get_state(node);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100268
269 /* A suspended cpu is available & on for the OS */
270 if (aff_state == PSCI_STATE_SUSPEND) {
271 aff_state = PSCI_STATE_ON;
272 }
273
274 rc = aff_state;
275 }
Achin Gupta75f73672013-12-05 16:33:10 +0000276
Achin Gupta4f6ad662013-10-25 09:08:21 +0100277 return rc;
278}
279
Soby Mathew110fe362014-10-23 10:35:34 +0100280int psci_migrate(unsigned long target_cpu)
Achin Gupta4f6ad662013-10-25 09:08:21 +0100281{
Soby Mathew110fe362014-10-23 10:35:34 +0100282 int rc;
283 unsigned long resident_cpu_mpidr;
284
285 rc = psci_spd_migrate_info(&resident_cpu_mpidr);
286 if (rc != PSCI_TOS_UP_MIG_CAP)
287 return (rc == PSCI_TOS_NOT_UP_MIG_CAP) ?
288 PSCI_E_DENIED : PSCI_E_NOT_SUPPORTED;
289
290 /*
291 * Migrate should only be invoked on the CPU where
292 * the Secure OS is resident.
293 */
294 if (resident_cpu_mpidr != read_mpidr_el1())
295 return PSCI_E_NOT_PRESENT;
296
297 /* Check the validity of the specified target cpu */
298 rc = psci_validate_mpidr(target_cpu, MPIDR_AFFLVL0);
299 if (rc != PSCI_E_SUCCESS)
300 return PSCI_E_INVALID_PARAMS;
301
302 assert(psci_spd_pm && psci_spd_pm->svc_migrate);
303
304 rc = psci_spd_pm->svc_migrate(read_mpidr_el1(), target_cpu);
305 assert(rc == PSCI_E_SUCCESS || rc == PSCI_E_INTERN_FAIL);
306
307 return rc;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100308}
309
Soby Mathew110fe362014-10-23 10:35:34 +0100310int psci_migrate_info_type(void)
Achin Gupta4f6ad662013-10-25 09:08:21 +0100311{
Soby Mathew110fe362014-10-23 10:35:34 +0100312 unsigned long resident_cpu_mpidr;
313
314 return psci_spd_migrate_info(&resident_cpu_mpidr);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100315}
316
Soby Mathew110fe362014-10-23 10:35:34 +0100317long psci_migrate_info_up_cpu(void)
Achin Gupta4f6ad662013-10-25 09:08:21 +0100318{
Soby Mathew110fe362014-10-23 10:35:34 +0100319 unsigned long resident_cpu_mpidr;
320 int rc;
321
Achin Gupta4f6ad662013-10-25 09:08:21 +0100322 /*
Soby Mathew110fe362014-10-23 10:35:34 +0100323 * Return value of this depends upon what
324 * psci_spd_migrate_info() returns.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100325 */
Soby Mathew110fe362014-10-23 10:35:34 +0100326 rc = psci_spd_migrate_info(&resident_cpu_mpidr);
327 if (rc != PSCI_TOS_NOT_UP_MIG_CAP && rc != PSCI_TOS_UP_MIG_CAP)
328 return PSCI_E_INVALID_PARAMS;
329
330 return resident_cpu_mpidr;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100331}
332
Soby Mathew6cdddaf2015-01-07 11:10:22 +0000333int psci_features(unsigned int psci_fid)
334{
335 uint32_t local_caps = psci_caps;
336
337 /* Check if it is a 64 bit function */
338 if (((psci_fid >> FUNCID_CC_SHIFT) & FUNCID_CC_MASK) == SMC_64)
339 local_caps &= PSCI_CAP_64BIT_MASK;
340
341 /* Check for invalid fid */
342 if (!(is_std_svc_call(psci_fid) && is_valid_fast_smc(psci_fid)
343 && is_psci_fid(psci_fid)))
344 return PSCI_E_NOT_SUPPORTED;
345
346
347 /* Check if the psci fid is supported or not */
348 if (!(local_caps & define_psci_cap(psci_fid)))
349 return PSCI_E_NOT_SUPPORTED;
350
351 /* Format the feature flags */
352 if (psci_fid == PSCI_CPU_SUSPEND_AARCH32 ||
353 psci_fid == PSCI_CPU_SUSPEND_AARCH64) {
354 /*
355 * The trusted firmware uses the original power state format
356 * and does not support OS Initiated Mode.
357 */
358 return (FF_PSTATE_ORIG << FF_PSTATE_SHIFT) |
359 ((!FF_SUPPORTS_OS_INIT_MODE) << FF_MODE_SUPPORT_SHIFT);
360 }
361
362 /* Return 0 for all other fid's */
363 return PSCI_E_SUCCESS;
364}
365
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000366/*******************************************************************************
367 * PSCI top level handler for servicing SMCs.
368 ******************************************************************************/
369uint64_t psci_smc_handler(uint32_t smc_fid,
370 uint64_t x1,
371 uint64_t x2,
372 uint64_t x3,
373 uint64_t x4,
374 void *cookie,
375 void *handle,
376 uint64_t flags)
377{
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100378 if (is_caller_secure(flags))
379 SMC_RET1(handle, SMC_UNK);
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000380
Soby Mathew61e615b2015-01-15 11:49:49 +0000381 /* Check the fid against the capabilities */
382 if (!(psci_caps & define_psci_cap(smc_fid)))
383 SMC_RET1(handle, SMC_UNK);
384
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100385 if (((smc_fid >> FUNCID_CC_SHIFT) & FUNCID_CC_MASK) == SMC_32) {
386 /* 32-bit PSCI function, clear top parameter bits */
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000387
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100388 x1 = (uint32_t)x1;
389 x2 = (uint32_t)x2;
390 x3 = (uint32_t)x3;
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000391
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100392 switch (smc_fid) {
393 case PSCI_VERSION:
394 SMC_RET1(handle, psci_version());
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000395
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100396 case PSCI_CPU_OFF:
Achin Guptae1aa5162014-06-26 09:58:52 +0100397 SMC_RET1(handle, psci_cpu_off());
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000398
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100399 case PSCI_CPU_SUSPEND_AARCH32:
Achin Guptae1aa5162014-06-26 09:58:52 +0100400 SMC_RET1(handle, psci_cpu_suspend(x1, x2, x3));
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000401
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100402 case PSCI_CPU_ON_AARCH32:
403 SMC_RET1(handle, psci_cpu_on(x1, x2, x3));
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000404
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100405 case PSCI_AFFINITY_INFO_AARCH32:
406 SMC_RET1(handle, psci_affinity_info(x1, x2));
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000407
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100408 case PSCI_MIG_AARCH32:
409 SMC_RET1(handle, psci_migrate(x1));
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000410
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100411 case PSCI_MIG_INFO_TYPE:
412 SMC_RET1(handle, psci_migrate_info_type());
413
414 case PSCI_MIG_INFO_UP_CPU_AARCH32:
415 SMC_RET1(handle, psci_migrate_info_up_cpu());
416
Soby Mathew96168382014-12-17 14:47:57 +0000417 case PSCI_SYSTEM_SUSPEND_AARCH32:
418 SMC_RET1(handle, psci_system_suspend(x1, x2));
419
Juan Castillo4dc4a472014-08-12 11:17:06 +0100420 case PSCI_SYSTEM_OFF:
421 psci_system_off();
422 /* We should never return from psci_system_off() */
423
424 case PSCI_SYSTEM_RESET:
425 psci_system_reset();
426 /* We should never return from psci_system_reset() */
427
Soby Mathew6cdddaf2015-01-07 11:10:22 +0000428 case PSCI_FEATURES:
429 SMC_RET1(handle, psci_features(x1));
430
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100431 default:
432 break;
433 }
434 } else {
435 /* 64-bit PSCI function */
436
437 switch (smc_fid) {
438 case PSCI_CPU_SUSPEND_AARCH64:
Achin Guptae1aa5162014-06-26 09:58:52 +0100439 SMC_RET1(handle, psci_cpu_suspend(x1, x2, x3));
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100440
441 case PSCI_CPU_ON_AARCH64:
442 SMC_RET1(handle, psci_cpu_on(x1, x2, x3));
443
444 case PSCI_AFFINITY_INFO_AARCH64:
445 SMC_RET1(handle, psci_affinity_info(x1, x2));
446
447 case PSCI_MIG_AARCH64:
448 SMC_RET1(handle, psci_migrate(x1));
449
450 case PSCI_MIG_INFO_UP_CPU_AARCH64:
451 SMC_RET1(handle, psci_migrate_info_up_cpu());
452
Soby Mathew96168382014-12-17 14:47:57 +0000453 case PSCI_SYSTEM_SUSPEND_AARCH64:
454 SMC_RET1(handle, psci_system_suspend(x1, x2));
455
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100456 default:
457 break;
458 }
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000459 }
460
Andrew Thoelke89a3c842014-06-10 16:37:37 +0100461 WARN("Unimplemented PSCI Call: 0x%x \n", smc_fid);
462 SMC_RET1(handle, SMC_UNK);
Jeenu Viswambharancaa84932014-02-06 10:36:15 +0000463}