@@ -36,12 +36,12 @@ static int is_printable_string(const void *data, int len);
*/
struct fdt_header *working_fdt;
-void set_working_fdt_addr(ulong addr)
+void set_working_fdt(char *fdt)
{
- void *buf;
+ uintptr_t addr;
- buf = map_sysmem(addr, 0);
- working_fdt = buf;
+ addr = map_to_sysmem(fdt);
+ working_fdt = fdt;
env_set_hex("fdtaddr", addr);
}
@@ -121,7 +121,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (control)
gd->fdt_blob = blob;
else
- set_working_fdt_addr(addr);
+ set_working_fdt(map_sysmem(addr, 0));
if (argc >= 2) {
int len;
@@ -262,7 +262,7 @@ int bootm_find_images(int flag, int argc, char * const argv[])
puts("Could not find a valid device tree\n");
return 1;
}
- set_working_fdt_addr((ulong)images.ft_addr);
+ set_working_fdt(images.ft_addr);
#endif
#if IMAGE_ENABLE_FIT
@@ -193,7 +193,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
*of_flat_tree = of_start;
*of_size = of_len;
- set_working_fdt_addr((ulong)*of_flat_tree);
+ set_working_fdt(*of_flat_tree);
return 0;
error:
@@ -191,7 +191,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
*/
int ft_system_setup(void *blob, bd_t *bd);
-void set_working_fdt_addr(ulong addr);
+void set_working_fdt(char *fdt);
/**
* shrink down the given blob to minimum size + some extrasize if required
When running sandbox with the new pointer sanitization we just recently introduced, we're running into a case with FIT images where we end up interpreting pointers as addresses. Since most callers of the set_working_fdt_addr() function are already at the pointer stage, let's just rename it to set_working_fdt() and pass in the pointer directly. This fixes sandbox fit tests for me. Signed-off-by: Alexander Graf <agraf@suse.de> --- cmd/fdt.c | 10 +++++----- common/bootm.c | 2 +- common/image-fdt.c | 2 +- include/fdt_support.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)