3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
11 * Copied from FADS ROM, Dan Malek (dmalek@jlc.net)
16 #ifdef CONFIG_HAS_DATAFLASH
17 #include <dataflash.h>
22 #include <linux/compiler.h>
24 DECLARE_GLOBAL_DATA_PTR;
26 #ifndef CONFIG_SYS_MEMTEST_SCRATCH
27 #define CONFIG_SYS_MEMTEST_SCRATCH 0
30 static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
32 /* Display values from last command.
33 * Memory modify remembered values are different from display memory.
35 static uint dp_last_addr, dp_last_size;
36 static uint dp_last_length = 0x40;
37 static uint mm_last_addr, mm_last_size;
39 static ulong base_address = 0;
44 * md{.b, .w, .l} {addr} {len}
46 #define DISP_LINE_LEN 16
47 static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
50 #if defined(CONFIG_HAS_DATAFLASH)
51 ulong nbytes, linebytes;
56 /* We use the last specified parameters, unless new ones are
61 length = dp_last_length;
66 if ((flag & CMD_FLAG_REPEAT) == 0) {
67 /* New command specified. Check for a size specification.
68 * Defaults to long if no or incorrect specification.
70 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
73 /* Address is specified since argc > 1
75 addr = simple_strtoul(argv[1], NULL, 16);
78 /* If another parameter, it is the length to display.
79 * Length is the number of objects, not number of bytes.
82 length = simple_strtoul(argv[2], NULL, 16);
85 #if defined(CONFIG_HAS_DATAFLASH)
88 * We buffer all read data, so we can make sure data is read only
89 * once, and all accesses are with the specified bus width.
91 nbytes = length * size;
93 char linebuf[DISP_LINE_LEN];
95 linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
97 rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
98 p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
99 print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
107 } while (nbytes > 0);
110 # if defined(CONFIG_BLACKFIN)
111 /* See if we're trying to display L1 inst */
112 if (addr_bfin_on_chip_mem(addr)) {
113 char linebuf[DISP_LINE_LEN];
114 ulong linebytes, nbytes = length * size;
116 linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
117 memcpy(linebuf, (void *)addr, linebytes);
118 print_buffer(addr, linebuf, size, linebytes/size, DISP_LINE_LEN/size);
126 } while (nbytes > 0);
131 ulong bytes = size * length;
132 const void *buf = map_sysmem(addr, bytes);
134 /* Print the lines. */
135 print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
142 dp_last_length = length;
147 static int do_mem_mm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
149 return mod_mem (cmdtp, 1, flag, argc, argv);
151 static int do_mem_nm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
153 return mod_mem (cmdtp, 0, flag, argc, argv);
156 static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
158 ulong addr, writeval, count;
163 if ((argc < 3) || (argc > 4))
164 return CMD_RET_USAGE;
166 /* Check for size specification.
168 if ((size = cmd_get_data_size(argv[0], 4)) < 1)
171 /* Address is specified since argc > 1
173 addr = simple_strtoul(argv[1], NULL, 16);
174 addr += base_address;
176 /* Get the value to write.
178 writeval = simple_strtoul(argv[2], NULL, 16);
182 count = simple_strtoul(argv[3], NULL, 16);
187 bytes = size * count;
188 buf = map_sysmem(addr, bytes);
189 while (count-- > 0) {
191 *((ulong *)buf) = (ulong)writeval;
193 *((ushort *)buf) = (ushort)writeval;
195 *((u_char *)buf) = (u_char)writeval;
202 #ifdef CONFIG_MX_CYCLIC
203 int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
209 return CMD_RET_USAGE;
211 count = simple_strtoul(argv[3], NULL, 10);
214 do_mem_md (NULL, 0, 3, argv);
216 /* delay for <count> ms... */
217 for (i=0; i<count; i++)
220 /* check for ctrl-c to abort... */
230 int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
236 return CMD_RET_USAGE;
238 count = simple_strtoul(argv[3], NULL, 10);
241 do_mem_mw (NULL, 0, 3, argv);
243 /* delay for <count> ms... */
244 for (i=0; i<count; i++)
247 /* check for ctrl-c to abort... */
256 #endif /* CONFIG_MX_CYCLIC */
258 static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
260 ulong addr1, addr2, count, ngood, bytes;
264 const void *buf1, *buf2, *base;
267 return CMD_RET_USAGE;
269 /* Check for size specification.
271 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
273 type = size == 4 ? "word" : size == 2 ? "halfword" : "byte";
275 addr1 = simple_strtoul(argv[1], NULL, 16);
276 addr1 += base_address;
278 addr2 = simple_strtoul(argv[2], NULL, 16);
279 addr2 += base_address;
281 count = simple_strtoul(argv[3], NULL, 16);
283 #ifdef CONFIG_HAS_DATAFLASH
284 if (addr_dataflash(addr1) | addr_dataflash(addr2)){
285 puts ("Comparison with DataFlash space not supported.\n\r");
290 #ifdef CONFIG_BLACKFIN
291 if (addr_bfin_on_chip_mem(addr1) || addr_bfin_on_chip_mem(addr2)) {
292 puts ("Comparison with L1 instruction memory not supported.\n\r");
297 bytes = size * count;
298 base = buf1 = map_sysmem(addr1, bytes);
299 buf2 = map_sysmem(addr2, bytes);
300 for (ngood = 0; ngood < count; ++ngood) {
303 word1 = *(ulong *)buf1;
304 word2 = *(ulong *)buf2;
305 } else if (size == 2) {
306 word1 = *(ushort *)buf1;
307 word2 = *(ushort *)buf2;
309 word1 = *(u_char *)buf1;
310 word2 = *(u_char *)buf2;
312 if (word1 != word2) {
313 ulong offset = buf1 - base;
315 printf("%s at 0x%08lx (%#0*lx) != %s at 0x%08lx (%#0*lx)\n",
316 type, (ulong)(addr1 + offset), size, word1,
317 type, (ulong)(addr2 + offset), size, word2);
325 /* reset watchdog from time to time */
326 if ((ngood % (64 << 10)) == 0)
332 printf("Total of %ld %s(s) were the same\n", ngood, type);
336 static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
338 ulong addr, dest, count, bytes;
344 return CMD_RET_USAGE;
346 /* Check for size specification.
348 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
351 addr = simple_strtoul(argv[1], NULL, 16);
352 addr += base_address;
354 dest = simple_strtoul(argv[2], NULL, 16);
355 dest += base_address;
357 count = simple_strtoul(argv[3], NULL, 16);
360 puts ("Zero length ???\n");
364 #ifndef CONFIG_SYS_NO_FLASH
365 /* check if we are copying to Flash */
366 if ( (addr2info(dest) != NULL)
367 #ifdef CONFIG_HAS_DATAFLASH
368 && (!addr_dataflash(dest))
373 puts ("Copy to Flash... ");
375 rc = flash_write ((char *)addr, dest, count*size);
385 #ifdef CONFIG_HAS_DATAFLASH
386 /* Check if we are copying from RAM or Flash to DataFlash */
387 if (addr_dataflash(dest) && !addr_dataflash(addr)){
390 puts ("Copy to DataFlash... ");
392 rc = write_dataflash (dest, addr, count*size);
395 dataflash_perror (rc);
402 /* Check if we are copying from DataFlash to RAM */
403 if (addr_dataflash(addr) && !addr_dataflash(dest)
404 #ifndef CONFIG_SYS_NO_FLASH
405 && (addr2info(dest) == NULL)
409 rc = read_dataflash(addr, count * size, (char *) dest);
411 dataflash_perror (rc);
417 if (addr_dataflash(addr) && addr_dataflash(dest)){
418 puts ("Unsupported combination of source/destination.\n\r");
423 #ifdef CONFIG_BLACKFIN
424 /* See if we're copying to/from L1 inst */
425 if (addr_bfin_on_chip_mem(dest) || addr_bfin_on_chip_mem(addr)) {
426 memcpy((void *)dest, (void *)addr, count * size);
431 bytes = size * count;
432 buf = map_sysmem(dest, bytes);
433 src = map_sysmem(addr, bytes);
434 while (count-- > 0) {
436 *((ulong *)buf) = *((ulong *)src);
438 *((ushort *)buf) = *((ushort *)src);
440 *((u_char *)buf) = *((u_char *)src);
444 /* reset watchdog from time to time */
445 if ((count % (64 << 10)) == 0)
451 static int do_mem_base(cmd_tbl_t *cmdtp, int flag, int argc,
455 /* Set new base address.
457 base_address = simple_strtoul(argv[1], NULL, 16);
459 /* Print the current base address.
461 printf("Base Address: 0x%08lx\n", base_address);
465 static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
468 ulong addr, length, i, bytes;
470 volatile uint *longp;
471 volatile ushort *shortp;
476 return CMD_RET_USAGE;
479 * Check for a size specification.
480 * Defaults to long if no or incorrect specification.
482 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
485 /* Address is always specified.
487 addr = simple_strtoul(argv[1], NULL, 16);
489 /* Length is the number of objects, not number of bytes.
491 length = simple_strtoul(argv[2], NULL, 16);
493 bytes = size * length;
494 buf = map_sysmem(addr, bytes);
496 /* We want to optimize the loops to run as fast as possible.
497 * If we have only one object, just run infinite loops.
506 shortp = (ushort *)buf;
525 shortp = (ushort *)buf;
543 int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
545 ulong addr, length, i, data, bytes;
547 volatile uint *longp;
548 volatile ushort *shortp;
553 return CMD_RET_USAGE;
556 * Check for a size specification.
557 * Defaults to long if no or incorrect specification.
559 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
562 /* Address is always specified.
564 addr = simple_strtoul(argv[1], NULL, 16);
566 /* Length is the number of objects, not number of bytes.
568 length = simple_strtoul(argv[2], NULL, 16);
571 data = simple_strtoul(argv[3], NULL, 16);
573 bytes = size * length;
574 buf = map_sysmem(addr, bytes);
576 /* We want to optimize the loops to run as fast as possible.
577 * If we have only one object, just run infinite loops.
586 shortp = (ushort *)buf;
605 shortp = (ushort *)buf;
618 #endif /* CONFIG_LOOPW */
620 #ifdef CONFIG_CMD_MEMTEST
621 static ulong mem_test_alt(vu_long *buf, ulong start_addr, ulong end_addr,
632 vu_long anti_pattern;
634 static const ulong bitpattern[] = {
635 0x00000001, /* single bit */
636 0x00000003, /* two adjacent bits */
637 0x00000007, /* three adjacent bits */
638 0x0000000F, /* four adjacent bits */
639 0x00000005, /* two non-adjacent bits */
640 0x00000015, /* three non-adjacent bits */
641 0x00000055, /* four non-adjacent bits */
642 0xaaaaaaaa, /* alternating 1/0 */
645 num_words = (end_addr - start_addr) / sizeof(vu_long);
648 * Data line test: write a pattern to the first
649 * location, write the 1's complement to a 'parking'
650 * address (changes the state of the data bus so a
651 * floating bus doesn't give a false OK), and then
652 * read the value back. Note that we read it back
653 * into a variable because the next time we read it,
654 * it might be right (been there, tough to explain to
655 * the quality guys why it prints a failure when the
656 * "is" and "should be" are obviously the same in the
659 * Rather than exhaustively testing, we test some
660 * patterns by shifting '1' bits through a field of
661 * '0's and '0' bits through a field of '1's (i.e.
662 * pattern and ~pattern).
665 for (j = 0; j < sizeof(bitpattern) / sizeof(bitpattern[0]); j++) {
667 for (; val != 0; val <<= 1) {
669 *dummy = ~val; /* clear the test data off the bus */
671 if (readback != val) {
672 printf("FAILURE (data line): "
673 "expected %08lx, actual %08lx\n",
682 if (readback != ~val) {
683 printf("FAILURE (data line): "
684 "Is %08lx, should be %08lx\n",
694 * Based on code whose Original Author and Copyright
695 * information follows: Copyright (c) 1998 by Michael
696 * Barr. This software is placed into the public
697 * domain and may be used for any purpose. However,
698 * this notice must not be changed or removed and no
699 * warranty is either expressed or implied by its
700 * publication or distribution.
706 * Description: Test the address bus wiring in a
707 * memory region by performing a walking
708 * 1's test on the relevant bits of the
709 * address and checking for aliasing.
710 * This test will find single-bit
711 * address failures such as stuck-high,
712 * stuck-low, and shorted pins. The base
713 * address and size of the region are
714 * selected by the caller.
716 * Notes: For best results, the selected base
717 * address should have enough LSB 0's to
718 * guarantee single address bit changes.
719 * For example, to test a 64-Kbyte
720 * region, select a base address on a
721 * 64-Kbyte boundary. Also, select the
722 * region size as a power-of-two if at
725 * Returns: 0 if the test succeeds, 1 if the test fails.
727 pattern = (vu_long) 0xaaaaaaaa;
728 anti_pattern = (vu_long) 0x55555555;
730 debug("%s:%d: length = 0x%.8lx\n", __func__, __LINE__, num_words);
732 * Write the default pattern at each of the
733 * power-of-two offsets.
735 for (offset = 1; offset < num_words; offset <<= 1)
736 addr[offset] = pattern;
739 * Check for address bits stuck high.
742 addr[test_offset] = anti_pattern;
744 for (offset = 1; offset < num_words; offset <<= 1) {
746 if (temp != pattern) {
747 printf("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
748 " expected 0x%.8lx, actual 0x%.8lx\n",
749 start_addr + offset, pattern, temp);
755 addr[test_offset] = pattern;
759 * Check for addr bits stuck low or shorted.
761 for (test_offset = 1; test_offset < num_words; test_offset <<= 1) {
762 addr[test_offset] = anti_pattern;
764 for (offset = 1; offset < num_words; offset <<= 1) {
766 if ((temp != pattern) && (offset != test_offset)) {
767 printf("\nFAILURE: Address bit stuck low or"
768 " shorted @ 0x%.8lx: expected 0x%.8lx,"
770 start_addr + offset, pattern, temp);
776 addr[test_offset] = pattern;
780 * Description: Test the integrity of a physical
781 * memory device by performing an
782 * increment/decrement test over the
783 * entire region. In the process every
784 * storage bit in the device is tested
785 * as a zero and a one. The base address
786 * and the size of the region are
787 * selected by the caller.
789 * Returns: 0 if the test succeeds, 1 if the test fails.
794 * Fill memory with a known pattern.
796 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
798 addr[offset] = pattern;
802 * Check each location and invert it for the second pass.
804 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
807 if (temp != pattern) {
808 printf("\nFAILURE (read/write) @ 0x%.8lx:"
809 " expected 0x%.8lx, actual 0x%.8lx)\n",
810 start_addr + offset, pattern, temp);
816 anti_pattern = ~pattern;
817 addr[offset] = anti_pattern;
821 * Check each location for the inverted pattern and zero it.
823 for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
825 anti_pattern = ~pattern;
827 if (temp != anti_pattern) {
828 printf("\nFAILURE (read/write): @ 0x%.8lx:"
829 " expected 0x%.8lx, actual 0x%.8lx)\n",
830 start_addr + offset, anti_pattern, temp);
841 static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
842 vu_long pattern, int iteration)
850 /* Alternate the pattern */
855 * Flip the pattern each time to make lots of zeros and
856 * then, the next time, lots of ones. We decrement
857 * the "negative" patterns and increment the "positive"
858 * patterns to preserve this feature.
860 if (pattern & 0x80000000)
861 pattern = -pattern; /* complement & increment */
865 length = (end_addr - start_addr) / sizeof(ulong);
867 printf("\rPattern %08lX Writing..."
869 "\b\b\b\b\b\b\b\b\b\b",
872 for (addr = buf, val = pattern; addr < end; addr++) {
880 for (addr = buf, val = pattern; addr < end; addr++) {
883 if (readback != val) {
884 ulong offset = addr - buf;
886 printf("\nMem error @ 0x%08X: "
887 "found %08lX, expected %08lX\n",
888 (uint)(uintptr_t)(start_addr + offset),
901 * Perform a memory test. A more complete alternative test can be
902 * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
903 * interrupted by ctrl-c or by a failure of one of the sub-tests.
905 static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
909 vu_long *buf, *dummy;
912 ulong errs = 0; /* number of errors, or -1 if interrupted */
915 #if defined(CONFIG_SYS_ALT_MEMTEST)
916 const int alt_test = 1;
918 const int alt_test = 0;
922 start = simple_strtoul(argv[1], NULL, 16);
924 start = CONFIG_SYS_MEMTEST_START;
927 end = simple_strtoul(argv[2], NULL, 16);
929 end = CONFIG_SYS_MEMTEST_END;
932 pattern = (ulong)simple_strtoul(argv[3], NULL, 16);
937 iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
941 printf("Testing %08x ... %08x:\n", (uint)start, (uint)end);
942 debug("%s:%d: start %#08lx end %#08lx\n", __func__, __LINE__,
945 buf = map_sysmem(start, end - start);
946 dummy = map_sysmem(CONFIG_SYS_MEMTEST_SCRATCH, sizeof(vu_long));
948 !iteration_limit || iteration < iteration_limit;
955 printf("Iteration: %6d\r", iteration + 1);
958 errs = mem_test_alt(buf, start, end, dummy);
960 errs = mem_test_quick(buf, start, end, pattern,
968 * Work-around for eldk-4.2 which gives this warning if we try to
969 * case in the unmap_sysmem() call:
970 * warning: initialization discards qualifiers from pointer target type
973 void *vbuf = (void *)buf;
974 void *vdummy = (void *)dummy;
977 unmap_sysmem(vdummy);
981 /* Memory test was aborted - write a newline to finish off */
985 printf("Tested %d iteration(s) with %lu errors.\n",
990 return ret; /* not reached */
992 #endif /* CONFIG_CMD_MEMTEST */
997 * mm{.b, .w, .l} {addr}
998 * nm{.b, .w, .l} {addr}
1001 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
1008 return CMD_RET_USAGE;
1010 #ifdef CONFIG_BOOT_RETRY_TIME
1011 reset_cmd_timeout(); /* got a good command to get here */
1013 /* We use the last specified parameters, unless new ones are
1016 addr = mm_last_addr;
1017 size = mm_last_size;
1019 if ((flag & CMD_FLAG_REPEAT) == 0) {
1020 /* New command specified. Check for a size specification.
1021 * Defaults to long if no or incorrect specification.
1023 if ((size = cmd_get_data_size(argv[0], 4)) < 0)
1026 /* Address is specified since argc > 1
1028 addr = simple_strtoul(argv[1], NULL, 16);
1029 addr += base_address;
1032 #ifdef CONFIG_HAS_DATAFLASH
1033 if (addr_dataflash(addr)){
1034 puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
1039 #ifdef CONFIG_BLACKFIN
1040 if (addr_bfin_on_chip_mem(addr)) {
1041 puts ("Can't modify L1 instruction in place. Use cp instead.\n\r");
1046 /* Print the address, followed by value. Then accept input for
1047 * the next value. A non-converted value exits.
1050 ptr = map_sysmem(addr, size);
1051 printf("%08lx:", addr);
1053 printf(" %08x", *((uint *)ptr));
1055 printf(" %04x", *((ushort *)ptr));
1057 printf(" %02x", *((u_char *)ptr));
1059 nbytes = readline (" ? ");
1060 if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
1061 /* <CR> pressed as only input, don't modify current
1062 * location and move to next. "-" pressed will go back.
1065 addr += nbytes ? -size : size;
1067 #ifdef CONFIG_BOOT_RETRY_TIME
1068 reset_cmd_timeout(); /* good enough to not time out */
1071 #ifdef CONFIG_BOOT_RETRY_TIME
1072 else if (nbytes == -2) {
1073 break; /* timed out, exit the command */
1078 i = simple_strtoul(console_buffer, &endp, 16);
1079 nbytes = endp - console_buffer;
1081 #ifdef CONFIG_BOOT_RETRY_TIME
1082 /* good enough to not time out
1084 reset_cmd_timeout();
1089 *((ushort *)ptr) = i;
1091 *((u_char *)ptr) = i;
1100 mm_last_addr = addr;
1101 mm_last_size = size;
1105 #ifdef CONFIG_CMD_CRC32
1107 static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
1114 return CMD_RET_USAGE;
1118 #ifdef CONFIG_HASH_VERIFY
1119 if (strcmp(*av, "-v") == 0) {
1120 flags |= HASH_FLAG_VERIFY;
1126 return hash_command("crc32", flags, cmdtp, flag, ac, av);
1131 /**************************************************/
1133 md, 3, 1, do_mem_md,
1135 "[.b, .w, .l] address [# of objects]"
1140 mm, 2, 1, do_mem_mm,
1141 "memory modify (auto-incrementing address)",
1142 "[.b, .w, .l] address"
1147 nm, 2, 1, do_mem_nm,
1148 "memory modify (constant address)",
1149 "[.b, .w, .l] address"
1153 mw, 4, 1, do_mem_mw,
1154 "memory write (fill)",
1155 "[.b, .w, .l] address value [count]"
1159 cp, 4, 1, do_mem_cp,
1161 "[.b, .w, .l] source target count"
1165 cmp, 4, 1, do_mem_cmp,
1167 "[.b, .w, .l] addr1 addr2 count"
1170 #ifdef CONFIG_CMD_CRC32
1172 #ifndef CONFIG_CRC32_VERIFY
1175 crc32, 4, 1, do_mem_crc,
1176 "checksum calculation",
1177 "address count [addr]\n - compute CRC32 checksum [save at addr]"
1180 #else /* CONFIG_CRC32_VERIFY */
1183 crc32, 5, 1, do_mem_crc,
1184 "checksum calculation",
1185 "address count [addr]\n - compute CRC32 checksum [save at addr]\n"
1186 "-v address count crc\n - verify crc of memory area"
1189 #endif /* CONFIG_CRC32_VERIFY */
1193 #ifdef CONFIG_CMD_MEMINFO
1194 __weak void board_show_dram(ulong size)
1197 print_size(size, "\n");
1200 static int do_mem_info(cmd_tbl_t *cmdtp, int flag, int argc,
1201 char * const argv[])
1203 board_show_dram(gd->ram_size);
1210 base, 2, 1, do_mem_base,
1211 "print or set address offset",
1212 "\n - print address offset for memory commands\n"
1213 "base off\n - set address offset for memory commands to 'off'"
1217 loop, 3, 1, do_mem_loop,
1218 "infinite loop on address range",
1219 "[.b, .w, .l] address number_of_objects"
1224 loopw, 4, 1, do_mem_loopw,
1225 "infinite write loop on address range",
1226 "[.b, .w, .l] address number_of_objects data_to_write"
1228 #endif /* CONFIG_LOOPW */
1230 #ifdef CONFIG_CMD_MEMTEST
1232 mtest, 5, 1, do_mem_mtest,
1233 "simple RAM read/write test",
1234 "[start [end [pattern [iterations]]]]"
1236 #endif /* CONFIG_CMD_MEMTEST */
1238 #ifdef CONFIG_MX_CYCLIC
1240 mdc, 4, 1, do_mem_mdc,
1241 "memory display cyclic",
1242 "[.b, .w, .l] address count delay(ms)"
1246 mwc, 4, 1, do_mem_mwc,
1247 "memory write cyclic",
1248 "[.b, .w, .l] address value delay(ms)"
1250 #endif /* CONFIG_MX_CYCLIC */
1252 #ifdef CONFIG_CMD_MEMINFO
1254 meminfo, 3, 1, do_mem_info,
1255 "display memory information",