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 #ifdef CONFIG_HAS_DATAFLASH
33 #include <dataflash.h>
39 #define PRINTF(fmt,args...) printf (fmt ,##args)
41 #define PRINTF(fmt,args...)
44 static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
46 /* Display values from last command.
47 * Memory modify remembered values are different from display memory.
49 static uint dp_last_addr, dp_last_size;
50 static uint dp_last_length = 0x40;
51 static uint mm_last_addr, mm_last_size;
53 static ulong base_address = 0;
58 * md{.b, .w, .l} {addr} {len}
60 #define DISP_LINE_LEN 16
61 int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
64 #if defined(CONFIG_HAS_DATAFLASH)
65 ulong nbytes, linebytes;
70 /* We use the last specified parameters, unless new ones are
75 length = dp_last_length;
78 return cmd_usage(cmdtp);
80 if ((flag & CMD_FLAG_REPEAT) == 0) {
81 /* New command specified. Check for a size specification.
82 * Defaults to long if no or incorrect specification.
84 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
87 /* Address is specified since argc > 1
89 addr = simple_strtoul(argv[1], NULL, 16);
92 /* If another parameter, it is the length to display.
93 * Length is the number of objects, not number of bytes.
96 length = simple_strtoul(argv[2], NULL, 16);
99 #if defined(CONFIG_HAS_DATAFLASH)
102 * We buffer all read data, so we can make sure data is read only
103 * once, and all accesses are with the specified bus width.
105 nbytes = length * size;
107 char linebuf[DISP_LINE_LEN];
109 linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
111 rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
112 p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
113 print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
121 } while (nbytes > 0);
124 # if defined(CONFIG_BLACKFIN)
125 /* See if we're trying to display L1 inst */
126 if (addr_bfin_on_chip_mem(addr)) {
127 char linebuf[DISP_LINE_LEN];
128 ulong linebytes, nbytes = length * size;
130 linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
131 memcpy(linebuf, (void *)addr, linebytes);
132 print_buffer(addr, linebuf, size, linebytes/size, DISP_LINE_LEN/size);
140 } while (nbytes > 0);
145 ulong bytes = size * length;
146 void *buf = map_physmem(addr, bytes, MAP_WRBACK);
148 /* Print the lines. */
149 print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
151 unmap_physmem(buf, bytes);
156 dp_last_length = length;
161 int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
163 return mod_mem (cmdtp, 1, flag, argc, argv);
165 int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
167 return mod_mem (cmdtp, 0, flag, argc, argv);
170 int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
172 ulong addr, writeval, count;
175 if ((argc < 3) || (argc > 4))
176 return cmd_usage(cmdtp);
178 /* Check for size specification.
180 if ((size = cmd_get_data_size(argv[0], 4)) < 1)
183 /* Address is specified since argc > 1
185 addr = simple_strtoul(argv[1], NULL, 16);
186 addr += base_address;
188 /* Get the value to write.
190 writeval = simple_strtoul(argv[2], NULL, 16);
194 count = simple_strtoul(argv[3], NULL, 16);
199 while (count-- > 0) {
201 *((ulong *)addr) = (ulong )writeval;
203 *((ushort *)addr) = (ushort)writeval;
205 *((u_char *)addr) = (u_char)writeval;
211 #ifdef CONFIG_MX_CYCLIC
212 int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
218 return cmd_usage(cmdtp);
220 count = simple_strtoul(argv[3], NULL, 10);
223 do_mem_md (NULL, 0, 3, argv);
225 /* delay for <count> ms... */
226 for (i=0; i<count; i++)
229 /* check for ctrl-c to abort... */
239 int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
245 return cmd_usage(cmdtp);
247 count = simple_strtoul(argv[3], NULL, 10);
250 do_mem_mw (NULL, 0, 3, argv);
252 /* delay for <count> ms... */
253 for (i=0; i<count; i++)
256 /* check for ctrl-c to abort... */
265 #endif /* CONFIG_MX_CYCLIC */
267 int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
269 ulong addr1, addr2, count, ngood;
274 return cmd_usage(cmdtp);
276 /* Check for size specification.
278 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
281 addr1 = simple_strtoul(argv[1], NULL, 16);
282 addr1 += base_address;
284 addr2 = simple_strtoul(argv[2], NULL, 16);
285 addr2 += base_address;
287 count = simple_strtoul(argv[3], NULL, 16);
289 #ifdef CONFIG_HAS_DATAFLASH
290 if (addr_dataflash(addr1) | addr_dataflash(addr2)){
291 puts ("Comparison with DataFlash space not supported.\n\r");
296 #ifdef CONFIG_BLACKFIN
297 if (addr_bfin_on_chip_mem(addr1) || addr_bfin_on_chip_mem(addr2)) {
298 puts ("Comparison with L1 instruction memory not supported.\n\r");
305 while (count-- > 0) {
307 ulong word1 = *(ulong *)addr1;
308 ulong word2 = *(ulong *)addr2;
309 if (word1 != word2) {
310 printf("word at 0x%08lx (0x%08lx) "
311 "!= word at 0x%08lx (0x%08lx)\n",
312 addr1, word1, addr2, word2);
317 else if (size == 2) {
318 ushort hword1 = *(ushort *)addr1;
319 ushort hword2 = *(ushort *)addr2;
320 if (hword1 != hword2) {
321 printf("halfword at 0x%08lx (0x%04x) "
322 "!= halfword at 0x%08lx (0x%04x)\n",
323 addr1, hword1, addr2, hword2);
329 u_char byte1 = *(u_char *)addr1;
330 u_char byte2 = *(u_char *)addr2;
331 if (byte1 != byte2) {
332 printf("byte at 0x%08lx (0x%02x) "
333 "!= byte at 0x%08lx (0x%02x)\n",
334 addr1, byte1, addr2, byte2);
343 /* reset watchdog from time to time */
344 if ((count % (64 << 10)) == 0)
348 printf("Total of %ld %s%s were the same\n",
349 ngood, size == 4 ? "word" : size == 2 ? "halfword" : "byte",
350 ngood == 1 ? "" : "s");
354 int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
356 ulong addr, dest, count;
360 return cmd_usage(cmdtp);
362 /* Check for size specification.
364 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
367 addr = simple_strtoul(argv[1], NULL, 16);
368 addr += base_address;
370 dest = simple_strtoul(argv[2], NULL, 16);
371 dest += base_address;
373 count = simple_strtoul(argv[3], NULL, 16);
376 puts ("Zero length ???\n");
380 #ifndef CONFIG_SYS_NO_FLASH
381 /* check if we are copying to Flash */
382 if ( (addr2info(dest) != NULL)
383 #ifdef CONFIG_HAS_DATAFLASH
384 && (!addr_dataflash(dest))
389 puts ("Copy to Flash... ");
391 rc = flash_write ((char *)addr, dest, count*size);
401 #ifdef CONFIG_HAS_DATAFLASH
402 /* Check if we are copying from RAM or Flash to DataFlash */
403 if (addr_dataflash(dest) && !addr_dataflash(addr)){
406 puts ("Copy to DataFlash... ");
408 rc = write_dataflash (dest, addr, count*size);
411 dataflash_perror (rc);
418 /* Check if we are copying from DataFlash to RAM */
419 if (addr_dataflash(addr) && !addr_dataflash(dest)
420 #ifndef CONFIG_SYS_NO_FLASH
421 && (addr2info(dest) == NULL)
425 rc = read_dataflash(addr, count * size, (char *) dest);
427 dataflash_perror (rc);
433 if (addr_dataflash(addr) && addr_dataflash(dest)){
434 puts ("Unsupported combination of source/destination.\n\r");
439 #ifdef CONFIG_BLACKFIN
440 /* See if we're copying to/from L1 inst */
441 if (addr_bfin_on_chip_mem(dest) || addr_bfin_on_chip_mem(addr)) {
442 memcpy((void *)dest, (void *)addr, count * size);
447 while (count-- > 0) {
449 *((ulong *)dest) = *((ulong *)addr);
451 *((ushort *)dest) = *((ushort *)addr);
453 *((u_char *)dest) = *((u_char *)addr);
457 /* reset watchdog from time to time */
458 if ((count % (64 << 10)) == 0)
464 int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
467 /* Set new base address.
469 base_address = simple_strtoul(argv[1], NULL, 16);
471 /* Print the current base address.
473 printf("Base Address: 0x%08lx\n", base_address);
477 int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
479 ulong addr, length, i;
481 volatile uint *longp;
482 volatile ushort *shortp;
486 return cmd_usage(cmdtp);
488 /* Check for a size spefication.
489 * Defaults to long if no or incorrect specification.
491 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
494 /* Address is always specified.
496 addr = simple_strtoul(argv[1], NULL, 16);
498 /* Length is the number of objects, not number of bytes.
500 length = simple_strtoul(argv[2], NULL, 16);
502 /* We want to optimize the loops to run as fast as possible.
503 * If we have only one object, just run infinite loops.
507 longp = (uint *)addr;
512 shortp = (ushort *)addr;
523 longp = (uint *)addr;
531 shortp = (ushort *)addr;
546 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
548 ulong addr, length, i, data;
550 volatile uint *longp;
551 volatile ushort *shortp;
555 return cmd_usage(cmdtp);
557 /* Check for a size spefication.
558 * Defaults to long if no or incorrect specification.
560 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
563 /* Address is always specified.
565 addr = simple_strtoul(argv[1], NULL, 16);
567 /* Length is the number of objects, not number of bytes.
569 length = simple_strtoul(argv[2], NULL, 16);
572 data = simple_strtoul(argv[3], NULL, 16);
574 /* We want to optimize the loops to run as fast as possible.
575 * If we have only one object, just run infinite loops.
579 longp = (uint *)addr;
584 shortp = (ushort *)addr;
595 longp = (uint *)addr;
603 shortp = (ushort *)addr;
616 #endif /* CONFIG_LOOPW */
619 * Perform a memory test. A more complete alternative test can be
620 * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
621 * interrupted by ctrl-c or by a failure of one of the sub-tests.
623 int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
625 vu_long *addr, *start, *end;
632 #if defined(CONFIG_SYS_ALT_MEMTEST)
638 vu_long anti_pattern;
640 #if defined(CONFIG_SYS_MEMTEST_SCRATCH)
641 vu_long *dummy = (vu_long*)CONFIG_SYS_MEMTEST_SCRATCH;
643 vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
647 static const ulong bitpattern[] = {
648 0x00000001, /* single bit */
649 0x00000003, /* two adjacent bits */
650 0x00000007, /* three adjacent bits */
651 0x0000000F, /* four adjacent bits */
652 0x00000005, /* two non-adjacent bits */
653 0x00000015, /* three non-adjacent bits */
654 0x00000055, /* four non-adjacent bits */
655 0xaaaaaaaa, /* alternating 1/0 */
663 start = (ulong *)simple_strtoul(argv[1], NULL, 16);
665 start = (ulong *)CONFIG_SYS_MEMTEST_START;
668 end = (ulong *)simple_strtoul(argv[2], NULL, 16);
670 end = (ulong *)(CONFIG_SYS_MEMTEST_END);
673 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
678 iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
682 #if defined(CONFIG_SYS_ALT_MEMTEST)
683 printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
684 PRINTF("%s:%d: start 0x%p end 0x%p\n",
685 __FUNCTION__, __LINE__, start, end);
694 if (iteration_limit && iterations > iteration_limit) {
695 printf("Tested %d iteration(s) with %lu errors.\n",
700 printf("Iteration: %6d\r", iterations);
705 * Data line test: write a pattern to the first
706 * location, write the 1's complement to a 'parking'
707 * address (changes the state of the data bus so a
708 * floating bus doen't give a false OK), and then
709 * read the value back. Note that we read it back
710 * into a variable because the next time we read it,
711 * it might be right (been there, tough to explain to
712 * the quality guys why it prints a failure when the
713 * "is" and "should be" are obviously the same in the
716 * Rather than exhaustively testing, we test some
717 * patterns by shifting '1' bits through a field of
718 * '0's and '0' bits through a field of '1's (i.e.
719 * pattern and ~pattern).
722 for (j = 0; j < sizeof(bitpattern)/sizeof(bitpattern[0]); j++) {
724 for(; val != 0; val <<= 1) {
726 *dummy = ~val; /* clear the test data off of the bus */
728 if(readback != val) {
729 printf ("FAILURE (data line): "
730 "expected %08lx, actual %08lx\n",
741 if(readback != ~val) {
742 printf ("FAILURE (data line): "
743 "Is %08lx, should be %08lx\n",
755 * Based on code whose Original Author and Copyright
756 * information follows: Copyright (c) 1998 by Michael
757 * Barr. This software is placed into the public
758 * domain and may be used for any purpose. However,
759 * this notice must not be changed or removed and no
760 * warranty is either expressed or implied by its
761 * publication or distribution.
767 * Description: Test the address bus wiring in a
768 * memory region by performing a walking
769 * 1's test on the relevant bits of the
770 * address and checking for aliasing.
771 * This test will find single-bit
772 * address failures such as stuck -high,
773 * stuck-low, and shorted pins. The base
774 * address and size of the region are
775 * selected by the caller.
777 * Notes: For best results, the selected base
778 * address should have enough LSB 0's to
779 * guarantee single address bit changes.
780 * For example, to test a 64-Kbyte
781 * region, select a base address on a
782 * 64-Kbyte boundary. Also, select the
783 * region size as a power-of-two if at
786 * Returns: 0 if the test succeeds, 1 if the test fails.
788 len = ((ulong)end - (ulong)start)/sizeof(vu_long);
789 pattern = (vu_long) 0xaaaaaaaa;
790 anti_pattern = (vu_long) 0x55555555;
792 PRINTF("%s:%d: length = 0x%.8lx\n",
793 __FUNCTION__, __LINE__,
796 * Write the default pattern at each of the
797 * power-of-two offsets.
799 for (offset = 1; offset < len; offset <<= 1) {
800 start[offset] = pattern;
804 * Check for address bits stuck high.
807 start[test_offset] = anti_pattern;
809 for (offset = 1; offset < len; offset <<= 1) {
810 temp = start[offset];
811 if (temp != pattern) {
812 printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
813 " expected 0x%.8lx, actual 0x%.8lx\n",
814 (ulong)&start[offset], pattern, temp);
822 start[test_offset] = pattern;
826 * Check for addr bits stuck low or shorted.
828 for (test_offset = 1; test_offset < len; test_offset <<= 1) {
829 start[test_offset] = anti_pattern;
831 for (offset = 1; offset < len; offset <<= 1) {
832 temp = start[offset];
833 if ((temp != pattern) && (offset != test_offset)) {
834 printf ("\nFAILURE: Address bit stuck low or shorted @"
835 " 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
836 (ulong)&start[offset], pattern, temp);
844 start[test_offset] = pattern;
848 * Description: Test the integrity of a physical
849 * memory device by performing an
850 * increment/decrement test over the
851 * entire region. In the process every
852 * storage bit in the device is tested
853 * as a zero and a one. The base address
854 * and the size of the region are
855 * selected by the caller.
857 * Returns: 0 if the test succeeds, 1 if the test fails.
859 num_words = ((ulong)end - (ulong)start)/sizeof(vu_long) + 1;
862 * Fill memory with a known pattern.
864 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
866 start[offset] = pattern;
870 * Check each location and invert it for the second pass.
872 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
874 temp = start[offset];
875 if (temp != pattern) {
876 printf ("\nFAILURE (read/write) @ 0x%.8lx:"
877 " expected 0x%.8lx, actual 0x%.8lx)\n",
878 (ulong)&start[offset], pattern, temp);
886 anti_pattern = ~pattern;
887 start[offset] = anti_pattern;
891 * Check each location for the inverted pattern and zero it.
893 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
895 anti_pattern = ~pattern;
896 temp = start[offset];
897 if (temp != anti_pattern) {
898 printf ("\nFAILURE (read/write): @ 0x%.8lx:"
899 " expected 0x%.8lx, actual 0x%.8lx)\n",
900 (ulong)&start[offset], anti_pattern, temp);
911 #else /* The original, quickie test */
919 if (iteration_limit && iterations > iteration_limit) {
920 printf("Tested %d iteration(s) with %lu errors.\n",
926 printf ("\rPattern %08lX Writing..."
928 "\b\b\b\b\b\b\b\b\b\b",
931 for (addr=start,val=pattern; addr<end; addr++) {
939 for (addr=start,val=pattern; addr<end; addr++) {
942 if (readback != val) {
943 printf ("\nMem error @ 0x%08X: "
944 "found %08lX, expected %08lX\n",
945 (uint)(uintptr_t)addr, readback, val);
956 * Flip the pattern each time to make lots of zeros and
957 * then, the next time, lots of ones. We decrement
958 * the "negative" patterns and increment the "positive"
959 * patterns to preserve this feature.
961 if(pattern & 0x80000000) {
962 pattern = -pattern; /* complement & increment */
970 return 0; /* not reached */
977 * mm{.b, .w, .l} {addr}
978 * nm{.b, .w, .l} {addr}
981 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
985 extern char console_buffer[];
988 return cmd_usage(cmdtp);
990 #ifdef CONFIG_BOOT_RETRY_TIME
991 reset_cmd_timeout(); /* got a good command to get here */
993 /* We use the last specified parameters, unless new ones are
999 if ((flag & CMD_FLAG_REPEAT) == 0) {
1000 /* New command specified. Check for a size specification.
1001 * Defaults to long if no or incorrect specification.
1003 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
1006 /* Address is specified since argc > 1
1008 addr = simple_strtoul(argv[1], NULL, 16);
1009 addr += base_address;
1012 #ifdef CONFIG_HAS_DATAFLASH
1013 if (addr_dataflash(addr)){
1014 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
1019 #ifdef CONFIG_BLACKFIN
1020 if (addr_bfin_on_chip_mem(addr)) {
1021 puts ("Can't modify L1 instruction in place. Use cp instead.\n\r");
1026 /* Print the address, followed by value. Then accept input for
1027 * the next value. A non-converted value exits.
1030 printf("%08lx:", addr);
1032 printf(" %08x", *((uint *)addr));
1034 printf(" %04x", *((ushort *)addr));
1036 printf(" %02x", *((u_char *)addr));
1038 nbytes = readline (" ? ");
1039 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
1040 /* <CR> pressed as only input, don't modify current
1041 * location and move to next. "-" pressed will go back.
1044 addr += nbytes ? -size : size;
1046 #ifdef CONFIG_BOOT_RETRY_TIME
1047 reset_cmd_timeout(); /* good enough to not time out */
1050 #ifdef CONFIG_BOOT_RETRY_TIME
1051 else if (nbytes == -2) {
1052 break; /* timed out, exit the command */
1057 i = simple_strtoul(console_buffer, &endp, 16);
1058 nbytes = endp - console_buffer;
1060 #ifdef CONFIG_BOOT_RETRY_TIME
1061 /* good enough to not time out
1063 reset_cmd_timeout();
1066 *((uint *)addr) = i;
1068 *((ushort *)addr) = i;
1070 *((u_char *)addr) = i;
1077 mm_last_addr = addr;
1078 mm_last_size = size;
1082 #ifdef CONFIG_CMD_CRC32
1084 #ifndef CONFIG_CRC32_VERIFY
1086 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1093 return cmd_usage(cmdtp);
1095 addr = simple_strtoul (argv[1], NULL, 16);
1096 addr += base_address;
1098 length = simple_strtoul (argv[2], NULL, 16);
1100 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1102 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1103 addr, addr + length - 1, crc);
1106 ptr = (ulong *) simple_strtoul (argv[3], NULL, 16);
1113 #else /* CONFIG_CRC32_VERIFY */
1115 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1127 return cmd_usage(cmdtp);
1132 if (strcmp(*av, "-v") == 0) {
1141 addr = simple_strtoul(*av++, NULL, 16);
1142 addr += base_address;
1143 length = simple_strtoul(*av++, NULL, 16);
1145 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1148 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1149 addr, addr + length - 1, crc);
1151 ptr = (ulong *) simple_strtoul (*av++, NULL, 16);
1155 vcrc = simple_strtoul(*av++, NULL, 16);
1157 printf ("CRC32 for %08lx ... %08lx ==> %08lx != %08lx ** ERROR **\n",
1158 addr, addr + length - 1, crc, vcrc);
1166 #endif /* CONFIG_CRC32_VERIFY */
1170 /**************************************************/
1172 md, 3, 1, do_mem_md,
1174 "[.b, .w, .l] address [# of objects]"
1179 mm, 2, 1, do_mem_mm,
1180 "memory modify (auto-incrementing address)",
1181 "[.b, .w, .l] address"
1186 nm, 2, 1, do_mem_nm,
1187 "memory modify (constant address)",
1188 "[.b, .w, .l] address"
1192 mw, 4, 1, do_mem_mw,
1193 "memory write (fill)",
1194 "[.b, .w, .l] address value [count]"
1198 cp, 4, 1, do_mem_cp,
1200 "[.b, .w, .l] source target count"
1204 cmp, 4, 1, do_mem_cmp,
1206 "[.b, .w, .l] addr1 addr2 count"
1209 #ifdef CONFIG_CMD_CRC32
1211 #ifndef CONFIG_CRC32_VERIFY
1214 crc32, 4, 1, do_mem_crc,
1215 "checksum calculation",
1216 "address count [addr]\n - compute CRC32 checksum [save at addr]"
1219 #else /* CONFIG_CRC32_VERIFY */
1222 crc32, 5, 1, do_mem_crc,
1223 "checksum calculation",
1224 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1225 "-v address count crc\n - verify crc of memory area"
1228 #endif /* CONFIG_CRC32_VERIFY */
1233 base, 2, 1, do_mem_base,
1234 "print or set address offset",
1235 "\n - print address offset for memory commands\n"
1236 "base off\n - set address offset for memory commands to 'off'"
1240 loop, 3, 1, do_mem_loop,
1241 "infinite loop on address range",
1242 "[.b, .w, .l] address number_of_objects"
1247 loopw, 4, 1, do_mem_loopw,
1248 "infinite write loop on address range",
1249 "[.b, .w, .l] address number_of_objects data_to_write"
1251 #endif /* CONFIG_LOOPW */
1254 mtest, 5, 1, do_mem_mtest,
1255 "simple RAM read/write test",
1256 "[start [end [pattern [iterations]]]]"
1259 #ifdef CONFIG_MX_CYCLIC
1261 mdc, 4, 1, do_mem_mdc,
1262 "memory display cyclic",
1263 "[.b, .w, .l] address count delay(ms)"
1267 mwc, 4, 1, do_mem_mwc,
1268 "memory write cyclic",
1269 "[.b, .w, .l] address value delay(ms)"
1271 #endif /* CONFIG_MX_CYCLIC */