Skip to content

Commit

Permalink
boards: enbables support for s32z270 hse crypto
Browse files Browse the repository at this point in the history
Enable test for s32z270 hash crypto.

Enable samples for cipher cryptoEndable samples for EBC, CBC,
CTR mode of cipher crypto.

Signed-off-by: Ha Duong Quang <[email protected]>
  • Loading branch information
haduongquang committed Oct 28, 2024
1 parent ec5ab83 commit 949dba0
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boards/nxp/s32z2xxdc2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ EDMA
The EDMA modules feature four EDMA3 instances: Instance 0 with 32 channels,
and instances 1, 4, and 5, each with 16 channels.

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
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- adc
- i2c
- dma
- crypto
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- adc
- i2c
- dma
- crypto
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- adc
- i2c
- dma
- crypto
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- adc
- i2c
- dma
- crypto
vendor: nxp
9 changes: 9 additions & 0 deletions samples/drivers/crypto/boards/s32z2xxdc2_s32z270_rtu0.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&mub0 {
status = "okay";
};
9 changes: 9 additions & 0 deletions samples/drivers/crypto/boards/s32z2xxdc2_s32z270_rtu1.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&mub2 {
status = "okay";
};
2 changes: 2 additions & 0 deletions samples/drivers/crypto/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ LOG_MODULE_REGISTER(main);
#define CRYPTO_DEV_COMPAT st_stm32_aes
#elif DT_HAS_COMPAT_STATUS_OKAY(nxp_mcux_dcp)
#define CRYPTO_DEV_COMPAT nxp_mcux_dcp
#elif DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_crypto_hse_mu)
#define CRYPTO_DEV_COMPAT nxp_s32_crypto_hse_mu
#elif CONFIG_CRYPTO_NRF_ECB
#define CRYPTO_DEV_COMPAT nordic_nrf_ecb
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_smartbond_crypto)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&mub0 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&mub2 {
status = "okay";
};
3 changes: 3 additions & 0 deletions tests/crypto/crypto_hash/src/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022 Intel Corporation
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -13,6 +14,8 @@
#define CRYPTO_DRV_NAME CONFIG_CRYPTO_MBEDTLS_SHIM_DRV_NAME
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_smartbond_crypto)
#define CRYPTO_DEV_COMPAT renesas_smartbond_crypto
#elif DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_crypto_hse_mu)
#define CRYPTO_DEV_COMPAT nxp_s32_crypto_hse_mu
#else
#error "You need to enable one crypto device"
#endif
Expand Down

0 comments on commit 949dba0

Please sign in to comment.