
By using map_sysmem() we can get the fdt command to work correctly with sandbox.
Signed-off-by: Simon Glass sjg@chromium.org --- common/cmd_fdt.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index a193cc3..3d5ff0f 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -29,6 +29,7 @@ #include <linux/ctype.h> #include <linux/types.h> #include <asm/global_data.h> +#include <asm/io.h> #include <fdt.h> #include <libfdt.h> #include <fdt_support.h> @@ -56,7 +57,10 @@ struct fdt_header *working_fdt;
void set_working_fdt_addr(void *addr) { - working_fdt = addr; + void *buf; + + buf = map_sysmem((ulong)addr, 0); + working_fdt = buf; setenv_addr("fdtaddr", addr); }
@@ -132,14 +136,16 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) }
addr = simple_strtoul(argv[0], NULL, 16); - blob = (void *)addr; if (control) { #ifdef CONFIG_OF_CONTROL + blob = map_sysmem(addr, 0); if (!fdt_valid(gd->fdt_blob)) return 1; gd->fdt_blob = blob; #endif } else { + blob = map_sysmem(addr, 0); + if (!fdt_valid(blob)) return 1; set_working_fdt_addr((void *)addr);