cmd: rng: Add support for selecting RNG device
authorSughosh Ganu <sughosh.ganu@linaro.org>
Fri, 22 Jul 2022 16:02:06 +0000 (21:32 +0530)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 2 Aug 2022 20:50:02 +0000 (23:50 +0300)
commit87ab234c1cf42a38655b4f93d0dc399b9a9561fa
tree2e02506f040e4e8428b12bade101a04eb3fc5f85
parentaedd45138ee61b4f5a48a2be9a358092a214edd5
cmd: rng: Add support for selecting RNG device

The 'rng' u-boot command is used for printing a select number of
random bytes on the console. Currently, the RNG device from which the
random bytes are read is fixed. However, a platform can have multiple
RNG devices, one example being qemu, which has a virtio RNG device and
the RNG pseudo device through the TPM chip.

Extend the 'rng' command so that the user can provide the RNG device
number from which the random bytes are to be read. This will be the
device index under the RNG uclass.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
cmd/rng.c