aboutsummaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2015-03-13 15:18:20 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2015-03-31 10:11:17 +0530
commit6693962c341d43cb610169c8467f68acecfc5e29 (patch)
tree7d3d357b417c93bb5e16562e7196cf447d208ad5 /services
parentf9d250549746f57ff45189653aae9889a1065151 (diff)
Open/Close TA sessions, send commands/events to TAs
This patch adds support to open/close secure sessions with Trusted Apps and later send commands/events. Modify TLK_NUM_FID to indicate the total number of FIDs available to the NS world. Change-Id: I3f1153dfa5510bd44fc25f1fee85cae475b1abf1 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'services')
-rw-r--r--services/spd/tlkd/tlkd_main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/services/spd/tlkd/tlkd_main.c b/services/spd/tlkd/tlkd_main.c
index bea4c48..c22203b 100644
--- a/services/spd/tlkd/tlkd_main.c
+++ b/services/spd/tlkd/tlkd_main.c
@@ -193,6 +193,10 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
/* Passing a NULL context is a critical programming error */
assert(handle);
+ /* These SMCs are only supported by CPU0 */
+ if ((read_mpidr() & MPIDR_CPU_MASK) != 0)
+ SMC_RET1(handle, SMC_UNK);
+
/* Determine which security state this SMC originated from */
ns = is_caller_non_secure(flags);
@@ -267,9 +271,16 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
* b. register shared memory with the SP for passing args
* required for maintaining sessions with the Trusted
* Applications.
+ * c. open/close sessions
+ * d. issue commands to the Trusted Apps
*/
case TLK_REGISTER_LOGBUF:
case TLK_REGISTER_REQBUF:
+ case TLK_OPEN_TA_SESSION:
+ case TLK_CLOSE_TA_SESSION:
+ case TLK_TA_LAUNCH_OP:
+ case TLK_TA_SEND_EVENT:
+
if (!ns || !tlk_args_results_buf)
SMC_RET1(handle, SMC_UNK);
@@ -442,3 +453,25 @@ DECLARE_RT_SVC(
NULL,
tlkd_smc_handler
);
+
+/* Define a SPD runtime service descriptor for fast SMC calls */
+DECLARE_RT_SVC(
+ tlkd_tap_fast,
+
+ OEN_TAP_START,
+ OEN_TAP_END,
+ SMC_TYPE_FAST,
+ NULL,
+ tlkd_smc_handler
+);
+
+/* Define a SPD runtime service descriptor for standard SMC calls */
+DECLARE_RT_SVC(
+ tlkd_tap_std,
+
+ OEN_TAP_START,
+ OEN_TAP_END,
+ SMC_TYPE_STD,
+ NULL,
+ tlkd_smc_handler
+);