diff mbox series

mkimage: fit: fix import of external data

Message ID 20200730043148.410020-1-patrick.oppenlander@gmail.com
State Accepted
Commit c995d854efcbf54ebd99a41f9a3c918340f16376
Delegated to: Tom Rini
Headers show
Series mkimage: fit: fix import of external data | expand

Commit Message

Patrick Oppenlander July 30, 2020, 4:31 a.m. UTC
From: Patrick Oppenlander <patrick.oppenlander@gmail.com>

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Aug. 8, 2020, 12:29 p.m. UTC | #1
On Thu, Jul 30, 2020 at 02:31:48PM +1000, patrick.oppenlander@gmail.com wrote:

> From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
> 
> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/fit_image.c b/tools/fit_image.c
index df310b53da..793df54449 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -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));