MALI: rockchip: upgrade midgard DDK to r14p0-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / mali_kbase_smc.h
1 /*
2  *
3  * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18
19
20 #ifndef _KBASE_SMC_H_
21 #define _KBASE_SMC_H_
22
23 #ifdef CONFIG_ARM64
24
25 #include <mali_kbase.h>
26
27 #define SMC_FAST_CALL (1 << 31)
28 #define SMC_64 (1 << 30)
29
30 #define SMC_OEN_OFFSET 24
31 #define SMC_OEN_MASK (0x3F << SMC_OEN_OFFSET) /* 6 bits */
32 #define SMC_OEN_SIP (2 << SMC_OEN_OFFSET)
33 #define SMC_OEN_STD (4 << SMC_OEN_OFFSET)
34
35
36 /**
37   * kbase_invoke_smc_fid - Perform a secure monitor call
38   * @fid: The SMC function to call, see SMC Calling convention.
39   * @arg0: First argument to the SMC.
40   * @arg1: Second argument to the SMC.
41   * @arg2: Third argument to the SMC.
42   *
43   * See SMC Calling Convention for details.
44   *
45   * Return: the return value from the SMC.
46   */
47 u64 kbase_invoke_smc_fid(u32 fid, u64 arg0, u64 arg1, u64 arg2);
48
49 /**
50   * kbase_invoke_smc_fid - Perform a secure monitor call
51   * @oen: Owning Entity number (SIP, STD etc).
52   * @function_number: The function number within the OEN.
53   * @smc64: use SMC64 calling convention instead of SMC32.
54   * @arg0: First argument to the SMC.
55   * @arg1: Second argument to the SMC.
56   * @arg2: Third argument to the SMC.
57   *
58   * See SMC Calling Convention for details.
59   *
60   * Return: the return value from the SMC call.
61   */
62 u64 kbase_invoke_smc(u32 oen, u16 function_number, bool smc64,
63                 u64 arg0, u64 arg1, u64 arg2);
64
65 #endif /* CONFIG_ARM64 */
66
67 #endif /* _KBASE_SMC_H_ */