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
, 1, 1, do_pr_free_avr
,
68 "print avr heap free list",
72 !prheap
, 1, 1, do_pr_heap_avr
,
78 mstep
, 2, 1, do_busreq_pulse
,
79 "execute one M cycle",
81 " - repeat count times"
84 echo
, CONFIG_SYS_MAXARGS
, 1, do_echo
,
85 "display a line of text",
86 "[-n] [argument ...]\n"
87 "- echo the argument(s) to console.\n"
88 " -n do not output the trailing newline"
91 sleep
, 2, 1, do_sleep
,
92 "delay execution for some time",
94 " - delay execution for decimal N (milli) seconds"
96 CMD_TBL_ITEM_COMPLETE(
97 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
98 "run commands in an environment variable",
100 " - run the commands in the environment variable(s) 'var'",
103 CMD_TBL_ITEM_COMPLETE(
104 source
, CONFIG_SYS_MAXARGS
, 1, do_source
,
105 "run commands from a file",
107 " - run the commands in the script file 'filename'",
110 CMD_TBL_ITEM_COMPLETE(
111 printenv
, CONFIG_SYS_MAXARGS
, 1, do_env_print
,
112 "print environment variables",
114 " - print values of all environment variables\n"
115 "printenv name ...\n"
116 " - print value of environment variable 'name'",
119 CMD_TBL_ITEM_COMPLETE(
120 setenv
, CONFIG_SYS_MAXARGS
, 0, do_env_set
,
121 "set environment variables",
123 " - set environment variable 'name' to 'value ...'\n"
125 " - delete environment variable 'name'",
129 saveenv
, 1, 0, do_env_save
,
130 "save environment variables to persistent storage",
134 defaultenv
, 1, 0, do_env_default
,
135 "set all environment variables to their default values",
140 loadf
, 1, 0, do_loadf
,
141 "load srec_cat prepared image from controller flash",
145 bootcf
, CONFIG_SYS_MAXARGS
, 0, do_bootcf
,
148 " Load a number of sectors from the first CP/M partition and jump to\n"
149 " the load address.\n"
151 " Load and start address (default 100 hex)\n"
153 " First sector of partition to load (0..255, default 0)\n"
155 " Number of sectors to load (1..127, default 7)\n"
157 " Partition type to look for (default 52 hex)\n"
159 " Load only, do not execute\n"
161 " Timeout for IDE commands (1..65535, default 10000)\n"
166 loadcpm3
, 3, 0, do_loadcpm3
,
167 "load CPM3.SYS file",
168 "[filename [common-base [banked-base]]] \n"
169 " - Load CP/M 3 system file from FAT filesystem. This command makes\n"
170 " CPMLDR superfluous. Uses the following environment variables if set:\n"
171 " '"ENV_CPM3_SYSFILE
"' File to load. Default is '"CONFIG_CPM3_SYSFILE
"'.\n"
172 " '"ENV_CPM3_BANKED_BASE
"' Default is '"CONFIG_CPM3_BANKED_BASE_STR
"'.\n"
173 " Sets the following environment variables after loading:\n"
174 " '"ENV_CPM3_COMMON_BASE
"'\n"
175 " '"ENV_STARTADDRESS
"'"
178 loadi
, 2, 0, do_loadihex
,
179 "load intel hex file over serial line",
181 " - load Intel-Hex-Record file over serial line with offset 'offset'"
184 #if defined(CONFIG_CMD_LOADB)
186 loadb
, 1, 0, do_load_serial_bin
,
187 "load binary file over serial line (kermit mode)",
188 " - load binary file over serial line"
192 loadx
, 1, 0, do_load_serial_bin
,
193 "load binary file over serial line (xmodem mode)",
194 " - load binary file over serial line"
198 loady
, 1, 0, do_load_serial_bin
,
199 "load binary file over serial line (ymodem mode)",
200 " - load binary file over serial line"
202 #endif /* CONFIG_CMD_LOADB */
206 "start application at address 'addr'",
208 " - start application at address 'addr'"
210 // " passing 'arg' as arguments"
213 reset
, 1, 0, do_reset
,
214 "Keep CPU in RESET state",
218 restart
, 1, 1, do_restart
,
219 "Perform RESET of the CPU",
223 connect
, 1, 0, do_console
,
224 "Connect to CPU console i/o",
226 " - type the escape character followed by Q to close the connection, \n"
227 " or followed by ? to see other options. The default escape character \n"
228 " is Ctrl-^ (0x1E). It can be changed by setting env var '"ENV_ESC_CHAR
"'."
233 pin
, CONFIG_SYS_MAXARGS
, 1, do_gpio
,
234 "Set or query pin state",
236 " - print cofiguration and state or frequency of pins\n"
237 " print all pins, if argument is omitted\n"
238 "pin <pins> h[igh]|l[ow]\n"
239 " - config pins as output and set to level high or low\n"
240 "pin <pins> ts|i[n]|p[ullup]\n"
241 " - config pins as input/tristate or input with pullup\n"
242 "pin <pins> value[K|M][Hz]\n"
243 " - output a clock on pins\n"
244 " value is system clock divider or frequency, if 'Hz' is appended\n"
245 " divider is rounded down to next possible value (depends on pin)\n"
247 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
251 md
, 3, CTBL_REPEAT
, do_mem_md
,
253 "address [# of objects]"
256 mm
, 2, CTBL_REPEAT
, do_mem_mm
,
257 "memory modify (auto-incrementing address)",
261 nm
, 2, CTBL_REPEAT
, do_mem_nm
,
262 "memory modify (constant address)",
266 mw
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_mem_mw
,
267 "memory write (fill)",
268 "[-bwl] address value [count]\n"
269 " -b write value as byte (8 bit, default)\n"
270 " -w write value as word (16 bit)\n"
271 " -l write value as long (32 bit)"
274 cp
, 4, CTBL_REPEAT
, do_mem_cp
,
276 "source target count"
279 cmp
, 4, CTBL_REPEAT
, do_mem_cmp
,
284 base
, 2, 0, do_mem_base
,
285 "print or set address offset",
287 " - print address offset for memory commands\n"
289 " - set address offset for memory commands to 'offset'"
292 mloop
, 3, CTBL_REPEAT
, do_mem_loop
,
293 "infinite loop on address range",
294 "address number_of_bytes"
297 mloopw
, 4, CTBL_REPEAT
, do_mem_loopw
,
298 "infinite write loop on address range",
299 "address number_of_bytes data_to_write"
302 #ifdef CONFIG_CMD_MEMTEST
304 mtest
, 4, CTBL_REPEAT
, do_mem_mtest
,
305 "simple RAM read/write test",
306 "[start [end [iterations]]]"
308 #endif /* CONFIG_CMD_MEMTEST */
310 #ifdef CONFIG_MX_CYCLIC
312 mdc
, 4, CTBL_REPEAT
, do_mem_mdc
,
313 "memory display cyclic",
314 "address count delay(ms)"
317 mwc
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_mem_mdc
,
318 "memory write cyclic",
319 "[-bwl] address value delay(ms)\n"
320 " -b write value as byte (8 bit, default)\n"
321 " -w write value as word (16 bit)\n"
322 " -l write value as long (32 bit)"
324 #endif /* CONFIG_MX_CYCLIC */
327 sd
, CONFIG_SYS_MAXARGS
, CTBL_SUBCMDAUTO
, do_sd
,
328 "SD/MMC card handling commands",
329 "<subcommand> args ...\n"
331 " - print help on subcommands",
335 fat
, CONFIG_SYS_MAXARGS
, CTBL_SUBCMD
|CTBL_SUBCMDAUTO
, do_fat
,
336 "fat filesystem commands",
337 "<subcommand> args ...\n"
339 " - print help on subcommands",
344 attach
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_attach
,
345 "attach filesystem image file to CP/M drive",
346 "[-rw] [-o options] dsk<n> diskfile\n"
347 " Attach diskfile to dsk<n>, where n in 0..7\n"
348 " -r File is read only (write protected)\n"
349 " -w File is read/write (default)\n"
351 " Options is a comma-separated list of\n"
352 " ro, rw, debug, nodebug\n"
354 "attach [-rw] -o reattach[,other options] dsk<n>\n"
355 " Change options for dsk<n>.\n"
356 " Options as above.\n"
358 "attach -d -a|dsk<n>\n"
360 " Detach diskfile from dsk<n>.\n"
364 " Without arguments, list current assignments"
367 detach
, 2, CTBL_REPEAT
, do_attach
,
368 "detach file from CP/M drive",
370 " - alias for 'attach -d dsk<n>'"
374 help
, CONFIG_SYS_MAXARGS
, CTBL_REPEAT
, do_help
,
375 "print command description/usage",
377 " - print brief description of all commands\n"
379 " - print detailed usage of 'command'"
382 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
383 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
384 FSTR("alias for 'help'"),
385 #ifdef CONFIG_SYS_LONGHELP
387 #endif /* CONFIG_SYS_LONGHELP */
389 #ifdef CONFIG_AUTO_COMPLETE
393 /* Mark end of table */