summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-25 13:51:09 +0000
committerWolfgang Denk <wd@denx.de>2011-11-03 22:35:01 +0100
commit355a835747c6f7c5071ead295a7dfc489c73cb03 (patch)
tree5101c108c0151896dab797f7caa9b498bf0df8c2 /common
parentb5728756e8af5633cbda4a1ba08aa244d60e60b5 (diff)
downloadu-boot-imx-355a835747c6f7c5071ead295a7dfc489c73cb03.zip
u-boot-imx-355a835747c6f7c5071ead295a7dfc489c73cb03.tar.gz
u-boot-imx-355a835747c6f7c5071ead295a7dfc489c73cb03.tar.bz2
sandbox: Change md command to use map_physmem
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>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mem.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 28476d7..461ee19 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -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