mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 23:50:26 +09:00
spl: fdt: Record load/entry fit-images entries in 64bit format
The commit 9f45aeb937
("spl: fit: implement fdt_record_loadable") which
introduced fdt_record_loadable() state there spl_fit.c is not 64bit safe.
Based on my tests on Xilinx ZynqMP zcu102 platform there shouldn't be a
problem to record these addresses in 64bit format.
The patch adds support for systems which need to load images above 4GB.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
caa7fc2c57
commit
13d1ca8742
@ -611,14 +611,9 @@ int fdt_record_loadable(void *blob, u32 index, const char *name,
|
|||||||
if (node < 0)
|
if (node < 0)
|
||||||
return node;
|
return node;
|
||||||
|
|
||||||
/*
|
fdt_setprop_u64(blob, node, "load", load_addr);
|
||||||
* We record these as 32bit entities, possibly truncating addresses.
|
|
||||||
* However, spl_fit.c is not 64bit safe either: i.e. we should not
|
|
||||||
* have an issue here.
|
|
||||||
*/
|
|
||||||
fdt_setprop_u32(blob, node, "load", load_addr);
|
|
||||||
if (entry_point != -1)
|
if (entry_point != -1)
|
||||||
fdt_setprop_u32(blob, node, "entry", entry_point);
|
fdt_setprop_u64(blob, node, "entry", entry_point);
|
||||||
fdt_setprop_u32(blob, node, "size", size);
|
fdt_setprop_u32(blob, node, "size", size);
|
||||||
if (type)
|
if (type)
|
||||||
fdt_setprop_string(blob, node, "type", type);
|
fdt_setprop_string(blob, node, "type", type);
|
||||||
|
@ -791,17 +791,18 @@ static int fit_image_get_address(const void *fit, int noffset, char *name,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > sizeof(ulong)) {
|
|
||||||
printf("Unsupported %s address size\n", name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
cell_len = len >> 2;
|
cell_len = len >> 2;
|
||||||
/* Use load64 to avoid compiling warning for 32-bit target */
|
/* Use load64 to avoid compiling warning for 32-bit target */
|
||||||
while (cell_len--) {
|
while (cell_len--) {
|
||||||
load64 = (load64 << 32) | uimage_to_cpu(*cell);
|
load64 = (load64 << 32) | uimage_to_cpu(*cell);
|
||||||
cell++;
|
cell++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len > sizeof(ulong) && (uint32_t)(load64 >> 32)) {
|
||||||
|
printf("Unsupported %s address size\n", name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
*load = (ulong)load64;
|
*load = (ulong)load64;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user