mbox series

[v3,0/9] hwrng: stm32: support STM32MP13x platforms

Message ID 20230921080301.253563-1-gatien.chevallier@foss.st.com
Headers show
Series hwrng: stm32: support STM32MP13x platforms | expand

Message

Gatien CHEVALLIER Sept. 21, 2023, 8:02 a.m. UTC
The STM32MP13x platforms have a RNG hardware block that supports
customization, a conditional reset sequences that allows to
recover from certain situations and a configuration locking
mechanism.

This series adds support for the mentionned features. Note that
the hardware RNG can and should be managed in the secure world
for this platform, hence the rng not being default enabled on
the STM32MP135F-DK board.

Changes in V2:
	- Use pm_ptr() and add __maybe_unused on PM API
	- Correct bug using WARN_ON

Changes in V3:
	- Squash of bindings patches
	- st,rng-lock-conf property declaration rework
	- Fix stm32_rng_pm_ops declaration in patch [5/9]

Gatien Chevallier (9):
  dt-bindings: rng: introduce new compatible for STM32MP13x
  hwrng: stm32 - use devm_platform_get_and_ioremap_resource() API
  hwrng: stm32 - implement STM32MP13x support
  hwrng: stm32 - implement error concealment
  hwrng: stm32 - rework error handling in stm32_rng_read()
  hwrng: stm32 - restrain RNG noise source clock
  hwrng: stm32 - support RNG configuration locking mechanism
  hwrng: stm32 - rework power management sequences
  ARM: dts: stm32: add RNG node for STM32MP13x platforms

 .../devicetree/bindings/rng/st,stm32-rng.yaml |  20 +-
 arch/arm/boot/dts/st/stm32mp131.dtsi          |   8 +
 drivers/char/hw_random/stm32-rng.c            | 511 +++++++++++++++---
 3 files changed, 455 insertions(+), 84 deletions(-)

Comments

Rob Herring (Arm) Sept. 22, 2023, 8:49 p.m. UTC | #1
On Thu, 21 Sep 2023 10:02:53 +0200, Gatien Chevallier wrote:
> Introduce st,stm32mp13-rng compatible and add st,rng-lock-conf.
> 
> If st,rng-lock-conf is set, the RNG configuration in RNG_CR, RNG_HTCR
> and RNG_NSCR will be locked. It is supported starting from the RNG
> version present in the STM32MP13
> 
> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
> ---
> 
> Changes in V3:
> 	- Squashed with: patch [V2 07/10]
> 	- Declare st,rng-lock-conf at top level and restrain its uses
> 	  depending on the compatible. I discarded Rob's tag as for
> 	  the modifications.
> 
>  .../devicetree/bindings/rng/st,stm32-rng.yaml | 20 ++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Alexandre TORGUE Oct. 9, 2023, 12:02 p.m. UTC | #2
Hi

On 9/21/23 10:02, Gatien Chevallier wrote:
> The STM32MP13x platforms have a RNG hardware block that supports
> customization, a conditional reset sequences that allows to
> recover from certain situations and a configuration locking
> mechanism.
> 
> This series adds support for the mentionned features. Note that
> the hardware RNG can and should be managed in the secure world
> for this platform, hence the rng not being default enabled on
> the STM32MP135F-DK board.
> 
> Changes in V2:
> 	- Use pm_ptr() and add __maybe_unused on PM API
> 	- Correct bug using WARN_ON
> 
> Changes in V3:
> 	- Squash of bindings patches
> 	- st,rng-lock-conf property declaration rework
> 	- Fix stm32_rng_pm_ops declaration in patch [5/9]
> 
> Gatien Chevallier (9):
>    dt-bindings: rng: introduce new compatible for STM32MP13x
>    hwrng: stm32 - use devm_platform_get_and_ioremap_resource() API
>    hwrng: stm32 - implement STM32MP13x support
>    hwrng: stm32 - implement error concealment
>    hwrng: stm32 - rework error handling in stm32_rng_read()
>    hwrng: stm32 - restrain RNG noise source clock
>    hwrng: stm32 - support RNG configuration locking mechanism
>    hwrng: stm32 - rework power management sequences
>    ARM: dts: stm32: add RNG node for STM32MP13x platforms
> 
>   .../devicetree/bindings/rng/st,stm32-rng.yaml |  20 +-
>   arch/arm/boot/dts/st/stm32mp131.dtsi          |   8 +
>   drivers/char/hw_random/stm32-rng.c            | 511 +++++++++++++++---
>   3 files changed, 455 insertions(+), 84 deletions(-)
> 

Patch[9] applied on stm32-next.

thanks
alex