]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(stm32mp1): add RNG initialization in BL2 for STM32MP13
authorNicolas Le Bayon <nicolas.le.bayon@foss.st.com>
Wed, 2 Dec 2020 15:23:49 +0000 (16:23 +0100)
committerLionel Debieve <lionel.debieve@foss.st.com>
Mon, 14 Nov 2022 09:55:17 +0000 (10:55 +0100)
Initialize RNG driver at platform level for STM32MP13.

Change-Id: I64832de43e5f6559a12e26680142db54c88f0b9e
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@foss.st.com>
plat/st/stm32mp1/bl2_plat_setup.c
plat/st/stm32mp1/platform.mk

index 5015f7d16d1ac37df7d558918126f3f45888f795..1fddfcccad978ca6b19cbde09909f2f0fddd0e2d 100644 (file)
@@ -17,6 +17,7 @@
 #include <drivers/st/bsec.h>
 #include <drivers/st/regulator_fixed.h>
 #include <drivers/st/stm32_iwdg.h>
+#include <drivers/st/stm32_rng.h>
 #include <drivers/st/stm32_uart.h>
 #include <drivers/st/stm32mp1_clk.h>
 #include <drivers/st/stm32mp1_pwr.h>
@@ -375,6 +376,12 @@ skip_console_init:
                }
        }
 
+#if STM32MP13
+       if (stm32_rng_init() != 0) {
+               panic();
+       }
+#endif
+
 #if STM32MP15
        if (stm32mp_is_auth_supported()) {
                stm32mp1_auth_ops.check_key =
index 2409935c06d275bfdfe619ec37ee7cd27b0f9e52..7aa55272e1f35fdb95d1a3556dd3c43ac75fff3c 100644 (file)
@@ -117,8 +117,10 @@ endif
 
 ifeq ($(STM32MP13),1)
 STM32_HASH_VER         :=      4
+STM32_RNG_VER          :=      4
 else # Assuming STM32MP15
 STM32_HASH_VER         :=      2
+STM32_RNG_VER          :=      2
 endif
 
 # Boot devices
@@ -236,6 +238,7 @@ $(eval $(call assert_numerics,\
        $(sort \
                PLAT_PARTITION_MAX_ENTRIES \
                STM32_HASH_VER \
+               STM32_RNG_VER \
                STM32_TF_A_COPIES \
                STM32_TF_VERSION \
                STM32MP_UART_BAUDRATE \
@@ -247,6 +250,7 @@ $(eval $(call add_defines,\
                PLAT_PARTITION_MAX_ENTRIES \
                PLAT_XLAT_TABLES_DYNAMIC \
                STM32_HASH_VER \
+               STM32_RNG_VER \
                STM32_TF_A_COPIES \
                STM32_TF_VERSION \
                STM32MP_CRYPTO_ROM_LIB \
@@ -317,7 +321,8 @@ PLAT_BL_COMMON_SOURCES      +=      drivers/arm/tzc/tzc400.c                                \
 
 ifeq ($(STM32MP13),1)
 PLAT_BL_COMMON_SOURCES +=      drivers/st/clk/clk-stm32-core.c                         \
-                               drivers/st/clk/clk-stm32mp13.c
+                               drivers/st/clk/clk-stm32mp13.c                          \
+                               drivers/st/crypto/stm32_rng.c
 else
 PLAT_BL_COMMON_SOURCES +=      drivers/st/clk/stm32mp1_clk.c
 endif