2 * (C) Copyright 2014-2016 Leo C. <erbl259-lmu@yahoo.de>
4 * SPDX-License-Identifier: GPL-2.0
14 #include "cmd_loadcpm3.h"
15 #include "cmd_loadihex.h"
19 #include "cmd_attach.h"
24 cmd_tbl_t cmd_tbl
[] = {
28 "get/set date & time",
29 "[MMDDhhmm[[CC]YY][.ss]]\n"
30 " - without arguments: print date & time\n"
31 " - with numeric argument: set the system date & time\n"
37 !mdr
, 3, 1, do_dump_mem
,
42 !mde
, 3, 1, do_dump_mem
,
47 !mdf
, 3, 1, do_dump_mem
,
52 !cpe
, 4, 0, do_eep_cp
,
57 !mm
, 2, 1, do_mem_mm_avr
,
58 "avr memory modify (auto-incrementing address)",
62 !nm
, 2, 1, do_mem_nm_avr
,
63 "avr memory modify (constant address)",
67 !prfree
, 2, 1, do_pr_free_avr
,
68 "print avr heap free list",
73 mstep
, 2, 1, do_busreq_pulse
,
74 "execute one M cycle",
76 " - repeat count times"
79 echo
, CONFIG_SYS_MAXARGS
, 1, do_echo
,
80 "display a line of text",
81 "[-n] [argument ...]\n"
82 "- echo the argument(s) to console.\n"
83 " -n do not output the trailing newline"
86 sleep
, 2, 1, do_sleep
,
87 "delay execution for some time",
89 " - delay execution for decimal N (milli) seconds"
91 CMD_TBL_ITEM_COMPLETE(
92 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
93 "run commands in an environment variable",
95 " - run the commands in the environment variable(s) 'var'",
98 CMD_TBL_ITEM_COMPLETE(
99 source
, CONFIG_SYS_MAXARGS
, 1, do_source
,
100 "run commands from a file",
102 " - run the commands in the script file 'filename'",
105 CMD_TBL_ITEM_COMPLETE(
106 printenv
, CONFIG_SYS_MAXARGS
, 1, do_env_print
,
107 "print environment variables",
109 " - print values of all environment variables\n"
110 "printenv name ...\n"
111 " - print value of environment variable 'name'",
114 CMD_TBL_ITEM_COMPLETE(
115 setenv
, CONFIG_SYS_MAXARGS
, 0, do_env_set
,
116 "set environment variables",
118 " - set environment variable 'name' to 'value ...'\n"
120 " - delete environment variable 'name'",
124 saveenv
, 1, 0, do_env_save
,
125 "save environment variables to persistent storage",
129 defaultenv
, 1, 0, do_env_default
,
130 "set all environment variables to their default values",
135 loadf
, 1, 0, do_loadf
,
136 "load srec_cat prepared image from controller flash",
140 bootcf
, CONFIG_SYS_MAXARGS
, 0, do_bootcf
,
143 " Load a number of sectors from the first CP/M partition and jump to\n"
144 " the load address.\n"
146 " Load and start address (default 100 hex)\n"
148 " First sector of partition to load (0..255, default 0)\n"
150 " Number of sectors to load (1..127, default 7)\n"
152 " Partition type to look for (default 52 hex)\n"
154 " Load only, do not execute\n"
156 " Timeout for IDE commands (1..65535, default 10000)\n"
161 loadcpm3
, 3, 0, do_loadcpm3
,
162 "load CPM3.SYS file",
163 "[filename [common-base [banked-base]]] \n"
164 " - Load CP/M 3 system file from FAT filesystem. This command makes\n"
165 " CPMLDR superfluous. Uses the following environment variables if set:\n"
166 " '"ENV_CPM3_SYSFILE
"' File to load. Default is '"CONFIG_CPM3_SYSFILE
"'.\n"
167 " '"ENV_CPM3_BANKED_BASE
"' Default is '"CONFIG_CPM3_BANKED_BASE_STR
"'.\n"
168 " Sets the following environment variables after loading:\n"
169 " '"ENV_CPM3_COMMON_BASE
"'\n"
170 " '"ENV_STARTADDRESS
"'"
173 loadi
, 2, 0, do_loadihex
,
174 "load intel hex file over serial line",
176 " - load Intel-Hex-Record file over serial line with offset 'offset'"
179 #if defined(CONFIG_CMD_LOADB)
181 loadb
, 1, 0, do_load_serial_bin
,
182 "load binary file over serial line (kermit mode)",
183 " - load binary file over serial line"
187 loadx
, 1, 0, do_load_serial_bin
,
188 "load binary file over serial line (xmodem mode)",
189 " - load binary file over serial line"
193 loady
, 1, 0, do_load_serial_bin
,
194 "load binary file over serial line (ymodem mode)",
195 " - load binary file over serial line"
197 #endif /* CONFIG_CMD_LOADB */
201 "start application at address 'addr'",
203 " - start application at address 'addr'"
205 // " passing 'arg' as arguments"
208 reset
, 1, 0, do_reset
,
209 "Keep CPU in RESET state",
213 restart
, 1, 1, do_restart
,
214 "Perform RESET of the CPU",
218 connect
, 1, 0, do_console
,
219 "Connect to CPU console i/o",
221 " - type the escape character followed by Q to close the connection, \n"
222 " or followed by ? to see other options. The default escape character \n"
223 " is Ctrl-^ (0x1E). It can be changed by setting env var '"ENV_ESC_CHAR
"'."
228 pin
, CONFIG_SYS_MAXARGS
, 1, do_gpio
,
229 "Set or query pin state",
231 " - print cofiguration and state or frequency of pins\n"
232 " print all pins, if argument is omitted\n"
233 "pin <pins> h[igh]|l[ow]\n"
234 " - config pins as output and set to level high or low\n"
235 "pin <pins> ts|i[n]|p[ullup]\n"
236 " - config pins as input/tristate or input with pullup\n"
237 "pin <pins> value[K|M][Hz]\n"
238 " - output a clock on pins\n"
239 " value is system clock divider or frequency, if 'Hz' is appended\n"
240 " divider is rounded down to next possible value (depends on pin)\n"
242 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
246 md
, 3, CTBL_REPEAT
, do_mem_md
,
248 "address [# of objects]"
251 mm
, 2, CTBL_REPEAT
, do_mem_mm
,
252 "memory modify (auto-incrementing address)",
256 nm
, 2, CTBL_REPEAT
, do_mem_nm
,
257 "memory modify (constant address)",
261 mw
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_mem_mw
,
262 "memory write (fill)",
263 "[-bwl] address value [count]\n"
264 " -b write value as byte (8 bit, default)\n"
265 " -w write value as word (16 bit)\n"
266 " -l write value as long (32 bit)"
269 cp
, 4, CTBL_REPEAT
, do_mem_cp
,
271 "source target count"
274 cmp
, 4, CTBL_REPEAT
, do_mem_cmp
,
279 base
, 2, 0, do_mem_base
,
280 "print or set address offset",
282 " - print address offset for memory commands\n"
284 " - set address offset for memory commands to 'offset'"
287 mloop
, 3, CTBL_REPEAT
, do_mem_loop
,
288 "infinite loop on address range",
289 "address number_of_bytes"
292 mloopw
, 4, CTBL_REPEAT
, do_mem_loopw
,
293 "infinite write loop on address range",
294 "address number_of_bytes data_to_write"
297 #ifdef CONFIG_CMD_MEMTEST
299 mtest
, 4, CTBL_REPEAT
, do_mem_mtest
,
300 "simple RAM read/write test",
301 "[start [end [iterations]]]"
303 #endif /* CONFIG_CMD_MEMTEST */
305 #ifdef CONFIG_MX_CYCLIC
307 mdc
, 4, CTBL_REPEAT
, do_mem_mdc
,
308 "memory display cyclic",
309 "address count delay(ms)"
312 mwc
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_mem_mdc
,
313 "memory write cyclic",
314 "[-bwl] address value delay(ms)\n"
315 " -b write value as byte (8 bit, default)\n"
316 " -w write value as word (16 bit)\n"
317 " -l write value as long (32 bit)"
319 #endif /* CONFIG_MX_CYCLIC */
322 sd
, CONFIG_SYS_MAXARGS
, CTBL_SUBCMDAUTO
, do_sd
,
323 "SD/MMC card handling commands",
324 "<subcommand> args ...\n"
326 " - print help on subcommands",
330 fat
, CONFIG_SYS_MAXARGS
, CTBL_SUBCMD
|CTBL_SUBCMDAUTO
, do_fat
,
331 "fat filesystem commands",
332 "<subcommand> args ...\n"
334 " - print help on subcommands",
339 attach
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_attach
,
340 "attach filesystem image file to CP/M drive",
341 "[-rw] [-o options] dsk<n> diskfile\n"
342 " Attach diskfile to dsk<n>, where n in 0..7\n"
343 " -r File is read only (write protected)\n"
344 " -w File is read/write (default)\n"
346 " Options is a comma-separated list of\n"
347 " ro, rw, debug, nodebug\n"
349 "attach [-rw] -o reattach[,other options] dsk<n>\n"
350 " Change options for dsk<n>.\n"
351 " Options as above.\n"
353 "attach -d -a|dsk<n>\n"
355 " Detach diskfile from dsk<n>.\n"
359 " Without arguments, list current assignments"
362 detach
, 2, CTBL_REPEAT
, do_attach
,
363 "detach file from CP/M drive",
365 " - alias for 'attach -d dsk<n>'"
369 help
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_help
,
370 "print command description/usage",
372 " - print brief description of all commands\n"
374 " - print detailed usage of 'command'"
377 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
378 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
379 FSTR("alias for 'help'"),
380 #ifdef CONFIG_SYS_LONGHELP
382 #endif /* CONFIG_SYS_LONGHELP */
384 #ifdef CONFIG_AUTO_COMPLETE
388 /* Mark end of table */