mkimage: fit: fix import of external data
authorPatrick Oppenlander <patrick.oppenlander@gmail.com>
Thu, 30 Jul 2020 04:31:48 +0000 (14:31 +1000)
committerTom Rini <trini@konsulko.com>
Fri, 7 Aug 2020 15:47:18 +0000 (11:47 -0400)
The external data is located after the mmapped FDT pointed to by
'old_fdt', not in the newly created FDT we are importing into at 'fdt'.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
tools/fit_image.c

index f7d2f56..06faeda 100644 (file)
@@ -606,8 +606,8 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
                        continue;
                debug("Importing data size %x\n", len);
 
-               ret = fdt_setprop(fdt, node, "data", fdt + data_base + buf_ptr,
-                                 len);
+               ret = fdt_setprop(fdt, node, "data",
+                                 old_fdt + data_base + buf_ptr, len);
                if (ret) {
                        debug("%s: Failed to write property: %s\n", __func__,
                              fdt_strerror(ret));