ARM: mx6: make CAAM usable on the i.MX6 boards
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 26 Jun 2020 17:57:55 +0000 (19:57 +0200)
committerStefano Babic <sbabic@denx.de>
Thu, 16 Jul 2020 09:20:08 +0000 (11:20 +0200)
Even if the HAB fuse is not set we want to be able to use the Cryptographic
Accelerator and Assurance Module (CAAM) for generating random numbers. So
SYS_FSL_HAS_SEC should be selected even if IMX_HAB is not set.

arch_misc_init() has to be called to initialize the CAAM.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
arch/arm/Kconfig
arch/arm/mach-imx/mx6/soc.c

index 8623852..e16fe03 100644 (file)
@@ -888,7 +888,7 @@ config ARCH_MX7
 config ARCH_MX6
        bool "Freescale MX6"
        select CPU_V7A
-       select SYS_FSL_HAS_SEC if IMX_HAB
+       select SYS_FSL_HAS_SEC
        select SYS_FSL_SEC_COMPAT_4
        select SYS_FSL_SEC_LE
        imply MXC_GPIO
index 19ca382..e129286 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/arch/mxc_hdmi.h>
 #include <asm/arch/crm_regs.h>
 #include <dm.h>
+#include <fsl_sec.h>
 #include <imx_thermal.h>
 #include <mmc.h>
 
@@ -691,6 +692,15 @@ void imx_setup_hdmi(void)
 }
 #endif
 
+#ifdef CONFIG_ARCH_MISC_INIT
+int arch_misc_init(void)
+{
+#ifdef CONFIG_FSL_CAAM
+       sec_init();
+#endif
+       return 0;
+}
+#endif
 
 /*
  * gpr_init() function is common for boards using MX6S, MX6DL, MX6D,