summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2018-11-01 17:02:48 +0200
committerAbel Vesa <abel.vesa@nxp.com>2018-11-07 15:56:52 +0200
commitc853049068ba2026cf91a6268958913db379a432 (patch)
treea064aa277c218b6b7760f2d65dd613978392b59f /common
parentde14e88698b9ae9b0a9ac674f16d65b3ceb4ccc2 (diff)
MLK-20233 arch: imx8: Add container parser for loading ATF and uboot proper
This intends to replace the FIT image support since that cannot be authenticated. Instead, we append another container at the end of flash.bin, this new one containing a new container with two images representing the ATF and uboot proper. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_mmc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 91b5190c07..785bbd5338 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -319,6 +319,14 @@ unsigned long __weak spl_mmc_get_uboot_raw_sector(struct mmc *mmc)
}
#endif
+#ifdef CONFIG_PARSE_CONTAINER
+int __weak mmc_load_image_parse_container(struct spl_image_info *spl_image,
+ struct mmc *mmc, unsigned long sector)
+{
+ return -ENODEV;
+};
+#endif
+
int spl_mmc_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
@@ -389,6 +397,13 @@ int spl_mmc_load_image(struct spl_image_info *spl_image,
err = mmc_load_image_raw_sector_dual_uboot(spl_image,
mmc);
#else
+#ifdef CONFIG_PARSE_CONTAINER
+ err = mmc_load_image_parse_container(spl_image, mmc,
+ spl_mmc_get_uboot_raw_sector(mmc));
+
+ if (!err)
+ return err;
+#endif
err = mmc_load_image_raw_sector(spl_image, mmc,
spl_mmc_get_uboot_raw_sector(mmc));
#endif