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>
37 static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
39 /* Display values from last command.
40 * Memory modify remembered values are different from display memory.
42 static uint dp_last_addr, dp_last_size;
43 static uint dp_last_length = 0x40;
44 static uint mm_last_addr, mm_last_size;
46 static ulong base_address = 0;
51 * md{.b, .w, .l} {addr} {len}
53 #define DISP_LINE_LEN 16
54 int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
57 #if defined(CONFIG_HAS_DATAFLASH)
58 ulong nbytes, linebytes;
63 /* We use the last specified parameters, unless new ones are
68 length = dp_last_length;
73 if ((flag & CMD_FLAG_REPEAT) == 0) {
74 /* New command specified. Check for a size specification.
75 * Defaults to long if no or incorrect specification.
77 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
80 /* Address is specified since argc > 1
82 addr = simple_strtoul(argv[1], NULL, 16);
85 /* If another parameter, it is the length to display.
86 * Length is the number of objects, not number of bytes.
89 length = simple_strtoul(argv[2], NULL, 16);
92 #if defined(CONFIG_HAS_DATAFLASH)
95 * We buffer all read data, so we can make sure data is read only
96 * once, and all accesses are with the specified bus width.
98 nbytes = length * size;
100 char linebuf[DISP_LINE_LEN];
102 linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
104 rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
105 p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
106 print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
114 } while (nbytes > 0);
117 # if defined(CONFIG_BLACKFIN)
118 /* See if we're trying to display L1 inst */
119 if (addr_bfin_on_chip_mem(addr)) {
120 char linebuf[DISP_LINE_LEN];
121 ulong linebytes, nbytes = length * size;
123 linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
124 memcpy(linebuf, (void *)addr, linebytes);
125 print_buffer(addr, linebuf, size, linebytes/size, DISP_LINE_LEN/size);
133 } while (nbytes > 0);
138 /* Print the lines. */
139 print_buffer(addr, (void*)addr, size, length, DISP_LINE_LEN/size);
145 dp_last_length = length;
150 int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
152 return mod_mem (cmdtp, 1, flag, argc, argv);
154 int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
156 return mod_mem (cmdtp, 0, flag, argc, argv);
159 int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
161 ulong addr, writeval, count;
164 if ((argc < 3) || (argc > 4))
165 return CMD_RET_USAGE;
167 /* Check for size specification.
169 if ((size = cmd_get_data_size(argv[0], 4)) < 1)
172 /* Address is specified since argc > 1
174 addr = simple_strtoul(argv[1], NULL, 16);
175 addr += base_address;
177 /* Get the value to write.
179 writeval = simple_strtoul(argv[2], NULL, 16);
183 count = simple_strtoul(argv[3], NULL, 16);
188 while (count-- > 0) {
190 *((ulong *)addr) = (ulong )writeval;
192 *((ushort *)addr) = (ushort)writeval;
194 *((u_char *)addr) = (u_char)writeval;
200 #ifdef CONFIG_MX_CYCLIC
201 int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
207 return CMD_RET_USAGE;
209 count = simple_strtoul(argv[3], NULL, 10);
212 do_mem_md (NULL, 0, 3, argv);
214 /* delay for <count> ms... */
215 for (i=0; i<count; i++)
218 /* check for ctrl-c to abort... */
228 int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
234 return CMD_RET_USAGE;
236 count = simple_strtoul(argv[3], NULL, 10);
239 do_mem_mw (NULL, 0, 3, argv);
241 /* delay for <count> ms... */
242 for (i=0; i<count; i++)
245 /* check for ctrl-c to abort... */
254 #endif /* CONFIG_MX_CYCLIC */
256 int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
258 ulong addr1, addr2, count, ngood;
263 return CMD_RET_USAGE;
265 /* Check for size specification.
267 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
270 addr1 = simple_strtoul(argv[1], NULL, 16);
271 addr1 += base_address;
273 addr2 = simple_strtoul(argv[2], NULL, 16);
274 addr2 += base_address;
276 count = simple_strtoul(argv[3], NULL, 16);
278 #ifdef CONFIG_HAS_DATAFLASH
279 if (addr_dataflash(addr1) | addr_dataflash(addr2)){
280 puts ("Comparison with DataFlash space not supported.\n\r");
285 #ifdef CONFIG_BLACKFIN
286 if (addr_bfin_on_chip_mem(addr1) || addr_bfin_on_chip_mem(addr2)) {
287 puts ("Comparison with L1 instruction memory not supported.\n\r");
294 while (count-- > 0) {
296 ulong word1 = *(ulong *)addr1;
297 ulong word2 = *(ulong *)addr2;
298 if (word1 != word2) {
299 printf("word at 0x%08lx (0x%08lx) "
300 "!= word at 0x%08lx (0x%08lx)\n",
301 addr1, word1, addr2, word2);
306 else if (size == 2) {
307 ushort hword1 = *(ushort *)addr1;
308 ushort hword2 = *(ushort *)addr2;
309 if (hword1 != hword2) {
310 printf("halfword at 0x%08lx (0x%04x) "
311 "!= halfword at 0x%08lx (0x%04x)\n",
312 addr1, hword1, addr2, hword2);
318 u_char byte1 = *(u_char *)addr1;
319 u_char byte2 = *(u_char *)addr2;
320 if (byte1 != byte2) {
321 printf("byte at 0x%08lx (0x%02x) "
322 "!= byte at 0x%08lx (0x%02x)\n",
323 addr1, byte1, addr2, byte2);
332 /* reset watchdog from time to time */
333 if ((count % (64 << 10)) == 0)
337 printf("Total of %ld %s%s were the same\n",
338 ngood, size == 4 ? "word" : size == 2 ? "halfword" : "byte",
339 ngood == 1 ? "" : "s");
343 int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
345 ulong addr, dest, count;
349 return CMD_RET_USAGE;
351 /* Check for size specification.
353 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
356 addr = simple_strtoul(argv[1], NULL, 16);
357 addr += base_address;
359 dest = simple_strtoul(argv[2], NULL, 16);
360 dest += base_address;
362 count = simple_strtoul(argv[3], NULL, 16);
365 puts ("Zero length ???\n");
369 #ifndef CONFIG_SYS_NO_FLASH
370 /* check if we are copying to Flash */
371 if ( (addr2info(dest) != NULL)
372 #ifdef CONFIG_HAS_DATAFLASH
373 && (!addr_dataflash(dest))
378 puts ("Copy to Flash... ");
380 rc = flash_write ((char *)addr, dest, count*size);
390 #ifdef CONFIG_HAS_DATAFLASH
391 /* Check if we are copying from RAM or Flash to DataFlash */
392 if (addr_dataflash(dest) && !addr_dataflash(addr)){
395 puts ("Copy to DataFlash... ");
397 rc = write_dataflash (dest, addr, count*size);
400 dataflash_perror (rc);
407 /* Check if we are copying from DataFlash to RAM */
408 if (addr_dataflash(addr) && !addr_dataflash(dest)
409 #ifndef CONFIG_SYS_NO_FLASH
410 && (addr2info(dest) == NULL)
414 rc = read_dataflash(addr, count * size, (char *) dest);
416 dataflash_perror (rc);
422 if (addr_dataflash(addr) && addr_dataflash(dest)){
423 puts ("Unsupported combination of source/destination.\n\r");
428 #ifdef CONFIG_BLACKFIN
429 /* See if we're copying to/from L1 inst */
430 if (addr_bfin_on_chip_mem(dest) || addr_bfin_on_chip_mem(addr)) {
431 memcpy((void *)dest, (void *)addr, count * size);
436 while (count-- > 0) {
438 *((ulong *)dest) = *((ulong *)addr);
440 *((ushort *)dest) = *((ushort *)addr);
442 *((u_char *)dest) = *((u_char *)addr);
446 /* reset watchdog from time to time */
447 if ((count % (64 << 10)) == 0)
453 int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
456 /* Set new base address.
458 base_address = simple_strtoul(argv[1], NULL, 16);
460 /* Print the current base address.
462 printf("Base Address: 0x%08lx\n", base_address);
466 int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
468 ulong addr, length, i;
470 volatile uint *longp;
471 volatile ushort *shortp;
475 return CMD_RET_USAGE;
477 /* Check for a size spefication.
478 * Defaults to long if no or incorrect specification.
480 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
483 /* Address is always specified.
485 addr = simple_strtoul(argv[1], NULL, 16);
487 /* Length is the number of objects, not number of bytes.
489 length = simple_strtoul(argv[2], NULL, 16);
491 /* We want to optimize the loops to run as fast as possible.
492 * If we have only one object, just run infinite loops.
496 longp = (uint *)addr;
501 shortp = (ushort *)addr;
512 longp = (uint *)addr;
520 shortp = (ushort *)addr;
535 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
537 ulong addr, length, i, data;
539 volatile uint *longp;
540 volatile ushort *shortp;
544 return CMD_RET_USAGE;
546 /* Check for a size spefication.
547 * Defaults to long if no or incorrect specification.
549 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
552 /* Address is always specified.
554 addr = simple_strtoul(argv[1], NULL, 16);
556 /* Length is the number of objects, not number of bytes.
558 length = simple_strtoul(argv[2], NULL, 16);
561 data = simple_strtoul(argv[3], NULL, 16);
563 /* We want to optimize the loops to run as fast as possible.
564 * If we have only one object, just run infinite loops.
568 longp = (uint *)addr;
573 shortp = (ushort *)addr;
584 longp = (uint *)addr;
592 shortp = (ushort *)addr;
605 #endif /* CONFIG_LOOPW */
608 * Perform a memory test. A more complete alternative test can be
609 * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
610 * interrupted by ctrl-c or by a failure of one of the sub-tests.
612 int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
614 vu_long *addr, *start, *end;
621 #if defined(CONFIG_SYS_ALT_MEMTEST)
627 vu_long anti_pattern;
629 #if defined(CONFIG_SYS_MEMTEST_SCRATCH)
630 vu_long *dummy = (vu_long*)CONFIG_SYS_MEMTEST_SCRATCH;
632 vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
636 static const ulong bitpattern[] = {
637 0x00000001, /* single bit */
638 0x00000003, /* two adjacent bits */
639 0x00000007, /* three adjacent bits */
640 0x0000000F, /* four adjacent bits */
641 0x00000005, /* two non-adjacent bits */
642 0x00000015, /* three non-adjacent bits */
643 0x00000055, /* four non-adjacent bits */
644 0xaaaaaaaa, /* alternating 1/0 */
652 start = (ulong *)simple_strtoul(argv[1], NULL, 16);
654 start = (ulong *)CONFIG_SYS_MEMTEST_START;
657 end = (ulong *)simple_strtoul(argv[2], NULL, 16);
659 end = (ulong *)(CONFIG_SYS_MEMTEST_END);
662 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
667 iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
671 #if defined(CONFIG_SYS_ALT_MEMTEST)
672 printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
673 debug("%s:%d: start 0x%p end 0x%p\n",
674 __FUNCTION__, __LINE__, start, end);
683 if (iteration_limit && iterations > iteration_limit) {
684 printf("Tested %d iteration(s) with %lu errors.\n",
689 printf("Iteration: %6d\r", iterations);
694 * Data line test: write a pattern to the first
695 * location, write the 1's complement to a 'parking'
696 * address (changes the state of the data bus so a
697 * floating bus doen't give a false OK), and then
698 * read the value back. Note that we read it back
699 * into a variable because the next time we read it,
700 * it might be right (been there, tough to explain to
701 * the quality guys why it prints a failure when the
702 * "is" and "should be" are obviously the same in the
705 * Rather than exhaustively testing, we test some
706 * patterns by shifting '1' bits through a field of
707 * '0's and '0' bits through a field of '1's (i.e.
708 * pattern and ~pattern).
711 for (j = 0; j < sizeof(bitpattern)/sizeof(bitpattern[0]); j++) {
713 for(; val != 0; val <<= 1) {
715 *dummy = ~val; /* clear the test data off of the bus */
717 if(readback != val) {
718 printf ("FAILURE (data line): "
719 "expected %08lx, actual %08lx\n",
730 if(readback != ~val) {
731 printf ("FAILURE (data line): "
732 "Is %08lx, should be %08lx\n",
744 * Based on code whose Original Author and Copyright
745 * information follows: Copyright (c) 1998 by Michael
746 * Barr. This software is placed into the public
747 * domain and may be used for any purpose. However,
748 * this notice must not be changed or removed and no
749 * warranty is either expressed or implied by its
750 * publication or distribution.
756 * Description: Test the address bus wiring in a
757 * memory region by performing a walking
758 * 1's test on the relevant bits of the
759 * address and checking for aliasing.
760 * This test will find single-bit
761 * address failures such as stuck -high,
762 * stuck-low, and shorted pins. The base
763 * address and size of the region are
764 * selected by the caller.
766 * Notes: For best results, the selected base
767 * address should have enough LSB 0's to
768 * guarantee single address bit changes.
769 * For example, to test a 64-Kbyte
770 * region, select a base address on a
771 * 64-Kbyte boundary. Also, select the
772 * region size as a power-of-two if at
775 * Returns: 0 if the test succeeds, 1 if the test fails.
777 len = ((ulong)end - (ulong)start)/sizeof(vu_long);
778 pattern = (vu_long) 0xaaaaaaaa;
779 anti_pattern = (vu_long) 0x55555555;
781 debug("%s:%d: length = 0x%.8lx\n",
782 __FUNCTION__, __LINE__,
785 * Write the default pattern at each of the
786 * power-of-two offsets.
788 for (offset = 1; offset < len; offset <<= 1) {
789 start[offset] = pattern;
793 * Check for address bits stuck high.
796 start[test_offset] = anti_pattern;
798 for (offset = 1; offset < len; offset <<= 1) {
799 temp = start[offset];
800 if (temp != pattern) {
801 printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
802 " expected 0x%.8lx, actual 0x%.8lx\n",
803 (ulong)&start[offset], pattern, temp);
811 start[test_offset] = pattern;
815 * Check for addr bits stuck low or shorted.
817 for (test_offset = 1; test_offset < len; test_offset <<= 1) {
818 start[test_offset] = anti_pattern;
820 for (offset = 1; offset < len; offset <<= 1) {
821 temp = start[offset];
822 if ((temp != pattern) && (offset != test_offset)) {
823 printf ("\nFAILURE: Address bit stuck low or shorted @"
824 " 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
825 (ulong)&start[offset], pattern, temp);
833 start[test_offset] = pattern;
837 * Description: Test the integrity of a physical
838 * memory device by performing an
839 * increment/decrement test over the
840 * entire region. In the process every
841 * storage bit in the device is tested
842 * as a zero and a one. The base address
843 * and the size of the region are
844 * selected by the caller.
846 * Returns: 0 if the test succeeds, 1 if the test fails.
848 num_words = ((ulong)end - (ulong)start)/sizeof(vu_long) + 1;
851 * Fill memory with a known pattern.
853 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
855 start[offset] = pattern;
859 * Check each location and invert it for the second pass.
861 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
863 temp = start[offset];
864 if (temp != pattern) {
865 printf ("\nFAILURE (read/write) @ 0x%.8lx:"
866 " expected 0x%.8lx, actual 0x%.8lx)\n",
867 (ulong)&start[offset], pattern, temp);
875 anti_pattern = ~pattern;
876 start[offset] = anti_pattern;
880 * Check each location for the inverted pattern and zero it.
882 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
884 anti_pattern = ~pattern;
885 temp = start[offset];
886 if (temp != anti_pattern) {
887 printf ("\nFAILURE (read/write): @ 0x%.8lx:"
888 " expected 0x%.8lx, actual 0x%.8lx)\n",
889 (ulong)&start[offset], anti_pattern, temp);
900 #else /* The original, quickie test */
908 if (iteration_limit && iterations > iteration_limit) {
909 printf("Tested %d iteration(s) with %lu errors.\n",
915 printf ("\rPattern %08lX Writing..."
917 "\b\b\b\b\b\b\b\b\b\b",
920 for (addr=start,val=pattern; addr<end; addr++) {
928 for (addr=start,val=pattern; addr<end; addr++) {
931 if (readback != val) {
932 printf ("\nMem error @ 0x%08X: "
933 "found %08lX, expected %08lX\n",
934 (uint)(uintptr_t)addr, readback, val);
945 * Flip the pattern each time to make lots of zeros and
946 * then, the next time, lots of ones. We decrement
947 * the "negative" patterns and increment the "positive"
948 * patterns to preserve this feature.
950 if(pattern & 0x80000000) {
951 pattern = -pattern; /* complement & increment */
959 return 0; /* not reached */
966 * mm{.b, .w, .l} {addr}
967 * nm{.b, .w, .l} {addr}
970 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
976 return CMD_RET_USAGE;
978 #ifdef CONFIG_BOOT_RETRY_TIME
979 reset_cmd_timeout(); /* got a good command to get here */
981 /* We use the last specified parameters, unless new ones are
987 if ((flag & CMD_FLAG_REPEAT) == 0) {
988 /* New command specified. Check for a size specification.
989 * Defaults to long if no or incorrect specification.
991 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
994 /* Address is specified since argc > 1
996 addr = simple_strtoul(argv[1], NULL, 16);
997 addr += base_address;
1000 #ifdef CONFIG_HAS_DATAFLASH
1001 if (addr_dataflash(addr)){
1002 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
1007 #ifdef CONFIG_BLACKFIN
1008 if (addr_bfin_on_chip_mem(addr)) {
1009 puts ("Can't modify L1 instruction in place. Use cp instead.\n\r");
1014 /* Print the address, followed by value. Then accept input for
1015 * the next value. A non-converted value exits.
1018 printf("%08lx:", addr);
1020 printf(" %08x", *((uint *)addr));
1022 printf(" %04x", *((ushort *)addr));
1024 printf(" %02x", *((u_char *)addr));
1026 nbytes = readline (" ? ");
1027 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
1028 /* <CR> pressed as only input, don't modify current
1029 * location and move to next. "-" pressed will go back.
1032 addr += nbytes ? -size : size;
1034 #ifdef CONFIG_BOOT_RETRY_TIME
1035 reset_cmd_timeout(); /* good enough to not time out */
1038 #ifdef CONFIG_BOOT_RETRY_TIME
1039 else if (nbytes == -2) {
1040 break; /* timed out, exit the command */
1045 i = simple_strtoul(console_buffer, &endp, 16);
1046 nbytes = endp - console_buffer;
1048 #ifdef CONFIG_BOOT_RETRY_TIME
1049 /* good enough to not time out
1051 reset_cmd_timeout();
1054 *((uint *)addr) = i;
1056 *((ushort *)addr) = i;
1058 *((u_char *)addr) = i;
1065 mm_last_addr = addr;
1066 mm_last_size = size;
1070 #ifdef CONFIG_CMD_CRC32
1072 #ifndef CONFIG_CRC32_VERIFY
1074 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1081 return CMD_RET_USAGE;
1083 addr = simple_strtoul (argv[1], NULL, 16);
1084 addr += base_address;
1086 length = simple_strtoul (argv[2], NULL, 16);
1088 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1090 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1091 addr, addr + length - 1, crc);
1094 ptr = (ulong *) simple_strtoul (argv[3], NULL, 16);
1101 #else /* CONFIG_CRC32_VERIFY */
1103 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1115 return CMD_RET_USAGE;
1120 if (strcmp(*av, "-v") == 0) {
1129 addr = simple_strtoul(*av++, NULL, 16);
1130 addr += base_address;
1131 length = simple_strtoul(*av++, NULL, 16);
1133 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1136 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1137 addr, addr + length - 1, crc);
1139 ptr = (ulong *) simple_strtoul (*av++, NULL, 16);
1143 vcrc = simple_strtoul(*av++, NULL, 16);
1145 printf ("CRC32 for %08lx ... %08lx ==> %08lx != %08lx ** ERROR **\n",
1146 addr, addr + length - 1, crc, vcrc);
1154 #endif /* CONFIG_CRC32_VERIFY */
1158 /**************************************************/
1160 md, 3, 1, do_mem_md,
1162 "[.b, .w, .l] address [# of objects]"
1167 mm, 2, 1, do_mem_mm,
1168 "memory modify (auto-incrementing address)",
1169 "[.b, .w, .l] address"
1174 nm, 2, 1, do_mem_nm,
1175 "memory modify (constant address)",
1176 "[.b, .w, .l] address"
1180 mw, 4, 1, do_mem_mw,
1181 "memory write (fill)",
1182 "[.b, .w, .l] address value [count]"
1186 cp, 4, 1, do_mem_cp,
1188 "[.b, .w, .l] source target count"
1192 cmp, 4, 1, do_mem_cmp,
1194 "[.b, .w, .l] addr1 addr2 count"
1197 #ifdef CONFIG_CMD_CRC32
1199 #ifndef CONFIG_CRC32_VERIFY
1202 crc32, 4, 1, do_mem_crc,
1203 "checksum calculation",
1204 "address count [addr]\n - compute CRC32 checksum [save at addr]"
1207 #else /* CONFIG_CRC32_VERIFY */
1210 crc32, 5, 1, do_mem_crc,
1211 "checksum calculation",
1212 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1213 "-v address count crc\n - verify crc of memory area"
1216 #endif /* CONFIG_CRC32_VERIFY */
1221 base, 2, 1, do_mem_base,
1222 "print or set address offset",
1223 "\n - print address offset for memory commands\n"
1224 "base off\n - set address offset for memory commands to 'off'"
1228 loop, 3, 1, do_mem_loop,
1229 "infinite loop on address range",
1230 "[.b, .w, .l] address number_of_objects"
1235 loopw, 4, 1, do_mem_loopw,
1236 "infinite write loop on address range",
1237 "[.b, .w, .l] address number_of_objects data_to_write"
1239 #endif /* CONFIG_LOOPW */
1242 mtest, 5, 1, do_mem_mtest,
1243 "simple RAM read/write test",
1244 "[start [end [pattern [iterations]]]]"
1247 #ifdef CONFIG_MX_CYCLIC
1249 mdc, 4, 1, do_mem_mdc,
1250 "memory display cyclic",
1251 "[.b, .w, .l] address count delay(ms)"
1255 mwc, 4, 1, do_mem_mwc,
1256 "memory write cyclic",
1257 "[.b, .w, .l] address value delay(ms)"
1259 #endif /* CONFIG_MX_CYCLIC */