mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
spl: LOAD_FIT_FULL: Fix selection of the "fdt" node
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>
This commit is contained in:
parent
d442f69399
commit
18fd663c63
@ -202,7 +202,6 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
|
|||||||
{
|
{
|
||||||
bootm_headers_t images;
|
bootm_headers_t images;
|
||||||
const char *fit_uname_config = NULL;
|
const char *fit_uname_config = NULL;
|
||||||
const char *fit_uname_fdt = FIT_FDT_PROP;
|
|
||||||
const char *uname;
|
const char *uname;
|
||||||
ulong fw_data = 0, dt_data = 0, img_data = 0;
|
ulong fw_data = 0, dt_data = 0, img_data = 0;
|
||||||
ulong fw_len = 0, dt_len = 0, img_len = 0;
|
ulong fw_len = 0, dt_len = 0, img_len = 0;
|
||||||
@ -231,8 +230,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
|
|||||||
#ifdef CONFIG_SPL_FIT_SIGNATURE
|
#ifdef CONFIG_SPL_FIT_SIGNATURE
|
||||||
images.verify = 1;
|
images.verify = 1;
|
||||||
#endif
|
#endif
|
||||||
ret = fit_image_load(&images, (ulong)header,
|
ret = fit_image_load(&images, (ulong)header, NULL, &fit_uname_config,
|
||||||
&fit_uname_fdt, &fit_uname_config,
|
|
||||||
IH_ARCH_DEFAULT, IH_TYPE_FLATDT, -1,
|
IH_ARCH_DEFAULT, IH_TYPE_FLATDT, -1,
|
||||||
FIT_LOAD_OPTIONAL, &dt_data, &dt_len);
|
FIT_LOAD_OPTIONAL, &dt_data, &dt_len);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user