2 * Copyright (c) 2015-2016, Linaro Limited
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
15 #define pr_fmt(fmt) "%s: " fmt, __func__
17 #include <linux/cdev.h>
18 #include <linux/device.h>
20 #include <linux/idr.h>
21 #include <linux/module.h>
22 #include <linux/slab.h>
23 #include <linux/tee_drv.h>
24 #include <linux/uaccess.h>
25 #include "tee_private.h"
27 #define TEE_NUM_DEVICES 32
29 #define TEE_IOCTL_PARAM_SIZE(x) (sizeof(struct tee_param) * (x))
32 * Unprivileged devices in the lower half range and privileged devices in
33 * the upper half range.
35 static DECLARE_BITMAP(dev_mask, TEE_NUM_DEVICES);
36 static DEFINE_SPINLOCK(driver_lock);
38 static struct class *tee_class;
39 static dev_t tee_devt;
41 static int tee_open(struct inode *inode, struct file *filp)
44 struct tee_device *teedev;
45 struct tee_context *ctx;
47 teedev = container_of(inode->i_cdev, struct tee_device, cdev);
48 if (!tee_device_get(teedev))
51 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
58 INIT_LIST_HEAD(&ctx->list_shm);
59 filp->private_data = ctx;
60 rc = teedev->desc->ops->open(ctx);
67 tee_device_put(teedev);
71 static int tee_release(struct inode *inode, struct file *filp)
73 struct tee_context *ctx = filp->private_data;
74 struct tee_device *teedev = ctx->teedev;
77 ctx->teedev->desc->ops->release(ctx);
78 mutex_lock(&ctx->teedev->mutex);
79 list_for_each_entry(shm, &ctx->list_shm, link)
81 mutex_unlock(&ctx->teedev->mutex);
83 tee_device_put(teedev);
87 static int tee_ioctl_version(struct tee_context *ctx,
88 struct tee_ioctl_version_data __user *uvers)
90 struct tee_ioctl_version_data vers;
92 ctx->teedev->desc->ops->get_version(ctx->teedev, &vers);
94 if (ctx->teedev->desc->flags & TEE_DESC_PRIVILEGED)
95 vers.gen_caps |= TEE_GEN_CAP_PRIVILEGED;
97 if (copy_to_user(uvers, &vers, sizeof(vers)))
103 static int tee_ioctl_shm_alloc(struct tee_context *ctx,
104 struct tee_ioctl_shm_alloc_data __user *udata)
107 struct tee_ioctl_shm_alloc_data data;
110 if (copy_from_user(&data, udata, sizeof(data)))
113 /* Currently no input flags are supported */
119 shm = tee_shm_alloc(ctx, data.size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
124 data.flags = shm->flags;
125 data.size = shm->size;
127 if (copy_to_user(udata, &data, sizeof(data)))
130 ret = tee_shm_get_fd(shm);
133 * When user space closes the file descriptor the shared memory
134 * should be freed or if tee_shm_get_fd() failed then it will
135 * be freed immediately.
141 static int params_from_user(struct tee_context *ctx, struct tee_param *params,
143 struct tee_ioctl_param __user *uparams)
147 for (n = 0; n < num_params; n++) {
149 struct tee_ioctl_param ip;
151 if (copy_from_user(&ip, uparams + n, sizeof(ip)))
154 /* All unused attribute bits has to be zero */
155 if (ip.attr & ~TEE_IOCTL_PARAM_ATTR_TYPE_MASK)
158 params[n].attr = ip.attr;
160 case TEE_IOCTL_PARAM_ATTR_TYPE_NONE:
161 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
163 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
164 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
165 params[n].u.value.a = ip.a;
166 params[n].u.value.b = ip.b;
167 params[n].u.value.c = ip.c;
169 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
170 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
171 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
173 * If we fail to get a pointer to a shared memory
174 * object (and increase the ref count) from an
175 * identifier we return an error. All pointers that
176 * has been added in params have an increased ref
177 * count. It's the callers responibility to do
178 * tee_shm_put() on all resolved pointers.
180 shm = tee_shm_get_from_id(ctx, ip.c);
185 * Ensure offset + size does not overflow offset
186 * and does not overflow the size of the referred
187 * shared memory object.
189 if ((ip.a + ip.b) < ip.a ||
190 (ip.a + ip.b) > shm->size) {
195 params[n].u.memref.shm_offs = ip.a;
196 params[n].u.memref.size = ip.b;
197 params[n].u.memref.shm = shm;
200 /* Unknown attribute */
207 static int params_to_user(struct tee_ioctl_param __user *uparams,
208 size_t num_params, struct tee_param *params)
212 for (n = 0; n < num_params; n++) {
213 struct tee_ioctl_param __user *up = uparams + n;
214 struct tee_param *p = params + n;
217 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
218 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
219 if (put_user(p->u.value.a, &up->a) ||
220 put_user(p->u.value.b, &up->b) ||
221 put_user(p->u.value.c, &up->c))
224 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
225 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
226 if (put_user((u64)p->u.memref.size, &up->b))
235 static bool param_is_memref(struct tee_param *param)
237 switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
238 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
239 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
240 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
247 static int tee_ioctl_open_session(struct tee_context *ctx,
248 struct tee_ioctl_buf_data __user *ubuf)
252 struct tee_ioctl_buf_data buf;
253 struct tee_ioctl_open_session_arg __user *uarg;
254 struct tee_ioctl_open_session_arg arg;
255 struct tee_ioctl_param __user *uparams = NULL;
256 struct tee_param *params = NULL;
257 bool have_session = false;
259 if (!ctx->teedev->desc->ops->open_session)
262 if (copy_from_user(&buf, ubuf, sizeof(buf)))
265 if (buf.buf_len > TEE_MAX_ARG_SIZE ||
266 buf.buf_len < sizeof(struct tee_ioctl_open_session_arg))
269 uarg = u64_to_user_ptr(buf.buf_ptr);
270 if (copy_from_user(&arg, uarg, sizeof(arg)))
273 if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
276 if (arg.num_params) {
277 params = kcalloc(arg.num_params, sizeof(struct tee_param),
281 uparams = uarg->params;
282 rc = params_from_user(ctx, params, arg.num_params, uparams);
287 rc = ctx->teedev->desc->ops->open_session(ctx, &arg, params);
292 if (put_user(arg.session, &uarg->session) ||
293 put_user(arg.ret, &uarg->ret) ||
294 put_user(arg.ret_origin, &uarg->ret_origin)) {
298 rc = params_to_user(uparams, arg.num_params, params);
301 * If we've succeeded to open the session but failed to communicate
302 * it back to user space, close the session again to avoid leakage.
304 if (rc && have_session && ctx->teedev->desc->ops->close_session)
305 ctx->teedev->desc->ops->close_session(ctx, arg.session);
308 /* Decrease ref count for all valid shared memory pointers */
309 for (n = 0; n < arg.num_params; n++)
310 if (param_is_memref(params + n) &&
311 params[n].u.memref.shm)
312 tee_shm_put(params[n].u.memref.shm);
319 static int tee_ioctl_invoke(struct tee_context *ctx,
320 struct tee_ioctl_buf_data __user *ubuf)
324 struct tee_ioctl_buf_data buf;
325 struct tee_ioctl_invoke_arg __user *uarg;
326 struct tee_ioctl_invoke_arg arg;
327 struct tee_ioctl_param __user *uparams = NULL;
328 struct tee_param *params = NULL;
330 if (!ctx->teedev->desc->ops->invoke_func)
333 if (copy_from_user(&buf, ubuf, sizeof(buf)))
336 if (buf.buf_len > TEE_MAX_ARG_SIZE ||
337 buf.buf_len < sizeof(struct tee_ioctl_invoke_arg))
340 uarg = u64_to_user_ptr(buf.buf_ptr);
341 if (copy_from_user(&arg, uarg, sizeof(arg)))
344 if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
347 if (arg.num_params) {
348 params = kcalloc(arg.num_params, sizeof(struct tee_param),
352 uparams = uarg->params;
353 rc = params_from_user(ctx, params, arg.num_params, uparams);
358 rc = ctx->teedev->desc->ops->invoke_func(ctx, &arg, params);
362 if (put_user(arg.ret, &uarg->ret) ||
363 put_user(arg.ret_origin, &uarg->ret_origin)) {
367 rc = params_to_user(uparams, arg.num_params, params);
370 /* Decrease ref count for all valid shared memory pointers */
371 for (n = 0; n < arg.num_params; n++)
372 if (param_is_memref(params + n) &&
373 params[n].u.memref.shm)
374 tee_shm_put(params[n].u.memref.shm);
380 static int tee_ioctl_cancel(struct tee_context *ctx,
381 struct tee_ioctl_cancel_arg __user *uarg)
383 struct tee_ioctl_cancel_arg arg;
385 if (!ctx->teedev->desc->ops->cancel_req)
388 if (copy_from_user(&arg, uarg, sizeof(arg)))
391 return ctx->teedev->desc->ops->cancel_req(ctx, arg.cancel_id,
396 tee_ioctl_close_session(struct tee_context *ctx,
397 struct tee_ioctl_close_session_arg __user *uarg)
399 struct tee_ioctl_close_session_arg arg;
401 if (!ctx->teedev->desc->ops->close_session)
404 if (copy_from_user(&arg, uarg, sizeof(arg)))
407 return ctx->teedev->desc->ops->close_session(ctx, arg.session);
410 static int params_to_supp(struct tee_context *ctx,
411 struct tee_ioctl_param __user *uparams,
412 size_t num_params, struct tee_param *params)
416 for (n = 0; n < num_params; n++) {
417 struct tee_ioctl_param ip;
418 struct tee_param *p = params + n;
420 ip.attr = p->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK;
422 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
423 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
428 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
429 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
430 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
431 ip.b = p->u.memref.size;
432 if (!p->u.memref.shm) {
434 ip.c = (u64)-1; /* invalid shm id */
437 ip.a = p->u.memref.shm_offs;
438 ip.c = p->u.memref.shm->id;
447 if (copy_to_user(uparams + n, &ip, sizeof(ip)))
454 static int tee_ioctl_supp_recv(struct tee_context *ctx,
455 struct tee_ioctl_buf_data __user *ubuf)
458 struct tee_ioctl_buf_data buf;
459 struct tee_iocl_supp_recv_arg __user *uarg;
460 struct tee_param *params;
464 if (!ctx->teedev->desc->ops->supp_recv)
467 if (copy_from_user(&buf, ubuf, sizeof(buf)))
470 if (buf.buf_len > TEE_MAX_ARG_SIZE ||
471 buf.buf_len < sizeof(struct tee_iocl_supp_recv_arg))
474 uarg = u64_to_user_ptr(buf.buf_ptr);
475 if (get_user(num_params, &uarg->num_params))
478 if (sizeof(*uarg) + TEE_IOCTL_PARAM_SIZE(num_params) != buf.buf_len)
481 params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL);
485 rc = ctx->teedev->desc->ops->supp_recv(ctx, &func, &num_params, params);
489 if (put_user(func, &uarg->func) ||
490 put_user(num_params, &uarg->num_params)) {
495 rc = params_to_supp(ctx, uarg->params, num_params, params);
501 static int params_from_supp(struct tee_param *params, size_t num_params,
502 struct tee_ioctl_param __user *uparams)
506 for (n = 0; n < num_params; n++) {
507 struct tee_param *p = params + n;
508 struct tee_ioctl_param ip;
510 if (copy_from_user(&ip, uparams + n, sizeof(ip)))
513 /* All unused attribute bits has to be zero */
514 if (ip.attr & ~TEE_IOCTL_PARAM_ATTR_TYPE_MASK)
519 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
520 case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
521 /* Only out and in/out values can be updated */
526 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
527 case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
529 * Only the size of the memref can be updated.
530 * Since we don't have access to the original
531 * parameters here, only store the supplied size.
532 * The driver will copy the updated size into the
533 * original parameters.
535 p->u.memref.shm = NULL;
536 p->u.memref.shm_offs = 0;
537 p->u.memref.size = ip.b;
540 memset(&p->u, 0, sizeof(p->u));
547 static int tee_ioctl_supp_send(struct tee_context *ctx,
548 struct tee_ioctl_buf_data __user *ubuf)
551 struct tee_ioctl_buf_data buf;
552 struct tee_iocl_supp_send_arg __user *uarg;
553 struct tee_param *params;
557 /* Not valid for this driver */
558 if (!ctx->teedev->desc->ops->supp_send)
561 if (copy_from_user(&buf, ubuf, sizeof(buf)))
564 if (buf.buf_len > TEE_MAX_ARG_SIZE ||
565 buf.buf_len < sizeof(struct tee_iocl_supp_send_arg))
568 uarg = u64_to_user_ptr(buf.buf_ptr);
569 if (get_user(ret, &uarg->ret) ||
570 get_user(num_params, &uarg->num_params))
573 if (sizeof(*uarg) + TEE_IOCTL_PARAM_SIZE(num_params) > buf.buf_len)
576 params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL);
580 rc = params_from_supp(params, num_params, uarg->params);
584 rc = ctx->teedev->desc->ops->supp_send(ctx, ret, num_params, params);
590 static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
592 struct tee_context *ctx = filp->private_data;
593 void __user *uarg = (void __user *)arg;
596 case TEE_IOC_VERSION:
597 return tee_ioctl_version(ctx, uarg);
598 case TEE_IOC_SHM_ALLOC:
599 return tee_ioctl_shm_alloc(ctx, uarg);
600 case TEE_IOC_OPEN_SESSION:
601 return tee_ioctl_open_session(ctx, uarg);
603 return tee_ioctl_invoke(ctx, uarg);
605 return tee_ioctl_cancel(ctx, uarg);
606 case TEE_IOC_CLOSE_SESSION:
607 return tee_ioctl_close_session(ctx, uarg);
608 case TEE_IOC_SUPPL_RECV:
609 return tee_ioctl_supp_recv(ctx, uarg);
610 case TEE_IOC_SUPPL_SEND:
611 return tee_ioctl_supp_send(ctx, uarg);
617 static const struct file_operations tee_fops = {
618 .owner = THIS_MODULE,
620 .release = tee_release,
621 .unlocked_ioctl = tee_ioctl,
622 .compat_ioctl = tee_ioctl,
625 static void tee_release_device(struct device *dev)
627 struct tee_device *teedev = container_of(dev, struct tee_device, dev);
629 spin_lock(&driver_lock);
630 clear_bit(teedev->id, dev_mask);
631 spin_unlock(&driver_lock);
632 mutex_destroy(&teedev->mutex);
633 idr_destroy(&teedev->idr);
638 * tee_device_alloc() - Allocate a new struct tee_device instance
639 * @teedesc: Descriptor for this driver
640 * @dev: Parent device for this device
641 * @pool: Shared memory pool, NULL if not used
642 * @driver_data: Private driver data for this device
644 * Allocates a new struct tee_device instance. The device is
645 * removed by tee_device_unregister().
647 * @returns a pointer to a 'struct tee_device' or an ERR_PTR on failure
649 struct tee_device *tee_device_alloc(const struct tee_desc *teedesc,
651 struct tee_shm_pool *pool,
654 struct tee_device *teedev;
659 if (!teedesc || !teedesc->name || !teedesc->ops ||
660 !teedesc->ops->get_version || !teedesc->ops->open ||
661 !teedesc->ops->release || !pool)
662 return ERR_PTR(-EINVAL);
664 teedev = kzalloc(sizeof(*teedev), GFP_KERNEL);
666 ret = ERR_PTR(-ENOMEM);
670 if (teedesc->flags & TEE_DESC_PRIVILEGED)
671 offs = TEE_NUM_DEVICES / 2;
673 spin_lock(&driver_lock);
674 teedev->id = find_next_zero_bit(dev_mask, TEE_NUM_DEVICES, offs);
675 if (teedev->id < TEE_NUM_DEVICES)
676 set_bit(teedev->id, dev_mask);
677 spin_unlock(&driver_lock);
679 if (teedev->id >= TEE_NUM_DEVICES) {
680 ret = ERR_PTR(-ENOMEM);
684 snprintf(teedev->name, sizeof(teedev->name), "tee%s%d",
685 teedesc->flags & TEE_DESC_PRIVILEGED ? "priv" : "",
688 teedev->dev.class = tee_class;
689 teedev->dev.release = tee_release_device;
690 teedev->dev.parent = dev;
692 teedev->dev.devt = MKDEV(MAJOR(tee_devt), teedev->id);
694 rc = dev_set_name(&teedev->dev, "%s", teedev->name);
700 cdev_init(&teedev->cdev, &tee_fops);
701 teedev->cdev.owner = teedesc->owner;
702 teedev->cdev.kobj.parent = &teedev->dev.kobj;
704 dev_set_drvdata(&teedev->dev, driver_data);
705 device_initialize(&teedev->dev);
707 /* 1 as tee_device_unregister() does one final tee_device_put() */
708 teedev->num_users = 1;
709 init_completion(&teedev->c_no_users);
710 mutex_init(&teedev->mutex);
711 idr_init(&teedev->idr);
713 teedev->desc = teedesc;
718 unregister_chrdev_region(teedev->dev.devt, 1);
720 pr_err("could not register %s driver\n",
721 teedesc->flags & TEE_DESC_PRIVILEGED ? "privileged" : "client");
722 if (teedev && teedev->id < TEE_NUM_DEVICES) {
723 spin_lock(&driver_lock);
724 clear_bit(teedev->id, dev_mask);
725 spin_unlock(&driver_lock);
730 EXPORT_SYMBOL_GPL(tee_device_alloc);
732 static ssize_t implementation_id_show(struct device *dev,
733 struct device_attribute *attr, char *buf)
735 struct tee_device *teedev = container_of(dev, struct tee_device, dev);
736 struct tee_ioctl_version_data vers;
738 teedev->desc->ops->get_version(teedev, &vers);
739 return scnprintf(buf, PAGE_SIZE, "%d\n", vers.impl_id);
741 static DEVICE_ATTR_RO(implementation_id);
743 static struct attribute *tee_dev_attrs[] = {
744 &dev_attr_implementation_id.attr,
748 static const struct attribute_group tee_dev_group = {
749 .attrs = tee_dev_attrs,
753 * tee_device_register() - Registers a TEE device
754 * @teedev: Device to register
756 * tee_device_unregister() need to be called to remove the @teedev if
757 * this function fails.
759 * @returns < 0 on failure
761 int tee_device_register(struct tee_device *teedev)
765 if (teedev->flags & TEE_DEVICE_FLAG_REGISTERED) {
766 dev_err(&teedev->dev, "attempt to register twice\n");
770 rc = cdev_add(&teedev->cdev, teedev->dev.devt, 1);
772 dev_err(&teedev->dev,
773 "unable to cdev_add() %s, major %d, minor %d, err=%d\n",
774 teedev->name, MAJOR(teedev->dev.devt),
775 MINOR(teedev->dev.devt), rc);
779 rc = device_add(&teedev->dev);
781 dev_err(&teedev->dev,
782 "unable to device_add() %s, major %d, minor %d, err=%d\n",
783 teedev->name, MAJOR(teedev->dev.devt),
784 MINOR(teedev->dev.devt), rc);
788 rc = sysfs_create_group(&teedev->dev.kobj, &tee_dev_group);
790 dev_err(&teedev->dev,
791 "failed to create sysfs attributes, err=%d\n", rc);
792 goto err_sysfs_create_group;
795 teedev->flags |= TEE_DEVICE_FLAG_REGISTERED;
798 err_sysfs_create_group:
799 device_del(&teedev->dev);
801 cdev_del(&teedev->cdev);
804 EXPORT_SYMBOL_GPL(tee_device_register);
806 void tee_device_put(struct tee_device *teedev)
808 mutex_lock(&teedev->mutex);
809 /* Shouldn't put in this state */
810 if (!WARN_ON(!teedev->desc)) {
812 if (!teedev->num_users) {
814 complete(&teedev->c_no_users);
817 mutex_unlock(&teedev->mutex);
820 bool tee_device_get(struct tee_device *teedev)
822 mutex_lock(&teedev->mutex);
824 mutex_unlock(&teedev->mutex);
828 mutex_unlock(&teedev->mutex);
833 * tee_device_unregister() - Removes a TEE device
834 * @teedev: Device to unregister
836 * This function should be called to remove the @teedev even if
837 * tee_device_register() hasn't been called yet. Does nothing if
840 void tee_device_unregister(struct tee_device *teedev)
845 if (teedev->flags & TEE_DEVICE_FLAG_REGISTERED) {
846 sysfs_remove_group(&teedev->dev.kobj, &tee_dev_group);
847 cdev_del(&teedev->cdev);
848 device_del(&teedev->dev);
851 tee_device_put(teedev);
852 wait_for_completion(&teedev->c_no_users);
855 * No need to take a mutex any longer now since teedev->desc was
856 * set to NULL before teedev->c_no_users was completed.
861 put_device(&teedev->dev);
863 EXPORT_SYMBOL_GPL(tee_device_unregister);
866 * tee_get_drvdata() - Return driver_data pointer
867 * @teedev: Device containing the driver_data pointer
868 * @returns the driver_data pointer supplied to tee_register().
870 void *tee_get_drvdata(struct tee_device *teedev)
872 return dev_get_drvdata(&teedev->dev);
874 EXPORT_SYMBOL_GPL(tee_get_drvdata);
876 static int __init tee_init(void)
880 tee_class = class_create(THIS_MODULE, "tee");
881 if (IS_ERR(tee_class)) {
882 pr_err("couldn't create class\n");
883 return PTR_ERR(tee_class);
886 rc = alloc_chrdev_region(&tee_devt, 0, TEE_NUM_DEVICES, "tee");
888 pr_err("failed to allocate char dev region\n");
889 class_destroy(tee_class);
896 static void __exit tee_exit(void)
898 class_destroy(tee_class);
900 unregister_chrdev_region(tee_devt, TEE_NUM_DEVICES);
903 subsys_initcall(tee_init);
904 module_exit(tee_exit);
906 MODULE_AUTHOR("Linaro");
907 MODULE_DESCRIPTION("TEE Driver");
908 MODULE_VERSION("1.0");
909 MODULE_LICENSE("GPL v2");