Skip to content

Commit 6ae444a

Browse files
committed
soc: silabs: Add hardware accelerated crypto for VSE devices
Add hardware acceleration for PSA Crypto APIs for devices with VSE, i.e. xG22 and xG27. Signed-off-by: Aksel Skauge Mellbye <[email protected]>
1 parent a5ece5d commit 6ae444a

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

modules/hal_silabs/simplicity_sdk/CMakeLists.txt

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
set(SECURITY_DIR ${ZEPHYR_HAL_SILABS_MODULE_DIR}/simplicity_sdk/platform/security)
5+
set(LIBCRYPTOSOC_DIR ${ZEPHYR_HAL_SILABS_EXTRA_MODULE_DIR}/simplicity_sdk/util/third_party/crypto_ip/libcryptosoc)
56
set(MBEDTLS_DIR ${ZEPHYR_MBEDTLS_MODULE_DIR})
67

78
# Get SoC series number, i.e. translate efr32bg22 -> 22, mgm240p -> 24, simg301 -> 301
@@ -84,6 +85,42 @@ zephyr_library_sources_ifdef(CONFIG_PSA_CRYPTO_DRIVER_SILABS_HSE
8485
)
8586

8687
# VSE
87-
# TODO
88+
zephyr_include_directories_ifdef(CONFIG_PSA_CRYPTO_DRIVER_SILABS_VSE
89+
${LIBCRYPTOSOC_DIR}/include
90+
${LIBCRYPTOSOC_DIR}/src
91+
)
92+
zephyr_library_sources_ifdef(CONFIG_PSA_CRYPTO_DRIVER_SILABS_VSE
93+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/cryptoacc_management.c
94+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_driver_key_derivation.c
95+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_driver_trng.c
96+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_opaque_driver_builtin_keys.c
97+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_opaque_driver_mac.c
98+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_aead.c
99+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_cipher.c
100+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_hash.c
101+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_key_derivation.c
102+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_key_management.c
103+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_mac.c
104+
${SECURITY_DIR}/sl_component/sl_psa_driver/src/sli_cryptoacc_transparent_driver_signature.c
105+
106+
${LIBCRYPTOSOC_DIR}/src/ba414ep_config.c
107+
${LIBCRYPTOSOC_DIR}/src/ba431_config.c
108+
${LIBCRYPTOSOC_DIR}/src/cryptodma_internal.c
109+
${LIBCRYPTOSOC_DIR}/src/cryptolib_types.c
110+
${LIBCRYPTOSOC_DIR}/src/sx_aes.c
111+
${LIBCRYPTOSOC_DIR}/src/sx_blk_cipher.c
112+
${LIBCRYPTOSOC_DIR}/src/sx_blk_cipher.h
113+
${LIBCRYPTOSOC_DIR}/src/sx_dh_alg.c
114+
${LIBCRYPTOSOC_DIR}/src/sx_ecc_curves.c
115+
${LIBCRYPTOSOC_DIR}/src/sx_ecc_keygen_alg.c
116+
${LIBCRYPTOSOC_DIR}/src/sx_ecdsa_alg.c
117+
${LIBCRYPTOSOC_DIR}/src/sx_hash.c
118+
${LIBCRYPTOSOC_DIR}/src/sx_math.c
119+
${LIBCRYPTOSOC_DIR}/src/sx_memcmp.c
120+
${LIBCRYPTOSOC_DIR}/src/sx_memcpy.c
121+
${LIBCRYPTOSOC_DIR}/src/sx_primitives.c
122+
${LIBCRYPTOSOC_DIR}/src/sx_rng.c
123+
${LIBCRYPTOSOC_DIR}/src/sx_trng.c
124+
)
88125

89126
endif() # PSA Crypto

soc/silabs/silabs_s2/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ config PSA_CRYPTO_SW_ONLY
1010
config PSA_CRYPTO_DRIVER_SILABS_HSE
1111
bool "PSA Crypto Driver for Secure Engine"
1212
depends on $(dt_has_compat,$(DT_COMPAT_SILABS_GECKO_SEMAILBOX))
13+
select SILABS_SISDK_SE
1314
default y if !PSA_CRYPTO_SW_ONLY
1415

1516
config PSA_CRYPTO_DRIVER_SILABS_VSE
1617
bool "PSA Crypto Driver for Virtual Secure Engine"
1718
depends on $(dt_has_compat,$(DT_COMPAT_SILABS_GECKO_TRNG))
18-
# default y if !PSA_CRYPTO_SW_ONLY
19+
select SILABS_SISDK_SE
20+
default y if !PSA_CRYPTO_SW_ONLY
1921

2022
config MBEDTLS_USER_CONFIG_ENABLE
2123
default y if (PSA_CRYPTO_DRIVER_SILABS_HSE || PSA_CRYPTO_DRIVER_SILABS_VSE)

west.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ manifest:
4242
- picolibc
4343
- segger
4444
- zcbor
45+
- name: zephyr-hal-silabs-extra
46+
remote: silabs
47+
revision: 04ea2a26baf2d0a768ce5c8970a754bbdd71e9b1
48+
path: modules/hal/silabs_extra
4549
- name: zephyr-mbedtls
4650
remote: silabs
4751
revision: 43bb1e577e2accfaa135464bac181ed2a0cc0489

0 commit comments

Comments
 (0)