[PATCH] ARM: implement support for SMCCC TRNG entropy source

Linus Walleij linus.walleij at linaro.org
Wed Oct 7 09:45:43 EDT 2020


On Wed, Oct 7, 2020 at 12:30 PM Ard Biesheuvel <ardb at kernel.org> wrote:
> [Me]
> > Ideally (if I can dream) I would like to see an interface similar to
> > "earlycon", where some drivers have special callbacks that can
> > be used really early to get some debug prints, something like
> > that but named "earlyrandom", so that any drivers under
> > drivers/char/hw_random.c
> > could optionally implement these early callbacks and provide
> > random seed right out of some register reads or so before the
> > kernel driver core is up. I do not know how
> > realistic that is, but for e.g. the nomadik-rng.c it is a simple
> > register read from a physical address which should be simple
> > to achieve.
> >
>
> This only works for peripherals that are always clocked, powered, etc,
> which you cannot rely on in the general case. This means you would
> need some cooperation from the bootloader/firmware to signal that the
> RNG is accessible early, and at which address. It might just as well
> pass you a random seed instead ...

Point taken. Maybe we should provide different ways to do that
if the system does not have firmware, like an added property in the
top of the device tree or even a new (gasp) ATAG
for legacy systems. But people might bikeshed that to pieces
so it's good to begin like this.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list