summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2022-05-24 17:02:56 +0800
committerJi Luo <ji.luo@nxp.com>2022-05-25 12:00:49 +0800
commit587c0e19a32ac49e681c8e05926e10cb9a9a43a7 (patch)
tree867a0313c67fa75d491b019e3ab63dd4f52fa0f6 /common
parent6c10cfe481c32cec642a2e09a8cece25982915aa (diff)
MA-20303-1 Support rollback index check for single bootloader
Add support to check the rollback index of next stage images (ATF, TEE, u-boot proper) in SPL to harden the security. And because there is no backup bootloader image to fall back to so the board would hang in SPL if rollback index is rejected. Change-Id: I4c7d1f084dd5b3d37899a9e4c4755c03145542c7 Signed-off-by: Ji Luo <ji.luo@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_fit.c4
-rw-r--r--common/spl/spl_mmc.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index b40d604c05..9d5a6dccec 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -67,7 +67,7 @@ static int find_node_from_desc(const void *fit, int node, const char *str)
return -ENOENT;
}
-#ifdef CONFIG_DUAL_BOOTLOADER
+#ifdef CONFIG_IMX_TRUSTY_OS
extern int spl_fit_get_rbindex(const void *fit);
#endif
@@ -741,7 +741,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
if (ret < 0)
return ret;
-#if defined(CONFIG_DUAL_BOOTLOADER) && defined(CONFIG_IMX_TRUSTY_OS)
+#ifdef CONFIG_IMX_TRUSTY_OS
int rbindex;
rbindex = spl_fit_get_rbindex(ctx.fit);
if (rbindex < 0) {
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 591c238a63..cbbd166eb3 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -82,7 +82,7 @@ int mmc_load_image_raw_sector_dual_uboot(struct spl_image_info *spl_image,
struct mmc *mmc);
#endif
-int __weak mmc_image_load_late(struct mmc *mmc)
+int __weak mmc_image_load_late(struct spl_image_info *spl_image, struct mmc *mmc)
{
return 0;
}
@@ -140,7 +140,7 @@ end:
return -1;
}
- ret = mmc_image_load_late(mmc);
+ ret = mmc_image_load_late(spl_image, mmc);
return ret;
}