diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-06-06 08:07:27 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-06-15 08:33:20 +0200 |
commit | 9199e9cb082fff290cdac2d323458f17db2a9ad0 (patch) | |
tree | 7bba3f55d0699187abf169e4d4bd40c98518010b /arch/arm/lib32 | |
parent | ed13dd918d597afd5bcce30d4dce66174435af55 (diff) | |
download | barebox-9199e9cb082fff290cdac2d323458f17db2a9ad0.tar.gz barebox-9199e9cb082fff290cdac2d323458f17db2a9ad0.tar.xz |
bootm: Split bootm_load_devicetree into two functions
It is not always desired to get the devicetree from image data and load
it to a SDRAM region at the same time. Sometimes it's enough to just
load it to an allocated address (in case the user has no constraints
where the devicetree should be placed.
This patch splits bootm_load_devicetree into bootm_get_devicetree which
returns a pointer to the allocated devicetree and bootm_load_devicetree
which loads the devicetree to a specified region.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib32')
-rw-r--r-- | arch/arm/lib32/bootm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c index a28079564d..b1ac2df731 100644 --- a/arch/arm/lib32/bootm.c +++ b/arch/arm/lib32/bootm.c @@ -165,11 +165,18 @@ static int __do_bootm_linux(struct image_data *data, unsigned long free_mem, free_mem = PAGE_ALIGN(initrd_end + 1); } + if (!fdt) { + fdt = bootm_get_devicetree(data); + if (IS_ERR(fdt)) + return PTR_ERR(fdt); + } + if (fdt) { - fdt_load_address = fdt; - } else { fdt_load_address = (void *)free_mem; - ret = bootm_load_devicetree(data, free_mem); + ret = bootm_load_devicetree(data, fdt, free_mem); + + free(fdt); + if (ret) return ret; } |