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 static 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 static 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 static 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 static 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 static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
258 ulong addr1, addr2, count, ngood;
264 return CMD_RET_USAGE;
266 /* Check for size specification.
268 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
270 type = size == 4 ? "word" : size == 2 ? "halfword" : "byte";
272 addr1 = simple_strtoul(argv[1], NULL, 16);
273 addr1 += base_address;
275 addr2 = simple_strtoul(argv[2], NULL, 16);
276 addr2 += base_address;
278 count = simple_strtoul(argv[3], NULL, 16);
280 #ifdef CONFIG_HAS_DATAFLASH
281 if (addr_dataflash(addr1) | addr_dataflash(addr2)){
282 puts ("Comparison with DataFlash space not supported.\n\r");
287 #ifdef CONFIG_BLACKFIN
288 if (addr_bfin_on_chip_mem(addr1) || addr_bfin_on_chip_mem(addr2)) {
289 puts ("Comparison with L1 instruction memory not supported.\n\r");
294 for (ngood = 0; ngood < count; ++ngood) {
297 word1 = *(ulong *)addr1;
298 word2 = *(ulong *)addr2;
299 } else if (size == 2) {
300 word1 = *(ushort *)addr1;
301 word2 = *(ushort *)addr2;
303 word1 = *(u_char *)addr1;
304 word2 = *(u_char *)addr2;
306 if (word1 != word2) {
307 printf("%s at 0x%08lx (%#0*lx) != %s at 0x%08lx (%#0*lx)\n",
308 type, addr1, size, word1,
309 type, addr2, size, word2);
317 /* reset watchdog from time to time */
318 if ((ngood % (64 << 10)) == 0)
322 printf("Total of %ld %s(s) were the same\n", ngood, type);
326 static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
328 ulong addr, dest, count;
332 return CMD_RET_USAGE;
334 /* Check for size specification.
336 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
339 addr = simple_strtoul(argv[1], NULL, 16);
340 addr += base_address;
342 dest = simple_strtoul(argv[2], NULL, 16);
343 dest += base_address;
345 count = simple_strtoul(argv[3], NULL, 16);
348 puts ("Zero length ???\n");
352 #ifndef CONFIG_SYS_NO_FLASH
353 /* check if we are copying to Flash */
354 if ( (addr2info(dest) != NULL)
355 #ifdef CONFIG_HAS_DATAFLASH
356 && (!addr_dataflash(dest))
361 puts ("Copy to Flash... ");
363 rc = flash_write ((char *)addr, dest, count*size);
373 #ifdef CONFIG_HAS_DATAFLASH
374 /* Check if we are copying from RAM or Flash to DataFlash */
375 if (addr_dataflash(dest) && !addr_dataflash(addr)){
378 puts ("Copy to DataFlash... ");
380 rc = write_dataflash (dest, addr, count*size);
383 dataflash_perror (rc);
390 /* Check if we are copying from DataFlash to RAM */
391 if (addr_dataflash(addr) && !addr_dataflash(dest)
392 #ifndef CONFIG_SYS_NO_FLASH
393 && (addr2info(dest) == NULL)
397 rc = read_dataflash(addr, count * size, (char *) dest);
399 dataflash_perror (rc);
405 if (addr_dataflash(addr) && addr_dataflash(dest)){
406 puts ("Unsupported combination of source/destination.\n\r");
411 #ifdef CONFIG_BLACKFIN
412 /* See if we're copying to/from L1 inst */
413 if (addr_bfin_on_chip_mem(dest) || addr_bfin_on_chip_mem(addr)) {
414 memcpy((void *)dest, (void *)addr, count * size);
419 while (count-- > 0) {
421 *((ulong *)dest) = *((ulong *)addr);
423 *((ushort *)dest) = *((ushort *)addr);
425 *((u_char *)dest) = *((u_char *)addr);
429 /* reset watchdog from time to time */
430 if ((count % (64 << 10)) == 0)
436 static int do_mem_base(cmd_tbl_t *cmdtp, int flag, int argc,
440 /* Set new base address.
442 base_address = simple_strtoul(argv[1], NULL, 16);
444 /* Print the current base address.
446 printf("Base Address: 0x%08lx\n", base_address);
450 static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
453 ulong addr, length, i;
455 volatile uint *longp;
456 volatile ushort *shortp;
460 return CMD_RET_USAGE;
462 /* Check for a size spefication.
463 * Defaults to long if no or incorrect specification.
465 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
468 /* Address is always specified.
470 addr = simple_strtoul(argv[1], NULL, 16);
472 /* Length is the number of objects, not number of bytes.
474 length = simple_strtoul(argv[2], NULL, 16);
476 /* We want to optimize the loops to run as fast as possible.
477 * If we have only one object, just run infinite loops.
481 longp = (uint *)addr;
486 shortp = (ushort *)addr;
497 longp = (uint *)addr;
505 shortp = (ushort *)addr;
520 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
522 ulong addr, length, i, data;
524 volatile uint *longp;
525 volatile ushort *shortp;
529 return CMD_RET_USAGE;
531 /* Check for a size spefication.
532 * Defaults to long if no or incorrect specification.
534 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
537 /* Address is always specified.
539 addr = simple_strtoul(argv[1], NULL, 16);
541 /* Length is the number of objects, not number of bytes.
543 length = simple_strtoul(argv[2], NULL, 16);
546 data = simple_strtoul(argv[3], NULL, 16);
548 /* We want to optimize the loops to run as fast as possible.
549 * If we have only one object, just run infinite loops.
553 longp = (uint *)addr;
558 shortp = (ushort *)addr;
569 longp = (uint *)addr;
577 shortp = (ushort *)addr;
590 #endif /* CONFIG_LOOPW */
593 * Perform a memory test. A more complete alternative test can be
594 * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
595 * interrupted by ctrl-c or by a failure of one of the sub-tests.
597 static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
600 vu_long *addr, *start, *end;
607 #if defined(CONFIG_SYS_ALT_MEMTEST)
613 vu_long anti_pattern;
615 #if defined(CONFIG_SYS_MEMTEST_SCRATCH)
616 vu_long *dummy = (vu_long*)CONFIG_SYS_MEMTEST_SCRATCH;
618 vu_long *dummy = NULL; /* yes, this is address 0x0, not NULL */
622 static const ulong bitpattern[] = {
623 0x00000001, /* single bit */
624 0x00000003, /* two adjacent bits */
625 0x00000007, /* three adjacent bits */
626 0x0000000F, /* four adjacent bits */
627 0x00000005, /* two non-adjacent bits */
628 0x00000015, /* three non-adjacent bits */
629 0x00000055, /* four non-adjacent bits */
630 0xaaaaaaaa, /* alternating 1/0 */
638 start = (ulong *)simple_strtoul(argv[1], NULL, 16);
640 start = (ulong *)CONFIG_SYS_MEMTEST_START;
643 end = (ulong *)simple_strtoul(argv[2], NULL, 16);
645 end = (ulong *)(CONFIG_SYS_MEMTEST_END);
648 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
653 iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
657 #if defined(CONFIG_SYS_ALT_MEMTEST)
658 printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
659 debug("%s:%d: start 0x%p end 0x%p\n",
660 __FUNCTION__, __LINE__, start, end);
669 if (iteration_limit && iterations > iteration_limit) {
670 printf("Tested %d iteration(s) with %lu errors.\n",
675 printf("Iteration: %6d\r", iterations);
680 * Data line test: write a pattern to the first
681 * location, write the 1's complement to a 'parking'
682 * address (changes the state of the data bus so a
683 * floating bus doen't give a false OK), and then
684 * read the value back. Note that we read it back
685 * into a variable because the next time we read it,
686 * it might be right (been there, tough to explain to
687 * the quality guys why it prints a failure when the
688 * "is" and "should be" are obviously the same in the
691 * Rather than exhaustively testing, we test some
692 * patterns by shifting '1' bits through a field of
693 * '0's and '0' bits through a field of '1's (i.e.
694 * pattern and ~pattern).
697 for (j = 0; j < sizeof(bitpattern)/sizeof(bitpattern[0]); j++) {
699 for(; val != 0; val <<= 1) {
701 *dummy = ~val; /* clear the test data off of the bus */
703 if(readback != val) {
704 printf ("FAILURE (data line): "
705 "expected %08lx, actual %08lx\n",
716 if(readback != ~val) {
717 printf ("FAILURE (data line): "
718 "Is %08lx, should be %08lx\n",
730 * Based on code whose Original Author and Copyright
731 * information follows: Copyright (c) 1998 by Michael
732 * Barr. This software is placed into the public
733 * domain and may be used for any purpose. However,
734 * this notice must not be changed or removed and no
735 * warranty is either expressed or implied by its
736 * publication or distribution.
742 * Description: Test the address bus wiring in a
743 * memory region by performing a walking
744 * 1's test on the relevant bits of the
745 * address and checking for aliasing.
746 * This test will find single-bit
747 * address failures such as stuck -high,
748 * stuck-low, and shorted pins. The base
749 * address and size of the region are
750 * selected by the caller.
752 * Notes: For best results, the selected base
753 * address should have enough LSB 0's to
754 * guarantee single address bit changes.
755 * For example, to test a 64-Kbyte
756 * region, select a base address on a
757 * 64-Kbyte boundary. Also, select the
758 * region size as a power-of-two if at
761 * Returns: 0 if the test succeeds, 1 if the test fails.
763 len = ((ulong)end - (ulong)start)/sizeof(vu_long);
764 pattern = (vu_long) 0xaaaaaaaa;
765 anti_pattern = (vu_long) 0x55555555;
767 debug("%s:%d: length = 0x%.8lx\n",
768 __FUNCTION__, __LINE__,
771 * Write the default pattern at each of the
772 * power-of-two offsets.
774 for (offset = 1; offset < len; offset <<= 1) {
775 start[offset] = pattern;
779 * Check for address bits stuck high.
782 start[test_offset] = anti_pattern;
784 for (offset = 1; offset < len; offset <<= 1) {
785 temp = start[offset];
786 if (temp != pattern) {
787 printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
788 " expected 0x%.8lx, actual 0x%.8lx\n",
789 (ulong)&start[offset], pattern, temp);
797 start[test_offset] = pattern;
801 * Check for addr bits stuck low or shorted.
803 for (test_offset = 1; test_offset < len; test_offset <<= 1) {
804 start[test_offset] = anti_pattern;
806 for (offset = 1; offset < len; offset <<= 1) {
807 temp = start[offset];
808 if ((temp != pattern) && (offset != test_offset)) {
809 printf ("\nFAILURE: Address bit stuck low or shorted @"
810 " 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
811 (ulong)&start[offset], pattern, temp);
819 start[test_offset] = pattern;
823 * Description: Test the integrity of a physical
824 * memory device by performing an
825 * increment/decrement test over the
826 * entire region. In the process every
827 * storage bit in the device is tested
828 * as a zero and a one. The base address
829 * and the size of the region are
830 * selected by the caller.
832 * Returns: 0 if the test succeeds, 1 if the test fails.
834 num_words = ((ulong)end - (ulong)start)/sizeof(vu_long) + 1;
837 * Fill memory with a known pattern.
839 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
841 start[offset] = pattern;
845 * Check each location and invert it for the second pass.
847 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
849 temp = start[offset];
850 if (temp != pattern) {
851 printf ("\nFAILURE (read/write) @ 0x%.8lx:"
852 " expected 0x%.8lx, actual 0x%.8lx)\n",
853 (ulong)&start[offset], pattern, temp);
861 anti_pattern = ~pattern;
862 start[offset] = anti_pattern;
866 * Check each location for the inverted pattern and zero it.
868 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
870 anti_pattern = ~pattern;
871 temp = start[offset];
872 if (temp != anti_pattern) {
873 printf ("\nFAILURE (read/write): @ 0x%.8lx:"
874 " expected 0x%.8lx, actual 0x%.8lx)\n",
875 (ulong)&start[offset], anti_pattern, temp);
886 #else /* The original, quickie test */
894 if (iteration_limit && iterations > iteration_limit) {
895 printf("Tested %d iteration(s) with %lu errors.\n",
901 printf ("\rPattern %08lX Writing..."
903 "\b\b\b\b\b\b\b\b\b\b",
906 for (addr=start,val=pattern; addr<end; addr++) {
914 for (addr=start,val=pattern; addr<end; addr++) {
917 if (readback != val) {
918 printf ("\nMem error @ 0x%08X: "
919 "found %08lX, expected %08lX\n",
920 (uint)(uintptr_t)addr, readback, val);
931 * Flip the pattern each time to make lots of zeros and
932 * then, the next time, lots of ones. We decrement
933 * the "negative" patterns and increment the "positive"
934 * patterns to preserve this feature.
936 if(pattern & 0x80000000) {
937 pattern = -pattern; /* complement & increment */
945 return 0; /* not reached */
952 * mm{.b, .w, .l} {addr}
953 * nm{.b, .w, .l} {addr}
956 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
962 return CMD_RET_USAGE;
964 #ifdef CONFIG_BOOT_RETRY_TIME
965 reset_cmd_timeout(); /* got a good command to get here */
967 /* We use the last specified parameters, unless new ones are
973 if ((flag & CMD_FLAG_REPEAT) == 0) {
974 /* New command specified. Check for a size specification.
975 * Defaults to long if no or incorrect specification.
977 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
980 /* Address is specified since argc > 1
982 addr = simple_strtoul(argv[1], NULL, 16);
983 addr += base_address;
986 #ifdef CONFIG_HAS_DATAFLASH
987 if (addr_dataflash(addr)){
988 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
993 #ifdef CONFIG_BLACKFIN
994 if (addr_bfin_on_chip_mem(addr)) {
995 puts ("Can't modify L1 instruction in place. Use cp instead.\n\r");
1000 /* Print the address, followed by value. Then accept input for
1001 * the next value. A non-converted value exits.
1004 printf("%08lx:", addr);
1006 printf(" %08x", *((uint *)addr));
1008 printf(" %04x", *((ushort *)addr));
1010 printf(" %02x", *((u_char *)addr));
1012 nbytes = readline (" ? ");
1013 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
1014 /* <CR> pressed as only input, don't modify current
1015 * location and move to next. "-" pressed will go back.
1018 addr += nbytes ? -size : size;
1020 #ifdef CONFIG_BOOT_RETRY_TIME
1021 reset_cmd_timeout(); /* good enough to not time out */
1024 #ifdef CONFIG_BOOT_RETRY_TIME
1025 else if (nbytes == -2) {
1026 break; /* timed out, exit the command */
1031 i = simple_strtoul(console_buffer, &endp, 16);
1032 nbytes = endp - console_buffer;
1034 #ifdef CONFIG_BOOT_RETRY_TIME
1035 /* good enough to not time out
1037 reset_cmd_timeout();
1040 *((uint *)addr) = i;
1042 *((ushort *)addr) = i;
1044 *((u_char *)addr) = i;
1051 mm_last_addr = addr;
1052 mm_last_size = size;
1056 #ifdef CONFIG_CMD_CRC32
1058 #ifndef CONFIG_CRC32_VERIFY
1060 static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1067 return CMD_RET_USAGE;
1069 addr = simple_strtoul (argv[1], NULL, 16);
1070 addr += base_address;
1072 length = simple_strtoul (argv[2], NULL, 16);
1074 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1076 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1077 addr, addr + length - 1, crc);
1080 ptr = (ulong *) simple_strtoul (argv[3], NULL, 16);
1087 #else /* CONFIG_CRC32_VERIFY */
1089 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1101 return CMD_RET_USAGE;
1106 if (strcmp(*av, "-v") == 0) {
1115 addr = simple_strtoul(*av++, NULL, 16);
1116 addr += base_address;
1117 length = simple_strtoul(*av++, NULL, 16);
1119 crc = crc32_wd (0, (const uchar *) addr, length, CHUNKSZ_CRC32);
1122 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1123 addr, addr + length - 1, crc);
1125 ptr = (ulong *) simple_strtoul (*av++, NULL, 16);
1129 vcrc = simple_strtoul(*av++, NULL, 16);
1131 printf ("CRC32 for %08lx ... %08lx ==> %08lx != %08lx ** ERROR **\n",
1132 addr, addr + length - 1, crc, vcrc);
1140 #endif /* CONFIG_CRC32_VERIFY */
1144 /**************************************************/
1146 md, 3, 1, do_mem_md,
1148 "[.b, .w, .l] address [# of objects]"
1153 mm, 2, 1, do_mem_mm,
1154 "memory modify (auto-incrementing address)",
1155 "[.b, .w, .l] address"
1160 nm, 2, 1, do_mem_nm,
1161 "memory modify (constant address)",
1162 "[.b, .w, .l] address"
1166 mw, 4, 1, do_mem_mw,
1167 "memory write (fill)",
1168 "[.b, .w, .l] address value [count]"
1172 cp, 4, 1, do_mem_cp,
1174 "[.b, .w, .l] source target count"
1178 cmp, 4, 1, do_mem_cmp,
1180 "[.b, .w, .l] addr1 addr2 count"
1183 #ifdef CONFIG_CMD_CRC32
1185 #ifndef CONFIG_CRC32_VERIFY
1188 crc32, 4, 1, do_mem_crc,
1189 "checksum calculation",
1190 "address count [addr]\n - compute CRC32 checksum [save at addr]"
1193 #else /* CONFIG_CRC32_VERIFY */
1196 crc32, 5, 1, do_mem_crc,
1197 "checksum calculation",
1198 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1199 "-v address count crc\n - verify crc of memory area"
1202 #endif /* CONFIG_CRC32_VERIFY */
1207 base, 2, 1, do_mem_base,
1208 "print or set address offset",
1209 "\n - print address offset for memory commands\n"
1210 "base off\n - set address offset for memory commands to 'off'"
1214 loop, 3, 1, do_mem_loop,
1215 "infinite loop on address range",
1216 "[.b, .w, .l] address number_of_objects"
1221 loopw, 4, 1, do_mem_loopw,
1222 "infinite write loop on address range",
1223 "[.b, .w, .l] address number_of_objects data_to_write"
1225 #endif /* CONFIG_LOOPW */
1228 mtest, 5, 1, do_mem_mtest,
1229 "simple RAM read/write test",
1230 "[start [end [pattern [iterations]]]]"
1233 #ifdef CONFIG_MX_CYCLIC
1235 mdc, 4, 1, do_mem_mdc,
1236 "memory display cyclic",
1237 "[.b, .w, .l] address count delay(ms)"
1241 mwc, 4, 1, do_mem_mwc,
1242 "memory write cyclic",
1243 "[.b, .w, .l] address value delay(ms)"
1245 #endif /* CONFIG_MX_CYCLIC */