msm: scm: Add a feat version query API
Some users of SCM need to detect features and also detect if
those features have certain versions available. Most notably the
jtag save restore code needs to detect if the secure environment
supports save and restore of jtag state so that it can skip doing
its own save and restore.
Add this API so that the code can work with either version of the
secure code.
Change-Id: Ice34a894b1eb48cbf741138858e68c91c6bdd98d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/scm.c b/arch/arm/mach-msm/scm.c
index cdb0cbe..e664414 100644
--- a/arch/arm/mach-msm/scm.c
+++ b/arch/arm/mach-msm/scm.c
@@ -414,6 +414,19 @@
}
EXPORT_SYMBOL(scm_is_call_available);
+#define GET_FEAT_VERSION_CMD 3
+int scm_get_feat_version(u32 feat)
+{
+ if (scm_is_call_available(SCM_SVC_INFO, GET_FEAT_VERSION_CMD)) {
+ u32 version;
+ if (!scm_call(SCM_SVC_INFO, GET_FEAT_VERSION_CMD, &feat,
+ sizeof(feat), &version, sizeof(version)))
+ return version;
+ }
+ return 0;
+}
+EXPORT_SYMBOL(scm_get_feat_version);
+
static int scm_init(void)
{
u32 ctr;