wdenk | 78f6622 | 2002-08-27 10:27:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 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, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | /* |
| 25 | * Memory Functions |
| 26 | */ |
| 27 | #ifndef _CMD_MEM_H |
| 28 | #define _CMD_MEM_H |
| 29 | |
| 30 | #if (CONFIG_COMMANDS & CFG_CMD_MEMORY) |
| 31 | #define CMD_TBL_MD MK_CMD_TBL_ENTRY( \ |
| 32 | "md", 2, 3, 1, do_mem_md, \ |
| 33 | "md - memory display\n", \ |
| 34 | "[.b, .w, .l] address [# of objects]\n - memory display\n" \ |
| 35 | ), |
| 36 | #define CMD_TBL_MM MK_CMD_TBL_ENTRY( \ |
| 37 | "mm", 2, 2, 1, do_mem_mm, \ |
| 38 | "mm - memory modify (auto-incrementing)\n", \ |
| 39 | "[.b, .w, .l] address\n" \ |
| 40 | " - memory modify, auto increment address\n" \ |
| 41 | ), |
| 42 | #define CMD_TBL_NM MK_CMD_TBL_ENTRY( \ |
| 43 | "nm", 2, 2, 1, do_mem_nm, \ |
| 44 | "nm - memory modify (constant address)\n", \ |
| 45 | "[.b, .w, .l] address\n - memory modify, read and keep address\n" \ |
| 46 | ), |
| 47 | #define CMD_TBL_MW MK_CMD_TBL_ENTRY( \ |
| 48 | "mw", 2, 4, 1, do_mem_mw, \ |
| 49 | "mw - memory write (fill)\n", \ |
| 50 | "[.b, .w, .l] address value [count]\n - write memory\n" \ |
| 51 | ), |
| 52 | #define CMD_TBL_CP MK_CMD_TBL_ENTRY( \ |
| 53 | "cp", 2, 4, 1, do_mem_cp, \ |
| 54 | "cp - memory copy\n", \ |
| 55 | "[.b, .w, .l] source target count\n - copy memory\n" \ |
| 56 | ), |
| 57 | #define CMD_TBL_CMP MK_CMD_TBL_ENTRY( \ |
| 58 | "cmp", 3, 4, 1, do_mem_cmp, \ |
| 59 | "cmp - memory compare\n", \ |
| 60 | "[.b, .w, .l] addr1 addr2 count\n - compare memory\n" \ |
| 61 | ), |
| 62 | #define CMD_TBL_CRC MK_CMD_TBL_ENTRY( \ |
| 63 | "crc32", 3, 4, 1, do_mem_crc, \ |
| 64 | "crc32 - checksum calculation\n", \ |
| 65 | "address count [addr]\n - compute CRC32 checksum [save at addr]\n" \ |
| 66 | ), |
| 67 | #define CMD_TBL_BASE MK_CMD_TBL_ENTRY( \ |
| 68 | "base", 2, 2, 1, do_mem_base, \ |
| 69 | "base - print or set address offset\n", \ |
| 70 | "\n - print address offset for memory commands\n" \ |
| 71 | "base off\n - set address offset for memory commands to 'off'\n" \ |
| 72 | ), |
| 73 | /* |
| 74 | * Require full name for "loop" and "mtest" because these are infinite loops! |
| 75 | */ |
| 76 | #define CMD_TBL_LOOP MK_CMD_TBL_ENTRY( \ |
| 77 | "loop", 4, 3, 1, do_mem_loop, \ |
| 78 | "loop - infinite loop on address range\n", \ |
| 79 | "[.b, .w, .l] address number_of_objects\n" \ |
| 80 | " - loop on a set of addresses\n" \ |
| 81 | ), |
| 82 | #define CMD_TBL_MTEST MK_CMD_TBL_ENTRY( \ |
| 83 | "mtest", 5, 4, 1, do_mem_mtest, \ |
| 84 | "mtest - simple RAM test\n", \ |
| 85 | "[start [end [pattern]]]\n" \ |
| 86 | " - simple RAM read/write test\n" \ |
| 87 | ), |
| 88 | int do_mem_md (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 89 | int do_mem_mm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 90 | int do_mem_nm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 91 | int do_mem_mw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 92 | int do_mem_cp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 93 | int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 94 | int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 95 | int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 96 | int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 97 | int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 98 | |
| 99 | #else |
| 100 | #define CMD_TBL_MD |
| 101 | #define CMD_TBL_MM |
| 102 | #define CMD_TBL_NM |
| 103 | #define CMD_TBL_MW |
| 104 | #define CMD_TBL_CP |
| 105 | #define CMD_TBL_CMP |
| 106 | #define CMD_TBL_CRC |
| 107 | #define CMD_TBL_BASE |
| 108 | #define CMD_TBL_LOOP |
| 109 | #define CMD_TBL_MTEST |
| 110 | #endif /* CFG_CMD_MEMORY */ |
| 111 | |
| 112 | #endif /* _CMD_MEM_H */ |