public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 6/6] image-fit: Accept OP-TEE images when booting a FIT
Date: Thu,  1 Apr 2021 13:25:31 -0500	[thread overview]
Message-ID: <20210401182531.2147653-7-mr.nuke.me@gmail.com> (raw)
In-Reply-To: <20210401182531.2147653-1-mr.nuke.me@gmail.com>

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>
---
 common/image-fit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/image-fit.c b/common/image-fit.c
index 970e3f89da..ee51f5e76f 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -2089,6 +2089,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));
 
@@ -2096,6 +2097,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);
-- 
2.26.3

  parent reply	other threads:[~2021-04-01 18:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 18:25 [PATCH v3 0/6] SPL: FIT: Fix some omissions of SPL_LOAD_FIT_FULL and bootm Alexandru Gagniuc
2021-04-01 18:25 ` [PATCH v3 1/6] spl: LOAD_FIT_FULL: Fix selection of the "fdt" node Alexandru Gagniuc
2021-04-16 12:26   ` Tom Rini
2021-04-01 18:25 ` [PATCH v3 2/6] spl: LOAD_FIT_FULL: Do not hard-code os to IH_OS_U_BOOT Alexandru Gagniuc
2021-04-16 12:26   ` Tom Rini
2021-04-01 18:25 ` [PATCH v3 3/6] spl: LOAD_FIT_FULL: Relocate FDT for u-boot payloads Alexandru Gagniuc
2021-04-16 12:26   ` Tom Rini
2021-04-01 18:25 ` [PATCH v3 4/6] spl: LOAD_FIT_FULL: Support 'kernel' and 'firmware' properties Alexandru Gagniuc
2021-04-16 12:26   ` Tom Rini
2021-04-01 18:25 ` [PATCH v3 5/6] image-fit: Accept IH_TYPE_FIRMWARE in fit_image_load() as valid Alexandru Gagniuc
2021-04-16 12:26   ` Tom Rini
2021-04-01 18:25 ` Alexandru Gagniuc [this message]
2021-04-16 12:26   ` [PATCH v3 6/6] image-fit: Accept OP-TEE images when booting a FIT Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210401182531.2147653-7-mr.nuke.me@gmail.com \
    --to=mr.nuke.me@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox