summaryrefslogtreecommitdiff
path: root/common/image-fit.c
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2021-04-01 21:25:31 +0300
committerTom Rini <trini@konsulko.com>2021-04-14 23:02:43 +0300
commit033ac4ebbad82241e2d7da3ead662ccb495b9e89 (patch)
tree613d46ebfa0cefd2362862efb27dfd3bec1d680d /common/image-fit.c
parent47b6f7f8451117546dd12af3eccd58961a9f7f05 (diff)
downloadu-boot-033ac4ebbad82241e2d7da3ead662ccb495b9e89.tar.xz
image-fit: Accept OP-TEE images when booting a FIT
OP-TEE images are normally packaged with type = "tee; os = "tee"; However, fit_image_load() thinks that is somehow invalid. However if they were declared as type = "kernel", os = "linux", fit_image_load() would happily accept them and allow the boot to continue. There is no technical limitation to excluding "tee". Allowing "tee" images is useful in a boot flow where OP-TEE is executed before linux. In fact, I think it's unintuitive for a "load"ing function to also do parsing and contain a bunch ad-hoc heuristics that only its caller might know. But I don't make the rules, I just write fixes. In more polite terms: refactoring the fit_image API is beyond the scope of this change. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image-fit.c')
-rw-r--r--common/image-fit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/image-fit.c b/common/image-fit.c
index 4e033e19cf..e614643fe3 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -2093,6 +2093,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL);
type_ok = fit_image_check_type(fit, noffset, image_type) ||
fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) ||
+ fit_image_check_type(fit, noffset, IH_TYPE_TEE) ||
(image_type == IH_TYPE_KERNEL &&
fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD));
@@ -2100,6 +2101,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
image_type == IH_TYPE_FPGA ||
fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
+ fit_image_check_os(fit, noffset, IH_OS_TEE) ||
fit_image_check_os(fit, noffset, IH_OS_OPENRTOS) ||
fit_image_check_os(fit, noffset, IH_OS_EFI) ||
fit_image_check_os(fit, noffset, IH_OS_VXWORKS);