Skip to content

Commit a4fb174

Browse files
sudeep-hollawilldeacon
authored andcommitted
firmware: smccc: Add function to fetch SMCCC version
For backward compatibility reasons, PSCI maintains SMCCC version as SMCCC didn't provide ARM_SMCCC_VERSION_FUNC_ID until v1.1. PSCI initialises both the SMCCC version and conduit. Similar to the conduit, let us provide accessors to fetch the SMCCC version also so that other SMCCC v1.1+ features can use it. Signed-off-by: Sudeep Holla <[email protected]> Tested-by: Etienne Carriere <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent f2ae970 commit a4fb174

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/firmware/smccc/smccc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
2424

2525
return smccc_conduit;
2626
}
27+
28+
u32 arm_smccc_get_version(void)
29+
{
30+
return smccc_version;
31+
}

include/linux/arm-smccc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ enum arm_smccc_conduit {
100100
*/
101101
enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
102102

103+
/**
104+
* arm_smccc_get_version()
105+
*
106+
* Returns the version to be used for SMCCCv1.1 or later.
107+
*
108+
* When SMCCCv1.1 or above is not present, returns SMCCCv1.0, but this
109+
* does not imply the presence of firmware or a valid conduit. Caller
110+
* handling SMCCCv1.0 must determine the conduit by other means.
111+
*/
112+
u32 arm_smccc_get_version(void);
113+
103114
/**
104115
* struct arm_smccc_res - Result from SMC/HVC call
105116
* @a0-a3 result values from registers 0 to 3

0 commit comments

Comments
 (0)