[PATCH v2 13/35] dm: core: Support sandbox with read interface

Simon Glass sjg at chromium.org
Sat Jul 30 23:52:15 CEST 2022


Update the 'read' command to work correctly with sandbox.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 cmd/read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/read.c b/cmd/read.c
index 99c7e3854e1..fecfadaa1fa 100644
--- a/cmd/read.c
+++ b/cmd/read.c
@@ -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);
 
-- 
2.37.1.455.g008518b4e5-goog



More information about the U-Boot mailing list