Skip to content

hwrng: Add Arm SMCCC TRNG based driver

Andre Przywara linux-arm-kernel linux-crypto lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesIn review
  2. v32 patches 3 repliesSuperseded
  3. v21 patch 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2firmware: smccc: Register smccc_trng platform devicedrivers/firmware/smccc/smccc.c+17 -00 replies
2/2hwrng: Add Arm SMCCC TRNG based driverdrivers/char/hw_random/Kconfig drivers/char/hw_random/Makefile drivers/char/hw_random/arm_smccc_trng.c+138 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArd BiesheuvelMark Brown
SeriesR-b R-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] 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.

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
Signature · 1 line
2.17.6