-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
base: main
Are you sure you want to change the base?
Add support NXP S32 HSE CRYPTO driver for S32Z270 #79351
Conversation
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 project with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
dc8d870
to
2ba0f4f
Compare
Fixed compliance, clang and build fail. |
For the first point, I have updated the device tree. |
drivers/crypto/crypto_nxp_s32_hse.c
Outdated
struct crypto_nxp_s32_hse_data *data = dev->data; | ||
struct crypto_nxp_s32_hse_session *session; | ||
|
||
if (Hse_Ip_Init(data->mu_instance, &data->mu_state) != HSE_IP_STATUS_SUCCESS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not enough to just call this initialiation but also the MUs that are not active by default must be activated through a request to HSE. As it is right now implemented, if the user tries to use the Zephyr Crypto API on a HSE-MU device that is not active, it will fail. In general, the device init function should ensure that all needed resources are allocated and ready in order for the driver to operate after exiting this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The driver assumes that the HSE Firmware has already been installed and configured (including the activation of MU and configuration of key catalogs, etc.). Therefore, simply initializing MU is enough.
8fd4348
to
949dba0
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
There are blocking comments not addressed.. awaiting for author to address them |
9ad4285
to
b4111c0
Compare
Hi, I have addressed the comment and fixed the conflict also. |
3b0cc82
to
c7533d3
Compare
I updated the copyright and improved and beautified the code. Fixed the typo in the commit message as well. |
0ce725f
to
91c0eea
Compare
Rebased and fixed the CI fail. |
|
||
static inline void free_session(struct crypto_nxp_s32_hse_session *session) | ||
{ | ||
session->in_use = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be protected by global mutex
91c0eea
to
639cedc
Compare
@haduongquang pls fix the twister failures |
Add device tree node for MU instances that will be used by HSE and RTU for s32z270. Add support hash crypto for NXP S32 with Algo 2: SHA224, SHA256, SHA384 and SHA512. Add support cipher crypto with ECB, CBC and CTR mode by using ram key catalog. Add support 128/256 bits ram key length. Signed-off-by: Ha Duong Quang <[email protected]>
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]>
639cedc
to
1f24a4b
Compare
All my comments on this PR were addressed, but we have a blocker on the hal_nxp side that we are resolving internally at NXP. Once that's clarified, I will remove my block on this PR. |
This PR introduces NXP S32 HSE CRYTO driver for SoC NXP S32Z27 and enables its usage for board s32z270dc2.
Supports cryptographic operations, including hashing and symmetric ciphers, with capabilities for ECB, CBC, and CTR modes using RAM-based key catalogs with 128-bit key lengths.
tests\crypto\crypto_hash:
samples\drivers\crypto: