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 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'",
104 boot
, 1, 1, do_bootd
,
105 "boot default, i.e., run 'bootcmd'",
108 CMD_TBL_ITEM_COMPLETE(
109 source
, CONFIG_SYS_MAXARGS
, 1, do_source
,
110 "run commands from a file",
112 " - run the commands in the script file 'filename'",
117 env
, CONFIG_SYS_MAXARGS
, 0, do_env
,
118 "environment handling commands",
124 loadf
, 1, 0, do_loadf
,
125 "load srec_cat prepared image from controller flash",
129 bootcf
, CONFIG_SYS_MAXARGS
, 0, do_bootcf
,
132 " Load a number of sectors from the first CP/M partition and jump to\n"
133 " the load address.\n"
135 " Load and start address (default 100 hex)\n"
137 " First sector of partition to load (0..255, default 0)\n"
139 " Number of sectors to load (1..127, default 7)\n"
141 " Partition type to look for (default 52 hex)\n"
143 " Load only, do not execute\n"
145 " Timeout for IDE commands (1..65535, default 10000)\n"
150 loadcpm3
, 3, 0, do_loadcpm3
,
151 "load CPM3.SYS file",
152 "[filename [common-base [banked-base]]] \n"
153 " - Load CP/M 3 system file from FAT filesystem. This command makes\n"
154 " CPMLDR superfluous. Uses the following environment variables if set:\n"
155 " '"ENV_CPM3_SYSFILE
"' File to load. Default is '"CONFIG_CPM3_SYSFILE
"'.\n"
156 " '"ENV_CPM3_BANKED_BASE
"' Default is '"CONFIG_CPM3_BANKED_BASE_STR
"'.\n"
157 " Sets the following environment variables after loading:\n"
158 " '"ENV_CPM3_COMMON_BASE
"'\n"
159 " '"ENV_STARTADDRESS
"'"
162 loadi
, 2, 0, do_loadihex
,
163 "load intel hex file over serial line",
165 " - load Intel-Hex-Record file over serial line with offset 'offset'"
168 #if defined(CONFIG_CMD_LOADB)
170 loadb
, 1, 0, do_load_serial_bin
,
171 "load binary file over serial line (kermit mode)",
172 " - load binary file over serial line"
176 loadx
, 1, 0, do_load_serial_bin
,
177 "load binary file over serial line (xmodem mode)",
178 " - load binary file over serial line"
182 loady
, 1, 0, do_load_serial_bin
,
183 "load binary file over serial line (ymodem mode)",
184 " - load binary file over serial line"
186 #endif /* CONFIG_CMD_LOADB */
190 "start application at address 'addr'",
192 " - start application at address 'addr'"
194 // " passing 'arg' as arguments"
197 reset
, 1, 0, do_reset
,
198 "Keep CPU in RESET state",
202 restart
, 1, 1, do_restart
,
203 "Perform RESET of the CPU",
207 connect
, 1, 0, do_console
,
208 "Connect to CPU console i/o",
210 " - type the escape character followed by Q to close the connection, \n"
211 " or followed by ? to see other options. The default escape character \n"
212 " is Ctrl-^ (0x1E). It can be changed by setting env var '"ENV_ESC_CHAR
"'."
217 pin
, CONFIG_SYS_MAXARGS
, 1, do_gpio
,
218 "Set or query pin state",
220 " - print cofiguration and state or frequency of pins\n"
221 " print all pins, if argument is omitted\n"
222 "pin <pins> h[igh]|l[ow]\n"
223 " - config pins as output and set to level high or low\n"
224 "pin <pins> ts|i[n]|p[ullup]\n"
225 " - config pins as input/tristate or input with pullup\n"
226 "pin <pins> value[K|M][Hz]\n"
227 " - output a clock on pins\n"
228 " value is system clock divider or frequency, if 'Hz' is appended\n"
229 " divider is rounded down to next possible value (depends on pin)\n"
231 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
235 md
, 3, CTBL_RPT
, do_mem_md
,
237 "address [# of objects]"
240 mm
, 2, CTBL_RPT
, do_mem_mm
,
241 "memory modify (auto-incrementing address)",
245 nm
, 2, CTBL_RPT
, do_mem_nm
,
246 "memory modify (constant address)",
250 mw
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mw
,
251 "memory write (fill)",
252 "[-bwl] address value [count]\n"
253 " -b write value as byte (8 bit, default)\n"
254 " -w write value as word (16 bit)\n"
255 " -l write value as long (32 bit)"
258 mcp
, 4, CTBL_RPT
, do_mem_cp
,
260 "source target count"
263 mcmp
, 4, CTBL_RPT
, do_mem_cmp
,
268 base
, 2, 0, do_mem_base
,
269 "print or set address offset",
271 " - print address offset for memory commands\n"
273 " - set address offset for memory commands to 'offset'"
276 mloop
, 3, CTBL_RPT
, do_mem_loop
,
277 "infinite loop on address range",
278 "address number_of_bytes"
281 mloopw
, 4, CTBL_RPT
, do_mem_loopw
,
282 "infinite write loop on address range",
283 "address number_of_bytes data_to_write"
286 #ifdef CONFIG_CMD_MEMTEST
288 mtest
, 4, CTBL_RPT
, do_mem_mtest
,
289 "simple RAM read/write test",
290 "[start [end [iterations]]]"
292 #endif /* CONFIG_CMD_MEMTEST */
294 #ifdef CONFIG_MX_CYCLIC
296 mdc
, 4, CTBL_RPT
, do_mem_mdc
,
297 "memory display cyclic",
298 "address count delay(ms)"
301 mwc
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_mem_mdc
,
302 "memory write cyclic",
303 "[-bwl] address value delay(ms)\n"
304 " -b write value as byte (8 bit, default)\n"
305 " -w write value as word (16 bit)\n"
306 " -l write value as long (32 bit)"
308 #endif /* CONFIG_MX_CYCLIC */
311 sd
, CONFIG_SYS_MAXARGS
, 0, do_sd
,
312 "SD/MMC card handling commands",
313 "<subcommand> args ...\n"
315 " - print help on subcommands",
319 fat
, CONFIG_SYS_MAXARGS
, 0, do_fat
,
320 "fat filesystem commands",
321 "<subcommand> args ...\n"
323 " - print help on subcommands",
328 attach
, CONFIG_SYS_MAXARGS
, CTBL_RPT
, do_attach
,
329 "attach filesystem image file to CP/M drive",
330 "[-rw] [-o options] dsk<n> diskfile\n"
331 " Attach diskfile to dsk<n>, where n in 0.."CONFIG_CPM_MAX_DRNR_STR
"\n"
332 " -r File is read only (write protected)\n"
333 " -w File is read/write (default)\n"
335 " Options is a comma-separated list of\n"
336 " ro, rw, debug, nodebug\n"
338 "attach [-rw] -o reattach[,other options] dsk<n>\n"
339 " Change options for dsk<n>.\n"
340 " Options as above.\n"
342 "attach -d -a|dsk<n>\n"
344 " Detach diskfile from dsk<n>.\n"
348 " Without arguments, list current assignments"
351 detach
, 2, 0, do_attach
,
352 "detach file from CP/M drive",
354 " - alias for 'attach -d dsk<n>'"
358 help
, CONFIG_SYS_MAXARGS
, 0, do_help
,
359 "print command description/usage",
361 " print brief description of all commands\n"
362 " -a print description of subcommands too\n"
363 "help -fk keyword ...\n"
364 " print brief description of commands matching keyword\n"
365 " -f search keyword in command name\n"
366 " -k search keyword in command name and description\n"
367 "help [-a] command ...\n"
368 " print detailed usage of 'command'"
371 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
372 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
373 FSTR("alias for 'help'"),
374 #ifdef CONFIG_SYS_LONGHELP
376 #endif /* CONFIG_SYS_LONGHELP */
378 #ifdef CONFIG_AUTO_COMPLETE
382 /* Mark end of table */