summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-04-09 07:41:32 -0400
committerTom Rini <[email protected]>2021-04-09 10:08:52 -0400
commita1e95e3805eacca1162f6049dceb9b1d2726cbf5 (patch)
treee4499db55ac8ee7b600a873a231b134d0adfc1a4 /cmd
parentf6127db8cc8dec22cf9cd6d6363d812f659ce517 (diff)
parent2fc93e5bafdae7cf6373479e054e9f3943fde23c (diff)
Merge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20210409 ------------------- - Secure Boot : - HAB for MX8M / MX7ULP - CAAM fixes - Fixes for imxrt1020 - Fixes for USDHC driver - Fixes for Toradex (Colibri / Apalis) - Switch to DM for several boards - mx23 olinuxo - usbarmory - marsboard / riotboard - Gateworks GW Ventana - NXP upstream patches (LPDDR / CAAM / HAB) CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7089
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig2
-rw-r--r--cmd/blob.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 9bf5e863e4d..c735e81b37a 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 c80e6977b4b..887219cc079 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