2 * (C) Copyright 2014-2016, 2018 Leo C. <erbl259-lmu@yahoo.de>
4 * SPDX-License-Identifier: GPL-2.0
15 #include "cmd_loadcpm3.h"
16 #include "cmd_loadihex.h"
20 #include "cmd_attach.h"
25 cmd_tbl_t cmd_tbl
[] = {
28 xx
, CONFIG_SYS_MAXARGS
, 0, do_cpu
,
29 "experimental commands",
30 "<subcommand> args ...\n"
38 "get/set date & time",
39 "[MMDDhhmm[[CC]YY][.ss]]\n"
40 " - without arguments: print date & time\n"
41 " - with numeric argument: set the system date & time\n"
47 !mdr
, 3, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
52 !mde
, 3, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
57 !mdf
, 3, CTBL_DBG
|CTBL_RPT
, do_dump_mem
,
62 !cpe
, 4, CTBL_DBG
, do_eep_cp
,
67 !mm
, 2, CTBL_DBG
|CTBL_RPT
, do_mem_mm_avr
,
68 "avr memory modify (auto-incrementing address)",
72 !nm
, 2, CTBL_DBG
|CTBL_RPT
, do_mem_nm_avr
,
73 "avr memory modify (constant address)",
77 !prfree
, 1, CTBL_DBG
|CTBL_RPT
, do_pr_free_avr
,
78 "print avr heap free list",
82 !prheap
, 1, CTBL_DBG
, do_pr_heap_avr
,
88 msize
, 1, 1, do_mem_size
,
93 mstep
, 2, 1, do_busreq_pulse
,
94 "execute one M cycle",
96 " - repeat count times"
99 echo
, CONFIG_SYS_MAXARGS
, 1, do_echo
,
100 "display a line of text",
101 "[-n] [argument ...]\n"
102 "- echo the argument(s) to console.\n"
103 " -n do not output the trailing newline"
106 sleep
, 2, 1, do_sleep
,
107 "delay execution for some time",
109 " - delay execution for decimal N (milli) seconds"
111 CMD_TBL_ITEM_COMPLETE(
112 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
113 "run commands in an environment variable",
115 " - run the commands in the environment variable(s) 'var'",
119 boot
, 1, 1, do_bootd
,
120 "boot default, i.e., run 'bootcmd'",
123 CMD_TBL_ITEM_COMPLETE(
124 source
, CONFIG_SYS_MAXARGS
, 1, do_source
,
125 "run commands from a file",
127 " - run the commands in the script file 'filename'",
132 env
, CONFIG_SYS_MAXARGS
, 0, do_env
,
133 "environment handling commands",
139 loadf
, 1, 0, do_loadf
,
140 "load srec_cat prepared image from controller flash",
144 bootcf
, CONFIG_SYS_MAXARGS
, 0, do_bootcf
,
147 " Load a number of sectors from the first CP/M partition and jump to\n"
148 " the load address.\n"
150 " Load and start address (default 100 hex)\n"
152 " First sector of partition to load (0..255, default 0)\n"
154 " Number of sectors to load (1..127, default 7)\n"
156 " Partition type to look for (default 52 hex)\n"
158 " Load only, do not execute\n"
160 " Timeout for IDE commands (1..65535, default 10000)\n"
165 loadcpm3
, 3, 0, do_loadcpm3
,
166 "load CPM3.SYS file",
167 "[filename [common-base [banked-base]]] \n"
168 " - Load CP/M 3 system file from FAT filesystem. This command makes\n"
169 " CPMLDR superfluous. Uses the following environment variables if set:\n"
170 " '"ENV_CPM3_SYSFILE
"' File to load. Default is '"CONFIG_CPM3_SYSFILE
"'.\n"
171 " '"ENV_CPM3_BANKED_BASE
"' Default is '"CONFIG_CPM3_BANKED_BASE_STR
"'.\n"
172 " Sets the following environment variables after loading:\n"
173 " '"ENV_CPM3_COMMON_BASE
"'\n"
174 " '"ENV_STARTADDRESS
"'"
177 loadi
, 2, 0, do_loadihex
,
178 "load intel hex file over serial line",
180 " - load Intel-Hex-Record file over serial line with offset 'offset'"
183 #if defined(CONFIG_CMD_LOADB)
185 loadb
, 1, 0, do_load_serial_bin
,
186 "load binary file over serial line (kermit mode)",
187 " - load binary file over serial line"
191 loadx
, 1, 0, do_load_serial_bin
,
192 "load binary file over serial line (xmodem mode)",
193 " - load binary file over serial line"
197 loady
, 1, 0, do_load_serial_bin
,
198 "load binary file over serial line (ymodem mode)",
199 " - load binary file over serial line"
201 #endif /* CONFIG_CMD_LOADB */
204 go
, CONFIG_SYS_MAXARGS
, 0, do_go
,
205 "start application at address 'addr'",
207 " - start application at address 'addr'"
210 reset
, 1, 0, do_reset
,
211 "Keep CPU in RESET state",
215 restart
, 1, 1, do_restart
,
216 "Perform RESET of the CPU",
220 connect
, 1, 0, do_console
,
221 "Connect to CPU console i/o",
223 " - type the escape character followed by Q to close the connection, \n"
224 " or followed by ? to see other options. The default escape character \n"
225 " is Ctrl-^ (0x1E). It can be changed by setting env var '"ENV_ESC_CHAR
"'."
230 pin
, CONFIG_SYS_MAXARGS
, 1, do_gpio
,
231 "Set or query pin state",
233 " - print cofiguration and state or frequency of pins\n"
234 " print all pins, if argument is omitted\n"
235 "pin <pins> h[igh]|l[ow]\n"
236 " - config pins as output and set to level high or low\n"
237 "pin <pins> ts|i[n]|p[ullup]\n"
238 " - config pins as input/tristate or input with pullup\n"
239 "pin <pins> value[K|M][Hz]\n"
240 " - output a clock on pins\n"
241 " value is system clock divider or frequency, if 'Hz' is appended\n"
242 " divider is rounded down to next possible value (depends on pin)\n"
244 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
248 md
, 3, CTBL_RPT
, do_mem_md
,
250 "address [# of objects]"
253 mm
, 2, CTBL_RPT
, do_mem_mm
,
254 "memory modify (auto-incrementing address)",
258 nm
, 2, CTBL_RPT
, do_mem_nm
,
259 "memory modify (constant address)",
263 mw
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mw
,
264 "memory write (fill)",
265 "[-bwl] address value [count]\n"
266 " -b write value as byte (8 bit, default)\n"
267 " -w write value as word (16 bit)\n"
268 " -l write value as long (32 bit)"
271 mcp
, 4, CTBL_RPT
, do_mem_cp
,
273 "source target count"
276 mcmp
, 4, CTBL_RPT
, do_mem_cmp
,
281 base
, 2, 0, do_mem_base
,
282 "print or set address offset",
284 " - print address offset for memory commands\n"
286 " - set address offset for memory commands to 'offset'"
289 mloop
, 3, CTBL_RPT
, do_mem_loop
,
290 "infinite loop on address range",
291 "address number_of_bytes"
294 mloopw
, 4, CTBL_RPT
, do_mem_loopw
,
295 "infinite write loop on address range",
296 "address number_of_bytes data_to_write"
299 #ifdef CONFIG_CMD_MEMTEST
301 mtest
, 4, CTBL_RPT
, do_mem_mtest
,
302 "simple RAM read/write test",
303 "[start [end [iterations]]]"
305 #endif /* CONFIG_CMD_MEMTEST */
307 #ifdef CONFIG_MX_CYCLIC
309 mdc
, 4, CTBL_RPT
, do_mem_mdc
,
310 "memory display cyclic",
311 "address count delay(ms)"
314 mwc
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mdc
,
315 "memory write cyclic",
316 "[-bwl] address value delay(ms)\n"
317 " -b write value as byte (8 bit, default)\n"
318 " -w write value as word (16 bit)\n"
319 " -l write value as long (32 bit)"
321 #endif /* CONFIG_MX_CYCLIC */
324 sd
, CONFIG_SYS_MAXARGS
, 0, do_sd
,
325 "SD/MMC card handling commands",
326 "<subcommand> args ...\n"
328 " - print help on subcommands",
332 fat
, CONFIG_SYS_MAXARGS
, 0, do_fat
,
333 "fat filesystem commands",
334 "<subcommand> args ...\n"
336 " - print help on subcommands",
341 attach
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_attach
,
342 "attach filesystem image file to CP/M drive",
343 "[-rw] [-o options] dsk<n> diskfile\n"
344 " Attach diskfile to dsk<n>, where n in 0.."CONFIG_CPM_MAX_DRNR_STR
"\n"
345 " -r File is read only (write protected)\n"
346 " -w File is read/write (default)\n"
348 " Options is a comma-separated list of\n"
349 " ro, rw, debug, nodebug\n"
351 "attach [-rw] -o reattach[,other options] dsk<n>\n"
352 " Change options for dsk<n>.\n"
353 " Options as above.\n"
355 "attach -d -a|dsk<n>\n"
357 " Detach diskfile from dsk<n>.\n"
361 " Without arguments, list current assignments"
364 detach
, 2, 0, do_attach
,
365 "detach file from CP/M drive",
367 " - alias for 'attach -d dsk<n>'"
371 help
, CONFIG_SYS_MAXARGS
, 0, do_help
,
372 "print command description/usage",
374 " print brief description of all commands\n"
375 " -a print description of subcommands too\n"
376 "help -fk keyword ...\n"
377 " print brief description of commands matching keyword\n"
378 " -f search keyword in command name\n"
379 " -k search keyword in command name and description\n"
380 "help [-a] command ...\n"
381 " print detailed usage of 'command'"
384 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
385 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
386 FSTR("alias for 'help'"),
387 #ifdef CONFIG_SYS_LONGHELP
389 #endif /* CONFIG_SYS_LONGHELP */
391 #ifdef CONFIG_AUTO_COMPLETE
395 /* Mark end of table */