sandbox: dtsi: add rng

Message ID 20210310143330.4342-1-vincent.stehle@arm.com
State Accepted
Commit 619a81516d3c05a55f0ce5463dd38993c6e9adc2
Headers show
Series
  • sandbox: dtsi: add rng
Related show

Commit Message

Vincent Stehlé March 10, 2021, 2:33 p.m.
Having an rng in the sandbox is useful not only for tests but also for e.g.
UEFI. Therefore, copy the rng node from test.dts to sandbox.dtsi.

In the case of UEFI, it can then be verified with `efidebug dh' that a
"Random Number Generator" protocol is indeed present.

This also fixes the following `bootefi' error:

  Missing RNG device for EFI_RNG_PROTOCOL

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>

Cc: Simon Glass <sjg@chromium.org>
---
 arch/sandbox/dts/sandbox.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.30.1

Comments

Simon Glass March 27, 2021, 3:18 a.m. | #1
On 10.03.21 15:33, Vincent Stehlé wrote:
> Having an rng in the sandbox is useful not only for tests but also for e.g.

> UEFI. Therefore, copy the rng node from test.dts to sandbox.dtsi.

>

> In the case of UEFI, it can then be verified with `efidebug dh' that a

> "Random Number Generator" protocol is indeed present.

>

> This also fixes the following `bootefi' error:


The message is written with log_warning(). It is not an error.

An error is written in the lib/efi_selftest/efi_selftest_rng.c when
executing the unit test.

Please, remember that this is not a good PRNG. If you want proper random
values, you would have to change the driver to use the host's
getentropy() function.

>

>   Missing RNG device for EFI_RNG_PROTOCOL

>

> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>

> Cc: Simon Glass <sjg@chromium.org>

> ---

>  arch/sandbox/dts/sandbox.dtsi | 4 ++++

>  1 file changed, 4 insertions(+)

>

Applied to u-boot-dm/next, thanks!

Patch

diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index dc933f3bfc7..43b9342ce56 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -196,6 +196,10 @@ 
 		compatible = "sandbox,reset";
 	};
 
+	rng {
+		compatible = "sandbox,sandbox-rng";
+	};
+
 	sound {
 		compatible = "sandbox,sound";
 		cpu {