LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v4 0/2] hwrng: Add Arm SMCCC TRNG based driver
@ 2021-07-31 20:48 Andre Przywara
  2021-07-31 20:48 ` [PATCH v4 1/2] firmware: smccc: Register smccc_trng platform device Andre Przywara
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andre Przywara @ 2021-07-31 20:48 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Mark Rutland, Lorenzo Pieralisi, Sudeep Holla
  Cc: linux-crypto, linux-arm-kernel, linux-kernel,
	Benjamin Herrenschmidt, Ard Biesheuvel, Mark Brown, Will Deacon,
	Ali Saidi, Jon Nettleton

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.

Patch 1 creates a platform device, triggered by the previous discovery
of the SMCCC TRNG service.
Patch 2 implements a hw_random platform driver, which is instantiated
through this said platform device.

The driver can be loaded as module, or built into the kernel.

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

Changelog v3 ... v4:
- drop pointless driver loading message
- drop unneeded init() routine

Changelog v2 ... v3:
- split platform device and driver

Changelog v1 ... v2:
- fix building as a module
- de-register device upon exit
- mention module name in Kconfig

Andre Przywara (2):
  firmware: smccc: Register smccc_trng platform device
  hwrng: Add Arm SMCCC TRNG based driver

 drivers/char/hw_random/Kconfig          |  14 +++
 drivers/char/hw_random/Makefile         |   1 +
 drivers/char/hw_random/arm_smccc_trng.c | 123 ++++++++++++++++++++++++
 drivers/firmware/smccc/smccc.c          |  17 ++++
 4 files changed, 155 insertions(+)
 create mode 100644 drivers/char/hw_random/arm_smccc_trng.c

-- 
2.17.6


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-06 12:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-31 20:48 [PATCH v4 0/2] hwrng: Add Arm SMCCC TRNG based driver Andre Przywara
2021-07-31 20:48 ` [PATCH v4 1/2] firmware: smccc: Register smccc_trng platform device Andre Przywara
2021-07-31 20:48 ` [PATCH v4 2/2] hwrng: Add Arm SMCCC TRNG based driver Andre Przywara
2021-08-01 16:26 ` [PATCH v4 0/2] " Ard Biesheuvel
2021-08-02 10:40 ` Mark Brown
2021-08-06 12:14 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).