Skip to contentSkip to conversation

sandbox: dtsi: add rng

PATCH New Vincent Stehlé 3 participants 3 messages Mar 10, 2021 – Mar 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sandbox: dtsi: add rng

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

---
 arch/sandbox/dts/sandbox.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/sandbox/dts/sandbox.dtsi +4 -0
index dc933f3bfc7..43b9342ce56 100644
@@ -196,6 +196,10 @@
 		compatible = "sandbox,reset";
 	};
 
+	rng {
+		compatible = "sandbox,sandbox-rng";
+	};
+
 	sound {
 		compatible = "sandbox,sound";
 		cpu {
Signature · 1 line
2.30.1
#1 lore raw

PATCH 1/1 sandbox: dtsi: add rng

Quoted 7 lines · Vincent Stehl?

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.

Quoted 14 lines

Missing RNG device for EFI_RNG_PROTOCOL

---
 arch/sandbox/dts/sandbox.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/sandbox/dts/sandbox.dtsi +0 -0
index dc933f3bfc7..43b9342ce56 100644

arch/sandbox/dts/sandbox.dtsi line 202

Quoted 7 lines
arch/sandbox/dts/sandbox.dtsi +4 -0
@@ -196,6 +196,10 @@
 		compatible = "sandbox,reset";
 	};
 
+	rng {
+		compatible = "sandbox,sandbox-rng";
+	};
+
Quoted 4 lines
arch/sandbox/dts/sandbox.dtsi +0 -0
 	sound {
 		compatible = "sandbox,sound";
 		cpu {
#2 lore raw

PATCH 1/1 sandbox: dtsi: add rng

Quoted 7 lines · Vincent Stehl?

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.

Quoted 9 lines

Missing RNG device for EFI_RNG_PROTOCOL

---
 arch/sandbox/dts/sandbox.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

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