• Home
  • Raw
  • Download

Lines Matching refs:optee

117 static int optee_from_msg_param(struct optee *optee, struct tee_param *params,  in optee_from_msg_param()  argument
207 static int optee_to_msg_param(struct optee *optee, in optee_to_msg_param() argument
261 static void optee_enable_shm_cache(struct optee *optee) in optee_enable_shm_cache() argument
266 optee_cq_wait_init(&optee->call_queue, &w); in optee_enable_shm_cache()
270 optee->smc.invoke_fn(OPTEE_SMC_ENABLE_SHM_CACHE, in optee_enable_shm_cache()
274 optee_cq_wait_for_completion(&optee->call_queue, &w); in optee_enable_shm_cache()
276 optee_cq_wait_final(&optee->call_queue, &w); in optee_enable_shm_cache()
286 static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped) in __optee_disable_shm_cache() argument
291 optee_cq_wait_init(&optee->call_queue, &w); in __optee_disable_shm_cache()
298 optee->smc.invoke_fn(OPTEE_SMC_DISABLE_SHM_CACHE, in __optee_disable_shm_cache()
316 optee_cq_wait_for_completion(&optee->call_queue, &w); in __optee_disable_shm_cache()
319 optee_cq_wait_final(&optee->call_queue, &w); in __optee_disable_shm_cache()
327 static void optee_disable_shm_cache(struct optee *optee) in optee_disable_shm_cache() argument
329 return __optee_disable_shm_cache(optee, true); in optee_disable_shm_cache()
338 static void optee_disable_unmapped_shm_cache(struct optee *optee) in optee_disable_unmapped_shm_cache() argument
340 return __optee_disable_shm_cache(optee, false); in optee_disable_unmapped_shm_cache()
436 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_shm_register() local
461 sz = optee_msg_arg_size(optee->rpc_param_count); in optee_shm_register()
490 if (optee->ops->do_call_with_arg(ctx, shm_arg, 0) || in optee_shm_register()
502 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_shm_unregister() local
517 sz = optee_msg_arg_size(optee->rpc_param_count); in optee_shm_unregister()
533 if (optee->ops->do_call_with_arg(ctx, shm_arg, 0) || in optee_shm_unregister()
657 struct optee *optee, in handle_rpc_func_cmd_shm_alloc() argument
687 shm = tee_shm_alloc_priv_buf(optee->ctx, sz); in handle_rpc_func_cmd_shm_alloc()
768 static void handle_rpc_func_cmd(struct tee_context *ctx, struct optee *optee, in handle_rpc_func_cmd() argument
776 handle_rpc_func_cmd_shm_alloc(ctx, optee, arg, call_ctx); in handle_rpc_func_cmd()
782 optee_rpc_cmd(ctx, optee, arg); in handle_rpc_func_cmd()
800 struct optee *optee = tee_get_drvdata(teedev); in optee_handle_rpc() local
807 shm = tee_shm_alloc_priv_buf(optee->ctx, param->a1); in optee_handle_rpc()
845 handle_rpc_func_cmd(ctx, optee, arg, call_ctx); in optee_handle_rpc()
870 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_smc_do_call_with_arg() local
877 if (optee->rpc_param_count) { in optee_smc_do_call_with_arg()
909 optee_cq_wait_init(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
914 optee->smc.invoke_fn(param.a0, param.a1, param.a2, param.a3, in optee_smc_do_call_with_arg()
924 optee_cq_wait_for_completion(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
943 optee_cq_wait_final(&optee->call_queue, &w); in optee_smc_do_call_with_arg()
998 struct optee *optee = dev_id; in notif_irq_handler() local
1005 value = get_async_notif_value(optee->smc.invoke_fn, in notif_irq_handler()
1013 optee_notif_send(optee, value); in notif_irq_handler()
1023 struct optee *optee = dev_id; in notif_irq_thread_fn() local
1025 optee_smc_do_bottom_half(optee->ctx); in notif_irq_thread_fn()
1030 static int optee_smc_notif_init_irq(struct optee *optee, u_int irq) in optee_smc_notif_init_irq() argument
1036 0, "optee_notification", optee); in optee_smc_notif_init_irq()
1040 optee->smc.notif_irq = irq; in optee_smc_notif_init_irq()
1045 static void optee_smc_notif_uninit_irq(struct optee *optee) in optee_smc_notif_uninit_irq() argument
1047 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_ASYNC_NOTIF) { in optee_smc_notif_uninit_irq()
1048 optee_smc_stop_async_notif(optee->ctx); in optee_smc_notif_uninit_irq()
1049 if (optee->smc.notif_irq) { in optee_smc_notif_uninit_irq()
1050 free_irq(optee->smc.notif_irq, optee); in optee_smc_notif_uninit_irq()
1051 irq_dispose_mapping(optee->smc.notif_irq); in optee_smc_notif_uninit_irq()
1073 struct optee *optee = tee_get_drvdata(teedev); in optee_get_version() local
1075 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) in optee_get_version()
1077 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_MEMREF_NULL) in optee_get_version()
1084 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_smc_open() local
1085 u32 sec_caps = optee->smc.sec_caps; in optee_smc_open()
1322 struct optee *optee = platform_get_drvdata(pdev); in optee_smc_remove() local
1329 if (!optee->rpc_param_count) in optee_smc_remove()
1330 optee_disable_shm_cache(optee); in optee_smc_remove()
1332 optee_smc_notif_uninit_irq(optee); in optee_smc_remove()
1334 optee_remove_common(optee); in optee_smc_remove()
1336 if (optee->smc.memremaped_shm) in optee_smc_remove()
1337 memunmap(optee->smc.memremaped_shm); in optee_smc_remove()
1339 kfree(optee); in optee_smc_remove()
1353 struct optee *optee = platform_get_drvdata(pdev); in optee_shutdown() local
1355 if (!optee->rpc_param_count) in optee_shutdown()
1356 optee_disable_shm_cache(optee); in optee_shutdown()
1363 struct optee *optee = NULL; in optee_probe() local
1445 optee = kzalloc(sizeof(*optee), GFP_KERNEL); in optee_probe()
1446 if (!optee) { in optee_probe()
1451 optee->ops = &optee_ops; in optee_probe()
1452 optee->smc.invoke_fn = invoke_fn; in optee_probe()
1453 optee->smc.sec_caps = sec_caps; in optee_probe()
1454 optee->rpc_param_count = rpc_param_count; in optee_probe()
1456 teedev = tee_device_alloc(&optee_clnt_desc, NULL, pool, optee); in optee_probe()
1461 optee->teedev = teedev; in optee_probe()
1463 teedev = tee_device_alloc(&optee_supp_desc, NULL, pool, optee); in optee_probe()
1468 optee->supp_teedev = teedev; in optee_probe()
1470 rc = tee_device_register(optee->teedev); in optee_probe()
1474 rc = tee_device_register(optee->supp_teedev); in optee_probe()
1478 mutex_init(&optee->call_queue.mutex); in optee_probe()
1479 INIT_LIST_HEAD(&optee->call_queue.waiters); in optee_probe()
1480 optee_supp_init(&optee->supp); in optee_probe()
1481 optee->smc.memremaped_shm = memremaped_shm; in optee_probe()
1482 optee->pool = pool; in optee_probe()
1483 optee_shm_arg_cache_init(optee, arg_cache_flags); in optee_probe()
1485 platform_set_drvdata(pdev, optee); in optee_probe()
1486 ctx = teedev_open(optee->teedev); in optee_probe()
1491 optee->ctx = ctx; in optee_probe()
1492 rc = optee_notif_init(optee, max_notif_value); in optee_probe()
1506 rc = optee_smc_notif_init_irq(optee, irq); in optee_probe()
1511 enable_async_notif(optee->smc.invoke_fn); in optee_probe()
1522 optee_disable_unmapped_shm_cache(optee); in optee_probe()
1528 if (!optee->rpc_param_count) in optee_probe()
1529 optee_enable_shm_cache(optee); in optee_probe()
1531 if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) in optee_probe()
1542 if (!optee->rpc_param_count) in optee_probe()
1543 optee_disable_shm_cache(optee); in optee_probe()
1544 optee_smc_notif_uninit_irq(optee); in optee_probe()
1547 optee_notif_uninit(optee); in optee_probe()
1551 optee_shm_arg_cache_uninit(optee); in optee_probe()
1552 optee_supp_uninit(&optee->supp); in optee_probe()
1553 mutex_destroy(&optee->call_queue.mutex); in optee_probe()
1555 tee_device_unregister(optee->supp_teedev); in optee_probe()
1557 tee_device_unregister(optee->teedev); in optee_probe()
1559 kfree(optee); in optee_probe()