Skip to contentSkip to conversation

ARM: dts: rk356x: Use RNG node from upstream DTSI

PATCH Superseded Alexander Shiyan 2 participants 2 messages Dec 11, 2024 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: rk356x: Use RNG node from upstream DTSI

Since the RNG node was added to the upstream DTSI, let's reuse it. Keep the compatibility string to support the barebox HWRNG driver.

---
 arch/arm/dts/rk356x.dtsi | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm/dts/rk356x.dtsi +4 -8
index fbabf2a6a6..1a51b9f1b9 100644
@@ -44,14 +44,6 @@ cpu_id: id@a {
 			reg = <0x0a 0x10>;
 		};
 	};
-
-	rng: rng@fe388000 {
-		compatible = "rockchip,rk3568-rng", "rockchip,cryptov2-rng";
-		reg = <0x0 0xfe388000 0x0 0x2000>;
-		clocks = <&cru CLK_TRNG_NS>, <&cru HCLK_TRNG_NS>;
-		clock-names = "trng_clk", "trng_hclk";
-		resets = <&cru SRST_TRNG_NS>;
-	};
 };
 
 &pmugrf {
@@ -62,3 +54,7 @@ reboot_mode_pmugrf: reboot-mode {
 		mode-serial = <0xef08a53c>; /* rk-usb-loader */
 	};
 };
+
+&rng {
+	compatible = "rockchip,rk3568-rng", "rockchip,cryptov2-rng";
+};
Signature · 1 line
2.39.1
#1 lore raw

Hi,

Quoted 28 lines · Alexander Shiyan

Since the RNG node was added to the upstream DTSI, let's reuse it. Keep the compatibility string to support the barebox HWRNG driver.

---
 arch/arm/dts/rk356x.dtsi | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm/dts/rk356x.dtsi +0 -8
index fbabf2a6a6..1a51b9f1b9 100644
@@ -44,14 +44,6 @@ cpu_id: id@a {
 			reg = <0x0a 0x10>;
 		};
 	};
-
-	rng: rng@fe388000 {
-		compatible = "rockchip,rk3568-rng", "rockchip,cryptov2-rng";
-		reg = <0x0 0xfe388000 0x0 0x2000>;
-		clocks = <&cru CLK_TRNG_NS>, <&cru HCLK_TRNG_NS>;
-		clock-names = "trng_clk", "trng_hclk";
-		resets = <&cru SRST_TRNG_NS>;
-	};
 };
 
 &pmugrf {

arch/arm/dts/rk356x.dtsi reboot_mode_pmugrf: reboot-mode { · line 59

Quoted 6 lines
arch/arm/dts/rk356x.dtsi +3 -0
@@ -62,3 +54,7 @@ reboot_mode_pmugrf: reboot-mode {
 		mode-serial = <0xef08a53c>; /* rk-usb-loader */
 	};
 };
+
+&rng {
+	compatible = "rockchip,rk3568-rng", "rockchip,cryptov2-rng";

Now that there is an upstream compatible binding, I think we should just add "rockchip,rk3568-rng" compatible to the RNG driver and drop our DT override completely.

Interestingly, upstream enables the node only for the rk3568 and not the rk3566. The reasoning appears to be that the rk3566 has way lower quality than expected and enabling it is unsafe[1].

I think we should follow suit in barebox, but it's appropriate for the commit message to point out that this change disables the HWRNG on the RK3566.

[1]: https://lore.kernel.org/all/[email protected]/

Cheers,
Ahmad

Quoted 1 line
arch/arm/dts/rk356x.dtsi +1 -0
+};
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |