[ARM] Support register switch in nommu mode
[linux-2.6/verdex.git] / drivers / crypto / padlock-generic.c
blob18cf0e8274a7dc5ac2bcbef3f8f450520c5d329f
1 /*
2 * Cryptographic API.
4 * Support for VIA PadLock hardware crypto engine.
6 * Copyright (c) 2004 Michal Ludvig <michal@logix.cz>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/types.h>
17 #include <linux/errno.h>
18 #include <linux/crypto.h>
19 #include <asm/byteorder.h>
20 #include "padlock.h"
22 static int __init
23 padlock_init(void)
25 int ret = -ENOSYS;
27 if (!cpu_has_xcrypt) {
28 printk(KERN_ERR PFX "VIA PadLock not detected.\n");
29 return -ENODEV;
32 if (!cpu_has_xcrypt_enabled) {
33 printk(KERN_ERR PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
34 return -ENODEV;
37 #ifdef CONFIG_CRYPTO_DEV_PADLOCK_AES
38 if ((ret = padlock_init_aes())) {
39 printk(KERN_ERR PFX "VIA PadLock AES initialization failed.\n");
40 return ret;
42 #endif
44 if (ret == -ENOSYS)
45 printk(KERN_ERR PFX "Hmm, VIA PadLock was compiled without any algorithm.\n");
47 return ret;
50 static void __exit
51 padlock_fini(void)
53 #ifdef CONFIG_CRYPTO_DEV_PADLOCK_AES
54 padlock_fini_aes();
55 #endif
58 module_init(padlock_init);
59 module_exit(padlock_fini);
61 MODULE_DESCRIPTION("VIA PadLock crypto engine support.");
62 MODULE_LICENSE("Dual BSD/GPL");
63 MODULE_AUTHOR("Michal Ludvig");