]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/crypto/atmel-sha-regs.h
crypto: atmel-sha - add simple DMA transfers
[mirror_ubuntu-bionic-kernel.git] / drivers / crypto / atmel-sha-regs.h
CommitLineData
ebc82efa
NR
1#ifndef __ATMEL_SHA_REGS_H__
2#define __ATMEL_SHA_REGS_H__
3
4#define SHA_REG_DIGEST(x) (0x80 + ((x) * 0x04))
5#define SHA_REG_DIN(x) (0x40 + ((x) * 0x04))
6
7#define SHA_CR 0x00
8#define SHA_CR_START (1 << 0)
9#define SHA_CR_FIRST (1 << 4)
10#define SHA_CR_SWRST (1 << 8)
7cee3508
CP
11#define SHA_CR_WUIHV (1 << 12)
12#define SHA_CR_WUIEHV (1 << 13)
ebc82efa
NR
13
14#define SHA_MR 0x04
15#define SHA_MR_MODE_MASK (0x3 << 0)
16#define SHA_MR_MODE_MANUAL 0x0
17#define SHA_MR_MODE_AUTO 0x1
18#define SHA_MR_MODE_PDC 0x2
563c47df 19#define SHA_MR_MODE_IDATAR0 0x2
ebc82efa 20#define SHA_MR_PROCDLY (1 << 4)
7cee3508
CP
21#define SHA_MR_UIHV (1 << 5)
22#define SHA_MR_UIEHV (1 << 6)
f07cebad 23#define SHA_MR_ALGO_MASK GENMASK(10, 8)
ebc82efa
NR
24#define SHA_MR_ALGO_SHA1 (0 << 8)
25#define SHA_MR_ALGO_SHA256 (1 << 8)
d4905b38
NR
26#define SHA_MR_ALGO_SHA384 (2 << 8)
27#define SHA_MR_ALGO_SHA512 (3 << 8)
28#define SHA_MR_ALGO_SHA224 (4 << 8)
29#define SHA_MR_DUALBUFF (1 << 16)
ebc82efa
NR
30
31#define SHA_IER 0x10
32#define SHA_IDR 0x14
33#define SHA_IMR 0x18
34#define SHA_ISR 0x1C
35#define SHA_INT_DATARDY (1 << 0)
36#define SHA_INT_ENDTX (1 << 1)
37#define SHA_INT_TXBUFE (1 << 2)
38#define SHA_INT_URAD (1 << 8)
39#define SHA_ISR_URAT_MASK (0x7 << 12)
40#define SHA_ISR_URAT_IDR (0x0 << 12)
41#define SHA_ISR_URAT_ODR (0x1 << 12)
42#define SHA_ISR_URAT_MR (0x2 << 12)
43#define SHA_ISR_URAT_WO (0x5 << 12)
44
d4905b38
NR
45#define SHA_HW_VERSION 0xFC
46
ebc82efa
NR
47#define SHA_TPR 0x108
48#define SHA_TCR 0x10C
49#define SHA_TNPR 0x118
50#define SHA_TNCR 0x11C
51#define SHA_PTCR 0x120
52#define SHA_PTCR_TXTEN (1 << 8)
53#define SHA_PTCR_TXTDIS (1 << 9)
54#define SHA_PTSR 0x124
55#define SHA_PTSR_TXTEN (1 << 8)
56
57#endif /* __ATMEL_SHA_REGS_H__ */