diff options
author | Saravana Kannan <skannan@codeaurora.org> | 2015-01-20 20:04:59 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2015-01-20 20:04:59 +0800 |
commit | bd307d9132c25c4610baf45ead0488c760e57780 (patch) | |
tree | f2120cbd61ec4b9708b36acc1c8c2952b3a51170 | |
parent | d046397a515bbcbb697bb823ef8f43ebbbf9ae6a (diff) |
ARM: qcom: scm: Add API to query for service/command availability.
Some drivers may need to query the secure environment about the
availability of a particular service/command. Add support for
this.
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[sboyd@codeaurora.org: Add some commit text]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
-rw-r--r-- | arch/arm/mach-qcom/scm.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-qcom/scm.h | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c index a77349d34e78..081099c37574 100644 --- a/arch/arm/mach-qcom/scm.c +++ b/arch/arm/mach-qcom/scm.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -322,3 +322,19 @@ u32 scm_get_version(void) return version; } EXPORT_SYMBOL(scm_get_version); + +#define IS_CALL_AVAIL_CMD 1 +int scm_is_call_available(u32 svc_id, u32 cmd_id) +{ + int ret; + u32 svc_cmd = (svc_id << 10) | cmd_id; + u32 ret_val = 0; + + ret = scm_call(SCM_SVC_INFO, IS_CALL_AVAIL_CMD, &svc_cmd, + sizeof(svc_cmd), &ret_val, sizeof(ret_val)); + if (ret) + return ret; + + return ret_val; +} +EXPORT_SYMBOL(scm_is_call_available); diff --git a/arch/arm/mach-qcom/scm.h b/arch/arm/mach-qcom/scm.h index 00b31ea58f29..6fa8d55981a3 100644 --- a/arch/arm/mach-qcom/scm.h +++ b/arch/arm/mach-qcom/scm.h @@ -14,6 +14,7 @@ #define SCM_SVC_BOOT 0x1 #define SCM_SVC_PIL 0x2 +#define SCM_SVC_INFO 0x6 extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, void *resp_buf, size_t resp_len); @@ -21,5 +22,6 @@ extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, #define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) extern u32 scm_get_version(void); +extern int scm_is_call_available(u32 svc_id, u32 cmd_id); #endif |