From: Peng Fan Date: Mon, 23 Sep 2019 02:18:48 +0000 (+0800) Subject: spl: nor: support loading i.MX container format file X-Git-Tag: v2020.01-rc1~33^2~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3bc4f1df033bdad3c1dbd89c1714886a0b075fac;p=oweals%2Fu-boot.git spl: nor: support loading i.MX container format file 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 Cc: Tien Fong Chee Cc: York Sun Cc: Marek Vasut Cc: Alex Kiernan Cc: Simon Glass Cc: Philipp Tomsich Cc: Kever Yang Cc: Heiko Schocher Signed-off-by: Peng Fan --- 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 #include -#ifdef CONFIG_SPL_LOAD_FIT 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; } -#endif 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; } #endif + if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) { + 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)