blob: 9939d7e7f0fdcf5818daf2a9c6f50029e8570aed [file] [log] [blame]
Shruti Gupta91105082024-11-27 05:29:55 +00001/*
2 * Copyright (c) 2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7#include <host_realm_rmi.h>
8#include <realm_helpers.h>
9#include <realm_psi.h>
10#include <realm_rsi.h>
11#include <smccc.h>
12
13void psi_exit_to_plane0(u_register_t psi_cmd,
14 u_register_t arg1,
15 u_register_t arg2,
16 u_register_t arg3,
17 u_register_t arg4,
18 u_register_t arg5,
19 u_register_t arg6,
20 u_register_t arg7)
21{
22 if (realm_is_plane0()) {
23 return;
24 }
25 tftf_hvc(&(hvc_args) {psi_cmd, arg1, arg2, arg3, arg4,
26 arg5, arg6, arg7});
27}
28
29u_register_t psi_get_plane_id(void)
30{
31 hvc_ret_values res = tftf_hvc(&(hvc_args) {PSI_CALL_GET_PLANE_ID_CMD, 0UL, 0UL,
32 0UL, 0UL, 0UL, 0UL, 0UL});
33
34 if (res.ret0 != RSI_SUCCESS) {
35 return (u_register_t)-1;
36 }
37 return res.ret1;
38}
39