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 ulong i, nbytes, linebytes;
100 /* We use the last specified parameters, unless new ones are
105 length = dp_last_length;
108 printf ("Usage:\n%s\n", cmdtp->usage);
112 if ((flag & CMD_FLAG_REPEAT) == 0) {
113 /* New command specified. Check for a size specification.
114 * Defaults to long if no or incorrect specification.
116 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
119 /* Address is specified since argc > 1
121 addr = simple_strtoul(argv[1], NULL, 16);
122 addr += base_address;
124 /* If another parameter, it is the length to display.
125 * Length is the number of objects, not number of bytes.
128 length = simple_strtoul(argv[2], NULL, 16);
133 * We buffer all read data, so we can make sure data is read only
134 * once, and all accesses are with the specified bus width.
136 nbytes = length * size;
138 char linebuf[DISP_LINE_LEN];
139 uint *uip = (uint *)linebuf;
140 ushort *usp = (ushort *)linebuf;
141 u_char *ucp = (u_char *)linebuf;
142 #ifdef CONFIG_HAS_DATAFLASH
145 printf("%08lx:", addr);
146 linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
148 #ifdef CONFIG_HAS_DATAFLASH
149 if ((rc = read_dataflash(addr, (linebytes/size)*size, linebuf)) == DATAFLASH_OK){
150 /* if outside dataflash */
152 dataflash_perror (rc);
155 for (i=0; i<linebytes; i+= size) {
157 printf(" %08x", *uip++);
158 } else if (size == 2) {
159 printf(" %04x", *usp++);
161 printf(" %02x", *ucp++);
166 } else { /* addr does not correspond to DataFlash */
168 for (i=0; i<linebytes; i+= size) {
170 printf(" %08x", (*uip++ = *((uint *)addr)));
171 } else if (size == 2) {
172 printf(" %04x", (*usp++ = *((ushort *)addr)));
174 printf(" %02x", (*ucp++ = *((u_char *)addr)));
178 #ifdef CONFIG_HAS_DATAFLASH
183 for (i=0; i<linebytes; i++) {
184 if ((*cp < 0x20) || (*cp > 0x7e))
196 } while (nbytes > 0);
199 dp_last_length = length;
204 int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
206 return mod_mem (cmdtp, 1, flag, argc, argv);
208 int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
210 return mod_mem (cmdtp, 0, flag, argc, argv);
213 int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
215 ulong addr, writeval, count;
218 if ((argc < 3) || (argc > 4)) {
219 printf ("Usage:\n%s\n", cmdtp->usage);
223 /* Check for size specification.
225 if ((size = cmd_get_data_size(argv[0], 4)) < 1)
228 /* Address is specified since argc > 1
230 addr = simple_strtoul(argv[1], NULL, 16);
231 addr += base_address;
233 /* Get the value to write.
235 writeval = simple_strtoul(argv[2], NULL, 16);
239 count = simple_strtoul(argv[3], NULL, 16);
244 while (count-- > 0) {
246 *((ulong *)addr) = (ulong )writeval;
248 *((ushort *)addr) = (ushort)writeval;
250 *((u_char *)addr) = (u_char)writeval;
256 int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
258 ulong addr1, addr2, count, ngood;
263 printf ("Usage:\n%s\n", cmdtp->usage);
267 /* Check for size specification.
269 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
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");
289 while (count-- > 0) {
291 ulong word1 = *(ulong *)addr1;
292 ulong word2 = *(ulong *)addr2;
293 if (word1 != word2) {
294 printf("word at 0x%08lx (0x%08lx) "
295 "!= word at 0x%08lx (0x%08lx)\n",
296 addr1, word1, addr2, word2);
301 else if (size == 2) {
302 ushort hword1 = *(ushort *)addr1;
303 ushort hword2 = *(ushort *)addr2;
304 if (hword1 != hword2) {
305 printf("halfword at 0x%08lx (0x%04x) "
306 "!= halfword at 0x%08lx (0x%04x)\n",
307 addr1, hword1, addr2, hword2);
313 u_char byte1 = *(u_char *)addr1;
314 u_char byte2 = *(u_char *)addr2;
315 if (byte1 != byte2) {
316 printf("byte at 0x%08lx (0x%02x) "
317 "!= byte at 0x%08lx (0x%02x)\n",
318 addr1, byte1, addr2, byte2);
328 printf("Total of %ld %s%s were the same\n",
329 ngood, size == 4 ? "word" : size == 2 ? "halfword" : "byte",
330 ngood == 1 ? "" : "s");
334 int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
336 ulong addr, dest, count;
340 printf ("Usage:\n%s\n", cmdtp->usage);
344 /* Check for size specification.
346 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
349 addr = simple_strtoul(argv[1], NULL, 16);
350 addr += base_address;
352 dest = simple_strtoul(argv[2], NULL, 16);
353 dest += base_address;
355 count = simple_strtoul(argv[3], NULL, 16);
358 puts ("Zero length ???\n");
363 /* check if we are copying to Flash */
364 if ( (addr2info(dest) != NULL)
365 #ifdef CONFIG_HAS_DATAFLASH
366 && (!addr_dataflash(addr))
371 puts ("Copy to Flash... ");
373 rc = flash_write ((uchar *)addr, dest, count*size);
383 #if (CONFIG_COMMANDS & CFG_CMD_MMC)
384 if (mmc2info(dest)) {
387 puts ("Copy to MMC... ");
388 switch (rc = mmc_write ((uchar *)addr, dest, count*size)) {
396 printf ("%s[%d] FIXME: rc=%d\n",__FILE__,__LINE__,rc);
403 if (mmc2info(addr)) {
406 puts ("Copy from MMC... ");
407 switch (rc = mmc_read (addr, (uchar *)dest, count*size)) {
415 printf ("%s[%d] FIXME: rc=%d\n",__FILE__,__LINE__,rc);
423 #ifdef CONFIG_HAS_DATAFLASH
424 /* Check if we are copying from RAM or Flash to DataFlash */
425 if (addr_dataflash(dest) && !addr_dataflash(addr)){
428 puts ("Copy to DataFlash... ");
430 rc = write_dataflash (dest, addr, count*size);
433 dataflash_perror (rc);
440 /* Check if we are copying from DataFlash to RAM */
441 if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
443 rc = read_dataflash(addr, count * size, (char *) dest);
445 dataflash_perror (rc);
451 if (addr_dataflash(addr) && addr_dataflash(dest)){
452 puts ("Unsupported combination of source/destination.\n\r");
457 while (count-- > 0) {
459 *((ulong *)dest) = *((ulong *)addr);
461 *((ushort *)dest) = *((ushort *)addr);
463 *((u_char *)dest) = *((u_char *)addr);
470 int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
473 /* Set new base address.
475 base_address = simple_strtoul(argv[1], NULL, 16);
477 /* Print the current base address.
479 printf("Base Address: 0x%08lx\n", base_address);
483 int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
485 ulong addr, length, i, junk;
487 volatile uint *longp;
488 volatile ushort *shortp;
492 printf ("Usage:\n%s\n", cmdtp->usage);
496 /* Check for a size spefication.
497 * Defaults to long if no or incorrect specification.
499 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
502 /* Address is always specified.
504 addr = simple_strtoul(argv[1], NULL, 16);
506 /* Length is the number of objects, not number of bytes.
508 length = simple_strtoul(argv[2], NULL, 16);
510 /* We want to optimize the loops to run as fast as possible.
511 * If we have only one object, just run infinite loops.
515 longp = (uint *)addr;
520 shortp = (ushort *)addr;
531 longp = (uint *)addr;
539 shortp = (ushort *)addr;
554 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
556 ulong addr, length, i, data;
558 volatile uint *longp;
559 volatile ushort *shortp;
563 printf ("Usage:\n%s\n", cmdtp->usage);
567 /* Check for a size spefication.
568 * Defaults to long if no or incorrect specification.
570 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
573 /* Address is always specified.
575 addr = simple_strtoul(argv[1], NULL, 16);
577 /* Length is the number of objects, not number of bytes.
579 length = simple_strtoul(argv[2], NULL, 16);
582 data = simple_strtoul(argv[3], NULL, 16);
584 /* We want to optimize the loops to run as fast as possible.
585 * If we have only one object, just run infinite loops.
589 longp = (uint *)addr;
594 shortp = (ushort *)addr;
605 longp = (uint *)addr;
613 shortp = (ushort *)addr;
626 #endif /* CONFIG_LOOPW */
629 * Perform a memory test. A more complete alternative test can be
630 * configured using CFG_ALT_MEMTEST. The complete test loops until
631 * interrupted by ctrl-c or by a failure of one of the sub-tests.
633 int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
635 vu_long *addr, *start, *end;
639 #if defined(CFG_ALT_MEMTEST)
645 vu_long anti_pattern;
647 #if defined(CFG_MEMTEST_SCRATCH)
648 vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
650 vu_long *dummy = NULL;
655 static const ulong bitpattern[] = {
656 0x00000001, /* single bit */
657 0x00000003, /* two adjacent bits */
658 0x00000007, /* three adjacent bits */
659 0x0000000F, /* four adjacent bits */
660 0x00000005, /* two non-adjacent bits */
661 0x00000015, /* three non-adjacent bits */
662 0x00000055, /* four non-adjacent bits */
663 0xaaaaaaaa, /* alternating 1/0 */
672 start = (ulong *)simple_strtoul(argv[1], NULL, 16);
674 start = (ulong *)CFG_MEMTEST_START;
678 end = (ulong *)simple_strtoul(argv[2], NULL, 16);
680 end = (ulong *)(CFG_MEMTEST_END);
684 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
689 #if defined(CFG_ALT_MEMTEST)
690 printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
691 PRINTF("%s:%d: start 0x%p end 0x%p\n",
692 __FUNCTION__, __LINE__, start, end);
700 printf("Iteration: %6d\r", iterations);
701 PRINTF("Iteration: %6d\n", 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",
736 if(readback != ~val) {
737 printf ("FAILURE (data line): "
738 "Is %08lx, should be %08lx\n",
745 * Based on code whose Original Author and Copyright
746 * information follows: Copyright (c) 1998 by Michael
747 * Barr. This software is placed into the public
748 * domain and may be used for any purpose. However,
749 * this notice must not be changed or removed and no
750 * warranty is either expressed or implied by its
751 * publication or distribution.
757 * Description: Test the address bus wiring in a
758 * memory region by performing a walking
759 * 1's test on the relevant bits of the
760 * address and checking for aliasing.
761 * This test will find single-bit
762 * address failures such as stuck -high,
763 * stuck-low, and shorted pins. The base
764 * address and size of the region are
765 * selected by the caller.
767 * Notes: For best results, the selected base
768 * address should have enough LSB 0's to
769 * guarantee single address bit changes.
770 * For example, to test a 64-Kbyte
771 * region, select a base address on a
772 * 64-Kbyte boundary. Also, select the
773 * region size as a power-of-two if at
776 * Returns: 0 if the test succeeds, 1 if the test fails.
778 * ## NOTE ## Be sure to specify start and end
779 * addresses such that addr_mask has
780 * lots of bits set. For example an
781 * address range of 01000000 02000000 is
782 * bad while a range of 01000000
783 * 01ffffff is perfect.
785 addr_mask = ((ulong)end - (ulong)start)/sizeof(vu_long);
786 pattern = (vu_long) 0xaaaaaaaa;
787 anti_pattern = (vu_long) 0x55555555;
789 PRINTF("%s:%d: addr mask = 0x%.8lx\n",
790 __FUNCTION__, __LINE__,
793 * Write the default pattern at each of the
794 * power-of-two offsets.
796 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
797 start[offset] = pattern;
801 * Check for address bits stuck high.
804 start[test_offset] = anti_pattern;
806 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
807 temp = start[offset];
808 if (temp != pattern) {
809 printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
810 " expected 0x%.8lx, actual 0x%.8lx\n",
811 (ulong)&start[offset], pattern, temp);
815 start[test_offset] = pattern;
818 * Check for addr bits stuck low or shorted.
820 for (test_offset = 1; (test_offset & addr_mask) != 0; test_offset <<= 1) {
821 start[test_offset] = anti_pattern;
823 for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) {
824 temp = start[offset];
825 if ((temp != pattern) && (offset != test_offset)) {
826 printf ("\nFAILURE: Address bit stuck low or shorted @"
827 " 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
828 (ulong)&start[offset], pattern, temp);
832 start[test_offset] = pattern;
836 * Description: Test the integrity of a physical
837 * memory device by performing an
838 * increment/decrement test over the
839 * entire region. In the process every
840 * storage bit in the device is tested
841 * as a zero and a one. The base address
842 * and the size of the region are
843 * selected by the caller.
845 * Returns: 0 if the test succeeds, 1 if the test fails.
847 num_words = ((ulong)end - (ulong)start)/sizeof(vu_long) + 1;
850 * Fill memory with a known pattern.
852 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
853 start[offset] = pattern;
857 * Check each location and invert it for the second pass.
859 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
860 temp = start[offset];
861 if (temp != pattern) {
862 printf ("\nFAILURE (read/write) @ 0x%.8lx:"
863 " expected 0x%.8lx, actual 0x%.8lx)\n",
864 (ulong)&start[offset], pattern, temp);
868 anti_pattern = ~pattern;
869 start[offset] = anti_pattern;
873 * Check each location for the inverted pattern and zero it.
875 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
876 anti_pattern = ~pattern;
877 temp = start[offset];
878 if (temp != anti_pattern) {
879 printf ("\nFAILURE (read/write): @ 0x%.8lx:"
880 " expected 0x%.8lx, actual 0x%.8lx)\n",
881 (ulong)&start[offset], anti_pattern, temp);
888 #else /* The original, quickie test */
896 printf ("\rPattern %08lX Writing..."
898 "\b\b\b\b\b\b\b\b\b\b",
901 for (addr=start,val=pattern; addr<end; addr++) {
908 for (addr=start,val=pattern; addr<end; addr++) {
910 if (readback != val) {
911 printf ("\nMem error @ 0x%08X: "
912 "found %08lX, expected %08lX\n",
913 (uint)addr, readback, val);
920 * Flip the pattern each time to make lots of zeros and
921 * then, the next time, lots of ones. We decrement
922 * the "negative" patterns and increment the "positive"
923 * patterns to preserve this feature.
925 if(pattern & 0x80000000) {
926 pattern = -pattern; /* complement & increment */
941 * mm{.b, .w, .l} {addr}
942 * nm{.b, .w, .l} {addr}
945 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
949 extern char console_buffer[];
952 printf ("Usage:\n%s\n", cmdtp->usage);
956 #ifdef CONFIG_BOOT_RETRY_TIME
957 reset_cmd_timeout(); /* got a good command to get here */
959 /* We use the last specified parameters, unless new ones are
965 if ((flag & CMD_FLAG_REPEAT) == 0) {
966 /* New command specified. Check for a size specification.
967 * Defaults to long if no or incorrect specification.
969 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
972 /* Address is specified since argc > 1
974 addr = simple_strtoul(argv[1], NULL, 16);
975 addr += base_address;
978 #ifdef CONFIG_HAS_DATAFLASH
979 if (addr_dataflash(addr)){
980 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
985 /* Print the address, followed by value. Then accept input for
986 * the next value. A non-converted value exits.
989 printf("%08lx:", addr);
991 printf(" %08x", *((uint *)addr));
993 printf(" %04x", *((ushort *)addr));
995 printf(" %02x", *((u_char *)addr));
997 nbytes = readline (" ? ");
998 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
999 /* <CR> pressed as only input, don't modify current
1000 * location and move to next. "-" pressed will go back.
1003 addr += nbytes ? -size : size;
1005 #ifdef CONFIG_BOOT_RETRY_TIME
1006 reset_cmd_timeout(); /* good enough to not time out */
1009 #ifdef CONFIG_BOOT_RETRY_TIME
1010 else if (nbytes == -2) {
1011 break; /* timed out, exit the command */
1016 i = simple_strtoul(console_buffer, &endp, 16);
1017 nbytes = endp - console_buffer;
1019 #ifdef CONFIG_BOOT_RETRY_TIME
1020 /* good enough to not time out
1022 reset_cmd_timeout();
1025 *((uint *)addr) = i;
1027 *((ushort *)addr) = i;
1029 *((u_char *)addr) = i;
1036 mm_last_addr = addr;
1037 mm_last_size = size;
1041 #ifndef CONFIG_CRC32_VERIFY
1043 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1050 printf ("Usage:\n%s\n", cmdtp->usage);
1054 addr = simple_strtoul (argv[1], NULL, 16);
1055 addr += base_address;
1057 length = simple_strtoul (argv[2], NULL, 16);
1059 crc = crc32 (0, (const uchar *) addr, length);
1061 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1062 addr, addr + length - 1, crc);
1065 ptr = (ulong *) simple_strtoul (argv[3], NULL, 16);
1072 #else /* CONFIG_CRC32_VERIFY */
1074 int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1086 printf ("Usage:\n%s\n", cmdtp->usage);
1092 if (strcmp(*av, "-v") == 0) {
1101 addr = simple_strtoul(*av++, NULL, 16);
1102 addr += base_address;
1103 length = simple_strtoul(*av++, NULL, 16);
1105 crc = crc32(0, (const uchar *) addr, length);
1108 printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
1109 addr, addr + length - 1, crc);
1111 ptr = (ulong *) simple_strtoul (*av++, NULL, 16);
1115 vcrc = simple_strtoul(*av++, NULL, 16);
1117 printf ("CRC32 for %08lx ... %08lx ==> %08lx != %08lx ** ERROR **\n",
1118 addr, addr + length - 1, crc, vcrc);
1126 #endif /* CONFIG_CRC32_VERIFY */
1128 /**************************************************/
1129 #if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
1131 md, 3, 1, do_mem_md,
1132 "md - memory display\n",
1133 "[.b, .w, .l] address [# of objects]\n - memory display\n"
1138 mm, 2, 1, do_mem_mm,
1139 "mm - memory modify (auto-incrementing)\n",
1140 "[.b, .w, .l] address\n" " - memory modify, auto increment address\n"
1145 nm, 2, 1, do_mem_nm,
1146 "nm - memory modify (constant address)\n",
1147 "[.b, .w, .l] address\n - memory modify, read and keep address\n"
1151 mw, 4, 1, do_mem_mw,
1152 "mw - memory write (fill)\n",
1153 "[.b, .w, .l] address value [count]\n - write memory\n"
1157 cp, 4, 1, do_mem_cp,
1158 "cp - memory copy\n",
1159 "[.b, .w, .l] source target count\n - copy memory\n"
1163 cmp, 4, 1, do_mem_cmp,
1164 "cmp - memory compare\n",
1165 "[.b, .w, .l] addr1 addr2 count\n - compare memory\n"
1168 #ifndef CONFIG_CRC32_VERIFY
1171 crc32, 4, 1, do_mem_crc,
1172 "crc32 - checksum calculation\n",
1173 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1176 #else /* CONFIG_CRC32_VERIFY */
1179 crc32, 5, 1, do_mem_crc,
1180 "crc32 - checksum calculation\n",
1181 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1182 "-v address count crc\n - verify crc of memory area\n"
1185 #endif /* CONFIG_CRC32_VERIFY */
1188 base, 2, 1, do_mem_base,
1189 "base - print or set address offset\n",
1190 "\n - print address offset for memory commands\n"
1191 "base off\n - set address offset for memory commands to 'off'\n"
1195 loop, 3, 1, do_mem_loop,
1196 "loop - infinite loop on address range\n",
1197 "[.b, .w, .l] address number_of_objects\n"
1198 " - loop on a set of addresses\n"
1203 loopw, 4, 1, do_mem_loopw,
1204 "loopw - infinite write loop on address range\n",
1205 "[.b, .w, .l] address number_of_objects data_to_write\n"
1206 " - loop on a set of addresses\n"
1208 #endif /* CONFIG_LOOPW */
1211 mtest, 4, 1, do_mem_mtest,
1212 "mtest - simple RAM test\n",
1213 "[start [end [pattern]]]\n"
1214 " - simple RAM read/write test\n"
1218 #endif /* CFG_CMD_MEMORY */