1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef __SKHA_H__
27#define __SKHA_H__
28
29typedef struct skha_ctrl {
30 u32 mr;
31 u32 cr;
32 u32 cmr;
33 u32 sr;
34 u32 esr;
35 u32 emr;
36 u32 ksr;
37 u32 dsr;
38 u32 in;
39 u32 out;
40 u32 res1[2];
41 u32 kdr1;
42 u32 kdr2;
43 u32 kdr3;
44 u32 kdr4;
45 u32 kdr5;
46 u32 kdr6;
47 u32 res2[10];
48 u32 c1;
49 u32 c2;
50 u32 c3;
51 u32 c4;
52 u32 c5;
53 u32 c6;
54 u32 c7;
55 u32 c8;
56 u32 c9;
57 u32 c10;
58 u32 c11;
59 u32 c12;
60} skha_t;
61
62#ifdef CONFIG_MCF532x
63#define SKHA_MODE_CTRM(x) (((x) & 0x0F) << 9)
64#define SKHA_MODE_CTRM_MASK (0xFFFFE1FF)
65#define SKHA_MODE_DKP (0x00000100)
66#else
67#define SKHA_MODE_CTRM(x) (((x) & 0x0F) << 8)
68#define SKHA_MODE_CTRM_MASK (0xFFFFF0FF)
69#define SKHA_MODE_DKP (0x00000080)
70#endif
71#define SKHA_MODE_CM(x) (((x) & 0x03) << 3)
72#define SKHA_MODE_CM_MASK (0xFFFFFFE7)
73#define SKHA_MODE_DIR (0x00000004)
74#define SKHA_MODE_ALG(x) ((x) & 0x03)
75#define SKHA_MODE_ALG_MASK (0xFFFFFFFC)
76
77#define SHKA_CR_ODMAL(x) (((x) & 0x3F) << 24)
78#define SHKA_CR_ODMAL_MASK (0xC0FFFFFF)
79#define SHKA_CR_IDMAL(x) (((x) & 0x3F) << 16)
80#define SHKA_CR_IDMAL_MASK (0xFFC0FFFF)
81#define SHKA_CR_END (0x00000008)
82#define SHKA_CR_ODMA (0x00000004)
83#define SHKA_CR_IDMA (0x00000002)
84#define SKHA_CR_IE (0x00000001)
85
86#define SKHA_CMR_GO (0x00000008)
87#define SKHA_CMR_CI (0x00000004)
88#define SKHA_CMR_RI (0x00000002)
89#define SKHA_CMR_SWR (0x00000001)
90
91#define SKHA_SR_OFL(x) (((x) & 0xFF) << 24)
92#define SKHA_SR_OFL_MASK (0x00FFFFFF)
93#define SKHA_SR_IFL(x) (((x) & 0xFF) << 16)
94#define SKHA_SR_IFL_MASK (0xFF00FFFF)
95#define SKHA_SR_AESES(x) (((x) & 0x1F) << 11)
96#define SKHA_SR_AESES_MASK (0xFFFF07FF)
97#define SKHA_SR_DESES(x) (((x) & 0x7) << 8)
98#define SKHA_SR_DESES_MASK (0xFFFFF8FF)
99#define SKHA_SR_BUSY (0x00000010)
100#define SKHA_SR_RD (0x00000008)
101#define SKHA_SR_ERR (0x00000004)
102#define SKHA_SR_DONE (0x00000002)
103#define SKHA_SR_INT (0x00000001)
104
105#define SHKA_ESE_DRL (0x00000800)
106#define SKHA_ESR_KRE (0x00000400)
107#define SKHA_ESR_KPE (0x00000200)
108#define SKHA_ESR_ERE (0x00000100)
109#define SKHA_ESR_RMDP (0x00000080)
110#define SKHA_ESR_KSE (0x00000040)
111#define SKHA_ESR_DSE (0x00000020)
112#define SKHA_ESR_IME (0x00000010)
113#define SKHA_ESR_NEOF (0x00000008)
114#define SKHA_ESR_NEIF (0x00000004)
115#define SKHA_ESR_OFU (0x00000002)
116#define SKHA_ESR_IFO (0x00000001)
117
118#define SKHA_KSR_SZ(x) ((x) & 0x3F)
119#define SKHA_KSR_SZ_MASK (0xFFFFFFC0)
120
121#endif
122