summaryrefslogtreecommitdiff
path: root/common/cmd_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_mem.c')
-rw-r--r--common/cmd_mem.c73
1 files changed, 70 insertions, 3 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index aca6926..944aada 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -29,7 +29,6 @@
#include <common.h>
#include <command.h>
-#include <cmd_mem.h>
#if (CONFIG_COMMANDS & CFG_CMD_MMC)
#include <mmc.h>
#endif
@@ -148,7 +147,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
addr += size;
}
-
+
} else { /* addr does not correspond to DataFlash */
#endif
for (i=0; i<linebytes; i+= size) {
@@ -416,7 +415,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("done\n");
return 0;
}
-
+
/* Check if we are copying from DataFlash to RAM */
if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
read_dataflash(addr, count * size, (char *) dest);
@@ -960,4 +959,72 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
+/**************************************************/
+#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+cmd_tbl_t U_BOOT_CMD(MD) = MK_CMD_ENTRY(
+ "md", 3, 1, do_mem_md,
+ "md - memory display\n",
+ "[.b, .w, .l] address [# of objects]\n - memory display\n"
+);
+
+
+cmd_tbl_t U_BOOT_CMD(MM) = MK_CMD_ENTRY(
+ "mm", 2, 1, do_mem_mm,
+ "mm - memory modify (auto-incrementing)\n",
+ "[.b, .w, .l] address\n" " - memory modify, auto increment address\n"
+);
+
+
+cmd_tbl_t U_BOOT_CMD(NM) = MK_CMD_ENTRY(
+ "nm", 2, 1, do_mem_nm,
+ "nm - memory modify (constant address)\n",
+ "[.b, .w, .l] address\n - memory modify, read and keep address\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(MW) = MK_CMD_ENTRY(
+ "mw", 4, 1, do_mem_mw,
+ "mw - memory write (fill)\n",
+ "[.b, .w, .l] address value [count]\n - write memory\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(CP) = MK_CMD_ENTRY(
+ "cp", 4, 1, do_mem_cp,
+ "cp - memory copy\n",
+ "[.b, .w, .l] source target count\n - copy memory\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(CMP) = MK_CMD_ENTRY(
+ "cmp", 4, 1, do_mem_cmp,
+ "cmp - memory compare\n",
+ "[.b, .w, .l] addr1 addr2 count\n - compare memory\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(CRC32) = MK_CMD_ENTRY(
+ "crc32", 4, 1, do_mem_crc,
+ "crc32 - checksum calculation\n",
+ "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(BASE) = MK_CMD_ENTRY(
+ "base", 2, 1, do_mem_base,
+ "base - print or set address offset\n",
+ "\n - print address offset for memory commands\n"
+ "base off\n - set address offset for memory commands to 'off'\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(LOOP) = MK_CMD_ENTRY(
+ "loop", 3, 1, do_mem_loop,
+ "loop - infinite loop on address range\n",
+ "[.b, .w, .l] address number_of_objects\n"
+ " - loop on a set of addresses\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(MTEST) = MK_CMD_ENTRY(
+ "mtest", 4, 1, do_mem_mtest,
+ "mtest - simple RAM test\n",
+ "[start [end [pattern]]]\n"
+ " - simple RAM read/write test\n"
+);
+
+#endif
#endif /* CFG_CMD_MEMORY */