1 /******************************************************************************
3 ** FILE NAME : ifxmips_deu_danube.h
5 ** MODULES : DEU Module for Danube
7 ** DATE : September 8, 2009
8 ** AUTHOR : Mohammad Firdaus
9 ** DESCRIPTION : Data Encryption Unit Driver
10 ** COPYRIGHT : Copyright (c) 2009
11 ** Infineon Technologies AG
12 ** Am Campeon 1-12, 85579 Neubiberg, Germany
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License as published by
16 ** the Free Software Foundation; either version 2 of the License, or
17 ** (at your option) any later version.
20 ** $Date $Author $Comment
21 ** 08,Sept 2009 Mohammad Firdaus Initial UEIP release
22 *******************************************************************************/
24 \defgroup IFX_DEU IFX_DEU_DRIVERS
26 \brief deu driver module
30 \file ifxmips_deu_danube.h
31 \brief board specific driver header file for danube
35 \defgroup BOARD_SPECIFIC_FUNCTIONS IFX_BOARD_SPECIFIC_FUNCTIONS
37 \brief board specific deu header files
40 #ifndef IFXMIPS_DEU_DANUBE_H
41 #define IFXMIPS_DEU_DANUBE_H
43 /* Project Header Files */
44 #include <linux/version.h>
45 #include <linux/module.h>
46 #include <linux/init.h>
47 #include <linux/types.h>
48 #include <linux/errno.h>
49 #include <linux/crypto.h>
50 #include <linux/interrupt.h>
51 #include <linux/delay.h>
52 #include <asm/byteorder.h>
53 #include <crypto/algapi.h>
54 #include <linux/module.h>
56 #include <linux/scatterlist.h>
57 #include <linux/skbuff.h>
58 #include <linux/netdevice.h>
59 #include "ifxmips_deu.h"
63 #define INPUT_ENDIAN_SWAP(input) input_swap(input)
64 #define DEU_ENDIAN_SWAP(input) endian_swap(input)
65 #define FIND_DEU_CHIP_VERSION chip_version()
66 #define AES_DMA_MISC_CONFIG()
67 #define CLC_START IFX_DEU_CLK
69 #define AES_START IFX_AES_CON
70 #define DES_3DES_START IFX_DES_CON
77 #define WAIT_AES_DMA_READY() \
80 volatile struct deu_dma_t *dma = (struct deu_dma_t *) IFX_DEU_DMA_CON; \
81 volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; \
82 for (i = 0; i < 10; i++) \
83 udelay(DELAY_PERIOD); \
84 while (dma->controlr.BSY) {}; \
85 while (aes->controlr.BUS) {}; \
88 #define WAIT_DES_DMA_READY() \
91 volatile struct deu_dma_t *dma = (struct deu_dma_t *) IFX_DEU_DMA_CON; \
92 volatile struct des_t *des = (struct des_t *) DES_3DES_START; \
93 for (i = 0; i < 10; i++) \
94 udelay(DELAY_PERIOD); \
95 while (dma->controlr.BSY) {}; \
96 while (des->controlr.BUS) {}; \
99 #define SHA_HASH_INIT \
101 volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START; \
102 hash->controlr.SM = 1; \
103 hash->controlr.ALGO = 0; \
104 hash->controlr.INIT = 1; \
109 struct clc_controlr_t {
121 struct des_controlr { //10h
155 struct aes_controlr {
202 struct hash_controlr {
237 struct dma_controlr {
250 #endif /* IFXMIPS_DEU_DANUBE_H */