aboutsummaryrefslogtreecommitdiff
path: root/common/update.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-22 17:46:02 +0200
committerMarek Vasut <marex@denx.de>2020-09-01 14:47:43 +0200
commit73f4ebb659df4996e154b17f14866fb166447be0 (patch)
tree840d05be38ffc1690c7e9aedc291c067c0731189 /common/update.c
parent9337037518e7a1fb8d2e16e1eaacfea8b1fb5b01 (diff)
downloadu-boot-73f4ebb659df4996e154b17f14866fb166447be0.zip
u-boot-73f4ebb659df4996e154b17f14866fb166447be0.tar.gz
u-boot-73f4ebb659df4996e154b17f14866fb166447be0.tar.bz2
dfu: fix dfu tftp on sandbox
The environment variable loadaddr is in the virtual address space of the sandbox. To get the actual memory address where the FIT image has been loaded we have to convert this address according to the memory mapping of the sandbox. Equally the addresses in the *.its file have to be converted when used in the dfu_ram driver. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'common/update.c')
-rw-r--r--common/update.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/update.c b/common/update.c
index d885479..36b6b75 100644
--- a/common/update.c
+++ b/common/update.c
@@ -24,6 +24,7 @@
#include <net.h>
#include <net/tftp.h>
#include <malloc.h>
+#include <mapmem.h>
#include <dfu.h>
#include <errno.h>
#include <mtd/cfi_flash.h>
@@ -280,7 +281,7 @@ int update_tftp(ulong addr, char *interface, char *devstring)
}
got_update_file:
- fit = (void *)addr;
+ fit = map_sysmem(addr, 0);
if (!fit_check_format((void *)fit)) {
printf("Bad FIT format of the update file, aborting "