2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
16 * Copyright (C) 2010 Ralph Hempel <ralph.hempel@lantiq.com>
17 * Copyright (C) 2009 Mohammad Firdaus
21 \defgroup IFX_DEU IFX_DEU_DRIVERS
23 \brief ifx deu driver module
29 \brief main deu driver file
33 \defgroup IFX_DEU_FUNCTIONS IFX_DEU_FUNCTIONS
35 \brief IFX DEU functions
39 #include <linux/version.h>
40 #if defined(CONFIG_MODVERSIONS)
42 #include <linux/modversions.h>
44 #include <linux/module.h>
45 #include <linux/init.h>
46 #include <linux/types.h>
47 #include <linux/errno.h>
48 #include <linux/crypto.h>
49 #include <linux/proc_fs.h>
50 #include <linux/fs.h> /* Stuff about file systems that we need */
51 #include <asm/byteorder.h>
52 #include <ifxmips_pmu.h>
53 #include "ifxmips_deu.h"
55 #ifdef CONFIG_CRYPTO_DEV_IFXMIPS_DMA
56 int disable_deudma
= 0;
58 int disable_deudma
= 1;
59 #endif /* CONFIG_CRYPTO_DEV_IFXMIPS_DMA */
62 char deu_debug_level
= 3;
65 /*! \fn static int __init deu_init (void)
66 * \ingroup IFX_DEU_FUNCTIONS
67 * \brief link all modules that have been selected in kernel config for ifx hw crypto support
70 static int __init
deu_init (void)
75 volatile struct clc_controlr_t
*clc
= (struct clc_controlr_t
*) IFX_DEU_CLK
;
77 ifxmips_pmu_enable(1<<20);
79 printk(KERN_INFO
"Lantiq crypto hardware driver version %s\n", IFX_DEU_DRV_VERSION
);
92 #ifdef CONFIG_CRYPTO_DEV_IFXMIPS_DMA
96 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_DES)
97 if(config
& IFX_DEU_ID_DES
) {
98 if ((ret
= ifxdeu_init_des ())) {
99 printk (KERN_ERR
"IFX DES initialization failed!\n");
102 printk (KERN_ERR
"IFX DES not supported!\n");
105 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_AES)
106 if(config
& IFX_DEU_ID_AES
) {
107 if ((ret
= ifxdeu_init_aes ())) {
108 printk (KERN_ERR
"IFX AES initialization failed!\n");
111 printk (KERN_ERR
"IFX AES not supported!\n");
114 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_ARC4)
115 if ((ret
= ifxdeu_init_arc4 ())) {
116 printk (KERN_ERR
"IFX ARC4 initialization failed!\n");
119 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_SHA1)
120 if(config
& IFX_DEU_ID_HASH
) {
121 if ((ret
= ifxdeu_init_sha1 ())) {
122 printk (KERN_ERR
"IFX SHA1 initialization failed!\n");
125 printk (KERN_ERR
"IFX SHA1 not supported!\n");
128 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_MD5)
129 if(config
& IFX_DEU_ID_HASH
) {
130 if ((ret
= ifxdeu_init_md5 ())) {
131 printk (KERN_ERR
"IFX MD5 initialization failed!\n");
134 printk (KERN_ERR
"IFX MD5 not supported!\n");
137 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_SHA1_HMAC)
138 if ((ret
= ifxdeu_init_sha1_hmac ())) {
139 printk (KERN_ERR
"IFX SHA1_HMAC initialization failed!\n");
142 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_MD5_HMAC)
143 if ((ret
= ifxdeu_init_md5_hmac ())) {
144 printk (KERN_ERR
"IFX MD5_HMAC initialization failed!\n");
150 /*! \fn static void __exit deu_fini (void)
151 * \ingroup IFX_DEU_FUNCTIONS
152 * \brief remove the loaded crypto algorithms
154 static void __exit
deu_fini (void)
156 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_DES)
159 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_AES)
162 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_ARC4)
165 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_SHA1)
168 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_MD5)
171 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_SHA1_HMAC)
172 ifxdeu_fini_sha1_hmac ();
174 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_MD5_HMAC)
175 ifxdeu_fini_md5_hmac ();
177 printk("DEU has exited successfully\n");
179 #if defined(CONFIG_CRYPTO_DEV_IFXMIPS_DMA)
181 printk("DMA has deregistered successfully\n");
185 module_init (deu_init
);
186 module_exit (deu_fini
);
188 MODULE_DESCRIPTION ("Infineon crypto engine support.");
189 MODULE_LICENSE ("GPL");
190 MODULE_AUTHOR ("Mohammad Firdaus");
This page took 0.063064 seconds and 5 git commands to generate.