Skip to contentSkip to conversation

rockchip: Update rng compatible for RK356x and RK3588

PATCH Superseded Jonas Karlman 2 participants 4 messages Mar 30, 2025 – Apr 6, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: Update rng compatible for RK356x and RK3588

This series adds support for and updates the random generator compatible used for RK356x and RK3588.

The RK356x rng node is already part of dts/upstream so the rng node in u-boot.dtsi is dropped, and because it is not enabled for rk3566 it gets enabled in u-boot.dtsi to restore its use in U-Boot.

The RK3588 dts/upstream rng node will not land in U-Boot until v6.15-dts is pulled into U-Boot for a future release, so the compatible is just updated to match the compatible used in upstream Linux.

Jonas Karlman (2):
rng: rockchip_rng: Add compatible for RK3568
rng: rockchip_rng: Update compatible for RK3588

 arch/arm/dts/rk356x-u-boot.dtsi  | 9 ++++-----
 arch/arm/dts/rk3588s-u-boot.dtsi | 4 ++--
 drivers/rng/rockchip_rng.c       | 6 +++++-
 3 files changed, 11 insertions(+), 8 deletions(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/2 rng: rockchip_rng: Add compatible for RK3568

Linux commit afeccc408496 ("arm64: dts: rockchip: add DT entry for RNG to RK356x") merged for v6.12-rc1 add a proper rng node to the SoC DT. The compatible used differs compared to what U-Boot is currently using.

Add support for the rk3568-rng used in upstream Linux. Support for the cryptov2-rng compatible is still kept because PX30/RK3326 and RK3308 are still using it.

---
 arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++-----
 drivers/rng/rockchip_rng.c      | 4 ++++
 2 files changed, 8 insertions(+), 5 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +4 -5
index 24a976cf7e21..871869739536 100644
@@ -21,11 +21,6 @@
 		bootph-all;
 	};
 
-	rng: rng@fe388000 {
-		compatible = "rockchip,cryptov2-rng";
-		reg = <0x0 0xfe388000 0x0 0x2000>;
-	};
-
 	otp: nvmem@fe38c000 {
 		compatible = "rockchip,rk3568-otp";
 		reg = <0x0 0xfe38c000 0x0 0x4000>;
@@ -121,6 +116,10 @@
 	bootph-all;
 };
 
+&rng {
+	status = "okay";
+};
+
 &sdhci {
 	bootph-pre-ram;
 	bootph-some-ram;
drivers/rng/rockchip_rng.c +4 -0
index 2426648fbd57..f673e2657c94 100644
@@ -312,6 +312,10 @@ static const struct udevice_id rockchip_rng_match[] = {
 		.compatible = "rockchip,rk3399-crypto",
 		.data = (ulong)&rk_cryptov1_soc_data,
 	},
+	{
+		.compatible = "rockchip,rk3568-rng",
+		.data = (ulong)&rk_cryptov2_soc_data,
+	},
 	{
 		.compatible = "rockchip,cryptov2-rng",
 		.data = (ulong)&rk_cryptov2_soc_data,
Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH 1/2] rng: rockchip_rng: Add compatible for RK3568

Hi Jonas,

    Please split the change to separate patches, the driver change and the dts change should not submit in one change.

Thanks,

- Kever

Quoted 56 lines · Jonas Karlman

Linux commit afeccc408496 ("arm64: dts: rockchip: add DT entry for RNG to RK356x") merged for v6.12-rc1 add a proper rng node to the SoC DT. The compatible used differs compared to what U-Boot is currently using.

Add support for the rk3568-rng used in upstream Linux. Support for the cryptov2-rng compatible is still kept because PX30/RK3326 and RK3308 are still using it.

---
  arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++-----
  drivers/rng/rockchip_rng.c      | 4 ++++
  2 files changed, 8 insertions(+), 5 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +4 -5
index 24a976cf7e21..871869739536 100644
@@ -21,11 +21,6 @@
  		bootph-all;
  	};
 
-	rng: rng@fe388000 {
-		compatible = "rockchip,cryptov2-rng";
-		reg = <0x0 0xfe388000 0x0 0x2000>;
-	};
-
  	otp: nvmem@fe38c000 {
  		compatible = "rockchip,rk3568-otp";
  		reg = <0x0 0xfe38c000 0x0 0x4000>;
@@ -121,6 +116,10 @@
  	bootph-all;
  };
 
+&rng {
+	status = "okay";
+};
+
  &sdhci {
  	bootph-pre-ram;
  	bootph-some-ram;
drivers/rng/rockchip_rng.c +4 -0
index 2426648fbd57..f673e2657c94 100644
@@ -312,6 +312,10 @@ static const struct udevice_id rockchip_rng_match[] = {
  		.compatible = "rockchip,rk3399-crypto",
  		.data = (ulong)&rk_cryptov1_soc_data,
  	},
+	{
+		.compatible = "rockchip,rk3568-rng",
+		.data = (ulong)&rk_cryptov2_soc_data,
+	},
  	{
  		.compatible = "rockchip,cryptov2-rng",
  		.data = (ulong)&rk_cryptov2_soc_data,
#3 lore raw

PATCH 2/2 rng: rockchip_rng: Update compatible for RK3588

In reply to Jonas Karlman

Linux commit 6ee0b9ad3995 ("arm64: dts: rockchip: Add rng node to RK3588") merged for v6.15-rc1 add a proper rng node to the device tree. The compatible used differs compared to what U-Boot is currently using.

Replace the old trngv1 compatible with the upstream Linux rk3588-rng compatible.

---
This was also tested with a full copy of the rng node, meaning the rng node can fully be dropped from u-boot.dtsi in the future when v6.15-dts has been merged.

---
 arch/arm/dts/rk3588s-u-boot.dtsi | 4 ++--
 drivers/rng/rockchip_rng.c       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/dts/rk3588s-u-boot.dtsi +2 -2
index 8880d162b11c..ee44ad271c7f 100644
@@ -19,8 +19,8 @@
 		bootph-all;
 	};
 
-	rng: rng@fe378000 {
-		compatible = "rockchip,trngv1";
+	rng@fe378000 {
+		compatible = "rockchip,rk3588-rng";
 		reg = <0x0 0xfe378000 0x0 0x200>;
 	};
 };
drivers/rng/rockchip_rng.c +1 -1
index f673e2657c94..6e4e3abf08c8 100644
@@ -321,7 +321,7 @@ static const struct udevice_id rockchip_rng_match[] = {
 		.data = (ulong)&rk_cryptov2_soc_data,
 	},
 	{
-		.compatible = "rockchip,trngv1",
+		.compatible = "rockchip,rk3588-rng",
 		.data = (ulong)&rk_trngv1_soc_data,
 	},
 	{},
Signature · 1 line
2.49.0