dm: core: Support sandbox with read interface
authorSimon Glass <sjg@chromium.org>
Sat, 30 Jul 2022 21:52:15 +0000 (15:52 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 12 Aug 2022 12:14:24 +0000 (08:14 -0400)
Update the 'read' command to work correctly with sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/read.c

index 99c7e38..fecfada 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <mapmem.h>
 #include <part.h>
 
 int do_read(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
@@ -45,7 +46,7 @@ int do_read(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
                return 1;
        }
 
-       addr = (void *)hextoul(argv[3], NULL);
+       addr = map_sysmem(hextoul(argv[3], NULL), 0);
        blk = hextoul(argv[4], NULL);
        cnt = hextoul(argv[5], NULL);