xref: /openbmc/linux/drivers/firmware/smccc/smccc.c (revision abe9af53)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2020 Arm Limited
4  */
5 
6 #define pr_fmt(fmt) "smccc: " fmt
7 
8 #include <linux/init.h>
9 #include <linux/arm-smccc.h>
10 
11 static u32 smccc_version = ARM_SMCCC_VERSION_1_0;
12 static enum arm_smccc_conduit smccc_conduit = SMCCC_CONDUIT_NONE;
13 
14 void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit)
15 {
16 	smccc_version = version;
17 	smccc_conduit = conduit;
18 }
19 
20 enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
21 {
22 	if (smccc_version < ARM_SMCCC_VERSION_1_1)
23 		return SMCCC_CONDUIT_NONE;
24 
25 	return smccc_conduit;
26 }
27 EXPORT_SYMBOL_GPL(arm_smccc_1_1_get_conduit);
28 
29 u32 arm_smccc_get_version(void)
30 {
31 	return smccc_version;
32 }
33 EXPORT_SYMBOL_GPL(arm_smccc_get_version);
34