diff mbox series

[05/13] rockchip: rk3308: Enable random generator

Message ID 20240316225655.3244348-6-jonas@kwiboo.se
State Superseded
Delegated to: Kever Yang
Headers show
Series rockchip: rk3308: Sync DT with linux v6.8 and update defconfigs | expand

Commit Message

Jonas Karlman March 16, 2024, 10:56 p.m. UTC
The RK3308 SoC contain a crypto engine block that can generate random
numbers.

Add rng node to soc u-boot.dtsi and enable Kconfig options to take
advantage of the random generator.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/arm/dts/rk3308-u-boot.dtsi | 5 +++++
 arch/arm/mach-rockchip/Kconfig  | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/dts/rk3308-u-boot.dtsi b/arch/arm/dts/rk3308-u-boot.dtsi
index 396fefb743cf..d6c71f62bc93 100644
--- a/arch/arm/dts/rk3308-u-boot.dtsi
+++ b/arch/arm/dts/rk3308-u-boot.dtsi
@@ -21,6 +21,11 @@ 
 			reg = <0x07 0x10>;
 		};
 	};
+
+	rng: rng@ff2f0000 {
+		compatible = "rockchip,cryptov2-rng";
+		reg = <0x0 0xff2f0000 0x0 0x4000>;
+	};
 };
 
 &cru {
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 6e07a70bf4ae..fa5917236a43 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -162,9 +162,11 @@  config ROCKCHIP_RK3308
 	select SPL_LOAD_FIT
 	imply ARMV8_CRYPTO
 	imply ARMV8_SET_SMPEN
+	imply DM_RNG
 	imply LEGACY_IMAGE_FORMAT
 	imply MISC
 	imply MISC_INIT_R
+	imply RNG_ROCKCHIP
 	imply ROCKCHIP_COMMON_BOARD
 	imply ROCKCHIP_OTP
 	imply SPL_CLK