xref: /OK3568_Linux_fs/kernel/drivers/crypto/rockchip/rk_crypto_v3_reg.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /* Copyright (c) 2022 Rockchip Electronics Co. Ltd. */
4 
5 #ifndef __RK_CRYPTO_V3_REG_H__
6 #define __RK_CRYPTO_V3_REG_H__
7 
8 #include "rk_crypto_v2_reg.h"
9 
10 #define CRYPTO_UNEQUAL_ERR_INT_EN	BIT(9)
11 #define CRYPTO_ZERO_LEN_INT_EN		BIT(6)
12 
13 /* DMA Destination Data Read Address Register */
14 #define CRYPTO_DMA_DST_WADDR		0x0028
15 
16 #define CRYPTO_BC_MID_IV_0		0x0060
17 #define CRYPTO_BC_MID_WORD_SIZE		6
18 
19 #define CRYPTO_MID_VALID		0x03e8
20 #define CRYPTO_BC_MID_IS_VALID		BIT(0)
21 #define CRYPTO_HASH_MID_IS_VALID	BIT(1)
22 
23 #define CRYPTO_KEY_SEL			0x0610
24 
25 #define CRYPTO_MID_VALID_SWITCH		0x0630
26 #define CRYPTO_MID_VALID_ENABLE		BIT(0)
27 
28 #define CRYPTO_AES_VERSION		0x0680
29 #define CRYPTO_DES_VERSION		0x0684
30 #define CRYPTO_SM4_VERSION		0x0688
31 
32 #define CRYPTO_ECB_FLAG			BIT(0)
33 #define CRYPTO_CBC_FLAG			BIT(1)
34 #define CRYPTO_CTS_FLAG			BIT(2)
35 #define CRYPTO_CTR_FLAG			BIT(3)
36 #define CRYPTO_CFB_FLAG			BIT(4)
37 #define CRYPTO_OFB_FLAG			BIT(5)
38 #define CRYPTO_XTS_FLAG			BIT(6)
39 #define CRYPTO_CCM_FLAG			BIT(7)
40 #define CRYPTO_GCM_FLAG			BIT(8)
41 #define CRYPTO_CMAC_FLAG		BIT(9)
42 #define CRYPTO_CBCMAC_FLAG		BIT(10)
43 
44 #define CRYPTO_AES128_FLAG		BIT(16)
45 #define CRYPTO_AES192_FLAG		BIT(17)
46 #define CRYPTO_AES256_FLAG		BIT(18)
47 
48 #define CRYPTO_TDES_FLAG		BIT(16)
49 
50 #define CRYPTO_LOCKSEP_FLAG		BIT(20)
51 #define CRYPTO_SECURE_FLAG		BIT(21)
52 #define CRYPTO_MULTI_CHN_FLAG		BIT(22)
53 
54 #define CRYPTO_HASH_VERSION		0x068C
55 #define CRYPTO_HASH_SHA1_FLAG		BIT(0)
56 #define CRYPTO_HASH_SHA224_FLAG		BIT(1)
57 #define CRYPTO_HASH_SHA256_FLAG		BIT(2)
58 #define CRYPTO_HASH_SHA384_FLAG		BIT(3)
59 #define CRYPTO_HASH_SHA512_FLAG		BIT(4)
60 #define CRYPTO_HASH_SHA512_224_FLAG	BIT(5)
61 #define CRYPTO_HASH_SHA512_256_FLAG	BIT(6)
62 #define CRYPTO_HASH_MD5_FLAG		BIT(7)
63 #define CRYPTO_HASH_SM3_FLAG		BIT(8)
64 
65 #define CRYPTO_HMAC_VERSION		0x0690
66 #define CRYPTO_HMAC_SHA1_FLAG		BIT(0)
67 #define CRYPTO_HMAC_SHA256_FLAG		BIT(1)
68 #define CRYPTO_HMAC_SHA512_FLAG		BIT(2)
69 #define CRYPTO_HMAC_MD5_FLAG		BIT(3)
70 #define CRYPTO_HMAC_SM3_FLAG		BIT(4)
71 
72 #define CRYPTO_RNG_VERSION		0x0694
73 #define CRYPTO_PKA_VERSION		0x0698
74 #define CRYPTO_CRYPTO_VERSION		0x06F0
75 
76 #define CRYPTO_HASH_MID_DATA_0		0x0700
77 #define CRYPTO_HASH_MID_WORD_SIZE	26
78 
79 #endif
80 
81