]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk35xx: Enable random generator
authorJonas Karlman <jonas@kwiboo.se>
Mon, 22 Apr 2024 06:28:45 +0000 (06:28 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 26 Apr 2024 07:47:04 +0000 (15:47 +0800)
The RK35xx SoCs contain a crypto engine block that can generate random
numbers.

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

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
arch/arm/dts/rk356x-u-boot.dtsi
arch/arm/dts/rk3588s-u-boot.dtsi
arch/arm/mach-rockchip/Kconfig
configs/anbernic-rgxx3-rk3566_defconfig

index 791f16b206f299fa1731010f0980b06e5566d3ce..793ed4ae8ae0e99f3204a00836bc38a342321511 100644 (file)
@@ -6,12 +6,6 @@
        chosen {
                u-boot,spl-boot-order = "same-as-spl", &sdmmc1, &sdmmc0;
        };
-
-       rng: rng@fe388000 {
-               compatible = "rockchip,cryptov2-rng";
-               reg = <0x0 0xfe388000 0x0 0x2000>;
-               status = "okay";
-       };
 };
 
 &dsi_dphy0 {
index d347080577d9cb9dd0f327d576fa26a29d7f2e2e..05367216e118ad74d1f6cb6eff1b8eae0efeadb5 100644 (file)
                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>;
index ac67c777adea1d5f236fc809385c0a7686858364..233eb79d9ba2e1ee09cf41b6bfb9d339f82f741a 100644 (file)
@@ -91,7 +91,6 @@
        rng: rng@fe378000 {
                compatible = "rockchip,trngv1";
                reg = <0x0 0xfe378000 0x0 0x200>;
-               status = "disabled";
        };
 
        usbdp_phy0: phy@fed80000 {
index 680364ae31f3277d81233ac1299c78130768931b..f35553ff21813a884aab3d94df60718410b305cc 100644 (file)
@@ -306,9 +306,11 @@ config ROCKCHIP_RK3568
        select BOARD_LATE_INIT
        select DM_REGULATOR_FIXED
        select DM_RESET
+       imply DM_RNG
        imply MISC_INIT_R
        imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
        imply OF_LIBFDT_OVERLAY
+       imply RNG_ROCKCHIP
        imply ROCKCHIP_COMMON_BOARD
        imply ROCKCHIP_OTP
        imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
@@ -335,9 +337,11 @@ config ROCKCHIP_RK3588
        select DM_RESET
        imply BOOTSTD_FULL
        imply CLK_SCMI
+       imply DM_RNG
        imply MISC_INIT_R
        imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
        imply OF_LIBFDT_OVERLAY
+       imply RNG_ROCKCHIP
        imply ROCKCHIP_COMMON_BOARD
        imply ROCKCHIP_OTP
        imply SCMI_FIRMWARE
index 24b050c59b53c6a683fdacb72b19aa4bd5a8cc5a..110237e798f935ed390196aace086ba314363c5d 100644 (file)
@@ -68,8 +68,6 @@ CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 # CONFIG_RAM_ROCKCHIP_DEBUG is not set
-CONFIG_DM_RNG=y
-CONFIG_RNG_ROCKCHIP=y
 # CONFIG_RNG_SMCCC_TRNG is not set
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2