diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 2 | ||||
-rw-r--r-- | cmd/blob.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 9bf5e863e4..c735e81b37 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1960,6 +1960,8 @@ config CMD_AES config CMD_BLOB bool "Enable the 'blob' command" + depends on !MX6ULL && !MX6SLL && !MX6SL + select IMX_HAB if ARCH_MX6 || ARCH_MX7 || ARCH_MX7ULP || ARCH_IMX8M help This is used with the Freescale secure boot mechanism. diff --git a/cmd/blob.c b/cmd/blob.c index c80e6977b4..887219cc07 100644 --- a/cmd/blob.c +++ b/cmd/blob.c @@ -9,6 +9,11 @@ #include <malloc.h> #include <asm/byteorder.h> #include <linux/compiler.h> +#if defined(CONFIG_ARCH_MX6) || defined(CONFIG_ARCH_MX7) || \ + defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8M) +#include <fsl_sec.h> +#include <asm/arch/clock.h> +#endif /** * blob_decap() - Decapsulate the data as a blob @@ -74,6 +79,17 @@ static int do_blob(struct cmd_tbl *cmdtp, int flag, int argc, src_ptr = (uint8_t *)(uintptr_t)src_addr; dst_ptr = (uint8_t *)(uintptr_t)dst_addr; +#if defined(CONFIG_ARCH_MX6) || defined(CONFIG_ARCH_MX7) || \ + defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8M) + + hab_caam_clock_enable(1); + + u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + + FSL_CAAM_ORSR_JRa_OFFSET); + if (out_jr_size != FSL_CAAM_MAX_JR_SIZE) + sec_init(); +#endif + if (enc) ret = blob_encap(km_ptr, src_ptr, dst_ptr, len); else |