From e05426aaf899f92d4e842137fa21d78d7e97a729 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Wed, 28 May 2025 17:10:27 +0000 Subject: [PATCH] sunxi: enable crypto offload engine Enable the sun8i_ce and sun8i_ss crypto engines that are included on various Allwinner SoCs, along with their respective hash/prng/trng options. sun8i_ce: H2+, H3, H5, H6, R40 and A64 sun8i_ss: A80, A83T BananaPi P2 Zero (H2+): [ 0.373860] sun8i-ce 1c15000.crypto: Set mod clock to 50000000 (50 Mhz) from 24000000 (24 Mhz) [ 0.374326] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 0.374516] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 0.374657] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 0.374788] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 0.374924] sun8i-ce 1c15000.crypto: Register cbc(aes) [ 0.374962] sun8i-ce 1c15000.crypto: Register ecb(aes) [ 0.374976] sun8i-ce 1c15000.crypto: Register cbc(des3_ede) [ 0.374990] sun8i-ce 1c15000.crypto: Register ecb(des3_ede) [ 0.375005] sun8i-ce 1c15000.crypto: Register md5 [ 0.375019] sun8i-ce 1c15000.crypto: Register sha1 [ 0.375032] sun8i-ce 1c15000.crypto: Register sha224 [ 0.375046] sun8i-ce 1c15000.crypto: Register sha256 [ 0.375061] sun8i-ce 1c15000.crypto: Register sha384 [ 0.375075] sun8i-ce 1c15000.crypto: Register sha512 [ 0.375109] sun8i-ce 1c15000.crypto: Register stdrng [ 0.375150] sun8i-ce 1c15000.crypto: TRNG not supported [ 0.375157] sun8i-ce 1c15000.crypto: CryptoEngine Die ID 1 BananaPi M3 (A83t): [ 0.429615] sun8i-ss 1c15000.crypto: will run requests pump with realtime priority [ 0.429866] sun8i-ss 1c15000.crypto: will run requests pump with realtime priority [ 0.430042] sun8i-ss 1c15000.crypto: DEBUG: Register cbc(aes) [ 0.430095] sun8i-ss 1c15000.crypto: DEBUG: Register ecb(aes) [ 0.430112] sun8i-ss 1c15000.crypto: DEBUG: Register cbc(des3_ede) [ 0.430128] sun8i-ss 1c15000.crypto: DEBUG: Register ecb(des3_ede) [ 0.430152] sun8i-ss 1c15000.crypto: Register md5 [ 0.430171] sun8i-ss 1c15000.crypto: Register sha1 [ 0.430187] sun8i-ss 1c15000.crypto: Register sha224 [ 0.430203] sun8i-ss 1c15000.crypto: Register sha256 [ 0.430220] sun8i-ss 1c15000.crypto: Register hmac(sha1) [ 0.430276] sun8i-ss 1c15000.crypto: Security System Die ID 7 [ 0.493087] sun8i-ss 1c15000.crypto: Fallback driver could no be loaded OrangePi Zero 2 (H616): [ 0.176833] sun8i-ce 1904000.crypto: will run requests pump with realtime priority [ 0.177054] sun8i-ce 1904000.crypto: will run requests pump with realtime priority [ 0.177167] sun8i-ce 1904000.crypto: will run requests pump with realtime priority [ 0.177258] sun8i-ce 1904000.crypto: will run requests pump with realtime priority [ 0.177361] sun8i-ce 1904000.crypto: Register cbc(aes) [ 0.177408] sun8i-ce 1904000.crypto: Register ecb(aes) [ 0.177420] sun8i-ce 1904000.crypto: Register cbc(des3_ede) [ 0.177432] sun8i-ce 1904000.crypto: Register ecb(des3_ede) [ 0.177444] sun8i-ce 1904000.crypto: Register md5 [ 0.177456] sun8i-ce 1904000.crypto: Register sha1 [ 0.177468] sun8i-ce 1904000.crypto: Register sha224 [ 0.177479] sun8i-ce 1904000.crypto: Register sha256 [ 0.177503] sun8i-ce 1904000.crypto: Register sha384 [ 0.177515] sun8i-ce 1904000.crypto: Register sha512 [ 0.177527] sun8i-ce 1904000.crypto: Register stdrng [ 0.177648] sun8i-ce 1904000.crypto: CryptoEngine Die ID 0 Signed-off-by: Zoltan HERPAI --- target/linux/sunxi/config-6.12 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/target/linux/sunxi/config-6.12 b/target/linux/sunxi/config-6.12 index 5de49168b6d..79063186b0b 100644 --- a/target/linux/sunxi/config-6.12 +++ b/target/linux/sunxi/config-6.12 @@ -112,10 +112,26 @@ CONFIG_CRYPTO_DEV_ALLWINNER=y CONFIG_CRYPTO_DEV_SUN4I_SS=y # CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG is not set CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y -# CONFIG_CRYPTO_DEV_SUN8I_CE is not set -# CONFIG_CRYPTO_DEV_SUN8I_SS is not set +CONFIG_CRYPTO_DEV_SUN8I_CE=y +# CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG is not set +CONFIG_CRYPTO_DEV_SUN8I_CE_HASH=y +CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG=y +CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG=y +CONFIG_CRYPTO_DEV_SUN8I_SS=y +# CONFIG_CRYPTO_DEV_SUN8I_SS_DEBUG is not set +CONFIG_CRYPTO_DEV_SUN8I_SS_HASH=y +CONFIG_CRYPTO_DEV_SUN8I_SS_PRNG=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_ENGINE=y CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_GF128MUL=y +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y +# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set +# CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y