linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: David Brown <davidb@codeaurora.org>, Kumar Gala <galak@codeaurora.org>
Cc: Saravana Kannan <skannan@codeaurora.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Lina Iyer <lina.iyer@linaro.org>
Subject: [PATCH 5/8] msm: scm: Add API to query for service/command availability.
Date: Mon,  4 Aug 2014 18:31:47 -0700	[thread overview]
Message-ID: <1407202310-3359-6-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1407202310-3359-1-git-send-email-sboyd@codeaurora.org>

From: Saravana Kannan <skannan@codeaurora.org>

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>
---
 arch/arm/mach-qcom/scm.c | 18 +++++++++++++++++-
 arch/arm/mach-qcom/scm.h |  2 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c
index a05cad3fa1c5..e80571f57ca4 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
@@ -394,3 +394,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 1f0f0180e767..f94c7279616a 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);
@@ -24,5 +25,6 @@ extern s32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2);
 #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
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


  parent reply	other threads:[~2014-08-05  1:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  1:31 [PATCH 0/8] qcom SCM updates Stephen Boyd
2014-08-05  1:31 ` [PATCH 1/8] msm: scm: Fix incorrect cache invalidation Stephen Boyd
2014-08-05  1:31 ` [PATCH 2/8] msm: scm: Get cacheline size from CTR Stephen Boyd
2014-08-05  1:31 ` [PATCH 3/8] msm: scm: Flush the command buffer only instead of the entire cache Stephen Boyd
2014-08-05  1:31 ` [PATCH 4/8] msm: scm: Add atomic SCM APIs Stephen Boyd
2014-08-05  1:31 ` Stephen Boyd [this message]
2014-08-05  1:31 ` [PATCH 6/8] msm: scm: Add a feat version query API Stephen Boyd
2014-08-05  1:31 ` [PATCH 7/8] msm: scm: Add logging of actual return code from scm call Stephen Boyd
2014-08-05  1:31 ` [PATCH 8/8] msm: scm: Move the scm driver to drivers/soc/qcom Stephen Boyd
2014-08-05  4:07   ` Lina Iyer
2014-08-05 20:12     ` Bjorn Andersson
2014-08-05 20:17       ` Lina Iyer
2015-01-22  1:13   ` Olof Johansson
2015-01-22  1:53     ` Bjorn Andersson
2015-01-22 16:49       ` Kumar Gala
2015-01-23  1:19     ` Rob Clark
2014-09-17 22:08 ` [PATCH 0/8] qcom SCM updates Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407202310-3359-6-git-send-email-sboyd@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=galak@codeaurora.org \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skannan@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).