Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
s5p-sss.c File Reference
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/crypto.h>
#include <linux/interrupt.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
#include <crypto/ctr.h>
#include <plat/cpu.h>
#include <plat/dma.h>

Go to the source code of this file.

Data Structures

struct  s5p_aes_reqctx
 
struct  s5p_aes_ctx
 
struct  s5p_aes_dev
 

Macros

#define _SBF(s, v)   ((v) << (s))
 
#define _BIT(b)   _SBF(b, 1)
 
#define SSS_REG_FCINTSTAT   0x0000
 
#define SSS_FCINTSTAT_BRDMAINT   _BIT(3)
 
#define SSS_FCINTSTAT_BTDMAINT   _BIT(2)
 
#define SSS_FCINTSTAT_HRDMAINT   _BIT(1)
 
#define SSS_FCINTSTAT_PKDMAINT   _BIT(0)
 
#define SSS_REG_FCINTENSET   0x0004
 
#define SSS_FCINTENSET_BRDMAINTENSET   _BIT(3)
 
#define SSS_FCINTENSET_BTDMAINTENSET   _BIT(2)
 
#define SSS_FCINTENSET_HRDMAINTENSET   _BIT(1)
 
#define SSS_FCINTENSET_PKDMAINTENSET   _BIT(0)
 
#define SSS_REG_FCINTENCLR   0x0008
 
#define SSS_FCINTENCLR_BRDMAINTENCLR   _BIT(3)
 
#define SSS_FCINTENCLR_BTDMAINTENCLR   _BIT(2)
 
#define SSS_FCINTENCLR_HRDMAINTENCLR   _BIT(1)
 
#define SSS_FCINTENCLR_PKDMAINTENCLR   _BIT(0)
 
#define SSS_REG_FCINTPEND   0x000C
 
#define SSS_FCINTPEND_BRDMAINTP   _BIT(3)
 
#define SSS_FCINTPEND_BTDMAINTP   _BIT(2)
 
#define SSS_FCINTPEND_HRDMAINTP   _BIT(1)
 
#define SSS_FCINTPEND_PKDMAINTP   _BIT(0)
 
#define SSS_REG_FCFIFOSTAT   0x0010
 
#define SSS_FCFIFOSTAT_BRFIFOFUL   _BIT(7)
 
#define SSS_FCFIFOSTAT_BRFIFOEMP   _BIT(6)
 
#define SSS_FCFIFOSTAT_BTFIFOFUL   _BIT(5)
 
#define SSS_FCFIFOSTAT_BTFIFOEMP   _BIT(4)
 
#define SSS_FCFIFOSTAT_HRFIFOFUL   _BIT(3)
 
#define SSS_FCFIFOSTAT_HRFIFOEMP   _BIT(2)
 
#define SSS_FCFIFOSTAT_PKFIFOFUL   _BIT(1)
 
#define SSS_FCFIFOSTAT_PKFIFOEMP   _BIT(0)
 
#define SSS_REG_FCFIFOCTRL   0x0014
 
#define SSS_FCFIFOCTRL_DESSEL   _BIT(2)
 
#define SSS_HASHIN_INDEPENDENT   _SBF(0, 0x00)
 
#define SSS_HASHIN_CIPHER_INPUT   _SBF(0, 0x01)
 
#define SSS_HASHIN_CIPHER_OUTPUT   _SBF(0, 0x02)
 
#define SSS_REG_FCBRDMAS   0x0020
 
#define SSS_REG_FCBRDMAL   0x0024
 
#define SSS_REG_FCBRDMAC   0x0028
 
#define SSS_FCBRDMAC_BYTESWAP   _BIT(1)
 
#define SSS_FCBRDMAC_FLUSH   _BIT(0)
 
#define SSS_REG_FCBTDMAS   0x0030
 
#define SSS_REG_FCBTDMAL   0x0034
 
#define SSS_REG_FCBTDMAC   0x0038
 
#define SSS_FCBTDMAC_BYTESWAP   _BIT(1)
 
#define SSS_FCBTDMAC_FLUSH   _BIT(0)
 
#define SSS_REG_FCHRDMAS   0x0040
 
#define SSS_REG_FCHRDMAL   0x0044
 
#define SSS_REG_FCHRDMAC   0x0048
 
#define SSS_FCHRDMAC_BYTESWAP   _BIT(1)
 
#define SSS_FCHRDMAC_FLUSH   _BIT(0)
 
#define SSS_REG_FCPKDMAS   0x0050
 
#define SSS_REG_FCPKDMAL   0x0054
 
#define SSS_REG_FCPKDMAC   0x0058
 
#define SSS_FCPKDMAC_BYTESWAP   _BIT(3)
 
#define SSS_FCPKDMAC_DESCEND   _BIT(2)
 
#define SSS_FCPKDMAC_TRANSMIT   _BIT(1)
 
#define SSS_FCPKDMAC_FLUSH   _BIT(0)
 
#define SSS_REG_FCPKDMAO   0x005C
 
#define SSS_REG_AES_CONTROL   0x4000
 
#define SSS_AES_BYTESWAP_DI   _BIT(11)
 
#define SSS_AES_BYTESWAP_DO   _BIT(10)
 
#define SSS_AES_BYTESWAP_IV   _BIT(9)
 
#define SSS_AES_BYTESWAP_CNT   _BIT(8)
 
#define SSS_AES_BYTESWAP_KEY   _BIT(7)
 
#define SSS_AES_KEY_CHANGE_MODE   _BIT(6)
 
#define SSS_AES_KEY_SIZE_128   _SBF(4, 0x00)
 
#define SSS_AES_KEY_SIZE_192   _SBF(4, 0x01)
 
#define SSS_AES_KEY_SIZE_256   _SBF(4, 0x02)
 
#define SSS_AES_FIFO_MODE   _BIT(3)
 
#define SSS_AES_CHAIN_MODE_ECB   _SBF(1, 0x00)
 
#define SSS_AES_CHAIN_MODE_CBC   _SBF(1, 0x01)
 
#define SSS_AES_CHAIN_MODE_CTR   _SBF(1, 0x02)
 
#define SSS_AES_MODE_DECRYPT   _BIT(0)
 
#define SSS_REG_AES_STATUS   0x4004
 
#define SSS_AES_BUSY   _BIT(2)
 
#define SSS_AES_INPUT_READY   _BIT(1)
 
#define SSS_AES_OUTPUT_READY   _BIT(0)
 
#define SSS_REG_AES_IN_DATA(s)   (0x4010 + (s << 2))
 
#define SSS_REG_AES_OUT_DATA(s)   (0x4020 + (s << 2))
 
#define SSS_REG_AES_IV_DATA(s)   (0x4030 + (s << 2))
 
#define SSS_REG_AES_CNT_DATA(s)   (0x4040 + (s << 2))
 
#define SSS_REG_AES_KEY_DATA(s)   (0x4080 + (s << 2))
 
#define SSS_REG(dev, reg)   ((dev)->ioaddr + (SSS_REG_##reg))
 
#define SSS_READ(dev, reg)   __raw_readl(SSS_REG(dev, reg))
 
#define SSS_WRITE(dev, reg, val)   __raw_writel((val), SSS_REG(dev, reg))
 
#define FLAGS_AES_DECRYPT   _BIT(0)
 
#define FLAGS_AES_MODE_MASK   _SBF(1, 0x03)
 
#define FLAGS_AES_CBC   _SBF(1, 0x01)
 
#define FLAGS_AES_CTR   _SBF(1, 0x02)
 
#define AES_KEY_LEN   16
 
#define CRYPTO_QUEUE_LEN   1
 

Functions

 module_platform_driver (s5p_aes_crypto)
 
 MODULE_DESCRIPTION ("S5PV210 AES hw acceleration support.")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Vladimir Zapolskiy <[email protected]>")
 

Macro Definition Documentation

#define _BIT (   b)    _SBF(b, 1)

Definition at line 36 of file s5p-sss.c.

#define _SBF (   s,
  v 
)    ((v) << (s))

Definition at line 35 of file s5p-sss.c.

#define AES_KEY_LEN   16

Definition at line 145 of file s5p-sss.c.

#define CRYPTO_QUEUE_LEN   1

Definition at line 146 of file s5p-sss.c.

#define FLAGS_AES_CBC   _SBF(1, 0x01)

Definition at line 142 of file s5p-sss.c.

#define FLAGS_AES_CTR   _SBF(1, 0x02)

Definition at line 143 of file s5p-sss.c.

#define FLAGS_AES_DECRYPT   _BIT(0)

Definition at line 140 of file s5p-sss.c.

#define FLAGS_AES_MODE_MASK   _SBF(1, 0x03)

Definition at line 141 of file s5p-sss.c.

#define SSS_AES_BUSY   _BIT(2)

Definition at line 125 of file s5p-sss.c.

#define SSS_AES_BYTESWAP_CNT   _BIT(8)

Definition at line 112 of file s5p-sss.c.

#define SSS_AES_BYTESWAP_DI   _BIT(11)

Definition at line 109 of file s5p-sss.c.

#define SSS_AES_BYTESWAP_DO   _BIT(10)

Definition at line 110 of file s5p-sss.c.

#define SSS_AES_BYTESWAP_IV   _BIT(9)

Definition at line 111 of file s5p-sss.c.

#define SSS_AES_BYTESWAP_KEY   _BIT(7)

Definition at line 113 of file s5p-sss.c.

#define SSS_AES_CHAIN_MODE_CBC   _SBF(1, 0x01)

Definition at line 120 of file s5p-sss.c.

#define SSS_AES_CHAIN_MODE_CTR   _SBF(1, 0x02)

Definition at line 121 of file s5p-sss.c.

#define SSS_AES_CHAIN_MODE_ECB   _SBF(1, 0x00)

Definition at line 119 of file s5p-sss.c.

#define SSS_AES_FIFO_MODE   _BIT(3)

Definition at line 118 of file s5p-sss.c.

#define SSS_AES_INPUT_READY   _BIT(1)

Definition at line 126 of file s5p-sss.c.

#define SSS_AES_KEY_CHANGE_MODE   _BIT(6)

Definition at line 114 of file s5p-sss.c.

#define SSS_AES_KEY_SIZE_128   _SBF(4, 0x00)

Definition at line 115 of file s5p-sss.c.

#define SSS_AES_KEY_SIZE_192   _SBF(4, 0x01)

Definition at line 116 of file s5p-sss.c.

#define SSS_AES_KEY_SIZE_256   _SBF(4, 0x02)

Definition at line 117 of file s5p-sss.c.

#define SSS_AES_MODE_DECRYPT   _BIT(0)

Definition at line 122 of file s5p-sss.c.

#define SSS_AES_OUTPUT_READY   _BIT(0)

Definition at line 127 of file s5p-sss.c.

#define SSS_FCBRDMAC_BYTESWAP   _BIT(1)

Definition at line 82 of file s5p-sss.c.

#define SSS_FCBRDMAC_FLUSH   _BIT(0)

Definition at line 83 of file s5p-sss.c.

#define SSS_FCBTDMAC_BYTESWAP   _BIT(1)

Definition at line 88 of file s5p-sss.c.

#define SSS_FCBTDMAC_FLUSH   _BIT(0)

Definition at line 89 of file s5p-sss.c.

#define SSS_FCFIFOCTRL_DESSEL   _BIT(2)

Definition at line 74 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_BRFIFOEMP   _BIT(6)

Definition at line 65 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_BRFIFOFUL   _BIT(7)

Definition at line 64 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_BTFIFOEMP   _BIT(4)

Definition at line 67 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_BTFIFOFUL   _BIT(5)

Definition at line 66 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_HRFIFOEMP   _BIT(2)

Definition at line 69 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_HRFIFOFUL   _BIT(3)

Definition at line 68 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_PKFIFOEMP   _BIT(0)

Definition at line 71 of file s5p-sss.c.

#define SSS_FCFIFOSTAT_PKFIFOFUL   _BIT(1)

Definition at line 70 of file s5p-sss.c.

#define SSS_FCHRDMAC_BYTESWAP   _BIT(1)

Definition at line 94 of file s5p-sss.c.

#define SSS_FCHRDMAC_FLUSH   _BIT(0)

Definition at line 95 of file s5p-sss.c.

#define SSS_FCINTENCLR_BRDMAINTENCLR   _BIT(3)

Definition at line 52 of file s5p-sss.c.

#define SSS_FCINTENCLR_BTDMAINTENCLR   _BIT(2)

Definition at line 53 of file s5p-sss.c.

#define SSS_FCINTENCLR_HRDMAINTENCLR   _BIT(1)

Definition at line 54 of file s5p-sss.c.

#define SSS_FCINTENCLR_PKDMAINTENCLR   _BIT(0)

Definition at line 55 of file s5p-sss.c.

#define SSS_FCINTENSET_BRDMAINTENSET   _BIT(3)

Definition at line 46 of file s5p-sss.c.

#define SSS_FCINTENSET_BTDMAINTENSET   _BIT(2)

Definition at line 47 of file s5p-sss.c.

#define SSS_FCINTENSET_HRDMAINTENSET   _BIT(1)

Definition at line 48 of file s5p-sss.c.

#define SSS_FCINTENSET_PKDMAINTENSET   _BIT(0)

Definition at line 49 of file s5p-sss.c.

#define SSS_FCINTPEND_BRDMAINTP   _BIT(3)

Definition at line 58 of file s5p-sss.c.

#define SSS_FCINTPEND_BTDMAINTP   _BIT(2)

Definition at line 59 of file s5p-sss.c.

#define SSS_FCINTPEND_HRDMAINTP   _BIT(1)

Definition at line 60 of file s5p-sss.c.

#define SSS_FCINTPEND_PKDMAINTP   _BIT(0)

Definition at line 61 of file s5p-sss.c.

#define SSS_FCINTSTAT_BRDMAINT   _BIT(3)

Definition at line 40 of file s5p-sss.c.

#define SSS_FCINTSTAT_BTDMAINT   _BIT(2)

Definition at line 41 of file s5p-sss.c.

#define SSS_FCINTSTAT_HRDMAINT   _BIT(1)

Definition at line 42 of file s5p-sss.c.

#define SSS_FCINTSTAT_PKDMAINT   _BIT(0)

Definition at line 43 of file s5p-sss.c.

#define SSS_FCPKDMAC_BYTESWAP   _BIT(3)

Definition at line 100 of file s5p-sss.c.

#define SSS_FCPKDMAC_DESCEND   _BIT(2)

Definition at line 101 of file s5p-sss.c.

#define SSS_FCPKDMAC_FLUSH   _BIT(0)

Definition at line 103 of file s5p-sss.c.

#define SSS_FCPKDMAC_TRANSMIT   _BIT(1)

Definition at line 102 of file s5p-sss.c.

#define SSS_HASHIN_CIPHER_INPUT   _SBF(0, 0x01)

Definition at line 76 of file s5p-sss.c.

#define SSS_HASHIN_CIPHER_OUTPUT   _SBF(0, 0x02)

Definition at line 77 of file s5p-sss.c.

#define SSS_HASHIN_INDEPENDENT   _SBF(0, 0x00)

Definition at line 75 of file s5p-sss.c.

#define SSS_READ (   dev,
  reg 
)    __raw_readl(SSS_REG(dev, reg))

Definition at line 136 of file s5p-sss.c.

#define SSS_REG (   dev,
  reg 
)    ((dev)->ioaddr + (SSS_REG_##reg))

Definition at line 135 of file s5p-sss.c.

#define SSS_REG_AES_CNT_DATA (   s)    (0x4040 + (s << 2))

Definition at line 132 of file s5p-sss.c.

#define SSS_REG_AES_CONTROL   0x4000

Definition at line 108 of file s5p-sss.c.

#define SSS_REG_AES_IN_DATA (   s)    (0x4010 + (s << 2))

Definition at line 129 of file s5p-sss.c.

#define SSS_REG_AES_IV_DATA (   s)    (0x4030 + (s << 2))

Definition at line 131 of file s5p-sss.c.

#define SSS_REG_AES_KEY_DATA (   s)    (0x4080 + (s << 2))

Definition at line 133 of file s5p-sss.c.

#define SSS_REG_AES_OUT_DATA (   s)    (0x4020 + (s << 2))

Definition at line 130 of file s5p-sss.c.

#define SSS_REG_AES_STATUS   0x4004

Definition at line 124 of file s5p-sss.c.

#define SSS_REG_FCBRDMAC   0x0028

Definition at line 81 of file s5p-sss.c.

#define SSS_REG_FCBRDMAL   0x0024

Definition at line 80 of file s5p-sss.c.

#define SSS_REG_FCBRDMAS   0x0020

Definition at line 79 of file s5p-sss.c.

#define SSS_REG_FCBTDMAC   0x0038

Definition at line 87 of file s5p-sss.c.

#define SSS_REG_FCBTDMAL   0x0034

Definition at line 86 of file s5p-sss.c.

#define SSS_REG_FCBTDMAS   0x0030

Definition at line 85 of file s5p-sss.c.

#define SSS_REG_FCFIFOCTRL   0x0014

Definition at line 73 of file s5p-sss.c.

#define SSS_REG_FCFIFOSTAT   0x0010

Definition at line 63 of file s5p-sss.c.

#define SSS_REG_FCHRDMAC   0x0048

Definition at line 93 of file s5p-sss.c.

#define SSS_REG_FCHRDMAL   0x0044

Definition at line 92 of file s5p-sss.c.

#define SSS_REG_FCHRDMAS   0x0040

Definition at line 91 of file s5p-sss.c.

#define SSS_REG_FCINTENCLR   0x0008

Definition at line 51 of file s5p-sss.c.

#define SSS_REG_FCINTENSET   0x0004

Definition at line 45 of file s5p-sss.c.

#define SSS_REG_FCINTPEND   0x000C

Definition at line 57 of file s5p-sss.c.

#define SSS_REG_FCINTSTAT   0x0000

Definition at line 39 of file s5p-sss.c.

#define SSS_REG_FCPKDMAC   0x0058

Definition at line 99 of file s5p-sss.c.

#define SSS_REG_FCPKDMAL   0x0054

Definition at line 98 of file s5p-sss.c.

#define SSS_REG_FCPKDMAO   0x005C

Definition at line 105 of file s5p-sss.c.

#define SSS_REG_FCPKDMAS   0x0050

Definition at line 97 of file s5p-sss.c.

#define SSS_WRITE (   dev,
  reg,
  val 
)    __raw_writel((val), SSS_REG(dev, reg))

Definition at line 137 of file s5p-sss.c.

Function Documentation

MODULE_AUTHOR ( "Vladimir Zapolskiy <[email protected]>"  )
MODULE_DESCRIPTION ( "S5PV210 AES hw acceleration support."  )
MODULE_LICENSE ( "GPL v2 )
module_platform_driver ( s5p_aes_crypto  )