Skip to content
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

STM32WB09: add TRNG support #83109

Conversation

mathieuchopstm
Copy link
Collaborator

Add TRNG driver for STM32WB09 line SoCs, and add a test overlay for Nucleo-WB09KE so that correct behavior can be verified.

The RNG node for the whole STM32WB0 line is introduced in DTSI by this PR, but the driver is explicitly prevented from building if enabled on unsupported SoCs (STM32WB05/06/07, which have different hardware).
I'm fine with changing this to a WB09-only node if it sounds cleaner for now.

Tested OK using standard tests/drivers/entropy/api and modified version that also verifies entropy_get_entropy_from_isr and large buffer sizes.

Add DT binding for STM32WB09 SoC TRNG.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Add driver for TRNG of STM32WB09 SoC. Other SoCs of the STM32WB09 series
are not supported for now.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Add Device Tree node corresponding to STM32WB0 series RNG.
The WB09-specific TRNG node is also added by this commit.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Add device tree overlay to test so that it can run on STM32WB09 hardware.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Copy link
Collaborator

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check entropy_stm32wb09.c, is it (at least partly) copied from somewhere? The rest looks good.

@mathieuchopstm
Copy link
Collaborator Author

I didn't check entropy_stm32wb09.c, is it (at least partly) copied from somewhere? The rest looks good.

This driver is partially derived from entropy_stm32.c (notably, the ringbuf/"rng pool" implementation is copy-pasted, with minor adaptations), and while I did follow its overall structure, this new driver still has quite a few differences (e.g., all LL functions are named differently).

@mathieuchopstm mathieuchopstm marked this pull request as draft December 18, 2024 11:00
@mathieuchopstm
Copy link
Collaborator Author

Marked as draft due to #83152.

@erwango
Copy link
Member

erwango commented Jan 14, 2025

Superseded by #83152

@erwango erwango closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants