jpsollie Guru
Joined: 17 Aug 2013 Posts: 300
|
Posted: Sun Sep 22, 2024 1:47 pm Post subject: how to initialize RNG when /dev/hwrng is not found? |
|
|
I built gentoo on a nanopi neo3 a while ago,
years have passed, it always did a good job,
but since version 6.2, friendlyarm dropped their custom kernel for this nanopi r2s like board.
Time moves on, so I thought 'yeah, let's give vanilla 6.6 a try' :
so, while I enjoy the working crypto controller in 6.6:
Code: |
[ 9.270549] rk3288-crypto ff060000.crypto: will run requests pump with realtime priority
[ 9.270687] rk3288-crypto ff060000.crypto: Register ecb(aes) as ecb-aes-rk
[ 9.270808] rk3288-crypto ff060000.crypto: Register cbc(aes) as cbc-aes-rk
[ 9.270831] rk3288-crypto ff060000.crypto: Register ecb(des) as ecb-des-rk
[ 9.270848] rk3288-crypto ff060000.crypto: Register cbc(des) as cbc-des-rk
[ 9.270864] rk3288-crypto ff060000.crypto: Register ecb(des3_ede) as ecb-des3-ede-rk
[ 9.270880] rk3288-crypto ff060000.crypto: Register cbc(des3_ede) as cbc-des3-ede-rk
[ 9.270896] rk3288-crypto ff060000.crypto: Register sha1 as rk-sha1
[ 9.270915] rk3288-crypto ff060000.crypto: Register sha256 as rk-sha256
[ 9.270932] rk3288-crypto ff060000.crypto: Register md5 as rk-md5
|
... I definitely do NOT enjoy rngd not booting up anymore because there's no rng device anymore:
Code: |
rngd -f
Initializing available sources
[hwrng ]: Initialization Failed
[rndr ]: No HW SUPPORT
[rndr ]: Initialization Failed
Can't open any entropy source
Maybe RNG device modules are not loaded
|
the diff of the dts tree shows why:
Code: |
@@ -279,17 +281,6 @@
status = "disabled";
};
- rng: rng@ff060000 {
- compatible = "rockchip,cryptov1-rng";
- reg = <0x0 0xff060000 0x0 0x4000>;
-
- clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>;
- clock-names = "clk_crypto", "hclk_crypto";
- assigned-clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>;
- assigned-clock-rates = <150000000>, <100000000>;
- status = "enabled";
- };
-
grf: syscon@ff100000 {
compatible = "rockchip,rk3328-grf", "syscon", "simple-mfd";
reg = <0x0 0xff100000 0x0 0x1000>;
@@ -1087,6 +1036,17 @@
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ crypto: crypto@ff060000 {
+ compatible = "rockchip,rk3328-crypto";
+ reg = <0x0 0xff060000 0x0 0x4000>;
+ interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru HCLK_CRYPTO_MST>, <&cru HCLK_CRYPTO_SLV>,
+ <&cru SCLK_CRYPTO>;
+ clock-names = "hclk_master", "hclk_slave", "sclk";
+ resets = <&cru SRST_CRYPTO>;
+ reset-names = "crypto-rst";
+ };
+
|
pretty clear, I guess ...
But why isn't rngd working with usual armv8 random instructions?[/code] _________________ The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img] |
|