3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * Copied from FADS ROM, Dan Malek (dmalek@jlc.net)
32 #if (CONFIG_COMMANDS & CFG_CMD_MMC)
35 #ifdef CONFIG_HAS_DATAFLASH
36 #include <dataflash.h>
39 #if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \
44 int cmd_get_data_size(char* arg, int default_size)
46 /* Check for a size specification .b, .w or .l.
48 int len = strlen(arg);
49 if (len > 2 && arg[len-2] == '.') {
67 #if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
70 #define PRINTF(fmt,args...) printf (fmt ,##args)
72 #define PRINTF(fmt,args...)
75 static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
77 /* Display values from last command.
78 * Memory modify remembered values are different from display memory.
80 uint dp_last_addr, dp_last_size;
81 uint dp_last_length = 0x40;
82 uint mm_last_addr, mm_last_size;
84 static ulong base_address = 0;
89 * md{.b, .w, .l} {addr} {len}
91 #define DISP_LINE_LEN 16
92 int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
95 #if defined(CONFIG_HAS_DATAFLASH)
96 ulong nbytes, linebytes;
101 /* We use the last specified parameters, unless new ones are
106 length = dp_last_length;
109 printf ("Usage:\n%s\n", cmdtp->usage);
113 if ((flag & CMD_FLAG_REPEAT) == 0) {
114 /* New command specified. Check for a size specification.
115 * Defaults to long if no or incorrect specification.
117 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
120 /* Address is specified since argc > 1
122 addr = simple_strtoul(argv[1], NULL, 16);
123 addr += base_address;
125 /* If another parameter, it is the length to display.
126 * Length is the number of objects, not number of bytes.
129 length = simple_strtoul(argv[2], NULL, 16);
132 #if defined(CONFIG_HAS_DATAFLASH)
135 * We buffer all read data, so we can make sure data is read only
136 * once, and all accesses are with the specified bus width.
138 nbytes = length * size;
140 char linebuf[DISP_LINE_LEN];
142 linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
144 rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
145 p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
146 print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
154 } while (nbytes > 0);
156 /* Print the lines. */
157 print_buffer(addr, (void*)addr, size, length, DISP_LINE_LEN/size);
162 dp_last_length = length;
167 int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
169 return mod_mem (cmdtp, 1, flag, argc, argv);
171 int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
173 return mod_mem (cmdtp, 0, flag, argc, argv);
176 int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
178 ulong addr, writeval, count;
181 if ((argc < 3) || (argc > 4)) {
182 printf ("Usage:\n%s\n", cmdtp->usage);
186 /* Check for size specification.
188 if ((size = cmd_get_data_size(argv[0], 4)) < 1)
191 /* Address is specified since argc > 1
193 addr = simple_strtoul(argv[1], NULL, 16);
194 addr += base_address;
196 /* Get the value to write.
198 writeval = simple_strtoul(argv[2], NULL, 16);
202 count = simple_strtoul(argv[3], NULL, 16);
207 while (count-- > 0) {
209 *((ulong *)addr) = (ulong )writeval;
211 *((ushort *)addr) = (ushort)writeval;
213 *((u_char *)addr) = (u_char)writeval;
219 #ifdef CONFIG_MX_CYCLIC
220 int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
226 printf ("Usage:\n%s\n", cmdtp->usage);
230 count = simple_strtoul(argv[3], NULL, 10);
233 do_mem_md (NULL, 0, 3, argv);
235 /* delay for <count> ms... */
236 for (i=0; i<count; i++)
239 /* check for ctrl-c to abort... */
249 int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
255 printf ("Usage:\n%s\n", cmdtp->usage);
259 count = simple_strtoul(argv[3], NULL, 10);
262 do_mem_mw (NULL, 0, 3, argv);
264 /* delay for <count> ms... */
265 for (i=0; i<count; i++)
268 /* check for ctrl-c to abort... */
277 #endif /* CONFIG_MX_CYCLIC */
279 int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
281 ulong addr1, addr2, count, ngood;
286 printf ("Usage:\n%s\n", cmdtp->usage);
290 /* Check for size specification.
292 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
295 addr1 = simple_strtoul(argv[1], NULL, 16);
296 addr1 += base_address;
298 addr2 = simple_strtoul(argv[2], NULL, 16);
299 addr2 += base_address;
301 count = simple_strtoul(argv[3], NULL, 16);
303 #ifdef CONFIG_HAS_DATAFLASH
304 if (addr_dataflash(addr1) | addr_dataflash(addr2)){
305 puts ("Comparison with DataFlash space not supported.\n\r");
312 while (count-- > 0) {
314 ulong word1 = *(ulong *)addr1;
315 ulong word2 = *(ulong *)addr2;
316 if (word1 != word2) {
317 printf("word at 0x%08lx (0x%08lx) "
318 "!= word at 0x%08lx (0x%08lx)\n",
319 addr1, word1, addr2, word2);
324 else if (size == 2) {
325 ushort hword1 = *(ushort *)addr1;
326 ushort hword2 = *(ushort *)addr2;
327 if (hword1 != hword2) {
328 printf("halfword at 0x%08lx (0x%04x) "
329 "!= halfword at 0x%08lx (0x%04x)\n",
330 addr1, hword1, addr2, hword2);
336 u_char byte1 = *(u_char *)addr1;
337 u_char byte2 = *(u_char *)addr2;
338 if (byte1 != byte2) {
339 printf("byte at 0x%08lx (0x%02x) "
340 "!= byte at 0x%08lx (0x%02x)\n",
341 addr1, byte1, addr2, byte2);
351 printf("Total of %ld %s%s were the same\n",
352 ngood, size == 4 ? "word" : size == 2 ? "halfword" : "byte",
353 ngood == 1 ? "" : "s");
357 int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
359 ulong addr, dest, count;
363 printf ("Usage:\n%s\n", cmdtp->usage);
367 /* Check for size specification.
369 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
372 addr = simple_strtoul(argv[1], NULL, 16);
373 addr += base_address;
375 dest = simple_strtoul(argv[2], NULL, 16);
376 dest += base_address;
378 count = simple_strtoul(argv[3], NULL, 16);
381 puts ("Zero length ???\n");
386 /* check if we are copying to Flash */
387 if ( (addr2info(dest) != NULL)
388 #ifdef CONFIG_HAS_DATAFLASH
389 && (!addr_dataflash(addr))
394 puts ("Copy to Flash... ");
396 rc = flash_write ((char *)addr, dest, count*size);
406 #if (CONFIG_COMMANDS & CFG_CMD_MMC)
407 if (mmc2info(dest)) {
410 puts ("Copy to MMC... ");
411 switch (rc = mmc_write ((uchar *)addr, dest, count*size)) {
419 printf ("%s[%d] FIXME: rc=%d\n",__FILE__,__LINE__,rc);
426 if (mmc2info(addr)) {
429 puts ("Copy from MMC... ");
430 switch (rc = mmc_read (addr, (uchar *)dest, count*size)) {
438 printf ("%s[%d] FIXME: rc=%d\n",__FILE__,__LINE__,rc);
446 #ifdef CONFIG_HAS_DATAFLASH
447 /* Check if we are copying from RAM or Flash to DataFlash */
448 if (addr_dataflash(dest) && !addr_dataflash(addr)){
451 puts ("Copy to DataFlash... ");
453 rc = write_dataflash (dest, addr, count*size);
456 dataflash_perror (rc);
463 /* Check if we are copying from DataFlash to RAM */
464 if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
466 rc = read_dataflash(addr, count * size, (char *) dest);
468 dataflash_perror (rc);
474 if (addr_dataflash(addr) && addr_dataflash(dest)){
475 puts ("Unsupported combination of source/destination.\n\r");
480 while (count-- > 0) {
482 *((ulong *)dest) = *((ulong *)addr);
484 *((ushort *)dest) = *((ushort *)addr);
486 *((u_char *)dest) = *((u_char *)addr);
493 int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
496 /* Set new base address.
498 base_address = simple_strtoul(argv[1], NULL, 16);
500 /* Print the current base address.
502 printf("Base Address: 0x%08lx\n", base_address);
506 int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
508 ulong addr, length, i, junk;
510 volatile uint *longp;
511 volatile ushort *shortp;
515 printf ("Usage:\n%s\n", cmdtp->usage);
519 /* Check for a size spefication.
520 * Defaults to long if no or incorrect specification.
522 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
525 /* Address is always specified.
527 addr = simple_strtoul(argv[1], NULL, 16);
529 /* Length is the number of objects, not number of bytes.
531 length = simple_strtoul(argv[2], NULL, 16);
533 /* We want to optimize the loops to run as fast as possible.
534 * If we have only one object, just run infinite loops.
538 longp = (uint *)addr;
543 shortp = (ushort *)addr;
554 longp = (uint *)addr;
562 shortp = (ushort *)addr;
577 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
579 ulong addr, length, i, data;
581 volatile uint *longp;
582 volatile ushort *shortp;
586 printf ("Usage:\n%s\n", cmdtp->usage);
590 /* Check for a size spefication.
591 * Defaults to long if no or incorrect specification.
593 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
596 /* Address is always specified.
598 addr = simple_strtoul(argv[1], NULL, 16);
600 /* Length is the number of objects, not number of bytes.
602 length = simple_strtoul(argv[2], NULL, 16);
605 data = simple_strtoul(argv[3], NULL, 16);
607 /* We want to optimize the loops to run as fast as possible.
608 * If we have only one object, just run infinite loops.
612 longp = (uint *)addr;
617 shortp = (ushort *)addr;
628 longp = (uint *)addr;
636 shortp = (ushort *)addr;
649 #endif /* CONFIG_LOOPW */
652 * Perform a memory test. A more complete alternative test can be
653 * configured using CFG_ALT_MEMTEST. The complete test loops until
654 * interrupted by ctrl-c or by a failure of one of the sub-tests.
656 int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
658 vu_long *addr, *start, *end;
662 #if defined(CFG_ALT_MEMTEST)
668 vu_long anti_pattern;
670 #if defined(CFG_MEMTEST_SCRATCH)
671 vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
673 vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
678 static const ulong bitpattern[] = {
679 0x00000001, /* single bit */
680 0x00000003, /* two adjacent bits */
681 0x00000007, /* three adjacent bits */
682 0x0000000F, /* four adjacent bits */
683 0x00000005, /* two non-adjacent bits */
684 0x00000015, /* three non-adjacent bits */
685 0x00000055, /* four non-adjacent bits */
686 0xaaaaaaaa, /* alternating 1/0 */
695 start = (ulong *)simple_strtoul(argv[1], NULL, 16);
697 start = (ulong *)CFG_MEMTEST_START;
701 end = (ulong *)simple_strtoul(argv[2], NULL, 16);
703 end = (ulong *)(CFG_MEMTEST_END);
707 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
712 #if defined(CFG_ALT_MEMTEST)
713 printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
714 PRINTF("%s:%d: start 0x%p end 0x%p\n",
715 __FUNCTION__, __LINE__, start, end);
723 printf("Iteration: %6d\r", iterations);
724 PRINTF("Iteration: %6d\n", iterations);
728 * Data line test: write a pattern to the first
729 * location, write the 1's complement to a 'parking'
730 * address (changes the state of the data bus so a
731 * floating bus doen't give a false OK), and then
732 * read the value back. Note that we read it back
733 * into a variable because the next time we read it,
734 * it might be right (been there, tough to explain to
735 * the quality guys why it prints a failure when the
736 * "is" and "should be" are obviously the same in the
739 * Rather than exhaustively testing, we test some
740 * patterns by shifting '1' bits through a field of
741 * '0's and '0' bits through a field of '1's (i.e.
742 * pattern and ~pattern).
745 for (j = 0; j < sizeof(bitpattern)/sizeof(bitpattern[0]); j++) {
747 for(; val != 0; val <<= 1) {
749 *dummy = ~val; /* clear the test data off of the bus */
751 if(readback != val) {
752 printf ("FAILURE (data line): "
753 "expected %08lx, actual %08lx\n",
759 if(readback != ~val) {
760 printf ("FAILURE (data line): "
761 "Is %08lx, should be %08lx\n",
768 * Based on code whose Original Author and Copyright
769 * information follows: Copyright (c) 1998 by Michael
770 * Barr. This software is placed into the public
771 * domain and may be used for any purpose. However,
772 * this notice must not be changed or removed and no
773 * warranty is either expressed or implied by its
774 * publication or distribution.
780 * Description: Test the address bus wiring in a
781 * memory region by performing a walking
782 * 1's test on the relevant bits of the
783 * address and checking for aliasing.
784 * This test will find single-bit
785 * address failures such as stuck -high,
786 * stuck-low, and shorted pins. The base
787 * address and size of the region are
788 * selected by the caller.
790 * Notes: For best results, the selected base
791 * address should have enough LSB 0's to
792 * guarantee single address bit changes.
793 * For example, to test a 64-Kbyte
794 * region, select a base address on a
795 * 64-Kbyte boundary. Also, select the
796 * region size as a power-of-two if at
799 * Returns: 0 if the test succeeds, 1 if the test fails.
801 * ## NOTE ## Be sure to specify start and end
802 * addresses such that addr_mask has
803 * lots of bits set. For example an
804 * address range of 01000000 02000000 is
805 * bad while a range of 01000000
806 * 01ffffff is perfect.
808 addr_mask = ((ulong)end - (ulong)start)/sizeof(vu_long);
809 pattern = (vu_long) 0xaaaaaaaa;
810 anti_pattern = (vu_long) 0x55555555;
812 PRINTF("%s:%d: addr mask = 0x%.8lx\n",
813 __FUNCTION__, __LINE__,
816 * Write the default pattern at each of the
817 * power-of-two offsets.
819 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
820 start[offset] = pattern;
824 * Check for address bits stuck high.
827 start[test_offset] = anti_pattern;
829 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
830 temp = start[offset];
831 if (temp != pattern) {
832 printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
833 " expected 0x%.8lx, actual 0x%.8lx\n",
834 (ulong)&start[offset], pattern, temp);
838 start[test_offset] = pattern;
841 * Check for addr bits stuck low or shorted.
843 for (test_offset = 1; (test_offset & addr_mask) != 0; test_offset <<= 1) {
844 start[test_offset] = anti_pattern;
846 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
847 temp = start[offset];
848 if ((temp != pattern) && (offset != test_offset)) {
849 printf ("\nFAILURE: Address bit stuck low or shorted @"
850 " 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
851 (ulong)&start[offset], pattern, temp);
855 start[test_offset] = pattern;
859 * Description: Test the integrity of a physical
860 * memory device by performing an
861 * increment/decrement test over the
862 * entire region. In the process every
863 * storage bit in the device is tested
864 * as a zero and a one. The base address
865 * and the size of the region are
866 * selected by the caller.
868 * Returns: 0 if the test succeeds, 1 if the test fails.
870 num_words = ((ulong)end - (ulong)start)/sizeof(vu_long) + 1;
873 * Fill memory with a known pattern.
875 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
876 start[offset] = pattern;
880 * Check each location and invert it for the second pass.
882 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
883 temp = start[offset];
884 if (temp != pattern) {
885 printf ("\nFAILURE (read/write) @ 0x%.8lx:"
886 " expected 0x%.8lx, actual 0x%.8lx)\n",
887 (ulong)&start[offset], pattern, temp);
891 anti_pattern = ~pattern;
892 start[offset] = anti_pattern;
896 * Check each location for the inverted pattern and zero it.
898 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
899 anti_pattern = ~pattern;
900 temp = start[offset];
901 if (temp != anti_pattern) {
902 printf ("\nFAILURE (read/write): @ 0x%.8lx:"
903 " expected 0x%.8lx, actual 0x%.8lx)\n",
904 (ulong)&start[offset], anti_pattern, temp);
911 #else /* The original, quickie test */
919 printf ("\rPattern %08lX Writing..."
921 "\b\b\b\b\b\b\b\b\b\b",
924 for (addr=start,val=pattern; addr<end; addr++) {
931 for (addr=start,val=pattern; addr<end; addr++) {
933 if (readback != val) {
934 printf ("\nMem error @ 0x%08X: "
935 "found %08lX, expected %08lX\n",
936 (uint)addr, readback, val);
943 * Flip the pattern each time to make lots of zeros and
944 * then, the next time, lots of ones. We decrement
945 * the "negative" patterns and increment the "positive"
946 * patterns to preserve this feature.
948 if(pattern & 0x80000000) {
949 pattern = -pattern; /* complement & increment */
964 * mm{.b, .w, .l} {addr}
965 * nm{.b, .w, .l} {addr}
968 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
972 extern char console_buffer[];
975 printf ("Usage:\n%s\n", cmdtp->usage);
979 #ifdef CONFIG_BOOT_RETRY_TIME
980 reset_cmd_timeout(); /* got a good command to get here */
982 /* We use the last specified parameters, unless new ones are
988 if ((flag & CMD_FLAG_REPEAT) == 0) {
989 /* New command specified. Check for a size specification.
990 * Defaults to long if no or incorrect specification.
992 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
995 /* Address is specified since argc > 1
997 addr = simple_strtoul(argv[1], NULL, 16);
998 addr += base_address;
1001 #ifdef CONFIG_HAS_DATAFLASH
1002 if (addr_dataflash(addr)){
1003 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
1008 /* Print the address, followed by value. Then accept input for
1009 * the next value. A non-converted value exits.
1012 printf("%08lx:", addr);
1014 printf(" %08x", *((uint *)addr));
1016 printf(" %04x", *((ushort *)addr));
1018 printf(" %02x", *((u_char *)addr));
1020 nbytes = readline (" ? ");
1021 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
1022 /* <CR> pressed as only input, don't modify current
1023 * location and move to next. "-" pressed will go back.
1026 addr += nbytes ? -size : size;
1028 #ifdef CONFIG_BOOT_RETRY_TIME
1029 reset_cmd_timeout(); /* good enough to not time out */
1032 #ifdef CONFIG_BOOT_RETRY_TIME
1033 else if (nbytes == -2) {
1034 break; /* timed out, exit the command */
1039 i = simple_strtoul(console_buffer, &endp, 16);
1040 nbytes = endp - console_buffer;
1042 #ifdef CONFIG_BOOT_RETRY_TIME
1043 /* good enough to not time out
1045 reset_cmd_timeout();
1048 *((uint *)addr) = i;
1050 *((ushort *)addr) = i;
1052 *((u_char *)addr) = i;
1059 mm_last_addr = addr;
1060 mm_last_size = size;
1064 #ifndef CONFIG_CRC32_VERIFY
1066 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1073 printf ("Usage:\n%s\n", cmdtp->usage);
1077 addr = simple_strtoul (argv[1], NULL, 16);
1078 addr += base_address;
1080 length = simple_strtoul (argv[2], NULL, 16);
1082 crc = crc32 (0, (const uchar *) addr, length);
1084 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1085 addr, addr + length - 1, crc);
1088 ptr = (ulong *) simple_strtoul (argv[3], NULL, 16);
1095 #else /* CONFIG_CRC32_VERIFY */
1097 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1109 printf ("Usage:\n%s\n", cmdtp->usage);
1115 if (strcmp(*av, "-v") == 0) {
1124 addr = simple_strtoul(*av++, NULL, 16);
1125 addr += base_address;
1126 length = simple_strtoul(*av++, NULL, 16);
1128 crc = crc32(0, (const uchar *) addr, length);
1131 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1132 addr, addr + length - 1, crc);
1134 ptr = (ulong *) simple_strtoul (*av++, NULL, 16);
1138 vcrc = simple_strtoul(*av++, NULL, 16);
1140 printf ("CRC32 for %08lx ... %08lx ==> %08lx != %08lx ** ERROR **\n",
1141 addr, addr + length - 1, crc, vcrc);
1149 #endif /* CONFIG_CRC32_VERIFY */
1151 /**************************************************/
1152 #if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
1154 md, 3, 1, do_mem_md,
1155 "md - memory display\n",
1156 "[.b, .w, .l] address [# of objects]\n - memory display\n"
1161 mm, 2, 1, do_mem_mm,
1162 "mm - memory modify (auto-incrementing)\n",
1163 "[.b, .w, .l] address\n" " - memory modify, auto increment address\n"
1168 nm, 2, 1, do_mem_nm,
1169 "nm - memory modify (constant address)\n",
1170 "[.b, .w, .l] address\n - memory modify, read and keep address\n"
1174 mw, 4, 1, do_mem_mw,
1175 "mw - memory write (fill)\n",
1176 "[.b, .w, .l] address value [count]\n - write memory\n"
1180 cp, 4, 1, do_mem_cp,
1181 "cp - memory copy\n",
1182 "[.b, .w, .l] source target count\n - copy memory\n"
1186 cmp, 4, 1, do_mem_cmp,
1187 "cmp - memory compare\n",
1188 "[.b, .w, .l] addr1 addr2 count\n - compare memory\n"
1191 #ifndef CONFIG_CRC32_VERIFY
1194 crc32, 4, 1, do_mem_crc,
1195 "crc32 - checksum calculation\n",
1196 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1199 #else /* CONFIG_CRC32_VERIFY */
1202 crc32, 5, 1, do_mem_crc,
1203 "crc32 - checksum calculation\n",
1204 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1205 "-v address count crc\n - verify crc of memory area\n"
1208 #endif /* CONFIG_CRC32_VERIFY */
1211 base, 2, 1, do_mem_base,
1212 "base - print or set address offset\n",
1213 "\n - print address offset for memory commands\n"
1214 "base off\n - set address offset for memory commands to 'off'\n"
1218 loop, 3, 1, do_mem_loop,
1219 "loop - infinite loop on address range\n",
1220 "[.b, .w, .l] address number_of_objects\n"
1221 " - loop on a set of addresses\n"
1226 loopw, 4, 1, do_mem_loopw,
1227 "loopw - infinite write loop on address range\n",
1228 "[.b, .w, .l] address number_of_objects data_to_write\n"
1229 " - loop on a set of addresses\n"
1231 #endif /* CONFIG_LOOPW */
1234 mtest, 4, 1, do_mem_mtest,
1235 "mtest - simple RAM test\n",
1236 "[start [end [pattern]]]\n"
1237 " - simple RAM read/write test\n"
1240 #ifdef CONFIG_MX_CYCLIC
1242 mdc, 4, 1, do_mem_mdc,
1243 "mdc - memory display cyclic\n",
1244 "[.b, .w, .l] address count delay(ms)\n - memory display cyclic\n"
1248 mwc, 4, 1, do_mem_mwc,
1249 "mwc - memory write cyclic\n",
1250 "[.b, .w, .l] address value delay(ms)\n - memory write cyclic\n"
1252 #endif /* CONFIG_MX_CYCLIC */
1255 #endif /* CFG_CMD_MEMORY */