ubifs: allow loading to above 4GiB
The ubifsload command is truncating any address above 4GiB as it casts
this address to an u32, instead of using an unsigned long which most of
the other load commands do. Change this to an unsigned long to allow
loading into high memory for boards which use these areas.
Fixes the following error:
=> ubifsload 0x2100000000 /boot/Image.lzma
Loading file '/boot/Image.lzma' to addr 0x00000000...
Unhandled exception: Store/AMO access fault
Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index 6a01d09..2a035bc 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -111,7 +111,7 @@
char *filename;
char *endp;
int ret;
- u32 addr;
+ unsigned long addr;
u32 size = 0;
if (!ubifs_mounted) {
@@ -133,7 +133,7 @@
if (endp == argv[3])
return CMD_RET_USAGE;
}
- debug("Loading file '%s' to address 0x%08x (size %d)\n", filename, addr, size);
+ debug("Loading file '%s' to address 0x%08lx (size %d)\n", filename, addr, size);
ret = ubifs_load(filename, addr, size);
if (ret) {