[PATCH] x86: geode: use kernel [hwrng] to provide randomness

Paul Fertser fercerpav at gmail.com
Fri Jan 21 01:19:05 PST 2022


Following the idea from 7747b3fa36d3 ("generic: add bcm2835-rng quality
patch") and 9dc84018eeef ("bcm27xx: remove urngd package") this patch
allows kernel to directly use HW RNG and provide enough entropy from
/dev/random without urngd and/or rng-tools.

I am not sending this upstream as I have no idea how to estimate quality
properly.

Tested-by: timur_davletshin
Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 target/linux/x86/geode/target.mk                     |  1 +
 .../960-hwrng-geode-set-quality-to-1000.patch        | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch

diff --git a/target/linux/x86/geode/target.mk b/target/linux/x86/geode/target.mk
index a64d2baaeec2..1ca0de2fbe49 100644
--- a/target/linux/x86/geode/target.mk
+++ b/target/linux/x86/geode/target.mk
@@ -1,5 +1,6 @@
 BOARDNAME:=AMD Geode based systems
 FEATURES += pci usb gpio
+DEFAULT_PACKAGES := $(filter-out urngd,$(DEFAULT_PACKAGES))
 
 define Target/Description
 	Build firmware images for AMD Geode GX/LX based systems (net5501, alix, geos)
diff --git a/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch b/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch
new file mode 100644
index 000000000000..de1435b20bc9
--- /dev/null
+++ b/target/linux/x86/patches-5.10/960-hwrng-geode-set-quality-to-1000.patch
@@ -0,0 +1,12 @@
+Index: linux-5.10.92/drivers/char/hw_random/geode-rng.c
+===================================================================
+--- linux-5.10.92.orig/drivers/char/hw_random/geode-rng.c
++++ linux-5.10.92/drivers/char/hw_random/geode-rng.c
+@@ -80,6 +80,7 @@ static struct hwrng geode_rng = {
+ 	.name		= "geode",
+ 	.data_present	= geode_rng_data_present,
+ 	.data_read	= geode_rng_data_read,
++	.quality	= 1000,
+ };
+ 
+ 
-- 
2.32.0




More information about the openwrt-devel mailing list