hwrng: stm32 - restrain RNG noise source clock
authorGatien Chevallier <gatien.chevallier@foss.st.com>
Thu, 21 Sep 2023 08:02:58 +0000 (10:02 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 1 Oct 2023 08:28:15 +0000 (16:28 +0800)
commit28d13f3fdbe52192e3a961ed489b542b111a098e
tree2d071364b430c2123fdd8c50ab338c6f0c48ddde
parentb17bc6eb7c2b089f4425b5b656184385acac77fe
hwrng: stm32 - restrain RNG noise source clock

For NIST certification the noise source sampling may need to be
restrained.

This change implements an algorithm that gets the rate of the RNG
clock and apply the correct value in CLKDIV field in RNG_CR register
to force the RNG clock rate to be "max_clock_rate" maximum.

As it is platform-specific, implement it as a compat data.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/stm32-rng.c