From bac8ed98778c93ef43ce9093efa3b9999d650576 Mon Sep 17 00:00:00 2001
From: Aymen Sghaier <aymen.sghaier@nxp.com>
Date: Wed, 2 May 2018 10:34:27 +0200
Subject: [PATCH] MLK-18044-3: crypto: Add blob command support for i.MX8M
 platforms

 This patch enable blob command for mScale platforms.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 895669394f6aae633abf6ea3f327d6093562edde)
---
 cmd/Kconfig | 4 ++--
 cmd/blob.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2074ac5..9991b2e 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1297,8 +1297,8 @@ config CMD_AES
 
 config CMD_BLOB
 	bool "Enable the 'blob' command"
-	depends on !MX6ULL && !MX6SLL && !MX6SL && !IMX8M
-	select SECURE_BOOT if ARCH_MX6 || ARCH_MX7 || ARCH_MX7ULP
+	depends on !MX6ULL && !MX6SLL && !MX6SL
+	select SECURE_BOOT 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 aea1d36..4bb6639 100644
--- a/cmd/blob.c
+++ b/cmd/blob.c
@@ -12,7 +12,7 @@
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
 #if defined(CONFIG_ARCH_MX6) || defined(CONFIG_ARCH_MX7) || \
-	defined(CONFIG_ARCH_MX7ULP)
+	defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8M)
 #include <fsl_sec.h>
 #include <asm/arch/clock.h>
 #endif
@@ -83,7 +83,7 @@ static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	dst_ptr = (uint8_t *)(uintptr_t)dst_addr;
 
 #if defined(CONFIG_ARCH_MX6) || defined(CONFIG_ARCH_MX7) || \
-	defined(CONFIG_ARCH_MX7ULP)
+	defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8M)
 
 	hab_caam_clock_enable(1);
 
-- 
1.9.1