Skip to content

Commit 1611f74

Browse files
Andre-ARMherbertx
authored andcommitted
crypto: sun8i-ce - add Allwinner H616 support
The crypto engine in the Allwinner H616 is very similar to the H6, but needs the base address for the task descriptor and the addresses within it to be expressed in words, not in bytes. Add a new variant struct entry for the H616, and set the new flag to mark the use of 34 bit addresses. Also the internal 32K oscillator is required for TRNG operation, so specify all four clocks. Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Tested-by: Ryan Walklin <[email protected]> Tested-by: Philippe Simons <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent e0740be commit 1611f74

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,30 @@ static const struct ce_variant ce_h6_variant = {
9292
.trng = CE_ALG_TRNG_V2,
9393
};
9494

95+
static const struct ce_variant ce_h616_variant = {
96+
.alg_cipher = { CE_ALG_AES, CE_ALG_DES, CE_ALG_3DES,
97+
},
98+
.alg_hash = { CE_ALG_MD5, CE_ALG_SHA1, CE_ALG_SHA224, CE_ALG_SHA256,
99+
CE_ALG_SHA384, CE_ALG_SHA512
100+
},
101+
.op_mode = { CE_OP_ECB, CE_OP_CBC
102+
},
103+
.cipher_t_dlen_in_bytes = true,
104+
.hash_t_dlen_in_bits = true,
105+
.prng_t_dlen_in_bytes = true,
106+
.trng_t_dlen_in_bytes = true,
107+
.needs_word_addresses = true,
108+
.ce_clks = {
109+
{ "bus", 0, 200000000 },
110+
{ "mod", 300000000, 0 },
111+
{ "ram", 0, 400000000 },
112+
{ "trng", 0, 0 },
113+
},
114+
.esr = ESR_H6,
115+
.prng = CE_ALG_PRNG_V2,
116+
.trng = CE_ALG_TRNG_V2,
117+
};
118+
95119
static const struct ce_variant ce_a64_variant = {
96120
.alg_cipher = { CE_ALG_AES, CE_ALG_DES, CE_ALG_3DES,
97121
},
@@ -1097,6 +1121,8 @@ static const struct of_device_id sun8i_ce_crypto_of_match_table[] = {
10971121
.data = &ce_h5_variant },
10981122
{ .compatible = "allwinner,sun50i-h6-crypto",
10991123
.data = &ce_h6_variant },
1124+
{ .compatible = "allwinner,sun50i-h616-crypto",
1125+
.data = &ce_h616_variant },
11001126
{}
11011127
};
11021128
MODULE_DEVICE_TABLE(of, sun8i_ce_crypto_of_match_table);

0 commit comments

Comments
 (0)