SPL: FIT: rework U-Boot image loading
authorAndre Przywara <andre.przywara@arm.com>
Wed, 26 Apr 2017 00:32:34 +0000 (01:32 +0100)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:37:22 +0000 (02:37 +0800)
commite0109e51009b05719d1fd4598a610dd5592e3bbc
tree46e27e310c2b3240c521d410db62b636adfcea8e
parentb245bb70d4d13c3fcb1fffb36e2d55d3ab54cefe
SPL: FIT: rework U-Boot image loading

Currently the SPL FIT loader always looks only for the first image in
the /images node a FIT tree, which it loads and later executes.

Generalize this by looking for a "firmware" property in the matched
configuration subnode, or, if that does not exist, for the first string
in the "loadables" property. Then using the string in that property,
load the image of that name from the /images node.
This still loads only one image at the moment, but refactors the code to
allow extending this in a following patch.
To simplify later re-usage, we also generalize the spl_fit_select_index()
function to not return the image location, but just the node offset.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Jagan Teki <jagan@openedev.com>
(cherry picked from commit 736806fbfa7a0ffc2bc18c1521e42ac578b1ad1e)
common/spl/spl_fit.c