]> git.baikalelectronics.ru Git - kernel.git/commit
hwrng: Add Arm SMCCC TRNG based driver
authorAndre Przywara <andre.przywara@arm.com>
Sat, 31 Jul 2021 20:48:45 +0000 (21:48 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Aug 2021 11:45:26 +0000 (19:45 +0800)
commit571c0083ee73c2ff1268324aa2f90b483ad25d3b
treefb948c4e44df2655c671fa600b17476389bb7d50
parent54f44edc0c7ec98cf99ba9a8ed41c03278c1bcfc
hwrng: Add Arm SMCCC TRNG based driver

The "Arm True Random Number Generator Firmware Interface"[1] provides
an SMCCC based interface to a true hardware random number generator.
So far we are using that in arch_get_random_seed(), but it might be
useful to expose the entropy through the /dev/hwrng device as well. This
allows to assess the quality of the implementation, by using "rngtest"
from the rng-tools package, for example.

Add a simple platform driver implementing the hw_random interface.
The corresponding platform device is created by the SMCCC core code,
we just match it here by name and provide a module alias.

Since the firmware takes care about serialisation, this can happily
coexist with the arch_get_random_seed() bits.

[1] https://developer.arm.com/documentation/den0098/latest/

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/Kconfig
drivers/char/hw_random/Makefile
drivers/char/hw_random/arm_smccc_trng.c [new file with mode: 0644]