spl: LOAD_FIT_FULL: Fix selection of the "fdt" node
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Thu, 1 Apr 2021 18:25:26 +0000 (13:25 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 14 Apr 2021 19:23:01 +0000 (15:23 -0400)
commit18fd663c630729695caba060aca394d8a910c573
treec3be9c170579b0594511ebf50444020fc29e6058
parentd442f69399996d426cdc45ce40bcf1e48d9cd8b9
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>
common/spl/spl.c