OSDN Git Service

firmware: smccc: Register smccc_trng platform device
authorAndre Przywara <andre.przywara@arm.com>
Sat, 31 Jul 2021 20:48:44 +0000 (21:48 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Aug 2021 11:45:25 +0000 (19:45 +0800)
commitb83c2d92be719bf7b1d24ac02aaa53db3991ea58
tree9d6ae6cb9f259d0b987e386889095098c9c691b2
parent5441a07a127f106c9936e4f9fa1a8a93e3f31828
firmware: smccc: Register smccc_trng platform device

At the moment we probe for the Random Number Generator SMCCC service,
and use that in the core code (arch_get_random). However the hardware
entropy can also be useful to access from userland, and be it to assess
its quality.

Register a platform device when the SMCCC TRNG service is detected, to
allow a hw_random driver to hook onto this.

The function registering the device is deliberately made in a way which
allows expansion, so other services that could be exposed via a platform
device (or some other interface), can be added here easily.

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/firmware/smccc/smccc.c