aboutsummaryrefslogtreecommitdiffstats
path: root/security/smc/omap4/scxlnx_device.c
blob: cd9d56baa6dc5f018eadd17e4f18f60ac5e48045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * Copyright (c) 2006-2010 Trusted Logic S.A.
 * 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 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#include <asm/atomic.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/page-flags.h>
#include <linux/pm.h>
#include <linux/sysdev.h>
#include <linux/vmalloc.h>
#include <linux/signal.h>
#ifdef CONFIG_ANDROID
#include <linux/device.h>
#endif

#include "scx_protocol.h"
#include "scxlnx_defs.h"
#include "scxlnx_util.h"
#ifdef CONFIG_TF_MSHIELD
#include <plat/cpu.h>
#include "scx_public_crypto.h"
#endif

/* The single device supported by this driver */
static struct SCXLNX_DEVICE g_SCXLNXDevice = {0, };

/*----------------------------------------------------------------------------
 * Implementations
 *----------------------------------------------------------------------------*/

struct SCXLNX_DEVICE *SCXLNXGetDevice(void)
{
	return &g_SCXLNXDevice;
}

/*----------------------------------------------------------------------------*/

static int __init register_dmcrypt_engines(void)
{
        int ret;

        printk(KERN_INFO "Entered register_dmcrypt_engines");

        ret = SCXPublicCryptoInit();
        if (ret) {
                printk(KERN_ERR "register_dmcrypt_engines():"
                        " SCXPublicCryptoInit failed, (error %d)!\n", ret);
                goto out;
        }

        ret = register_smc_public_crypto_aes();
        if (ret) {
                printk(KERN_ERR "register_dmcrypt_engines():"
                        " regiser_smc_public_crypto_aes failed, (error %d)!\n", ret);
                goto out;
        }

        ret = register_smc_public_crypto_digest();
        if (ret) {
                printk(KERN_ERR "register_dmcrypt_engines():"
                        " regiser_smc_public_crypto_digest failed, (error %d)!\n", ret);
                goto out;
        }

out:
        return ret;
}
module_init(register_dmcrypt_engines);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Trusted Logic S.A.");