]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Change md command to use map_physmem
authorSimon Glass <sjg@chromium.org>
Tue, 25 Oct 2011 13:51:09 +0000 (13:51 +0000)
committerWolfgang Denk <wd@denx.de>
Thu, 3 Nov 2011 21:35:01 +0000 (22:35 +0100)
Sandbox wants to support commands which use memory. The map_physmen()
call provides this feature, so should be used more consistently in
U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Matthias Weisser <weisserm@arcor.de>
common/cmd_mem.c

index 28476d750b0e6f76a87fa8c7a9eb0d823365e682..461ee1977d59d4e57f84203c514635b509cacb05 100644 (file)
@@ -33,6 +33,7 @@
 #include <dataflash.h>
 #endif
 #include <watchdog.h>
+#include <asm/io.h>
 
 #ifdef CMD_MEM_DEBUG
 #define        PRINTF(fmt,args...)     printf (fmt ,##args)
@@ -141,9 +142,13 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 # endif
 
        {
+               ulong bytes = size * length;
+               void *buf = map_physmem(addr, bytes, MAP_WRBACK);
+
                /* Print the lines. */
-               print_buffer(addr, (void*)addr, size, length, DISP_LINE_LEN/size);
-               addr += size*length;
+               print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
+               addr += bytes;
+               unmap_physmem(buf, bytes);
        }
 #endif