[PATCH linux dev-4.13] ARM: dts: aspeed: Describe random number device

Joel Stanley joel at jms.id.au
Mon Mar 26 16:17:58 AEDT 2018


There is a random number generator that updates a register in the SCU
every second. This is compatible with the timeriomem rng driver in the
kernel.

>From the timeriomem_rng bindings:

  quality: estimated number of bits of true entropy per 1024 bits read
  from the rng.  Defaults to zero which causes the kernel's default
  quality to be used instead.  Note that the default quality is usually
  zero which disables using this rng to automatically fill the kernel's
  entropy pool.

As to the recommended value for us to use:

 Rick Altherr <raltherr at google.com> wrote:
 > Quality is #bit of entropy per 1000 bits read.  100 is a
 > conservative value that was suggested by those in the know.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 arch/arm/boot/dts/aspeed-g4.dtsi | 7 +++++++
 arch/arm/boot/dts/aspeed-g5.dtsi | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
index 6205228b18ea..3d391b428b25 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -120,6 +120,13 @@
 				pinctrl: pinctrl {
 					compatible = "aspeed,g4-pinctrl";
 				};
+
+				hwrng at 78 {
+					compatible = "timeriomem_rng";
+					reg = <0x78 0x4>;
+					period = <1>;
+					quality = <100>;
+				};
 			};
 
 			adc: adc at 1e6e9000 {
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index 0a866da8db32..1468b4ad22dc 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -157,6 +157,13 @@
 					aspeed,external-nodes = <&gfx &lhc>;
 
 				};
+
+				hwrng at 78 {
+					compatible = "timeriomem_rng";
+					reg = <0x78 0x4>;
+					period = <1>;
+					quality = <100>;
+				};
 			};
 
 			gfx: display at 1e6e6000 {
-- 
2.15.1



More information about the openbmc mailing list