2 * (C) Copyright 2014-2016, 2018 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, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
42 !mde
, 3, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
47 !mdf
, 3, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
52 !cpe
, 4, CTBL_DBG
, do_eep_cp
,
57 !mm
, 2, CTBL_DBG
|CTBL_RPT
, do_mem_mm_avr
,
58 "avr memory modify (auto-incrementing address)",
62 !nm
, 2, CTBL_DBG
|CTBL_RPT
, do_mem_nm_avr
,
63 "avr memory modify (constant address)",
67 !prfree
, 1, CTBL_DBG
|CTBL_RPT
, do_pr_free_avr
,
68 "print avr heap free list",
72 !prheap
, 1, CTBL_DBG
, do_pr_heap_avr
,
78 msize
, 1, 1, do_mem_size
,
83 mstep
, 2, 1, do_busreq_pulse
,
84 "execute one M cycle",
86 " - repeat count times"
89 echo
, CONFIG_SYS_MAXARGS
, 1, do_echo
,
90 "display a line of text",
91 "[-n] [argument ...]\n"
92 "- echo the argument(s) to console.\n"
93 " -n do not output the trailing newline"
96 sleep
, 2, 1, do_sleep
,
97 "delay execution for some time",
99 " - delay execution for decimal N (milli) seconds"
101 CMD_TBL_ITEM_COMPLETE(
102 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
103 "run commands in an environment variable",
105 " - run the commands in the environment variable(s) 'var'",
109 boot
, 1, 1, do_bootd
,
110 "boot default, i.e., run 'bootcmd'",
113 CMD_TBL_ITEM_COMPLETE(
114 source
, CONFIG_SYS_MAXARGS
, 1, do_source
,
115 "run commands from a file",
117 " - run the commands in the script file 'filename'",
122 env
, CONFIG_SYS_MAXARGS
, 0, do_env
,
123 "environment handling commands",
129 loadf
, 1, 0, do_loadf
,
130 "load srec_cat prepared image from controller flash",
134 bootcf
, CONFIG_SYS_MAXARGS
, 0, do_bootcf
,
137 " Load a number of sectors from the first CP/M partition and jump to\n"
138 " the load address.\n"
140 " Load and start address (default 100 hex)\n"
142 " First sector of partition to load (0..255, default 0)\n"
144 " Number of sectors to load (1..127, default 7)\n"
146 " Partition type to look for (default 52 hex)\n"
148 " Load only, do not execute\n"
150 " Timeout for IDE commands (1..65535, default 10000)\n"
155 loadcpm3
, 3, 0, do_loadcpm3
,
156 "load CPM3.SYS file",
157 "[filename [common-base [banked-base]]] \n"
158 " - Load CP/M 3 system file from FAT filesystem. This command makes\n"
159 " CPMLDR superfluous. Uses the following environment variables if set:\n"
160 " '"ENV_CPM3_SYSFILE
"' File to load. Default is '"CONFIG_CPM3_SYSFILE
"'.\n"
161 " '"ENV_CPM3_BANKED_BASE
"' Default is '"CONFIG_CPM3_BANKED_BASE_STR
"'.\n"
162 " Sets the following environment variables after loading:\n"
163 " '"ENV_CPM3_COMMON_BASE
"'\n"
164 " '"ENV_STARTADDRESS
"'"
167 loadi
, 2, 0, do_loadihex
,
168 "load intel hex file over serial line",
170 " - load Intel-Hex-Record file over serial line with offset 'offset'"
173 #if defined(CONFIG_CMD_LOADB)
175 loadb
, 1, 0, do_load_serial_bin
,
176 "load binary file over serial line (kermit mode)",
177 " - load binary file over serial line"
181 loadx
, 1, 0, do_load_serial_bin
,
182 "load binary file over serial line (xmodem mode)",
183 " - load binary file over serial line"
187 loady
, 1, 0, do_load_serial_bin
,
188 "load binary file over serial line (ymodem mode)",
189 " - load binary file over serial line"
191 #endif /* CONFIG_CMD_LOADB */
195 "start application at address 'addr'",
197 " - start application at address 'addr'"
199 // " passing 'arg' as arguments"
202 reset
, 1, 0, do_reset
,
203 "Keep CPU in RESET state",
207 restart
, 1, 1, do_restart
,
208 "Perform RESET of the CPU",
212 connect
, 1, 0, do_console
,
213 "Connect to CPU console i/o",
215 " - type the escape character followed by Q to close the connection, \n"
216 " or followed by ? to see other options. The default escape character \n"
217 " is Ctrl-^ (0x1E). It can be changed by setting env var '"ENV_ESC_CHAR
"'."
222 pin
, CONFIG_SYS_MAXARGS
, 1, do_gpio
,
223 "Set or query pin state",
225 " - print cofiguration and state or frequency of pins\n"
226 " print all pins, if argument is omitted\n"
227 "pin <pins> h[igh]|l[ow]\n"
228 " - config pins as output and set to level high or low\n"
229 "pin <pins> ts|i[n]|p[ullup]\n"
230 " - config pins as input/tristate or input with pullup\n"
231 "pin <pins> value[K|M][Hz]\n"
232 " - output a clock on pins\n"
233 " value is system clock divider or frequency, if 'Hz' is appended\n"
234 " divider is rounded down to next possible value (depends on pin)\n"
236 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
240 md
, 3, CTBL_RPT
, do_mem_md
,
242 "address [# of objects]"
245 mm
, 2, CTBL_RPT
, do_mem_mm
,
246 "memory modify (auto-incrementing address)",
250 nm
, 2, CTBL_RPT
, do_mem_nm
,
251 "memory modify (constant address)",
255 mw
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mw
,
256 "memory write (fill)",
257 "[-bwl] address value [count]\n"
258 " -b write value as byte (8 bit, default)\n"
259 " -w write value as word (16 bit)\n"
260 " -l write value as long (32 bit)"
263 mcp
, 4, CTBL_RPT
, do_mem_cp
,
265 "source target count"
268 mcmp
, 4, CTBL_RPT
, do_mem_cmp
,
273 base
, 2, 0, do_mem_base
,
274 "print or set address offset",
276 " - print address offset for memory commands\n"
278 " - set address offset for memory commands to 'offset'"
281 mloop
, 3, CTBL_RPT
, do_mem_loop
,
282 "infinite loop on address range",
283 "address number_of_bytes"
286 mloopw
, 4, CTBL_RPT
, do_mem_loopw
,
287 "infinite write loop on address range",
288 "address number_of_bytes data_to_write"
291 #ifdef CONFIG_CMD_MEMTEST
293 mtest
, 4, CTBL_RPT
, do_mem_mtest
,
294 "simple RAM read/write test",
295 "[start [end [iterations]]]"
297 #endif /* CONFIG_CMD_MEMTEST */
299 #ifdef CONFIG_MX_CYCLIC
301 mdc
, 4, CTBL_RPT
, do_mem_mdc
,
302 "memory display cyclic",
303 "address count delay(ms)"
306 mwc
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mdc
,
307 "memory write cyclic",
308 "[-bwl] address value delay(ms)\n"
309 " -b write value as byte (8 bit, default)\n"
310 " -w write value as word (16 bit)\n"
311 " -l write value as long (32 bit)"
313 #endif /* CONFIG_MX_CYCLIC */
316 sd
, CONFIG_SYS_MAXARGS
, 0, do_sd
,
317 "SD/MMC card handling commands",
318 "<subcommand> args ...\n"
320 " - print help on subcommands",
324 fat
, CONFIG_SYS_MAXARGS
, 0, do_fat
,
325 "fat filesystem commands",
326 "<subcommand> args ...\n"
328 " - print help on subcommands",
333 attach
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_attach
,
334 "attach filesystem image file to CP/M drive",
335 "[-rw] [-o options] dsk<n> diskfile\n"
336 " Attach diskfile to dsk<n>, where n in 0.."CONFIG_CPM_MAX_DRNR_STR
"\n"
337 " -r File is read only (write protected)\n"
338 " -w File is read/write (default)\n"
340 " Options is a comma-separated list of\n"
341 " ro, rw, debug, nodebug\n"
343 "attach [-rw] -o reattach[,other options] dsk<n>\n"
344 " Change options for dsk<n>.\n"
345 " Options as above.\n"
347 "attach -d -a|dsk<n>\n"
349 " Detach diskfile from dsk<n>.\n"
353 " Without arguments, list current assignments"
356 detach
, 2, 0, do_attach
,
357 "detach file from CP/M drive",
359 " - alias for 'attach -d dsk<n>'"
363 help
, CONFIG_SYS_MAXARGS
, 0, do_help
,
364 "print command description/usage",
366 " print brief description of all commands\n"
367 " -a print description of subcommands too\n"
368 "help -fk keyword ...\n"
369 " print brief description of commands matching keyword\n"
370 " -f search keyword in command name\n"
371 " -k search keyword in command name and description\n"
372 "help [-a] command ...\n"
373 " print detailed usage of 'command'"
376 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
377 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
378 FSTR("alias for 'help'"),
379 #ifdef CONFIG_SYS_LONGHELP
381 #endif /* CONFIG_SYS_LONGHELP */
383 #ifdef CONFIG_AUTO_COMPLETE
387 /* Mark end of table */