From: Kim B. Heino <Kim.Heino@bluegiga.com>
Date: Mon, 3 Mar 2008 08:39:13 +0000 (+0200)
Subject: fix copy from ram to dataflash
X-Git-Tag: v2025.01-rc5-pxa1908~22462
X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-favicon.png?a=commitdiff_plain;h=84d0c2f1e39caff58bf765a7ab7c72da23c25ec8;p=u-boot.git

fix copy from ram to dataflash

If I try to "cp.b <ram> <dataflash>", u-boot selects normal flash
routines instead of dataflash. This is because it checks "if source
address is not dataflash" instead of target address.

Signed-off-by: Kim B. Heino <Kim.Heino@bluegiga.com>
---

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index ed91f27046..4262e26a61 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -417,7 +417,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	/* check if we are copying to Flash */
 	if ( (addr2info(dest) != NULL)
 #ifdef CONFIG_HAS_DATAFLASH
-	   && (!addr_dataflash(addr))
+	   && (!addr_dataflash(dest))
 #endif
 	   ) {
 		int rc;