* [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem
@ 2011-10-25 23:51 Simon Glass
2011-10-26 0:02 ` Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Simon Glass @ 2011-10-25 23:51 UTC (permalink / raw)
To: u-boot
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>
---
Changes in v2:
- Remove check for NULL pointer since map_physmem apparently cannot fail
common/cmd_mem.c | 9 +++++++--
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
--
1.7.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem
2011-10-25 23:51 [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem Simon Glass
@ 2011-10-26 0:02 ` Mike Frysinger
2011-11-02 18:39 ` Matthias Weisser
2011-11-03 21:27 ` Wolfgang Denk
2 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2011-10-26 0:02 UTC (permalink / raw)
To: u-boot
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem
2011-10-25 23:51 [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem Simon Glass
2011-10-26 0:02 ` Mike Frysinger
@ 2011-11-02 18:39 ` Matthias Weisser
2011-11-02 20:59 ` Simon Glass
2011-11-03 21:27 ` Wolfgang Denk
2 siblings, 1 reply; 5+ messages in thread
From: Matthias Weisser @ 2011-11-02 18:39 UTC (permalink / raw)
To: u-boot
Am 26.10.2011 01:51, schrieb Simon Glass:
> 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>
After fixing malloc problem:
Tested-by: Matthias Weisser <weisserm@arcor.de>
Regards Matthias
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem
2011-11-02 18:39 ` Matthias Weisser
@ 2011-11-02 20:59 ` Simon Glass
0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2011-11-02 20:59 UTC (permalink / raw)
To: u-boot
Hi Matthias,
On Wed, Nov 2, 2011 at 11:39 AM, Matthias Weisser <weisserm@arcor.de> wrote:
> Am 26.10.2011 01:51, schrieb Simon Glass:
>> 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>
>
> After fixing malloc problem:
>
> Tested-by: Matthias Weisser <weisserm@arcor.de>
>
Thanks - I tracked this down to 2d01dd9 which puts dlmalloc.o in the
Makefile twice. It is fixed by your 'sandbox: Add improved RAM
simulation' so I will not submit a patch.
Regards,
Simon
> Regards Matthias
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem
2011-10-25 23:51 [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem Simon Glass
2011-10-26 0:02 ` Mike Frysinger
2011-11-02 18:39 ` Matthias Weisser
@ 2011-11-03 21:27 ` Wolfgang Denk
2 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-11-03 21:27 UTC (permalink / raw)
To: u-boot
Dear Simon Glass,
In message <1319586669-22190-1-git-send-email-sjg@chromium.org> you wrote:
> 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>
> ---
> Changes in v2:
> - Remove check for NULL pointer since map_physmem apparently cannot fail
>
> common/cmd_mem.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Unix: Some say the learning curve is steep, but you only have to
climb it once. - Karl Lehenbauer
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-03 21:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 23:51 [U-Boot] [PATCH v2] sandbox: Change md command to use map_physmem Simon Glass
2011-10-26 0:02 ` Mike Frysinger
2011-11-02 18:39 ` Matthias Weisser
2011-11-02 20:59 ` Simon Glass
2011-11-03 21:27 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox