Lines Matching refs:optee

105 static int optee_from_msg_param(struct optee *optee, struct tee_param *params,  in optee_from_msg_param()  argument
195 static int optee_to_msg_param(struct optee *optee, in optee_to_msg_param() argument
249 static void optee_enable_shm_cache(struct optee *optee) in optee_enable_shm_cache() argument
254 optee_cq_wait_init(&optee->call_queue, &w); in optee_enable_shm_cache()
258 optee->smc.invoke_fn(OPTEE_SMC_ENABLE_SHM_CACHE, in optee_enable_shm_cache()
262 optee_cq_wait_for_completion(&optee->call_queue, &w); in optee_enable_shm_cache()
264 optee_cq_wait_final(&optee->call_queue, &w); in optee_enable_shm_cache()
272 void optee_disable_shm_cache(struct optee *optee) in optee_disable_shm_cache() argument
277 optee_cq_wait_init(&optee->call_queue, &w); in optee_disable_shm_cache()
284 optee->smc.invoke_fn(OPTEE_SMC_DISABLE_SHM_CACHE, in optee_disable_shm_cache()
295 optee_cq_wait_for_completion(&optee->call_queue, &w); in optee_disable_shm_cache()
298 optee_cq_wait_final(&optee->call_queue, &w); in optee_disable_shm_cache()
394 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_shm_register() local
432 if (optee->ops->do_call_with_arg(ctx, shm_arg) || in optee_shm_register()
444 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_shm_unregister() local
458 if (optee->ops->do_call_with_arg(ctx, shm_arg) || in optee_shm_unregister()
691 static void handle_rpc_func_cmd(struct tee_context *ctx, struct optee *optee, in handle_rpc_func_cmd() argument
712 optee_rpc_cmd(ctx, optee, arg); in handle_rpc_func_cmd()
729 struct optee *optee = tee_get_drvdata(teedev); in optee_handle_rpc() local
763 handle_rpc_func_cmd(ctx, optee, shm, call_ctx); in optee_handle_rpc()
787 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_smc_do_call_with_arg() local
801 optee_cq_wait_init(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
806 optee->smc.invoke_fn(param.a0, param.a1, param.a2, param.a3, in optee_smc_do_call_with_arg()
816 optee_cq_wait_for_completion(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
835 optee_cq_wait_final(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
857 struct optee *optee = tee_get_drvdata(teedev); in optee_get_version() local
859 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) in optee_get_version()
861 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_MEMREF_NULL) in optee_get_version()
868 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_smc_open() local
869 u32 sec_caps = optee->smc.sec_caps; in optee_smc_open()
1142 struct optee *optee = platform_get_drvdata(pdev); in optee_smc_remove() local
1149 optee_disable_shm_cache(optee); in optee_smc_remove()
1151 optee_remove_common(optee); in optee_smc_remove()
1153 if (optee->smc.memremaped_shm) in optee_smc_remove()
1154 memunmap(optee->smc.memremaped_shm); in optee_smc_remove()
1156 kfree(optee); in optee_smc_remove()
1177 struct optee *optee = NULL; in optee_probe() local
1219 optee = kzalloc(sizeof(*optee), GFP_KERNEL); in optee_probe()
1220 if (!optee) { in optee_probe()
1225 optee->ops = &optee_ops; in optee_probe()
1226 optee->smc.invoke_fn = invoke_fn; in optee_probe()
1227 optee->smc.sec_caps = sec_caps; in optee_probe()
1229 teedev = tee_device_alloc(&optee_clnt_desc, NULL, pool, optee); in optee_probe()
1234 optee->teedev = teedev; in optee_probe()
1236 teedev = tee_device_alloc(&optee_supp_desc, NULL, pool, optee); in optee_probe()
1241 optee->supp_teedev = teedev; in optee_probe()
1243 rc = tee_device_register(optee->teedev); in optee_probe()
1247 rc = tee_device_register(optee->supp_teedev); in optee_probe()
1251 mutex_init(&optee->call_queue.mutex); in optee_probe()
1252 INIT_LIST_HEAD(&optee->call_queue.waiters); in optee_probe()
1253 optee_wait_queue_init(&optee->wait_queue); in optee_probe()
1254 optee_supp_init(&optee->supp); in optee_probe()
1255 optee->smc.memremaped_shm = memremaped_shm; in optee_probe()
1256 optee->pool = pool; in optee_probe()
1258 optee_enable_shm_cache(optee); in optee_probe()
1260 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) in optee_probe()
1263 platform_set_drvdata(pdev, optee); in optee_probe()
1274 if (optee) { in optee_probe()
1280 tee_device_unregister(optee->supp_teedev); in optee_probe()
1281 tee_device_unregister(optee->teedev); in optee_probe()
1282 kfree(optee); in optee_probe()