Patchwork [U-Boot] cmd_mem: fix cp command

login
register
mail settings
Submitter Masahiro Yamada
Date May 21, 2013, 7:08 a.m.
Message ID <1369120088-28509-1-git-send-email-yamada.m@jp.panasonic.com>
Download mbox | patch
Permalink /patch/245217/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Masahiro Yamada - May 21, 2013, 7:08 a.m.
The "cp" command has not worked since
commit 0628ab8ec59834f98ede267edd21ddb8ba0bb57b,
because of the following lines, which set the destination
and the source to the same address.

	buf = map_sysmem(addr, bytes);
	src = map_sysmem(addr, bytes);

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
 common/cmd_mem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Tom Rini - May 24, 2013, 2:38 p.m.
On Tue, May 21, 2013 at 04:08:08PM +0900, Masahiro Yamada wrote:

> The "cp" command has not worked since
> commit 0628ab8ec59834f98ede267edd21ddb8ba0bb57b,
> because of the following lines, which set the destination
> and the source to the same address.
> 
> 	buf = map_sysmem(addr, bytes);
> 	src = map_sysmem(addr, bytes);
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Tested-by: Tom Rini <trini@ti.com>

Applied to u-boot/master, thanks!

Patch

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 64dd76a..6df00b1 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -445,7 +445,7 @@  static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 
 	bytes = size * count;
-	buf = map_sysmem(addr, bytes);
+	buf = map_sysmem(dest, bytes);
 	src = map_sysmem(addr, bytes);
 	while (count-- > 0) {
 		if (size == 4)