From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 1/6] spl: LOAD_FIT_FULL: Fix selection of the "fdt" node
Date: Thu, 1 Apr 2021 13:25:26 -0500 [thread overview]
Message-ID: <20210401182531.2147653-2-mr.nuke.me@gmail.com> (raw)
In-Reply-To: <20210401182531.2147653-1-mr.nuke.me@gmail.com>
The correct FDT to use is described by the "fdt" property of the
configuration node. When the fit_unamep argument to fit_image_load()
is "fdt", we get the "/images/fdt" node. This is incorrect, as it
ignores the "fdt" property of the config node, and in most cases,
the "/images/fdt" node doesn't exist.
Use NULL for the 'fit_unamep' argument. With NULL, fit_image_load()
uses the IH_TYPE_FLATDT value to read the config property "fdt",
which points to the correct FDT node(s).
fit_image_load() should probably be split into a function that reads
an image by name, and one that reads an image by config reference. I
don't make those decisions, I just point out the craziness.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
common/spl/spl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index e3d84082f4..986cfbc6fd 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -201,7 +201,6 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
{
bootm_headers_t images;
const char *fit_uname_config = NULL;
- const char *fit_uname_fdt = FIT_FDT_PROP;
const char *uname;
ulong fw_data = 0, dt_data = 0, img_data = 0;
ulong fw_len = 0, dt_len = 0, img_len = 0;
@@ -230,8 +229,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
#ifdef CONFIG_SPL_FIT_SIGNATURE
images.verify = 1;
#endif
- ret = fit_image_load(&images, (ulong)header,
- &fit_uname_fdt, &fit_uname_config,
+ ret = fit_image_load(&images, (ulong)header, NULL, &fit_uname_config,
IH_ARCH_DEFAULT, IH_TYPE_FLATDT, -1,
FIT_LOAD_OPTIONAL, &dt_data, &dt_len);
if (ret >= 0)
--
2.26.3
next prev 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 ` Alexandru Gagniuc [this message]
2021-04-16 12:26 ` [PATCH v3 1/6] spl: LOAD_FIT_FULL: Fix selection of the "fdt" node 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 ` [PATCH v3 6/6] image-fit: Accept OP-TEE images when booting a FIT Alexandru Gagniuc
2021-04-16 12:26 ` 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-2-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