[U-Boot] [PATCH V2 9/9] spl: nor: support loading i.MX container format file

peng.fan at nxp.com peng.fan at nxp.com
Mon Sep 23 02:18:48 UTC 2019

From: Peng Fan <peng.fan at nxp.com>

i.MX8 only support AHAB secure boot with Container format image,
we could not use FIT to support secure boot, so introduce container
support to let SPL could load container images.

Cc: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
Cc: Tien Fong Chee <tien.fong.chee at intel.com>
Cc: York Sun <york.sun at nxp.com>
Cc: Marek Vasut <marex at denx.de>
Cc: Alex Kiernan <alex.kiernan at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
Cc: Kever Yang <kever.yang at rock-chips.com>
Cc: Heiko Schocher <hs at denx.de>
Signed-off-by: Peng Fan <peng.fan at nxp.com>


 common/spl/spl_nor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 0f8afa6f92..7df708de9b 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -6,7 +6,6 @@
 #include <common.h>
 #include <spl.h>
 static ulong spl_nor_load_read(struct spl_load_info *load, ulong sector,
 			       ulong count, void *buf)
@@ -16,7 +15,6 @@ static ulong spl_nor_load_read(struct spl_load_info *load, ulong sector,
 	return count;
 unsigned long __weak spl_nor_get_uboot_base(void)
@@ -97,6 +95,13 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
 		return ret;
+		load.bl_len = 1;
+		load.read = spl_nor_load_read;
+		return spl_load_imx_container(spl_image, &load,
+					      spl_nor_get_uboot_base());
+	}
 	ret = spl_parse_image_header(spl_image,
 			(const struct image_header *)spl_nor_get_uboot_base());
 	if (ret)

More information about the U-Boot mailing list