crypto: sun8i-ce - Add TRNG clock to the D1 variant
authorSamuel Holland <samuel@sholland.org>
Sat, 31 Dec 2022 22:01:44 +0000 (16:01 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 13 Jan 2023 08:39:04 +0000 (16:39 +0800)
commitf81c1d4a6d3f6b9f31cb8feec13a4357b68a95d6
tree0b1bf5dedb1d3148cfe6c1bee1ad259599905a68
parent197286f86012250191bfe616dc4e9b8e34380c35
crypto: sun8i-ce - Add TRNG clock to the D1 variant

At least the D1 variant requires a separate clock for the TRNG.
Without this clock enabled, reading from /dev/hwrng reports:

   sun8i-ce 3040000.crypto: DMA timeout for TRNG (tm=96) on flow 3

Experimentation shows that the necessary clock is the SoC's internal
RC oscillator. This makes sense, as noise from the oscillator can be
used as a source of entropy.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h