blob: 87ba7327818c22ddcdc842cc72cc36bc1ca3a220 [file] [log] [blame]
Tejas Patel354fe572018-12-14 00:55:37 -08001/*
Tejas Patel5b433b62020-01-29 22:09:55 -08002 * Copyright (c) 2019-2020, Xilinx, Inc. All rights reserved.
Tejas Patel354fe572018-12-14 00:55:37 -08003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/*
8 * Top-level SMC handler for Versal power management calls and
9 * IPI setup functions for communication with PMC.
10 */
11
12#include <errno.h>
13#include <plat_private.h>
Tejas Patel59c608a2019-01-09 04:10:29 -080014#include <stdbool.h>
15#include <common/runtime_svc.h>
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +053016#include <plat/common/platform.h>
Tejas Patel59c608a2019-01-09 04:10:29 -080017#include "pm_api_sys.h"
Tejas Patel354fe572018-12-14 00:55:37 -080018#include "pm_client.h"
19#include "pm_ipi.h"
Venkatesh Yadav Abbarapuaa4898a2021-03-31 03:07:40 -060020#include <drivers/arm/gicv3.h>
21
22#define XSCUGIC_SGIR_EL1_INITID_SHIFT 24U
23#define INVALID_SGI 0xFF
24DEFINE_RENAME_SYSREG_RW_FUNCS(icc_asgi1r_el1, S3_0_C12_C11_6)
Tejas Patel354fe572018-12-14 00:55:37 -080025
Tejas Patel59c608a2019-01-09 04:10:29 -080026/* pm_up = true - UP, pm_up = false - DOWN */
27static bool pm_up;
Venkatesh Yadav Abbarapuaa4898a2021-03-31 03:07:40 -060028static unsigned int sgi = INVALID_SGI;
Tejas Patel59c608a2019-01-09 04:10:29 -080029
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +053030static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle,
31 void *cookie)
32{
Venkatesh Yadav Abbarapuaa4898a2021-03-31 03:07:40 -060033 int cpu;
34 unsigned int reg;
35
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +053036 (void)plat_ic_acknowledge_interrupt();
Venkatesh Yadav Abbarapuaa4898a2021-03-31 03:07:40 -060037 cpu = plat_my_core_pos() + 1;
38
39 if (sgi != INVALID_SGI) {
40 reg = (cpu | (sgi << XSCUGIC_SGIR_EL1_INITID_SHIFT));
41 write_icc_asgi1r_el1(reg);
42 }
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +053043
44 /* Clear FIQ */
45 plat_ic_end_of_interrupt(id);
46
Venkatesh Yadav Abbarapuaa4898a2021-03-31 03:07:40 -060047 return 0;
48}
49
50/**
51 * pm_register_sgi() - PM register the IPI interrupt
52 *
53 * @sgi - SGI number to be used for communication.
54 * @return On success, the initialization function must return 0.
55 * Any other return value will cause the framework to ignore
56 * the service
57 *
58 * Update the SGI number to be used.
59 *
60 */
61int pm_register_sgi(unsigned int sgi_num)
62{
63 if (sgi != INVALID_SGI) {
64 return -EBUSY;
65 }
66
67 if (sgi_num >= GICV3_MAX_SGI_TARGETS) {
68 return -EINVAL;
69 }
70
71 sgi = sgi_num;
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +053072 return 0;
73}
74
Tejas Patel354fe572018-12-14 00:55:37 -080075/**
76 * pm_setup() - PM service setup
77 *
78 * @return On success, the initialization function must return 0.
79 * Any other return value will cause the framework to ignore
80 * the service
81 *
82 * Initialization functions for Versal power management for
83 * communicaton with PMC.
84 *
85 * Called from sip_svc_setup initialization function with the
86 * rt_svc_init signature.
87 */
88int pm_setup(void)
89{
90 int status, ret = 0;
91
92 status = pm_ipi_init(primary_proc);
93
94 if (status < 0) {
95 INFO("BL31: PM Service Init Failed, Error Code %d!\n", status);
96 ret = status;
Tejas Patel59c608a2019-01-09 04:10:29 -080097 } else {
98 pm_up = true;
Tejas Patel354fe572018-12-14 00:55:37 -080099 }
100
Shubhrajyoti Dattaabf61222021-03-17 23:01:17 +0530101 /*
102 * Enable IPI IRQ
103 * assume the rich OS is OK to handle callback IRQs now.
104 * Even if we were wrong, it would not enable the IRQ in
105 * the GIC.
106 */
107 pm_ipi_irq_enable(primary_proc);
108
109 ret = request_intr_type_el3(PLAT_VERSAL_IPI_IRQ, ipi_fiq_handler);
110 if (ret) {
111 WARN("BL31: registering IPI interrupt failed\n");
112 }
Tejas Patel354fe572018-12-14 00:55:37 -0800113 return ret;
114}
Tejas Patel59c608a2019-01-09 04:10:29 -0800115
116/**
117 * pm_smc_handler() - SMC handler for PM-API calls coming from EL1/EL2.
118 * @smc_fid - Function Identifier
119 * @x1 - x4 - Arguments
120 * @cookie - Unused
121 * @handler - Pointer to caller's context structure
122 *
123 * @return - Unused
124 *
125 * Determines that smc_fid is valid and supported PM SMC Function ID from the
126 * list of pm_api_ids, otherwise completes the request with
127 * the unknown SMC Function ID
128 *
129 * The SMC calls for PM service are forwarded from SIP Service SMC handler
130 * function with rt_svc_handle signature
131 */
132uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
133 uint64_t x4, void *cookie, void *handle, uint64_t flags)
134{
135 enum pm_ret_status ret;
136
137 uint32_t pm_arg[4];
Tejas Patel18072da2021-02-25 20:16:56 -0800138 uint32_t security_flag = SECURE_FLAG;
Tejas Patel59c608a2019-01-09 04:10:29 -0800139
140 /* Handle case where PM wasn't initialized properly */
141 if (!pm_up)
142 SMC_RET1(handle, SMC_UNK);
143
144 pm_arg[0] = (uint32_t)x1;
145 pm_arg[1] = (uint32_t)(x1 >> 32);
146 pm_arg[2] = (uint32_t)x2;
147 pm_arg[3] = (uint32_t)(x2 >> 32);
148
Tejas Patel18072da2021-02-25 20:16:56 -0800149 /*
150 * Mark BIT24 payload (i.e 1st bit of pm_arg[3] ) as non-secure (1)
151 * if smc called is non secure
152 */
153 if (is_caller_non_secure(flags)) {
154 security_flag = NON_SECURE_FLAG;
155 }
156
Tejas Patel59c608a2019-01-09 04:10:29 -0800157 switch (smc_fid & FUNCID_NUM_MASK) {
158 /* PM API Functions */
159 case PM_SELF_SUSPEND:
160 ret = pm_self_suspend(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800161 pm_arg[3], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800162 SMC_RET1(handle, (uint64_t)ret);
163
Tejas Patel6b282252019-01-10 03:03:47 -0800164 case PM_FORCE_POWERDOWN:
Tejas Patel18072da2021-02-25 20:16:56 -0800165 ret = pm_force_powerdown(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel6b282252019-01-10 03:03:47 -0800166 SMC_RET1(handle, (uint64_t)ret);
167
Tejas Patel59c608a2019-01-09 04:10:29 -0800168 case PM_REQ_SUSPEND:
169 ret = pm_req_suspend(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800170 pm_arg[3], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800171 SMC_RET1(handle, (uint64_t)ret);
172
173 case PM_ABORT_SUSPEND:
Tejas Patel18072da2021-02-25 20:16:56 -0800174 ret = pm_abort_suspend(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800175 SMC_RET1(handle, (uint64_t)ret);
176
Tejas Patel6b282252019-01-10 03:03:47 -0800177 case PM_SYSTEM_SHUTDOWN:
Tejas Patel18072da2021-02-25 20:16:56 -0800178 ret = pm_system_shutdown(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel6b282252019-01-10 03:03:47 -0800179 SMC_RET1(handle, (uint64_t)ret);
180
Tejas Patel49cd8712019-01-23 14:18:51 +0530181 case PM_REQ_WAKEUP:
Tejas Patel18072da2021-02-25 20:16:56 -0800182 ret = pm_req_wakeup(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3],
183 security_flag);
Tejas Patel49cd8712019-01-23 14:18:51 +0530184 SMC_RET1(handle, (uint64_t)ret);
185
Tejas Pateldb812052019-01-23 14:18:53 +0530186 case PM_SET_WAKEUP_SOURCE:
Tejas Patel18072da2021-02-25 20:16:56 -0800187 ret = pm_set_wakeup_source(pm_arg[0], pm_arg[1], pm_arg[2],
188 security_flag);
Tejas Pateldb812052019-01-23 14:18:53 +0530189 SMC_RET1(handle, (uint64_t)ret);
190
Tejas Patel59c608a2019-01-09 04:10:29 -0800191 case PM_REQUEST_DEVICE:
192 ret = pm_request_device(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800193 pm_arg[3], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800194 SMC_RET1(handle, (uint64_t)ret);
195
196 case PM_RELEASE_DEVICE:
Tejas Patel18072da2021-02-25 20:16:56 -0800197 ret = pm_release_device(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800198 SMC_RET1(handle, (uint64_t)ret);
199
200 case PM_SET_REQUIREMENT:
201 ret = pm_set_requirement(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800202 pm_arg[3], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800203 SMC_RET1(handle, (uint64_t)ret);
204
205 case PM_GET_API_VERSION:
206 {
207 uint32_t api_version;
208
Tejas Patel18072da2021-02-25 20:16:56 -0800209 ret = pm_get_api_version(&api_version, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800210 SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS |
211 ((uint64_t)api_version << 32));
212 }
213
214 case PM_GET_DEVICE_STATUS:
215 {
216 uint32_t buff[3];
217
Tejas Patel18072da2021-02-25 20:16:56 -0800218 ret = pm_get_device_status(pm_arg[0], buff, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800219 SMC_RET2(handle, (uint64_t)ret | ((uint64_t)buff[0] << 32),
220 (uint64_t)buff[1] | ((uint64_t)buff[2] << 32));
221 }
222
223 case PM_RESET_ASSERT:
Tejas Patel18072da2021-02-25 20:16:56 -0800224 ret = pm_reset_assert(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800225 SMC_RET1(handle, (uint64_t)ret);
226
227 case PM_RESET_GET_STATUS:
228 {
229 uint32_t reset_status;
230
Tejas Patel18072da2021-02-25 20:16:56 -0800231 ret = pm_reset_get_status(pm_arg[0], &reset_status,
232 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800233 SMC_RET1(handle, (uint64_t)ret |
234 ((uint64_t)reset_status << 32));
235 }
236
Tejas Patel02662022019-01-21 17:56:49 +0530237 case PM_INIT_FINALIZE:
Tejas Patel18072da2021-02-25 20:16:56 -0800238 ret = pm_init_finalize(security_flag);
Ravi Patel476b5b12019-08-12 03:10:10 -0700239 SMC_RET1(handle, (uint64_t)ret);
Tejas Patel02662022019-01-21 17:56:49 +0530240
Rajan Vaja649e9242019-03-04 11:09:40 +0530241 case PM_GET_CALLBACK_DATA:
242 {
243 uint32_t result[4] = {0};
244
Tejas Patel18072da2021-02-25 20:16:56 -0800245 pm_get_callbackdata(result, ARRAY_SIZE(result), security_flag);
Rajan Vaja649e9242019-03-04 11:09:40 +0530246 SMC_RET2(handle,
247 (uint64_t)result[0] | ((uint64_t)result[1] << 32),
248 (uint64_t)result[2] | ((uint64_t)result[3] << 32));
249 }
250
Tejas Patel59c608a2019-01-09 04:10:29 -0800251 case PM_PINCTRL_REQUEST:
Tejas Patel18072da2021-02-25 20:16:56 -0800252 ret = pm_pinctrl_request(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800253 SMC_RET1(handle, (uint64_t)ret);
254
255 case PM_PINCTRL_RELEASE:
Tejas Patel18072da2021-02-25 20:16:56 -0800256 ret = pm_pinctrl_release(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800257 SMC_RET1(handle, (uint64_t)ret);
258
259 case PM_PINCTRL_GET_FUNCTION:
260 {
261 uint32_t value = 0;
262
Tejas Patel18072da2021-02-25 20:16:56 -0800263 ret = pm_pinctrl_get_function(pm_arg[0], &value, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800264 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
265 }
266
267 case PM_PINCTRL_SET_FUNCTION:
Tejas Patel18072da2021-02-25 20:16:56 -0800268 ret = pm_pinctrl_set_function(pm_arg[0], pm_arg[1],
269 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800270 SMC_RET1(handle, (uint64_t)ret);
271
272 case PM_PINCTRL_CONFIG_PARAM_GET:
273 {
274 uint32_t value;
275
Tejas Patel18072da2021-02-25 20:16:56 -0800276 ret = pm_pinctrl_get_pin_param(pm_arg[0], pm_arg[1], &value,
277 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800278 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
279 }
280
281 case PM_PINCTRL_CONFIG_PARAM_SET:
Tejas Patel18072da2021-02-25 20:16:56 -0800282 ret = pm_pinctrl_set_pin_param(pm_arg[0], pm_arg[1], pm_arg[2],
283 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800284 SMC_RET1(handle, (uint64_t)ret);
285
Tejas Patel9141f442019-01-10 03:03:48 -0800286 case PM_IOCTL:
287 {
288 uint32_t value;
289
290 ret = pm_api_ioctl(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800291 pm_arg[3], &value, security_flag);
Tejas Patel9141f442019-01-10 03:03:48 -0800292 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
293 }
294
Tejas Patela3e34ad2019-02-01 17:25:19 +0530295 case PM_QUERY_DATA:
296 {
Rajan Vaja030620d2020-11-23 04:13:54 -0800297 uint32_t data[8] = { 0 };
Tejas Patela3e34ad2019-02-01 17:25:19 +0530298
299 ret = pm_query_data(pm_arg[0], pm_arg[1], pm_arg[2],
Tejas Patel18072da2021-02-25 20:16:56 -0800300 pm_arg[3], data, security_flag);
Rajan Vaja030620d2020-11-23 04:13:54 -0800301
Tejas Patela3e34ad2019-02-01 17:25:19 +0530302 SMC_RET2(handle, (uint64_t)ret | ((uint64_t)data[0] << 32),
Rajan Vaja030620d2020-11-23 04:13:54 -0800303 (uint64_t)data[1] | ((uint64_t)data[2] << 32));
Tejas Patela3e34ad2019-02-01 17:25:19 +0530304
Rajan Vaja030620d2020-11-23 04:13:54 -0800305 }
Tejas Patel59c608a2019-01-09 04:10:29 -0800306 case PM_CLOCK_ENABLE:
Tejas Patel18072da2021-02-25 20:16:56 -0800307 ret = pm_clock_enable(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800308 SMC_RET1(handle, (uint64_t)ret);
309
310 case PM_CLOCK_DISABLE:
Tejas Patel18072da2021-02-25 20:16:56 -0800311 ret = pm_clock_disable(pm_arg[0], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800312 SMC_RET1(handle, (uint64_t)ret);
313
314 case PM_CLOCK_GETSTATE:
315 {
316 uint32_t value;
317
Tejas Patel18072da2021-02-25 20:16:56 -0800318 ret = pm_clock_get_state(pm_arg[0], &value, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800319 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
320 }
321
322 case PM_CLOCK_SETDIVIDER:
Tejas Patel18072da2021-02-25 20:16:56 -0800323 ret = pm_clock_set_divider(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800324 SMC_RET1(handle, (uint64_t)ret);
325
326 case PM_CLOCK_GETDIVIDER:
327 {
328 uint32_t value;
329
Tejas Patel18072da2021-02-25 20:16:56 -0800330 ret = pm_clock_get_divider(pm_arg[0], &value, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800331 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
332 }
333
334 case PM_CLOCK_SETPARENT:
Tejas Patel18072da2021-02-25 20:16:56 -0800335 ret = pm_clock_set_parent(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800336 SMC_RET1(handle, (uint64_t)ret);
337
338 case PM_CLOCK_GETPARENT:
339 {
340 uint32_t value;
341
Tejas Patel18072da2021-02-25 20:16:56 -0800342 ret = pm_clock_get_parent(pm_arg[0], &value, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800343 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
344 }
345
Tejas Patel84275bf2020-09-01 04:43:53 -0700346 case PM_CLOCK_GETRATE:
347 {
348 uint32_t rate[2] = { 0 };
349
Tejas Patel18072da2021-02-25 20:16:56 -0800350 ret = pm_clock_get_rate(pm_arg[0], rate, security_flag);
Tejas Patel84275bf2020-09-01 04:43:53 -0700351 SMC_RET2(handle, (uint64_t)ret | ((uint64_t)rate[0] << 32),
352 rate[1]);
353 }
354
Tejas Patel59c608a2019-01-09 04:10:29 -0800355 case PM_PLL_SET_PARAMETER:
Tejas Patel18072da2021-02-25 20:16:56 -0800356 ret = pm_pll_set_param(pm_arg[0], pm_arg[1], pm_arg[2],
357 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800358 SMC_RET1(handle, (uint64_t)ret);
359
360 case PM_PLL_GET_PARAMETER:
361 {
362 uint32_t value;
363
Tejas Patel18072da2021-02-25 20:16:56 -0800364 ret = pm_pll_get_param(pm_arg[0], pm_arg[1], &value,
365 security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800366 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value << 32));
367 }
368
369 case PM_PLL_SET_MODE:
Tejas Patel18072da2021-02-25 20:16:56 -0800370 ret = pm_pll_set_mode(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800371 SMC_RET1(handle, (uint64_t)ret);
372
373 case PM_PLL_GET_MODE:
374 {
375 uint32_t mode;
376
Tejas Patel18072da2021-02-25 20:16:56 -0800377 ret = pm_pll_get_mode(pm_arg[0], &mode, security_flag);
Tejas Patel59c608a2019-01-09 04:10:29 -0800378 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)mode << 32));
379 }
380
Tejas Patel044001d2019-01-21 17:56:48 +0530381 case PM_GET_TRUSTZONE_VERSION:
382 SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS |
383 ((uint64_t)VERSAL_TZ_VERSION << 32));
384
Ravi Patelbd4aa5a2019-08-12 03:17:54 -0700385 case PM_GET_CHIPID:
386 {
387 uint32_t result[2];
388
Tejas Patel18072da2021-02-25 20:16:56 -0800389 ret = pm_get_chipid(result, security_flag);
Ravi Patelbd4aa5a2019-08-12 03:17:54 -0700390 SMC_RET2(handle, (uint64_t)ret | ((uint64_t)result[0] << 32),
391 result[1]);
392 }
393
Ravi Patel22b0b492019-03-06 12:34:46 +0530394 case PM_FEATURE_CHECK:
395 {
396 uint32_t version;
397
Tejas Patel18072da2021-02-25 20:16:56 -0800398 ret = pm_feature_check(pm_arg[0], &version, security_flag);
Ravi Patel22b0b492019-03-06 12:34:46 +0530399 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)version << 32));
400 }
401
Jolly Shahed05a712019-03-22 05:33:39 +0530402 case PM_LOAD_PDI:
403 {
Tejas Patel18072da2021-02-25 20:16:56 -0800404 ret = pm_load_pdi(pm_arg[0], pm_arg[1], pm_arg[2],
405 security_flag);
Jolly Shahed05a712019-03-22 05:33:39 +0530406 SMC_RET1(handle, (uint64_t)ret);
407 }
408
Saeed Nowshadi2294b422019-06-03 10:22:35 -0700409 case PM_GET_OP_CHARACTERISTIC:
410 {
411 uint32_t result;
412
Tejas Patel18072da2021-02-25 20:16:56 -0800413 ret = pm_get_op_characteristic(pm_arg[0], pm_arg[1], &result,
414 security_flag);
Saeed Nowshadi2294b422019-06-03 10:22:35 -0700415 SMC_RET1(handle, (uint64_t)ret | ((uint64_t)result << 32));
416 }
417
Tejas Patel5c154e12020-11-25 01:53:12 -0800418 case PM_SET_MAX_LATENCY:
419 {
Tejas Patel18072da2021-02-25 20:16:56 -0800420 ret = pm_set_max_latency(pm_arg[0], pm_arg[1], security_flag);
Tejas Patel5c154e12020-11-25 01:53:12 -0800421 SMC_RET1(handle, (uint64_t)ret);
422 }
423
Tejas Patel42015552020-11-25 01:56:57 -0800424 case PM_REGISTER_NOTIFIER:
425 {
Tejas Patel18072da2021-02-25 20:16:56 -0800426 ret = pm_register_notifier(pm_arg[0], pm_arg[1], pm_arg[2],
427 pm_arg[3], security_flag);
Tejas Patel42015552020-11-25 01:56:57 -0800428 SMC_RET1(handle, (uint64_t)ret);
429 }
430
Tejas Patel59c608a2019-01-09 04:10:29 -0800431 default:
432 WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid);
433 SMC_RET1(handle, SMC_UNK);
434 }
435}