]>
Commit | Line | Data |
---|---|---|
d684c216 L |
1 | |
2 | #include "common.h" | |
3 | ||
4 | #include "command.h" | |
72f58822 | 5 | #include "cmd_mem.h" |
d684c216 L |
6 | |
7 | ||
d0581f88 L |
8 | extern command_ret_t do_help(cmd_tbl_t *, int, int, char * const []); |
9 | extern command_ret_t do_echo(cmd_tbl_t *, int, int, char * const []); | |
10 | extern command_ret_t do_env_print(cmd_tbl_t *, int, int, char * const []); | |
11 | extern command_ret_t do_env_set(cmd_tbl_t *, int, int, char * const []); | |
12 | extern command_ret_t do_env_save(cmd_tbl_t *, int, int, char * const []); | |
13 | extern command_ret_t do_loadf(cmd_tbl_t *, int, int, char * const []); | |
14 | extern command_ret_t do_go(cmd_tbl_t *, int, int, char * const []); | |
15 | extern command_ret_t do_restart(cmd_tbl_t *, int, int, char * const []); | |
16 | extern command_ret_t do_dump_mem(cmd_tbl_t *, int, int, char * const []); | |
17 | extern command_ret_t do_eep_cp(cmd_tbl_t *, int, int, char * const []); | |
18 | extern command_ret_t do_busreq_pulse(cmd_tbl_t *, int, int, char * const []); | |
d684c216 L |
19 | |
20 | ||
21 | cmd_tbl_t cmd_tbl[] = { | |
22 | ||
323398b1 L |
23 | #ifdef DEBUG |
24 | CMD_TBL_ITEM( | |
f338df2a L |
25 | !mdr, 3, 1, do_dump_mem, |
26 | "RAM dump", | |
27 | "address [count]" | |
28 | ), | |
29 | CMD_TBL_ITEM( | |
30 | !mde, 3, 1, do_dump_mem, | |
323398b1 L |
31 | "EEPROM dump", |
32 | "address [count]" | |
33 | ), | |
34 | CMD_TBL_ITEM( | |
f338df2a | 35 | !cpe, 4, 0, do_eep_cp, |
323398b1 L |
36 | "EEPROM copy", |
37 | "source target count" | |
38 | ), | |
39 | #endif | |
f338df2a L |
40 | CMD_TBL_ITEM( |
41 | mstep, 2, 1, do_busreq_pulse, | |
42 | "execute one M cycle", | |
43 | "[count]\n" | |
44 | " - repeat count times" | |
45 | ), | |
d684c216 L |
46 | CMD_TBL_ITEM( |
47 | echo, CONFIG_SYS_MAXARGS, 1, do_echo, | |
48 | "echo args to console", | |
49 | "[args..]\n" | |
50 | " - echo args to console; \\c suppresses newline" | |
51 | ), | |
52 | CMD_TBL_ITEM_COMPLETE( | |
53 | run, CONFIG_SYS_MAXARGS, 1, do_run, | |
54 | "run commands in an environment variable", | |
55 | "var [...]\n" | |
56 | " - run the commands in the environment variable(s) 'var'", | |
57 | var_complete | |
58 | ), | |
59 | CMD_TBL_ITEM_COMPLETE( | |
60 | printenv, CONFIG_SYS_MAXARGS, 1, do_env_print, | |
61 | "print environment variables", | |
72f58822 | 62 | "\n" |
534e1dfc | 63 | " - print values of all environment variables\n" |
d684c216 L |
64 | "printenv name ...\n" |
65 | " - print value of environment variable 'name'", | |
66 | var_complete | |
67 | ), | |
68 | CMD_TBL_ITEM_COMPLETE( | |
69 | setenv, CONFIG_SYS_MAXARGS, 0, do_env_set, | |
70 | "set environment variables", | |
72f58822 L |
71 | "name value ...\n" |
72 | " - set environment variable 'name' to 'value ...'\n" | |
73 | "setenv name\n" | |
74 | " - delete environment variable 'name'", | |
d684c216 L |
75 | var_complete |
76 | ), | |
323398b1 L |
77 | CMD_TBL_ITEM( |
78 | saveenv, 1, 0, do_env_save, | |
79 | "save environment variables to persistent storage", | |
80 | "" | |
81 | ), | |
72f58822 | 82 | |
534e1dfc | 83 | CMD_TBL_ITEM( |
323398b1 | 84 | loadf, 1, 0, do_loadf, |
534e1dfc L |
85 | "load srec_cat prepared image from controller flash", |
86 | "" | |
87 | ), | |
88 | CMD_TBL_ITEM( | |
323398b1 | 89 | go, 2, 0, do_go, |
534e1dfc L |
90 | "start application at address 'addr'", |
91 | "addr\n" | |
92 | " - start application at address 'addr'" | |
93 | // "\n" | |
94 | // " passing 'arg' as arguments" | |
95 | ), | |
96 | CMD_TBL_ITEM( | |
323398b1 | 97 | reset, 1, 0, do_reset, |
534e1dfc L |
98 | "Keep CPU in RESET state", |
99 | "" | |
100 | ), | |
101 | CMD_TBL_ITEM( | |
102 | restart, 1, 0, do_restart, | |
103 | "Perform RESET of the CPU", | |
104 | "" | |
105 | ), | |
106 | ||
72f58822 L |
107 | CMD_TBL_ITEM( |
108 | md, 3, 1, do_mem_md, | |
109 | "memory display", | |
110 | "address [# of objects]" | |
111 | ), | |
112 | CMD_TBL_ITEM( | |
113 | mm, 2, 1, do_mem_mm, | |
114 | "memory modify (auto-incrementing address)", | |
115 | "address" | |
116 | ), | |
117 | CMD_TBL_ITEM( | |
118 | nm, 2, 1, do_mem_nm, | |
119 | "memory modify (constant address)", | |
120 | "address" | |
121 | ), | |
122 | CMD_TBL_ITEM( | |
123 | mw, 4, 1, do_mem_mw, | |
124 | "memory write (fill)", | |
125 | "address value [count]" | |
126 | ), | |
127 | CMD_TBL_ITEM( | |
128 | cp, 4, 1, do_mem_cp, | |
129 | "memory copy", | |
130 | "source target count" | |
131 | ), | |
132 | CMD_TBL_ITEM( | |
133 | cmp, 4, 1, do_mem_cmp, | |
134 | "memory compare", | |
135 | "addr1 addr2 count" | |
136 | ), | |
137 | CMD_TBL_ITEM( | |
138 | base, 2, 1, do_mem_base, | |
139 | "print or set address offset", | |
140 | "\n" | |
141 | " - print address offset for memory commands\n" | |
142 | "base offset\n" | |
143 | " - set address offset for memory commands to 'offset'" | |
144 | ), | |
145 | CMD_TBL_ITEM( | |
146 | loop, 3, 1, do_mem_loop, | |
147 | "infinite loop on address range", | |
148 | "address number_of_bytes" | |
149 | ), | |
150 | #ifdef CONFIG_LOOPW | |
151 | CMD_TBL_ITEM( | |
152 | loopw, 4, 1, do_mem_loopw, | |
153 | "infinite write loop on address range", | |
154 | "address number_of_bytes data_to_write" | |
155 | ), | |
156 | #endif /* CONFIG_LOOPW */ | |
157 | ||
158 | #ifdef CONFIG_CMD_MEMTEST | |
159 | CMD_TBL_ITEM( | |
160 | mtest, 5, 1, do_mem_mtest, | |
161 | "simple RAM read/write test", | |
162 | "[start [end [pattern [iterations]]]]" | |
163 | ), | |
164 | #endif /* CONFIG_CMD_MEMTEST */ | |
165 | ||
166 | #ifdef CONFIG_MX_CYCLIC | |
167 | CMD_TBL_ITEM( | |
168 | mdc, 4, 1, do_mem_mdc, | |
169 | "memory display cyclic", | |
170 | "address count delay(ms)" | |
171 | ), | |
172 | CMD_TBL_ITEM( | |
173 | mwc, 4, 1, do_mem_mwc, | |
174 | "memory write cyclic", | |
175 | "address value delay(ms)" | |
176 | ), | |
177 | #endif /* CONFIG_MX_CYCLIC */ | |
178 | ||
179 | ||
d684c216 L |
180 | CMD_TBL_ITEM( |
181 | help, CONFIG_SYS_MAXARGS, 1, do_help, | |
182 | "print command description/usage", | |
183 | "\n" | |
184 | " - print brief description of all commands\n" | |
185 | "help command ...\n" | |
186 | " - print detailed usage of 'command'" | |
187 | ), | |
188 | ||
72f58822 | 189 | /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */ |
d684c216 L |
190 | {FSTR("?"), CONFIG_SYS_MAXARGS, 1, do_help, |
191 | FSTR("alias for 'help'"), | |
192 | #ifdef CONFIG_SYS_LONGHELP | |
193 | FSTR(""), | |
194 | #endif /* CONFIG_SYS_LONGHELP */ | |
195 | #ifdef CONFIG_AUTO_COMPLETE | |
196 | 0, | |
197 | #endif | |
198 | }, | |
199 | /* Mark end of table */ | |
200 | { 0 }, | |
201 | }; |