]> git.dujemihanovic.xyz Git - u-boot.git/commit
driver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers
authorAndre Przywara <andre.przywara@arm.com>
Wed, 30 Aug 2023 11:32:30 +0000 (12:32 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 11 Oct 2023 17:22:32 +0000 (13:22 -0400)
commit31565bb0aa2d76b6941e96bcdbd204bae49ca828
tree9f91efbe8e7dd873f913f5624335967d0e1c36d2
parent0cf1a136d861533645b901d5d3f09a1908883a63
driver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers

The ARMv8.5 architecture extension defines architectural RNDR/RNDRRS
system registers, that provide 64 bits worth of randomness on every
read. Since it's an extension, and implementing it is optional, there is
a field in the ID_AA64ISAR0_EL1 ID register to query the availability
of those registers.

Add a UCLASS_RNG driver that returns entropy via repeated reads from
those system registers, if the extension is implemented.
The driver always binds, but checks the availability in the probe()
routine.

This helps systems which suffer from low boot entropy, since U-Boot can
provide entropy via the generic UEFI entropy gathering protocol to the OS,
at an early stage.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/include/asm/system.h
drivers/rng/Kconfig
drivers/rng/Makefile
drivers/rng/arm_rndr.c [new file with mode: 0644]