u-boot-brain/common/spl
Andre Przywara 4b9340abdc SPL: FIT: refactor FDT loading
Currently the SPL FIT loader uses the spl_fit_select_fdt() function to
find the offset to the right DTB within the FIT image.
For this it iterates over all subnodes of the /configuration node in
the FIT tree and compares all "description" strings therein using a
board specific matching function.
If that finds a match, it uses the string in the "fdt" property of that
subnode to locate the matching subnode in the /images node, which points
to the DTB data.
Now this works very well, but is quite specific to cover this particular
use case. To open up the door for a more generic usage, let's split this
function into:
1) a function that just returns the node offset for the matching
   configuration node (spl_fit_find_config_node())
2) a function that returns the image data any given property in a given
   configuration node points to, additionally using a given index into
   a possbile list of strings (spl_fit_select_index())
This allows us to replace the specific function above by asking for the
image the _first string of the "fdt" property_ in the matching
configuration subnode points to.

This patch introduces no functional changes, it just refactors the code
to allow reusing it later.

(diff is overly clever here and produces a hard-to-read patch, so I
recommend to throw a look at the result instead).

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>
2017-05-17 23:13:27 +05:30
..
Kconfig Merge branch 'master' of git://git.denx.de/u-boot-mmc 2017-05-16 08:10:50 -04:00
Makefile spl: add support to booting with ATF 2017-05-15 10:38:09 -04:00
spl_atf.c spl: add support to booting with ATF 2017-05-15 10:38:09 -04:00
spl_dfu.c spl: dfu: adding dfu support functions for SPL-DFU 2016-09-27 23:30:19 +02:00
spl_ext.c spl: Remove inline ifdef check for EXT and FAT support 2017-01-20 15:37:59 -05:00
spl_fat.c spl: Remove inline ifdef check for EXT and FAT support 2017-01-20 15:37:59 -05:00
spl_fit.c SPL: FIT: refactor FDT loading 2017-05-17 23:13:27 +05:30
spl_mmc.c SPL: Move SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION to Kconfig 2017-02-17 14:15:15 -05:00
spl_nand.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_net.c spl: net: Add FIT image support over network boot 2017-04-08 21:35:08 -04:00
spl_nor.c spl: make image arg or fdt blob address reconfigurable 2017-05-08 11:38:40 -04:00
spl_onenand.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_ram.c spl: move RAM boot support in separate file 2017-01-14 16:46:26 -05:00
spl_sata.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_spi.c spl: spi: override CONFIG_SYS_SPI_U_BOOT_OFFS via /config-property 2017-05-11 22:03:39 -04:00
spl_ubi.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_usb.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl_ymodem.c spl: Add a name to the SPL load-image methods 2016-12-09 08:40:13 -05:00
spl.c spl: add support to booting with ATF 2017-05-15 10:38:09 -04:00