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