rockchip: Update rng compatible for RK356x and RK3588
Subsystems (2)
v2 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 removed, and because it is not enabled for rk3566 it gets enabled in u-boot.dtsi to restore its use in U-Boot.
The RK3588 rng node is added into dts/upstream DT by picking a commit from devicetree-rebasing v6.15-rc1-dts and the rng node in u-boot.dtsi is removed.
Changes in v2:
- Split rng driver and DT change into separate patches for RK356x
- Pick RK3588 rng node commit from devicetree-rebasing v6.15-rc1-dts
Jonas Karlman (3):
rng: rockchip_rng: Add compatible for RK3568
rockchip: rk356x: Remove rng node from u-boot.dtsi
rng: rockchip_rng: Update compatible for RK3588
Nicolas Frattaroli (1):
arm64: dts: rockchip: Add rng node to RK3588
arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++----- arch/arm/dts/rk3588s-u-boot.dtsi | 5 ----- drivers/rng/rockchip_rng.c | 6 +++++- dts/upstream/src/arm64/rockchip/rk3588-base.dtsi | 8 ++++++++ 4 files changed, 17 insertions(+), 11 deletions(-)
Signature · 1 line
2.49.0
PATCH v2 1/4 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.
---
v2: Split SoC u-boot.dtsi change into own patch
--- drivers/rng/rockchip_rng.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/rng/rockchip_rng.c +4 -0
@@ -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
Re: [PATCH v2 1/4] rng: rockchip_rng: Add compatible for RK3568
Quoted 9 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.
Signed-off-by Jonas Karlman <[email protected]>
Thanks,
- Kever
Quoted 21 lines
---
v2: Split SoCu-boot.dtsichange into own patch--- drivers/rng/rockchip_rng.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/rng/rockchip_rng.c +4
-0@@ -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,
PATCH v2 2/4 rockchip: rk356x: Remove rng node from u-boot.dtsi
In reply to Jonas KarlmanLinux 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.
Remove the rng node from SoC u-boot.dtsi now that the rng driver support the compatible used in dts/upstream DT. Ensure the rng node is enabled to support rng on RK3566 variants.
---
v2: Split SoC u-boot.dtsi change into own patch
--- arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +4 -5
@@ -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;
Signature · 1 line
2.49.0
Re: [PATCH v2 2/4] rockchip: rk356x: Remove rng node from u-boot.dtsi
Quoted 8 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.Remove the rng node from SoC
u-boot.dtsinow that the rng driver support the compatible used in dts/upstream DT. Ensure the rng node is enabled to support rng on RK3566 variants.Signed-off-by Jonas Karlman <[email protected]>
Thanks,
- Kever
Quoted 33 lines
---
v2: Split SoCu-boot.dtsichange into own patch--- arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)arch/arm/dts/rk356x-u-boot.dtsi +4
-5@@ -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;
PATCH v2 3/4 arm64: dts: rockchip: Add rng node to RK3588
In reply to Jonas KarlmanFrom: Nicolas Frattaroli <[email protected]>
Add the RK3588's standalone hardware random number generator node to its device tree, and enable it.
[changed reset-id to its numeric value while the constant makes its
way through the crypto tree]
[ upstream commit: 6ee0b9ad3995ee5fa229035c69013b7dd0d3634b ]
--- dts/upstream/src/arm64/rockchip/rk3588-base.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
dts/upstream/src/arm64/rockchip/rk3588-base.dtsi +8 -0
@@ -1921,6 +1921,14 @@ status = "disabled"; }; + rng@fe378000 { + compatible = "rockchip,rk3588-rng"; + reg = <0x0 0xfe378000 0x0 0x200>; + interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>; + resets = <&scmi_reset 48>; + }; + i2s0_8ch: i2s@fe470000 { compatible = "rockchip,rk3588-i2s-tdm"; reg = <0x0 0xfe470000 0x0 0x1000>;
Signature · 1 line
2.49.0
Re: [PATCH v2 3/4] arm64: dts: rockchip: Add rng node to RK3588
Quoted 10 lines · Jonas Karlman
From: Nicolas Frattaroli <[email protected]>
Add the RK3588's standalone hardware random number generator node to its device tree, and enable it.
Signed-off-by Nicolas Frattaroli <[email protected]>[changed reset-id to its numeric value while the constant makes its
way through the crypto tree]Signed-off-by Heiko Stuebner <[email protected]>
Thanks,
- Kever
Quoted 28 lines
[ upstream commit:
6ee0b9ad3995ee5fa229035c69013b7dd0d3634b](cherry picked from commit 4800c4aaad00ffdc053850f130e8504a04dd110d)Signed-off-by Jonas Karlman <[email protected]>--- dts/upstream/src/arm64/rockchip/rk3588-base.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)dts/upstream/src/arm64/rockchip/rk3588-base.dtsi +8
-0@@ -1921,6 +1921,14 @@ status = "disabled"; }; + rng@fe378000 { + compatible = "rockchip,rk3588-rng"; + reg = <0x0 0xfe378000 0x0 0x200>; + interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>; + resets = <&scmi_reset 48>; + }; + i2s0_8ch: i2s@fe470000 { compatible = "rockchip,rk3588-i2s-tdm"; reg = <0x0 0xfe470000 0x0 0x1000>;
PATCH v2 4/4 rng: rockchip_rng: Update compatible for RK3588
In reply to Jonas KarlmanLinux 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 dts/upstream compatible in the rng driver and remove the old rng node compatible override from SoC u-boot.dtsi to keep rng working after the driver change.
---
v2: Remove the rng node instead of changing compatible
--- arch/arm/dts/rk3588s-u-boot.dtsi | 5 ----- drivers/rng/rockchip_rng.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)
arch/arm/dts/rk3588s-u-boot.dtsi +0 -5
@@ -18,11 +18,6 @@ compatible = "rockchip,rk3588-dmc"; bootph-all; }; - - rng: rng@fe378000 { - compatible = "rockchip,trngv1"; - reg = <0x0 0xfe378000 0x0 0x200>; - }; }; #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
drivers/rng/rockchip_rng.c +1 -1
@@ -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
Re: [PATCH v2 4/4] rng: rockchip_rng: Update compatible for RK3588
Quoted 9 lines · 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 dts/upstream compatible in the rng driver and remove the old rng node compatible override from SoC
u-boot.dtsito keep rng working after the driver change.Signed-off-by Jonas Karlman <[email protected]>
Thanks,
- Kever
Quoted 36 lines
---
v2: Remove the rng node instead of changing compatible--- arch/arm/dts/rk3588s-u-boot.dtsi | 5 ----- drivers/rng/rockchip_rng.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)arch/arm/dts/rk3588s-u-boot.dtsi +0
-5@@ -18,11 +18,6 @@ compatible = "rockchip,rk3588-dmc"; bootph-all; }; - - rng: rng@fe378000 { - compatible = "rockchip,trngv1"; - reg = <0x0 0xfe378000 0x0 0x200>; - }; }; #ifdef CONFIG_ROCKCHIP_SPI_IMAGEdrivers/rng/rockchip_rng.c +1
-1@@ -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, }, {},
Hi Jonas,
Sorry for the late reply here.
Quoted 7 lines · Jonas Karlman
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.dtsiis removed, and because it is not enabled for rk3566 it gets enabled inu-boot.dtsito restore its use in U-Boot.
It's explicitly disabled in the upstream kernel because it doesn't produce actual random data and hence upstream believe it shouldn't be used, there's a couple of threads on it.
Have we tested to see if the data produced in U-Boot from the HW exhibits a different outcome? I wonder if Kever is aware of the kernel issue and can provide input.
Peter
Quoted 25 lines
The RK3588 rng node is added into dts/upstream DT by picking a commit from devicetree-rebasing v6.15-rc1-dts and the rng node in
u-boot.dtsiis removed.Changes in v2:
- Split rng driver and DT change into separate patches for RK356x
- Pick RK3588 rng node commit from devicetree-rebasing v6.15-rc1-dtsJonas Karlman (3):
rng:rockchip_rng: Add compatible for RK3568
rockchip: rk356x: Remove rng node fromu-boot.dtsi
rng:rockchip_rng: Update compatible for RK3588Nicolas Frattaroli (1):
arm64: dts: rockchip: Add rng node to RK3588arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++----- arch/arm/dts/rk3588s-u-boot.dtsi | 5 ----- drivers/rng/rockchip_rng.c | 6 +++++- dts/upstream/src/arm64/rockchip/rk3588-base.dtsi | 8 ++++++++ 4 files changed, 17 insertions(+), 11 deletions(-)--
2.49.0
Hi Peter,
Quoted 5 lines · Peter Robinson
Hi Jonas,
Sorry for the late reply here.
On Tue, 8 Apr 2025 at 23:37, Jonas Karlman <[email protected]> wrote:
Quoted 8 lines
Quoted 6 lines
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.dtsiis removed, and because it is not enabled for rk3566 it gets enabled inu-boot.dtsito restore its use in U-Boot.It's explicitly disabled in the upstream kernel because it doesn't produce actual random data
rockchip trng module is able to pass the third party RNG test, should be "actual random data",
so no idea why kernel people think it doesn't produce actual random data.
Quoted 6 lines
and hence upstream believe it shouldn't be
used, there's a couple of threads on it.Have we tested to see if the data produced in U-Boot from the HW exhibits a different outcome? I wonder if Kever is aware of the kernel issue and can provide input.
I only follow linux-rockchip mailing list, so didn't notice the the kernel issue.
Thanks,
- Kever
Quoted 28 lines
Peter
Quoted 25 lines
The RK3588 rng node is added into dts/upstream DT by picking a commit from devicetree-rebasing v6.15-rc1-dts and the rng node in
u-boot.dtsiis removed.Changes in v2:
- Split rng driver and DT change into separate patches for RK356x
- Pick RK3588 rng node commit from devicetree-rebasing v6.15-rc1-dtsJonas Karlman (3):
rng:rockchip_rng: Add compatible for RK3568
rockchip: rk356x: Remove rng node fromu-boot.dtsi
rng:rockchip_rng: Update compatible for RK3588Nicolas Frattaroli (1):
arm64: dts: rockchip: Add rng node to RK3588arch/arm/dts/rk356x-u-boot.dtsi | 9 ++++----- arch/arm/dts/rk3588s-u-boot.dtsi | 5 ----- drivers/rng/rockchip_rng.c | 6 +++++- dts/upstream/src/arm64/rockchip/rk3588-base.dtsi | 8 ++++++++ 4 files changed, 17 insertions(+), 11 deletions(-)--
2.49.0