mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-29 10:01:43 +00:00
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>
This commit is contained in:
parent
b5728756e8
commit
355a835747
1 changed files with 7 additions and 2 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <dataflash.h>
|
#include <dataflash.h>
|
||||||
#endif
|
#endif
|
||||||
#include <watchdog.h>
|
#include <watchdog.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
#ifdef CMD_MEM_DEBUG
|
#ifdef CMD_MEM_DEBUG
|
||||||
#define PRINTF(fmt,args...) printf (fmt ,##args)
|
#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
|
# endif
|
||||||
|
|
||||||
{
|
{
|
||||||
|
ulong bytes = size * length;
|
||||||
|
void *buf = map_physmem(addr, bytes, MAP_WRBACK);
|
||||||
|
|
||||||
/* Print the lines. */
|
/* Print the lines. */
|
||||||
print_buffer(addr, (void*)addr, size, length, DISP_LINE_LEN/size);
|
print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
|
||||||
addr += size*length;
|
addr += bytes;
|
||||||
|
unmap_physmem(buf, bytes);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue