Skip to content

Add support NXP S32 HSE CRYPTO driver for S32Z270 #79351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions boards/nxp/s32z2xxdc2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ External Flash
The on-board S26HS512T 512M-bit HyperFlash memory is connected to the QSPI controller
port A1. This board configuration selects it as the default flash controller.

CRYPTO
======

The Hardware Security Engine (HSE) supports cryptographic operations, including hashing and
symmetric ciphers, with capabilities for ECB, CBC, and CTR modes using RAM-based key catalogs
with 128-bit or 256-bit key lengths.

.. note::
The driver assumes that the HSE Firmware has been installed and configured (i.e the key catalogs
has been formatted, used MU instances has been activated, etc). HSE Firmware installation and
configuration phase documented in HSE Firmware User Manual. Please contact NXP sales person or
NXP distributor in order to have access to that document.

Programming and Debugging
*************************

Expand Down
3 changes: 2 additions & 1 deletion boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2024 NXP
# Copyright 2022-2025 NXP
# SPDX-License-Identifier: Apache-2.0

identifier: s32z2xxdc2/s32z270/rtu0
Expand All @@ -20,4 +20,5 @@ supported:
- i2c
- dma
- pwm
- crypto
vendor: nxp
3 changes: 2 additions & 1 deletion boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023-2024 NXP
# Copyright 2023-2025 NXP
# SPDX-License-Identifier: Apache-2.0

identifier: s32z2xxdc2@D/s32z270/rtu0
Expand All @@ -20,4 +20,5 @@ supported:
- i2c
- dma
- pwm
- crypto
vendor: nxp
3 changes: 2 additions & 1 deletion boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2024 NXP
# Copyright 2022-2025 NXP
# SPDX-License-Identifier: Apache-2.0

identifier: s32z2xxdc2/s32z270/rtu1
Expand All @@ -20,4 +20,5 @@ supported:
- i2c
- dma
- pwm
- crypto
vendor: nxp
3 changes: 2 additions & 1 deletion boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2024 NXP
# Copyright 2022-2025 NXP
# SPDX-License-Identifier: Apache-2.0

identifier: s32z2xxdc2@D/s32z270/rtu1
Expand All @@ -20,4 +20,5 @@ supported:
- i2c
- dma
- pwm
- crypto
vendor: nxp
1 change: 1 addition & 0 deletions drivers/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ zephyr_library_sources_ifdef(CONFIG_CRYPTO_IT8XXX2_SHA_V2 crypto_it8xxx2_sha_v2.
zephyr_library_sources_ifdef(CONFIG_CRYPTO_MCUX_DCP crypto_mcux_dcp.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_SI32 crypto_si32.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_CC23X0 crypto_cc23x0.c)
zephyr_library_sources_ifdef(CONFIG_CRYPTO_NXP_S32_HSE crypto_nxp_s32_hse.c)
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
1 change: 1 addition & 0 deletions drivers/crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ source "drivers/crypto/Kconfig.mcux_dcp"
source "drivers/crypto/Kconfig.si32"
source "drivers/crypto/Kconfig.smartbond"
source "drivers/crypto/Kconfig.cc23x0"
source "drivers/crypto/Kconfig.nxp_s32_hse"

endif # CRYPTO
33 changes: 33 additions & 0 deletions drivers/crypto/Kconfig.nxp_s32_hse
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

menuconfig CRYPTO_NXP_S32_HSE
bool "NXP S32 HSE crypto driver"
default y
depends on DT_HAS_NXP_S32_CRYPTO_HSE_MU_ENABLED
help
Enable NXP HSE crypto driver.

if CRYPTO_NXP_S32_HSE

config CRYPTO_NXP_S32_HSE_OUTPUT_BUFFER_SIZE
int "HSE crypto service output buffer size in bytes"
default 128
help
The output buffer size for storing the output data of HSE crypto service, measured in bytes.

config CRYPTO_NXP_S32_HSE_AES_KEY_SIZE
int "Key size in bits"
default 128
help
The size of the key used in cryptographic algorithms, measured in bits.
Only support for 128 bits or 256 bits.

config CRYPTO_NXP_S32_HSE_AES_KEY_GROUP_ID
int "The AES Key Group ID within RAM Key Catalog."
range 0 255
default 0
help
The AES Key Group ID within RAM Key Catalog.

endif #CRYPTO_NXP_S32_HSE
Loading
Loading