Skip to content
Snippets Groups Projects
Commit 355a8357 authored by Simon Glass's avatar Simon Glass Committed by Wolfgang Denk
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
Tested-by: default avatarMatthias Weisser <weisserm@arcor.de>
parent b5728756
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment