i.MX8MM/MN/MP/MQ - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
config ARCH_IMX8M
bool "NXP i.MX8M platform"
select ARM64
- select SYS_FSL_HAS_SEC if IMX_HAB
+ select SYS_FSL_HAS_SEC
select SYS_FSL_SEC_COMPAT_4
select SYS_FSL_SEC_LE
select DM
select SUPPORT_SPL
imply CMD_DM
- select IMX_SEC_INIT if HAS_CAAM
config ARCH_IMXRT
bool "NXP i.MXRT platform"
select SYS_FSL_SEC_COMPAT_4
select SYS_FSL_SEC_LE
select ROM_UNIFIED_SECTIONS
- select IMX_SEC_INIT if HAS_CAAM
imply MXC_GPIO
imply SYS_THUMB_BUILD
select SYS_FSL_SEC_COMPAT_4
select SYS_FSL_SEC_LE
imply BOARD_EARLY_INIT_F
- select IMX_SEC_INIT if HAS_CAAM
imply MXC_GPIO
imply SYS_THUMB_BUILD
select SYS_FSL_HAS_SEC
select SYS_FSL_SEC_COMPAT_4
select SYS_FSL_SEC_LE
- select IMX_SEC_INIT if HAS_CAAM
imply MXC_GPIO
imply SYS_THUMB_BUILD
u-boot,dm-spl;
};
+&crypto {
+ u-boot,dm-spl;
+};
+
+&sec_jr0 {
+ u-boot,dm-spl;
+};
+
+&sec_jr1 {
+ u-boot,dm-spl;
+};
+
+&sec_jr2 {
+ u-boot,dm-spl;
+};
+
&usdhc1 {
u-boot,dm-spl;
assigned-clocks = <&clk IMX8MN_CLK_USDHC1>;
u-boot,dm-spl;
};
+&crypto {
+ u-boot,dm-spl;
+};
+
+&sec_jr0 {
+ u-boot,dm-spl;
+};
+
+&sec_jr1 {
+ u-boot,dm-spl;
+};
+
+&sec_jr2 {
+ u-boot,dm-spl;
+};
+
&usdhc1 {
u-boot,dm-spl;
assigned-clocks = <&clk IMX8MN_CLK_USDHC1>;
u-boot,dm-spl;
};
+&crypto {
+ u-boot,dm-spl;
+};
+
+&sec_jr0 {
+ u-boot,dm-spl;
+};
+
+&sec_jr1 {
+ u-boot,dm-spl;
+};
+
+&sec_jr2 {
+ u-boot,dm-spl;
+};
+
&i2c1 {
u-boot,dm-spl;
};
config FSL_CAAM_KB
bool
-config IMX_SEC_INIT
- bool
- help
- In most of i.MX board with CAAM this option is used
- to init RNG from U-Boot
- select FSL_CAAM_KB
- select SPL_CRYPTO_SUPPORT if SPL
-
config IMX_RDC
bool "i.MX Resource domain controller driver"
depends on ARCH_MX6 || ARCH_MX7
bool "imx8mq_evk"
select IMX8MQ
select IMX8M_LPDDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MQ_PHANBELL
bool "imx8mq_phanbell"
select IMX8MM
select SUPPORT_SPL
select IMX8M_LPDDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MM_VENICE
bool "Support Gateworks Venice iMX8M Mini module"
select IMX8MM
select SUPPORT_SPL
select IMX8M_DDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MN_EVK
bool "imx8mn LPDDR4 EVK board"
select IMX8MN
select SUPPORT_SPL
select IMX8M_LPDDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MN_DDR4_EVK
bool "imx8mn DDR4 EVK board"
select IMX8MN
select SUPPORT_SPL
select IMX8M_DDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MN_DDR3_EVK
bool "imx8mn 11x11 DDR3 EVK board"
select IMX8MN
select SUPPORT_SPL
select IMX8M_DDR3L
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_IMX8MP_EVK
bool "imx8mp LPDDR4 EVK board"
select IMX8MP
select SUPPORT_SPL
select IMX8M_LPDDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_PICO_IMX8MQ
bool "Support Technexion Pico iMX8MQ"
select IMX8MP
select SUPPORT_SPL
select IMX8M_DDR4
+ select FSL_CAAM
+ select FSL_BLOB
+ select MISC
+ select SPL_CRYPTO_SUPPORT if SPL
config TARGET_VERDIN_IMX8MM
bool "Support Toradex Verdin iMX8M Mini module"
#include <asm/ptrace.h>
#include <asm/armv8/mmu.h>
#include <dm/uclass.h>
+#include <dm/platdata.h>
+#include <dm/uclass-internal.h>
+#include <dm/device-internal.h>
#include <efi_loader.h>
#include <env.h>
#include <env_internal.h>
#include <linux/bitops.h>
#include <asm/setup.h>
#include <asm/bootm.h>
-#ifdef CONFIG_IMX_SEC_INIT
-#include <fsl_caam.h>
-#endif
DECLARE_GLOBAL_DATA_PTR;
}
}
-#ifdef CONFIG_IMX_SEC_INIT
- /* Secure init function such RNG */
- imx_sec_init();
-#endif
#if defined(CONFIG_ANDROID_SUPPORT)
/* Enable RTC */
writel(0x21, 0x30370038);
int arch_misc_init(void)
{
+ struct udevice *dev;
+
+ uclass_find_first_device(UCLASS_MISC, &dev);
+ for (; dev; uclass_find_next_device(&dev)) {
+ if (device_probe(dev))
+ continue;
+ }
+
acquire_buildinfo();
return 0;
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/mach-imx/regs-common.h>
-#include <fsl_caam.h>
#include <fdt_support.h>
DECLARE_GLOBAL_DATA_PTR;
#endif
}
-void imx_sec_init(void)
-{
-#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL)
- caam_open();
-#endif
-}
-
static void set_dt_val(void *data, uint32_t cell_size, uint64_t val)
{
if (cell_size == 1) {
#include <asm/mach-imx/gpio.h>
#include <asm/mach-imx/mxc_i2c.h>
#include <fsl_esdhc_imx.h>
+#include <fsl_sec.h>
#include <mmc.h>
#include <linux/delay.h>
void spl_board_init(void)
{
+#ifdef CONFIG_FSL_CAAM
+ if (sec_init()) {
+ printf("\nsec_init failed!\n");
+ }
+#endif
#ifndef CONFIG_SPL_USB_SDP_SUPPORT
/* Serial download mode */
if (is_usb_boot()) {
void spl_board_init(void)
{
+ struct udevice *dev;
+ uclass_find_first_device(UCLASS_MISC, &dev);
+
+ for (; dev; uclass_find_next_device(&dev)) {
+ if (device_probe(dev))
+ continue;
+ }
puts("Normal Boot\n");
}
void spl_board_init(void)
{
+ struct udevice *dev;
+ uclass_find_first_device(UCLASS_MISC, &dev);
+
+ for (; dev; uclass_find_next_device(&dev)) {
+ if (device_probe(dev))
+ continue;
+ }
+
/* Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does not allow to change it.
* Should set the clock after PMIC setting done.
* Default is 400Mhz (system_pll1_800m with div = 2) set by ROM for ND VDD_SOC
#include <asm/mach-imx/gpio.h>
#include <asm/mach-imx/mxc_i2c.h>
#include <fsl_esdhc_imx.h>
+#include <fsl_sec.h>
#include <mmc.h>
#include <linux/delay.h>
#include <power/pmic.h>
void spl_board_init(void)
{
+#ifdef CONFIG_FSL_CAAM
+ if (sec_init()) {
+ printf("\nsec_init failed!\n");
+ }
+#endif
#ifndef CONFIG_SPL_USB_SDP_SUPPORT
/* Serial download mode */
if (is_usb_boot()) {
//!
////////////////////////////////////////////////////////////////////////////////
void caam_open(void);
-void imx_sec_init(void);
////////////////////////////////////////////////////////////////////////////////
//! @brief Generate a blob of a secure key.