xref: /openbmc/linux/drivers/crypto/qce/regs-v5.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*97fb5e8dSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2ec8f5d8fSStanimir Varbanov /*
3ec8f5d8fSStanimir Varbanov  * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
4ec8f5d8fSStanimir Varbanov  */
5ec8f5d8fSStanimir Varbanov 
6ec8f5d8fSStanimir Varbanov #ifndef _REGS_V5_H_
7ec8f5d8fSStanimir Varbanov #define _REGS_V5_H_
8ec8f5d8fSStanimir Varbanov 
9ec8f5d8fSStanimir Varbanov #include <linux/bitops.h>
10ec8f5d8fSStanimir Varbanov 
11ec8f5d8fSStanimir Varbanov #define REG_VERSION			0x000
12ec8f5d8fSStanimir Varbanov #define REG_STATUS			0x100
13ec8f5d8fSStanimir Varbanov #define REG_STATUS2			0x104
14ec8f5d8fSStanimir Varbanov #define REG_ENGINES_AVAIL		0x108
15ec8f5d8fSStanimir Varbanov #define REG_FIFO_SIZES			0x10c
16ec8f5d8fSStanimir Varbanov #define REG_SEG_SIZE			0x110
17ec8f5d8fSStanimir Varbanov #define REG_GOPROC			0x120
18ec8f5d8fSStanimir Varbanov #define REG_ENCR_SEG_CFG		0x200
19ec8f5d8fSStanimir Varbanov #define REG_ENCR_SEG_SIZE		0x204
20ec8f5d8fSStanimir Varbanov #define REG_ENCR_SEG_START		0x208
21ec8f5d8fSStanimir Varbanov #define REG_CNTR0_IV0			0x20c
22ec8f5d8fSStanimir Varbanov #define REG_CNTR1_IV1			0x210
23ec8f5d8fSStanimir Varbanov #define REG_CNTR2_IV2			0x214
24ec8f5d8fSStanimir Varbanov #define REG_CNTR3_IV3			0x218
25ec8f5d8fSStanimir Varbanov #define REG_CNTR_MASK			0x21C
26ec8f5d8fSStanimir Varbanov #define REG_ENCR_CCM_INT_CNTR0		0x220
27ec8f5d8fSStanimir Varbanov #define REG_ENCR_CCM_INT_CNTR1		0x224
28ec8f5d8fSStanimir Varbanov #define REG_ENCR_CCM_INT_CNTR2		0x228
29ec8f5d8fSStanimir Varbanov #define REG_ENCR_CCM_INT_CNTR3		0x22c
30ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_DU_SIZE		0x230
31ec8f5d8fSStanimir Varbanov #define REG_CNTR_MASK2			0x234
32ec8f5d8fSStanimir Varbanov #define REG_CNTR_MASK1			0x238
33ec8f5d8fSStanimir Varbanov #define REG_CNTR_MASK0			0x23c
34ec8f5d8fSStanimir Varbanov #define REG_AUTH_SEG_CFG		0x300
35ec8f5d8fSStanimir Varbanov #define REG_AUTH_SEG_SIZE		0x304
36ec8f5d8fSStanimir Varbanov #define REG_AUTH_SEG_START		0x308
37ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV0			0x310
38ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV1			0x314
39ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV2			0x318
40ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV3			0x31c
41ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV4			0x320
42ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV5			0x324
43ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV6			0x328
44ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV7			0x32c
45ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV8			0x330
46ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV9			0x334
47ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV10			0x338
48ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV11			0x33c
49ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV12			0x340
50ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV13			0x344
51ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV14			0x348
52ec8f5d8fSStanimir Varbanov #define REG_AUTH_IV15			0x34c
53ec8f5d8fSStanimir Varbanov #define REG_AUTH_INFO_NONCE0		0x350
54ec8f5d8fSStanimir Varbanov #define REG_AUTH_INFO_NONCE1		0x354
55ec8f5d8fSStanimir Varbanov #define REG_AUTH_INFO_NONCE2		0x358
56ec8f5d8fSStanimir Varbanov #define REG_AUTH_INFO_NONCE3		0x35c
57ec8f5d8fSStanimir Varbanov #define REG_AUTH_BYTECNT0		0x390
58ec8f5d8fSStanimir Varbanov #define REG_AUTH_BYTECNT1		0x394
59ec8f5d8fSStanimir Varbanov #define REG_AUTH_BYTECNT2		0x398
60ec8f5d8fSStanimir Varbanov #define REG_AUTH_BYTECNT3		0x39c
61ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC0		0x3a0
62ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC1		0x3a4
63ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC2		0x3a8
64ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC3		0x3ac
65ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC4		0x3b0
66ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC5		0x3b4
67ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC6		0x3b8
68ec8f5d8fSStanimir Varbanov #define REG_AUTH_EXP_MAC7		0x3bc
69ec8f5d8fSStanimir Varbanov #define REG_CONFIG			0x400
70ec8f5d8fSStanimir Varbanov #define REG_GOPROC_QC_KEY		0x1000
71ec8f5d8fSStanimir Varbanov #define REG_GOPROC_OEM_KEY		0x2000
72ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY0			0x3000
73ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY1			0x3004
74ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY2			0x3008
75ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY3			0x300c
76ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY4			0x3010
77ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY5			0x3014
78ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY6			0x3018
79ec8f5d8fSStanimir Varbanov #define REG_ENCR_KEY7			0x301c
80ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY0		0x3020
81ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY1		0x3024
82ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY2		0x3028
83ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY3		0x302c
84ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY4		0x3030
85ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY5		0x3034
86ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY6		0x3038
87ec8f5d8fSStanimir Varbanov #define REG_ENCR_XTS_KEY7		0x303c
88ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY0			0x3040
89ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY1			0x3044
90ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY2			0x3048
91ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY3			0x304c
92ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY4			0x3050
93ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY5			0x3054
94ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY6			0x3058
95ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY7			0x305c
96ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY8			0x3060
97ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY9			0x3064
98ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY10			0x3068
99ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY11			0x306c
100ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY12			0x3070
101ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY13			0x3074
102ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY14			0x3078
103ec8f5d8fSStanimir Varbanov #define REG_AUTH_KEY15			0x307c
104ec8f5d8fSStanimir Varbanov 
105ec8f5d8fSStanimir Varbanov /* Register bits - REG_VERSION */
106ec8f5d8fSStanimir Varbanov #define CORE_STEP_REV_SHIFT		0
107ec8f5d8fSStanimir Varbanov #define CORE_STEP_REV_MASK		GENMASK(15, 0)
108ec8f5d8fSStanimir Varbanov #define CORE_MINOR_REV_SHIFT		16
109ec8f5d8fSStanimir Varbanov #define CORE_MINOR_REV_MASK		GENMASK(23, 16)
110ec8f5d8fSStanimir Varbanov #define CORE_MAJOR_REV_SHIFT		24
111ec8f5d8fSStanimir Varbanov #define CORE_MAJOR_REV_MASK		GENMASK(31, 24)
112ec8f5d8fSStanimir Varbanov 
113ec8f5d8fSStanimir Varbanov /* Register bits - REG_STATUS */
114ec8f5d8fSStanimir Varbanov #define MAC_FAILED_SHIFT		31
115ec8f5d8fSStanimir Varbanov #define DOUT_SIZE_AVAIL_SHIFT		26
116ec8f5d8fSStanimir Varbanov #define DOUT_SIZE_AVAIL_MASK		GENMASK(30, 26)
117ec8f5d8fSStanimir Varbanov #define DIN_SIZE_AVAIL_SHIFT		21
118ec8f5d8fSStanimir Varbanov #define DIN_SIZE_AVAIL_MASK		GENMASK(25, 21)
119ec8f5d8fSStanimir Varbanov #define HSD_ERR_SHIFT			20
120ec8f5d8fSStanimir Varbanov #define ACCESS_VIOL_SHIFT		19
121ec8f5d8fSStanimir Varbanov #define PIPE_ACTIVE_ERR_SHIFT		18
122ec8f5d8fSStanimir Varbanov #define CFG_CHNG_ERR_SHIFT		17
123ec8f5d8fSStanimir Varbanov #define DOUT_ERR_SHIFT			16
124ec8f5d8fSStanimir Varbanov #define DIN_ERR_SHIFT			15
125ec8f5d8fSStanimir Varbanov #define AXI_ERR_SHIFT			14
126ec8f5d8fSStanimir Varbanov #define CRYPTO_STATE_SHIFT		10
127ec8f5d8fSStanimir Varbanov #define CRYPTO_STATE_MASK		GENMASK(13, 10)
128ec8f5d8fSStanimir Varbanov #define ENCR_BUSY_SHIFT			9
129ec8f5d8fSStanimir Varbanov #define AUTH_BUSY_SHIFT			8
130ec8f5d8fSStanimir Varbanov #define DOUT_INTR_SHIFT			7
131ec8f5d8fSStanimir Varbanov #define DIN_INTR_SHIFT			6
132ec8f5d8fSStanimir Varbanov #define OP_DONE_INTR_SHIFT		5
133ec8f5d8fSStanimir Varbanov #define ERR_INTR_SHIFT			4
134ec8f5d8fSStanimir Varbanov #define DOUT_RDY_SHIFT			3
135ec8f5d8fSStanimir Varbanov #define DIN_RDY_SHIFT			2
136ec8f5d8fSStanimir Varbanov #define OPERATION_DONE_SHIFT		1
137ec8f5d8fSStanimir Varbanov #define SW_ERR_SHIFT			0
138ec8f5d8fSStanimir Varbanov 
139ec8f5d8fSStanimir Varbanov /* Register bits - REG_STATUS2 */
140ec8f5d8fSStanimir Varbanov #define AXI_EXTRA_SHIFT			1
141ec8f5d8fSStanimir Varbanov #define LOCKED_SHIFT			2
142ec8f5d8fSStanimir Varbanov 
143ec8f5d8fSStanimir Varbanov /* Register bits - REG_CONFIG */
144ec8f5d8fSStanimir Varbanov #define REQ_SIZE_SHIFT			17
145ec8f5d8fSStanimir Varbanov #define REQ_SIZE_MASK			GENMASK(20, 17)
146ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_1_BEAT		0
147ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_2_BEAT		1
148ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_3_BEAT		2
149ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_4_BEAT		3
150ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_5_BEAT		4
151ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_6_BEAT		5
152ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_7_BEAT		6
153ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_8_BEAT		7
154ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_9_BEAT		8
155ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_10_BEAT		9
156ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_11_BEAT		10
157ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_12_BEAT		11
158ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_13_BEAT		12
159ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_14_BEAT		13
160ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_15_BEAT		14
161ec8f5d8fSStanimir Varbanov #define REQ_SIZE_ENUM_16_BEAT		15
162ec8f5d8fSStanimir Varbanov 
163ec8f5d8fSStanimir Varbanov #define MAX_QUEUED_REQ_SHIFT		14
164ec8f5d8fSStanimir Varbanov #define MAX_QUEUED_REQ_MASK		GENMASK(24, 16)
165ec8f5d8fSStanimir Varbanov #define ENUM_1_QUEUED_REQS		0
166ec8f5d8fSStanimir Varbanov #define ENUM_2_QUEUED_REQS		1
167ec8f5d8fSStanimir Varbanov #define ENUM_3_QUEUED_REQS		2
168ec8f5d8fSStanimir Varbanov 
169ec8f5d8fSStanimir Varbanov #define IRQ_ENABLES_SHIFT		10
170ec8f5d8fSStanimir Varbanov #define IRQ_ENABLES_MASK		GENMASK(13, 10)
171ec8f5d8fSStanimir Varbanov 
172ec8f5d8fSStanimir Varbanov #define LITTLE_ENDIAN_MODE_SHIFT	9
173ec8f5d8fSStanimir Varbanov #define PIPE_SET_SELECT_SHIFT		5
174ec8f5d8fSStanimir Varbanov #define PIPE_SET_SELECT_MASK		GENMASK(8, 5)
175ec8f5d8fSStanimir Varbanov 
176ec8f5d8fSStanimir Varbanov #define HIGH_SPD_EN_N_SHIFT		4
177ec8f5d8fSStanimir Varbanov #define MASK_DOUT_INTR_SHIFT		3
178ec8f5d8fSStanimir Varbanov #define MASK_DIN_INTR_SHIFT		2
179ec8f5d8fSStanimir Varbanov #define MASK_OP_DONE_INTR_SHIFT		1
180ec8f5d8fSStanimir Varbanov #define MASK_ERR_INTR_SHIFT		0
181ec8f5d8fSStanimir Varbanov 
182ec8f5d8fSStanimir Varbanov /* Register bits - REG_AUTH_SEG_CFG */
183ec8f5d8fSStanimir Varbanov #define COMP_EXP_MAC_SHIFT		24
184ec8f5d8fSStanimir Varbanov #define COMP_EXP_MAC_DISABLED		0
185ec8f5d8fSStanimir Varbanov #define COMP_EXP_MAC_ENABLED		1
186ec8f5d8fSStanimir Varbanov 
187ec8f5d8fSStanimir Varbanov #define F9_DIRECTION_SHIFT		23
188ec8f5d8fSStanimir Varbanov #define F9_DIRECTION_UPLINK		0
189ec8f5d8fSStanimir Varbanov #define F9_DIRECTION_DOWNLINK		1
190ec8f5d8fSStanimir Varbanov 
191ec8f5d8fSStanimir Varbanov #define AUTH_NONCE_NUM_WORDS_SHIFT	20
192ec8f5d8fSStanimir Varbanov #define AUTH_NONCE_NUM_WORDS_MASK	GENMASK(22, 20)
193ec8f5d8fSStanimir Varbanov 
194ec8f5d8fSStanimir Varbanov #define USE_PIPE_KEY_AUTH_SHIFT		19
195ec8f5d8fSStanimir Varbanov #define USE_HW_KEY_AUTH_SHIFT		18
196ec8f5d8fSStanimir Varbanov #define AUTH_FIRST_SHIFT		17
197ec8f5d8fSStanimir Varbanov #define AUTH_LAST_SHIFT			16
198ec8f5d8fSStanimir Varbanov 
199ec8f5d8fSStanimir Varbanov #define AUTH_POS_SHIFT			14
200ec8f5d8fSStanimir Varbanov #define AUTH_POS_MASK			GENMASK(15, 14)
201ec8f5d8fSStanimir Varbanov #define AUTH_POS_BEFORE			0
202ec8f5d8fSStanimir Varbanov #define AUTH_POS_AFTER			1
203ec8f5d8fSStanimir Varbanov 
204ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_SHIFT			9
205ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_MASK			GENMASK(13, 9)
206ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_SHA1			0
207ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_SHA256		1
208ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_1_BYTES		0
209ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_2_BYTES		1
210ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_3_BYTES		2
211ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_4_BYTES		3
212ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_5_BYTES		4
213ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_6_BYTES		5
214ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_7_BYTES		6
215ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_8_BYTES		7
216ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_9_BYTES		8
217ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_10_BYTES		9
218ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_11_BYTES		10
219ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_12_BYTES		11
220ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_13_BYTES		12
221ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_14_BYTES		13
222ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_15_BYTES		14
223ec8f5d8fSStanimir Varbanov #define AUTH_SIZE_ENUM_16_BYTES		15
224ec8f5d8fSStanimir Varbanov 
225ec8f5d8fSStanimir Varbanov #define AUTH_MODE_SHIFT			6
226ec8f5d8fSStanimir Varbanov #define AUTH_MODE_MASK			GENMASK(8, 6)
227ec8f5d8fSStanimir Varbanov #define AUTH_MODE_HASH			0
228ec8f5d8fSStanimir Varbanov #define AUTH_MODE_HMAC			1
229ec8f5d8fSStanimir Varbanov #define AUTH_MODE_CCM			0
230ec8f5d8fSStanimir Varbanov #define AUTH_MODE_CMAC			1
231ec8f5d8fSStanimir Varbanov 
232ec8f5d8fSStanimir Varbanov #define AUTH_KEY_SIZE_SHIFT		3
233ec8f5d8fSStanimir Varbanov #define AUTH_KEY_SIZE_MASK		GENMASK(5, 3)
234ec8f5d8fSStanimir Varbanov #define AUTH_KEY_SZ_AES128		0
235ec8f5d8fSStanimir Varbanov #define AUTH_KEY_SZ_AES256		2
236ec8f5d8fSStanimir Varbanov 
237ec8f5d8fSStanimir Varbanov #define AUTH_ALG_SHIFT			0
238ec8f5d8fSStanimir Varbanov #define AUTH_ALG_MASK			GENMASK(2, 0)
239ec8f5d8fSStanimir Varbanov #define AUTH_ALG_NONE			0
240ec8f5d8fSStanimir Varbanov #define AUTH_ALG_SHA			1
241ec8f5d8fSStanimir Varbanov #define AUTH_ALG_AES			2
242ec8f5d8fSStanimir Varbanov #define AUTH_ALG_KASUMI			3
243ec8f5d8fSStanimir Varbanov #define AUTH_ALG_SNOW3G			4
244ec8f5d8fSStanimir Varbanov #define AUTH_ALG_ZUC			5
245ec8f5d8fSStanimir Varbanov 
246ec8f5d8fSStanimir Varbanov /* Register bits - REG_ENCR_XTS_DU_SIZE */
247ec8f5d8fSStanimir Varbanov #define ENCR_XTS_DU_SIZE_SHIFT		0
248ec8f5d8fSStanimir Varbanov #define ENCR_XTS_DU_SIZE_MASK		GENMASK(19, 0)
249ec8f5d8fSStanimir Varbanov 
250ec8f5d8fSStanimir Varbanov /* Register bits - REG_ENCR_SEG_CFG */
251ec8f5d8fSStanimir Varbanov #define F8_KEYSTREAM_ENABLE_SHIFT	17
252ec8f5d8fSStanimir Varbanov #define F8_KEYSTREAM_DISABLED		0
253ec8f5d8fSStanimir Varbanov #define F8_KEYSTREAM_ENABLED		1
254ec8f5d8fSStanimir Varbanov 
255ec8f5d8fSStanimir Varbanov #define F8_DIRECTION_SHIFT		16
256ec8f5d8fSStanimir Varbanov #define F8_DIRECTION_UPLINK		0
257ec8f5d8fSStanimir Varbanov #define F8_DIRECTION_DOWNLINK		1
258ec8f5d8fSStanimir Varbanov 
259ec8f5d8fSStanimir Varbanov #define USE_PIPE_KEY_ENCR_SHIFT		15
260ec8f5d8fSStanimir Varbanov #define USE_PIPE_KEY_ENCR_ENABLED	1
261ec8f5d8fSStanimir Varbanov #define USE_KEY_REGISTERS		0
262ec8f5d8fSStanimir Varbanov 
263ec8f5d8fSStanimir Varbanov #define USE_HW_KEY_ENCR_SHIFT		14
264ec8f5d8fSStanimir Varbanov #define USE_KEY_REG			0
265ec8f5d8fSStanimir Varbanov #define USE_HW_KEY			1
266ec8f5d8fSStanimir Varbanov 
267ec8f5d8fSStanimir Varbanov #define LAST_CCM_SHIFT			13
268ec8f5d8fSStanimir Varbanov #define LAST_CCM_XFR			1
269ec8f5d8fSStanimir Varbanov #define INTERM_CCM_XFR			0
270ec8f5d8fSStanimir Varbanov 
271ec8f5d8fSStanimir Varbanov #define CNTR_ALG_SHIFT			11
272ec8f5d8fSStanimir Varbanov #define CNTR_ALG_MASK			GENMASK(12, 11)
273ec8f5d8fSStanimir Varbanov #define CNTR_ALG_NIST			0
274ec8f5d8fSStanimir Varbanov 
275ec8f5d8fSStanimir Varbanov #define ENCODE_SHIFT			10
276ec8f5d8fSStanimir Varbanov 
277ec8f5d8fSStanimir Varbanov #define ENCR_MODE_SHIFT			6
278ec8f5d8fSStanimir Varbanov #define ENCR_MODE_MASK			GENMASK(9, 6)
279ec8f5d8fSStanimir Varbanov #define ENCR_MODE_ECB			0
280ec8f5d8fSStanimir Varbanov #define ENCR_MODE_CBC			1
281ec8f5d8fSStanimir Varbanov #define ENCR_MODE_CTR			2
282ec8f5d8fSStanimir Varbanov #define ENCR_MODE_XTS			3
283ec8f5d8fSStanimir Varbanov #define ENCR_MODE_CCM			4
284ec8f5d8fSStanimir Varbanov 
285ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_SHIFT		3
286ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_MASK		GENMASK(5, 3)
287ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_DES			0
288ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_3DES		1
289ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_AES128		0
290ec8f5d8fSStanimir Varbanov #define ENCR_KEY_SZ_AES256		2
291ec8f5d8fSStanimir Varbanov 
292ec8f5d8fSStanimir Varbanov #define ENCR_ALG_SHIFT			0
293ec8f5d8fSStanimir Varbanov #define ENCR_ALG_MASK			GENMASK(2, 0)
294ec8f5d8fSStanimir Varbanov #define ENCR_ALG_NONE			0
295ec8f5d8fSStanimir Varbanov #define ENCR_ALG_DES			1
296ec8f5d8fSStanimir Varbanov #define ENCR_ALG_AES			2
297ec8f5d8fSStanimir Varbanov #define ENCR_ALG_KASUMI			4
298ec8f5d8fSStanimir Varbanov #define ENCR_ALG_SNOW_3G		5
299ec8f5d8fSStanimir Varbanov #define ENCR_ALG_ZUC			6
300ec8f5d8fSStanimir Varbanov 
301ec8f5d8fSStanimir Varbanov /* Register bits - REG_GOPROC */
302ec8f5d8fSStanimir Varbanov #define GO_SHIFT			0
303ec8f5d8fSStanimir Varbanov #define CLR_CNTXT_SHIFT			1
304ec8f5d8fSStanimir Varbanov #define RESULTS_DUMP_SHIFT		2
305ec8f5d8fSStanimir Varbanov 
306ec8f5d8fSStanimir Varbanov /* Register bits - REG_ENGINES_AVAIL */
307ec8f5d8fSStanimir Varbanov #define ENCR_AES_SEL_SHIFT		0
308ec8f5d8fSStanimir Varbanov #define DES_SEL_SHIFT			1
309ec8f5d8fSStanimir Varbanov #define ENCR_SNOW3G_SEL_SHIFT		2
310ec8f5d8fSStanimir Varbanov #define ENCR_KASUMI_SEL_SHIFT		3
311ec8f5d8fSStanimir Varbanov #define SHA_SEL_SHIFT			4
312ec8f5d8fSStanimir Varbanov #define SHA512_SEL_SHIFT		5
313ec8f5d8fSStanimir Varbanov #define AUTH_AES_SEL_SHIFT		6
314ec8f5d8fSStanimir Varbanov #define AUTH_SNOW3G_SEL_SHIFT		7
315ec8f5d8fSStanimir Varbanov #define AUTH_KASUMI_SEL_SHIFT		8
316ec8f5d8fSStanimir Varbanov #define BAM_PIPE_SETS_SHIFT		9
317ec8f5d8fSStanimir Varbanov #define BAM_PIPE_SETS_MASK		GENMASK(12, 9)
318ec8f5d8fSStanimir Varbanov #define AXI_WR_BEATS_SHIFT		13
319ec8f5d8fSStanimir Varbanov #define AXI_WR_BEATS_MASK		GENMASK(18, 13)
320ec8f5d8fSStanimir Varbanov #define AXI_RD_BEATS_SHIFT		19
321ec8f5d8fSStanimir Varbanov #define AXI_RD_BEATS_MASK		GENMASK(24, 19)
322ec8f5d8fSStanimir Varbanov #define ENCR_ZUC_SEL_SHIFT		26
323ec8f5d8fSStanimir Varbanov #define AUTH_ZUC_SEL_SHIFT		27
324ec8f5d8fSStanimir Varbanov #define ZUC_ENABLE_SHIFT		28
325ec8f5d8fSStanimir Varbanov 
326ec8f5d8fSStanimir Varbanov #endif /* _REGS_V5_H_ */
327