summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhen Kong <zkong@codeaurora.org>2017-02-14 11:10:09 -0800
committerZhen Kong <zkong@codeaurora.org>2017-02-14 15:32:19 -0800
commit3f3f20e3479ba3dc5e596cdfc996619035a9646f (patch)
tree3b65c64272a71c3b5a041d9daecdeeed0cfe6ecf
parent15632ada36671d7b06c6767e0ca0e2f9fb87420b (diff)
qseecom: add new SCM ID to register listener when smcinvoke is supported
Add new SCM ID to register listener when smcinvoke is supported. Then TZ, depending on how the listener has been registered, will either behave in the old way (i.e. rsp[1]=QSEE_LISTENER_ID), or the new way (rsp[1]=app_id) when smcinvoke is supported. And qseecom will first to register listener with new SCM ID, if failed, then fallback to use old ID. Change-Id: Ia27055db6ec8f26705669ee913919b29461121ca Signed-off-by: Zhen Kong <zkong@codeaurora.org>
-rw-r--r--drivers/misc/qseecom.c8
-rw-r--r--include/soc/qcom/qseecomi.h5
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index 1653f7e1ae99..aa6b64b860de 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -562,7 +562,6 @@ static int qseecom_scm_call2(uint32_t svc_id, uint32_t tz_cmd_id,
case QSEOS_REGISTER_LISTENER: {
struct qseecom_register_listener_ireq *req;
struct qseecom_register_listener_64bit_ireq *req_64bit;
- smc_id = TZ_OS_REGISTER_LISTENER_ID;
desc.arginfo =
TZ_OS_REGISTER_LISTENER_ID_PARAM_ID;
if (qseecom.qsee_version < QSEE_VERSION_40) {
@@ -579,8 +578,15 @@ static int qseecom_scm_call2(uint32_t svc_id, uint32_t tz_cmd_id,
desc.args[1] = req_64bit->sb_ptr;
desc.args[2] = req_64bit->sb_len;
}
+ smc_id = TZ_OS_REGISTER_LISTENER_SMCINVOKE_ID;
__qseecom_reentrancy_check_if_no_app_blocked(smc_id);
ret = scm_call2(smc_id, &desc);
+ if (ret) {
+ smc_id = TZ_OS_REGISTER_LISTENER_ID;
+ __qseecom_reentrancy_check_if_no_app_blocked(
+ smc_id);
+ ret = scm_call2(smc_id, &desc);
+ }
break;
}
case QSEOS_DEREGISTER_LISTENER: {
diff --git a/include/soc/qcom/qseecomi.h b/include/soc/qcom/qseecomi.h
index e33fd9fc1841..6497d962e347 100644
--- a/include/soc/qcom/qseecomi.h
+++ b/include/soc/qcom/qseecomi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017, 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
@@ -511,6 +511,9 @@ __packed struct qseecom_continue_blocked_request_ireq {
#define TZ_OS_REGISTER_LISTENER_ID \
TZ_SYSCALL_CREATE_SMC_ID(TZ_OWNER_QSEE_OS, TZ_SVC_LISTENER, 0x01)
+#define TZ_OS_REGISTER_LISTENER_SMCINVOKE_ID \
+ TZ_SYSCALL_CREATE_SMC_ID(TZ_OWNER_QSEE_OS, TZ_SVC_LISTENER, 0x06)
+
#define TZ_OS_REGISTER_LISTENER_ID_PARAM_ID \
TZ_SYSCALL_CREATE_PARAM_ID_3( \
TZ_SYSCALL_PARAM_TYPE_VAL, TZ_SYSCALL_PARAM_TYPE_BUF_RW, \