]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_mem.c
onenand: rename 16 bit memory copy into memcpy_16() to avoid conflicts
[u-boot] / common / cmd_mem.c
index ed91f27046b52c5c6dd3f0208f708d3f02bd09aa..51aa71fca84999b17fd451eb0607925732a22baa 100644 (file)
@@ -35,6 +35,7 @@
 #ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
 #endif
+#include <watchdog.h>
 
 #if defined(CONFIG_CMD_MEMORY)         \
     || defined(CONFIG_CMD_I2C)         \
@@ -417,7 +418,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;
@@ -492,7 +493,11 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        /* Check if we are copying from DataFlash to RAM */
-       if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
+       if (addr_dataflash(addr) && !addr_dataflash(dest)
+#ifndef CFG_NO_FLASH
+                                && (addr2info(dest) == NULL)
+#endif
+          ){
                int rc;
                rc = read_dataflash(addr, count * size, (char *) dest);
                if (rc != 1) {
@@ -868,6 +873,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                    }
                }
                start[test_offset] = pattern;
+               WATCHDOG_RESET();
 
                /*
                 * Check for addr bits stuck low or shorted.
@@ -905,6 +911,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                 * Fill memory with a known pattern.
                 */
                for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+                       WATCHDOG_RESET();
                        start[offset] = pattern;
                }
 
@@ -912,6 +919,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                 * Check each location and invert it for the second pass.
                 */
                for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+                   WATCHDOG_RESET();
                    temp = start[offset];
                    if (temp != pattern) {
                        printf ("\nFAILURE (read/write) @ 0x%.8lx:"
@@ -928,6 +936,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                 * Check each location for the inverted pattern and zero it.
                 */
                for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+                   WATCHDOG_RESET();
                    anti_pattern = ~pattern;
                    temp = start[offset];
                    if (temp != anti_pattern) {
@@ -954,6 +963,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        pattern, "");
 
                for (addr=start,val=pattern; addr<end; addr++) {
+                       WATCHDOG_RESET();
                        *addr = val;
                        val  += incr;
                }
@@ -961,6 +971,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                puts ("Reading...");
 
                for (addr=start,val=pattern; addr<end; addr++) {
+                       WATCHDOG_RESET();
                        readback = *addr;
                        if (readback != val) {
                                printf ("\nMem error @ 0x%08X: "