Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Rajan Vaja | 8368761 | 2018-01-17 02:39:20 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Top-level SMC handler for ZynqMP power management calls and |
| 9 | * IPI setup functions for communication with PMU. |
| 10 | */ |
| 11 | |
| 12 | #include <errno.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 13 | #include <runtime_svc.h> |
Isla Mitchell | e363146 | 2017-07-14 10:46:32 +0100 | [diff] [blame] | 14 | #include "../zynqmp_private.h" |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 15 | #include "pm_api_sys.h" |
| 16 | #include "pm_client.h" |
| 17 | #include "pm_ipi.h" |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 18 | |
Siva Durga Prasad Paladugu | 43b23a3 | 2018-04-27 16:26:47 +0530 | [diff] [blame] | 19 | #define PM_SET_SUSPEND_MODE 0xa02 |
Rajan Vaja | c7ee23d | 2018-02-14 23:10:54 -0800 | [diff] [blame] | 20 | #define PM_GET_TRUSTZONE_VERSION 0xa03 |
Soren Brinkmann | 84f0af4 | 2016-09-30 14:24:25 -0700 | [diff] [blame] | 21 | |
Siva Durga Prasad Paladugu | 79f7595 | 2018-04-30 19:39:49 +0530 | [diff] [blame] | 22 | /* !0 - UP, 0 - DOWN */ |
| 23 | static int32_t pm_up = 0; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * pm_context - Structure which contains data for power management |
| 27 | * @api_version version of PM API, must match with one on PMU side |
| 28 | * @payload payload array used to store received |
| 29 | * data from ipi buffer registers |
| 30 | */ |
| 31 | static struct { |
| 32 | uint32_t api_version; |
| 33 | uint32_t payload[PAYLOAD_ARG_CNT]; |
| 34 | } pm_ctx; |
| 35 | |
| 36 | /** |
| 37 | * pm_setup() - PM service setup |
| 38 | * |
| 39 | * @return On success, the initialization function must return 0. |
| 40 | * Any other return value will cause the framework to ignore |
| 41 | * the service |
| 42 | * |
| 43 | * Initialization functions for ZynqMP power management for |
| 44 | * communicaton with PMU. |
| 45 | * |
| 46 | * Called from sip_svc_setup initialization function with the |
| 47 | * rt_svc_init signature. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 48 | */ |
| 49 | int pm_setup(void) |
| 50 | { |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 51 | int status, ret; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 52 | |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 53 | status = pm_ipi_init(primary_proc); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 54 | |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 55 | if (status >= 0) { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 56 | INFO("BL31: PM Service Init Complete: API v%d.%d\n", |
| 57 | PM_VERSION_MAJOR, PM_VERSION_MINOR); |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 58 | ret = 0; |
| 59 | } else { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 60 | INFO("BL31: PM Service Init Failed, Error Code %d!\n", status); |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 61 | ret = status; |
| 62 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 63 | |
Siva Durga Prasad Paladugu | 79f7595 | 2018-04-30 19:39:49 +0530 | [diff] [blame] | 64 | pm_up = !status; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 65 | |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 66 | return ret; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | /** |
| 70 | * pm_smc_handler() - SMC handler for PM-API calls coming from EL1/EL2. |
| 71 | * @smc_fid - Function Identifier |
| 72 | * @x1 - x4 - Arguments |
| 73 | * @cookie - Unused |
| 74 | * @handler - Pointer to caller's context structure |
| 75 | * |
| 76 | * @return - Unused |
| 77 | * |
| 78 | * Determines that smc_fid is valid and supported PM SMC Function ID from the |
| 79 | * list of pm_api_ids, otherwise completes the request with |
| 80 | * the unknown SMC Function ID |
| 81 | * |
| 82 | * The SMC calls for PM service are forwarded from SIP Service SMC handler |
| 83 | * function with rt_svc_handle signature |
| 84 | */ |
| 85 | uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, |
| 86 | uint64_t x4, void *cookie, void *handle, uint64_t flags) |
| 87 | { |
| 88 | enum pm_ret_status ret; |
| 89 | |
| 90 | uint32_t pm_arg[4]; |
| 91 | |
| 92 | /* Handle case where PM wasn't initialized properly */ |
Siva Durga Prasad Paladugu | 79f7595 | 2018-04-30 19:39:49 +0530 | [diff] [blame] | 93 | if (!pm_up) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 94 | SMC_RET1(handle, SMC_UNK); |
| 95 | |
| 96 | pm_arg[0] = (uint32_t)x1; |
| 97 | pm_arg[1] = (uint32_t)(x1 >> 32); |
| 98 | pm_arg[2] = (uint32_t)x2; |
| 99 | pm_arg[3] = (uint32_t)(x2 >> 32); |
| 100 | |
| 101 | switch (smc_fid & FUNCID_NUM_MASK) { |
| 102 | /* PM API Functions */ |
| 103 | case PM_SELF_SUSPEND: |
| 104 | ret = pm_self_suspend(pm_arg[0], pm_arg[1], pm_arg[2], |
| 105 | pm_arg[3]); |
| 106 | SMC_RET1(handle, (uint64_t)ret); |
| 107 | |
| 108 | case PM_REQ_SUSPEND: |
| 109 | ret = pm_req_suspend(pm_arg[0], pm_arg[1], pm_arg[2], |
| 110 | pm_arg[3]); |
| 111 | SMC_RET1(handle, (uint64_t)ret); |
| 112 | |
| 113 | case PM_REQ_WAKEUP: |
Filip Drazic | 78ba145 | 2017-02-07 12:03:57 +0100 | [diff] [blame] | 114 | { |
| 115 | /* Use address flag is encoded in the 1st bit of the low-word */ |
| 116 | unsigned int set_addr = pm_arg[1] & 0x1; |
| 117 | uint64_t address = (uint64_t)pm_arg[2] << 32; |
| 118 | |
| 119 | address |= pm_arg[1] & (~0x1); |
| 120 | ret = pm_req_wakeup(pm_arg[0], set_addr, address, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 121 | pm_arg[3]); |
| 122 | SMC_RET1(handle, (uint64_t)ret); |
Filip Drazic | 78ba145 | 2017-02-07 12:03:57 +0100 | [diff] [blame] | 123 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 124 | |
| 125 | case PM_FORCE_POWERDOWN: |
| 126 | ret = pm_force_powerdown(pm_arg[0], pm_arg[1]); |
| 127 | SMC_RET1(handle, (uint64_t)ret); |
| 128 | |
| 129 | case PM_ABORT_SUSPEND: |
| 130 | ret = pm_abort_suspend(pm_arg[0]); |
| 131 | SMC_RET1(handle, (uint64_t)ret); |
| 132 | |
| 133 | case PM_SET_WAKEUP_SOURCE: |
| 134 | ret = pm_set_wakeup_source(pm_arg[0], pm_arg[1], pm_arg[2]); |
| 135 | SMC_RET1(handle, (uint64_t)ret); |
| 136 | |
| 137 | case PM_SYSTEM_SHUTDOWN: |
Soren Brinkmann | 58fbb9b | 2016-09-02 09:50:54 -0700 | [diff] [blame] | 138 | ret = pm_system_shutdown(pm_arg[0], pm_arg[1]); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 139 | SMC_RET1(handle, (uint64_t)ret); |
| 140 | |
| 141 | case PM_REQ_NODE: |
| 142 | ret = pm_req_node(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]); |
| 143 | SMC_RET1(handle, (uint64_t)ret); |
| 144 | |
| 145 | case PM_RELEASE_NODE: |
| 146 | ret = pm_release_node(pm_arg[0]); |
| 147 | SMC_RET1(handle, (uint64_t)ret); |
| 148 | |
| 149 | case PM_SET_REQUIREMENT: |
| 150 | ret = pm_set_requirement(pm_arg[0], pm_arg[1], pm_arg[2], |
| 151 | pm_arg[3]); |
| 152 | SMC_RET1(handle, (uint64_t)ret); |
| 153 | |
| 154 | case PM_SET_MAX_LATENCY: |
| 155 | ret = pm_set_max_latency(pm_arg[0], pm_arg[1]); |
| 156 | SMC_RET1(handle, (uint64_t)ret); |
| 157 | |
| 158 | case PM_GET_API_VERSION: |
| 159 | /* Check is PM API version already verified */ |
Soren Brinkmann | a1b0a90 | 2016-09-30 11:30:21 -0700 | [diff] [blame] | 160 | if (pm_ctx.api_version == PM_VERSION) { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 161 | SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS | |
| 162 | ((uint64_t)PM_VERSION << 32)); |
Soren Brinkmann | a1b0a90 | 2016-09-30 11:30:21 -0700 | [diff] [blame] | 163 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 164 | |
| 165 | ret = pm_get_api_version(&pm_ctx.api_version); |
Soren Brinkmann | a1b0a90 | 2016-09-30 11:30:21 -0700 | [diff] [blame] | 166 | /* |
| 167 | * Enable IPI IRQ |
| 168 | * assume the rich OS is OK to handle callback IRQs now. |
| 169 | * Even if we were wrong, it would not enable the IRQ in |
| 170 | * the GIC. |
| 171 | */ |
Wendy Liang | 328105c | 2017-10-03 23:21:11 -0700 | [diff] [blame] | 172 | pm_ipi_irq_enable(primary_proc); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 173 | SMC_RET1(handle, (uint64_t)ret | |
| 174 | ((uint64_t)pm_ctx.api_version << 32)); |
| 175 | |
| 176 | case PM_SET_CONFIGURATION: |
| 177 | ret = pm_set_configuration(pm_arg[0]); |
| 178 | SMC_RET1(handle, (uint64_t)ret); |
| 179 | |
Filip Drazic | f2ddd91 | 2017-03-15 11:50:47 +0100 | [diff] [blame] | 180 | case PM_INIT_FINALIZE: |
| 181 | ret = pm_init_finalize(); |
| 182 | SMC_RET1(handle, (uint64_t)ret); |
| 183 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 184 | case PM_GET_NODE_STATUS: |
Anes Hadziahmetagic | 1caf88e | 2017-01-27 18:42:44 +0100 | [diff] [blame] | 185 | { |
| 186 | uint32_t buff[3]; |
| 187 | |
| 188 | ret = pm_get_node_status(pm_arg[0], buff); |
| 189 | SMC_RET2(handle, (uint64_t)ret | ((uint64_t)buff[0] << 32), |
| 190 | (uint64_t)buff[1] | ((uint64_t)buff[2] << 32)); |
| 191 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 192 | |
| 193 | case PM_GET_OP_CHARACTERISTIC: |
Anes Hadziahmetagic | 92aee01 | 2016-05-12 16:17:30 +0200 | [diff] [blame] | 194 | { |
| 195 | uint32_t result; |
| 196 | |
| 197 | ret = pm_get_op_characteristic(pm_arg[0], pm_arg[1], &result); |
| 198 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)result << 32)); |
| 199 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 200 | |
| 201 | case PM_REGISTER_NOTIFIER: |
| 202 | ret = pm_register_notifier(pm_arg[0], pm_arg[1], pm_arg[2], |
| 203 | pm_arg[3]); |
| 204 | SMC_RET1(handle, (uint64_t)ret); |
| 205 | |
| 206 | case PM_RESET_ASSERT: |
| 207 | ret = pm_reset_assert(pm_arg[0], pm_arg[1]); |
| 208 | SMC_RET1(handle, (uint64_t)ret); |
| 209 | |
| 210 | case PM_RESET_GET_STATUS: |
| 211 | { |
| 212 | uint32_t reset_status; |
| 213 | |
| 214 | ret = pm_reset_get_status(pm_arg[0], &reset_status); |
| 215 | SMC_RET1(handle, (uint64_t)ret | |
| 216 | ((uint64_t)reset_status << 32)); |
| 217 | } |
| 218 | |
| 219 | /* PM memory access functions */ |
| 220 | case PM_MMIO_WRITE: |
| 221 | ret = pm_mmio_write(pm_arg[0], pm_arg[1], pm_arg[2]); |
| 222 | SMC_RET1(handle, (uint64_t)ret); |
| 223 | |
| 224 | case PM_MMIO_READ: |
| 225 | { |
| 226 | uint32_t value; |
| 227 | |
| 228 | ret = pm_mmio_read(pm_arg[0], &value); |
| 229 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 230 | } |
Nava kishore Manne | 68d460c | 2016-08-20 23:18:09 +0530 | [diff] [blame] | 231 | |
| 232 | case PM_FPGA_LOAD: |
| 233 | ret = pm_fpga_load(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]); |
| 234 | SMC_RET1(handle, (uint64_t)ret); |
| 235 | |
| 236 | case PM_FPGA_GET_STATUS: |
| 237 | { |
| 238 | uint32_t value; |
| 239 | |
| 240 | ret = pm_fpga_get_status(&value); |
| 241 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 242 | } |
| 243 | |
Siva Durga Prasad Paladugu | 16427d1 | 2016-08-24 11:45:47 +0530 | [diff] [blame] | 244 | case PM_GET_CHIPID: |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 245 | { |
| 246 | uint32_t result[2]; |
| 247 | |
| 248 | ret = pm_get_chipid(result); |
| 249 | SMC_RET2(handle, (uint64_t)ret | ((uint64_t)result[0] << 32), |
| 250 | result[1]); |
| 251 | } |
Siva Durga Prasad Paladugu | 16427d1 | 2016-08-24 11:45:47 +0530 | [diff] [blame] | 252 | |
Siva Durga Prasad Paladugu | de93d98 | 2018-04-30 15:49:27 +0530 | [diff] [blame] | 253 | case PM_SECURE_RSA_AES: |
| 254 | ret = pm_secure_rsaaes(pm_arg[0], pm_arg[1], pm_arg[2], |
| 255 | pm_arg[3]); |
| 256 | SMC_RET1(handle, (uint64_t)ret); |
| 257 | |
Rajan Vaja | 8368761 | 2018-01-17 02:39:20 -0800 | [diff] [blame] | 258 | case PM_PINCTRL_REQUEST: |
| 259 | ret = pm_pinctrl_request(pm_arg[0]); |
| 260 | SMC_RET1(handle, (uint64_t)ret); |
| 261 | |
| 262 | case PM_PINCTRL_RELEASE: |
| 263 | ret = pm_pinctrl_release(pm_arg[0]); |
| 264 | SMC_RET1(handle, (uint64_t)ret); |
| 265 | |
| 266 | case PM_PINCTRL_GET_FUNCTION: |
| 267 | { |
Jolly Shah | 69fb5bf | 2018-02-07 16:25:41 -0800 | [diff] [blame] | 268 | uint32_t value = 0; |
Rajan Vaja | 8368761 | 2018-01-17 02:39:20 -0800 | [diff] [blame] | 269 | |
| 270 | ret = pm_pinctrl_get_function(pm_arg[0], &value); |
| 271 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 272 | } |
| 273 | |
| 274 | case PM_PINCTRL_SET_FUNCTION: |
| 275 | ret = pm_pinctrl_set_function(pm_arg[0], pm_arg[1]); |
| 276 | SMC_RET1(handle, (uint64_t)ret); |
| 277 | |
| 278 | case PM_PINCTRL_CONFIG_PARAM_GET: |
| 279 | { |
| 280 | uint32_t value; |
| 281 | |
| 282 | ret = pm_pinctrl_get_config(pm_arg[0], pm_arg[1], &value); |
| 283 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 284 | } |
| 285 | |
| 286 | case PM_PINCTRL_CONFIG_PARAM_SET: |
| 287 | ret = pm_pinctrl_set_config(pm_arg[0], pm_arg[1], pm_arg[2]); |
| 288 | SMC_RET1(handle, (uint64_t)ret); |
| 289 | |
Rajan Vaja | 5529a01 | 2018-01-17 02:39:23 -0800 | [diff] [blame] | 290 | case PM_IOCTL: |
| 291 | { |
| 292 | uint32_t value; |
| 293 | |
| 294 | ret = pm_ioctl(pm_arg[0], pm_arg[1], pm_arg[2], |
| 295 | pm_arg[3], &value); |
| 296 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 297 | } |
| 298 | |
Rajan Vaja | 3511613 | 2018-01-17 02:39:25 -0800 | [diff] [blame] | 299 | case PM_QUERY_DATA: |
| 300 | { |
Jolly Shah | 69fb5bf | 2018-02-07 16:25:41 -0800 | [diff] [blame] | 301 | uint32_t data[4] = { 0 }; |
Rajan Vaja | 3511613 | 2018-01-17 02:39:25 -0800 | [diff] [blame] | 302 | |
| 303 | ret = pm_query_data(pm_arg[0], pm_arg[1], pm_arg[2], |
| 304 | pm_arg[3], data); |
| 305 | SMC_RET2(handle, (uint64_t)data[0] | ((uint64_t)data[1] << 32), |
| 306 | (uint64_t)data[2] | ((uint64_t)data[3] << 32)); |
| 307 | } |
| 308 | |
| 309 | case PM_CLOCK_ENABLE: |
| 310 | ret = pm_clock_enable(pm_arg[0]); |
| 311 | SMC_RET1(handle, (uint64_t)ret); |
| 312 | |
| 313 | case PM_CLOCK_DISABLE: |
| 314 | ret = pm_clock_disable(pm_arg[0]); |
| 315 | SMC_RET1(handle, (uint64_t)ret); |
| 316 | |
| 317 | case PM_CLOCK_GETSTATE: |
| 318 | { |
| 319 | uint32_t value; |
| 320 | |
| 321 | ret = pm_clock_getstate(pm_arg[0], &value); |
| 322 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 323 | } |
| 324 | |
| 325 | case PM_CLOCK_SETDIVIDER: |
| 326 | ret = pm_clock_setdivider(pm_arg[0], pm_arg[1]); |
| 327 | SMC_RET1(handle, (uint64_t)ret); |
| 328 | |
| 329 | case PM_CLOCK_GETDIVIDER: |
| 330 | { |
| 331 | uint32_t value; |
| 332 | |
| 333 | ret = pm_clock_getdivider(pm_arg[0], &value); |
| 334 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 335 | } |
| 336 | |
| 337 | case PM_CLOCK_SETRATE: |
| 338 | ret = pm_clock_setrate(pm_arg[0], |
| 339 | ((uint64_t)pm_arg[2]) << 32 | pm_arg[1]); |
| 340 | |
| 341 | SMC_RET1(handle, (uint64_t)ret); |
| 342 | |
| 343 | case PM_CLOCK_GETRATE: |
| 344 | { |
| 345 | uint64_t value; |
| 346 | |
| 347 | ret = pm_clock_getrate(pm_arg[0], &value); |
Jolly Shah | 69fb5bf | 2018-02-07 16:25:41 -0800 | [diff] [blame] | 348 | SMC_RET2(handle, (uint64_t)ret | |
| 349 | (((uint64_t)value & 0xFFFFFFFFU) << 32U), |
| 350 | (value >> 32U) & 0xFFFFFFFFU); |
Rajan Vaja | 3511613 | 2018-01-17 02:39:25 -0800 | [diff] [blame] | 351 | |
| 352 | } |
| 353 | |
| 354 | case PM_CLOCK_SETPARENT: |
| 355 | ret = pm_clock_setparent(pm_arg[0], pm_arg[1]); |
| 356 | SMC_RET1(handle, (uint64_t)ret); |
| 357 | |
| 358 | case PM_CLOCK_GETPARENT: |
| 359 | { |
| 360 | uint32_t value; |
| 361 | |
| 362 | ret = pm_clock_getparent(pm_arg[0], &value); |
| 363 | SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); |
| 364 | } |
| 365 | |
Rajan Vaja | c7ee23d | 2018-02-14 23:10:54 -0800 | [diff] [blame] | 366 | case PM_GET_TRUSTZONE_VERSION: |
| 367 | SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS | |
| 368 | ((uint64_t)ZYNQMP_TZ_VERSION << 32)); |
| 369 | |
Siva Durga Prasad Paladugu | 43b23a3 | 2018-04-27 16:26:47 +0530 | [diff] [blame] | 370 | case PM_SET_SUSPEND_MODE: |
| 371 | ret = pm_set_suspend_mode(pm_arg[0]); |
| 372 | SMC_RET1(handle, (uint64_t)ret); |
| 373 | |
Siva Durga Prasad Paladugu | f3994cc | 2018-05-01 11:12:55 +0530 | [diff] [blame] | 374 | case PM_SECURE_SHA: |
| 375 | ret = pm_sha_hash(pm_arg[0], pm_arg[1], pm_arg[2], |
| 376 | pm_arg[3]); |
| 377 | SMC_RET1(handle, (uint64_t)ret); |
| 378 | |
| 379 | case PM_SECURE_RSA: |
| 380 | ret = pm_rsa_core(pm_arg[0], pm_arg[1], pm_arg[2], |
| 381 | pm_arg[3]); |
| 382 | SMC_RET1(handle, (uint64_t)ret); |
| 383 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 384 | default: |
| 385 | WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); |
| 386 | SMC_RET1(handle, SMC_UNK); |
| 387 | } |
| 388 | } |