drivers/remote_bitbang: Group adapter commands 89/6389/3
authorMarc Schink <dev@zapb.de>
Fri, 30 Jul 2021 16:01:09 +0000 (18:01 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 Aug 2021 12:33:30 +0000 (13:33 +0100)
Use a command group 'remote_bitbang' with subcommands instead of individual
commands with 'remote_bitbang_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: I2692320f19c8a357112a365db6ca7e13cd6ad411
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6389
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
contrib/remote_bitbang/remote_bitbang_sysfsgpio.c
doc/openocd.texi
src/jtag/drivers/remote_bitbang.c
src/jtag/startup.tcl

index 5c717ce0ed0816f348bf05fd5d2833439a4e7794..6cf30c3bc4c175dfc577ee5dca84d0244b3372ee 100644 (file)
   socat TCP6-LISTEN:7777,fork EXEC:"sudo ./remote_bitbang_sysfsgpio tck 11 tms 25 tdo 9 tdi 10"
 
   On host run:
-  openocd -c "interface remote_bitbang; remote_bitbang_host raspberrypi; remote_bitbang_port 7777" \
+  openocd -c "interface remote_bitbang; remote_bitbang host raspberrypi; remote_bitbang port 7777" \
          -f target/stm32f1x.cfg
 
   Or if you want to test UNIX sockets, run both on Raspberry Pi:
   socat UNIX-LISTEN:/tmp/remotebitbang-socket,fork EXEC:"sudo ./remote_bitbang_sysfsgpio tck 11 tms 25 tdo 9 tdi 10"
-  openocd -c "interface remote_bitbang; remote_bitbang_host /tmp/remotebitbang-socket" -f target/stm32f1x.cfg
+  openocd -c "interface remote_bitbang; remote_bitbang host /tmp/remotebitbang-socket" -f target/stm32f1x.cfg
 */
 
 #include <sys/types.h>
index c3963d6cbd9aac82a46ad99120981b18e9b097cc..0d7719defe1c4638bba0ae422ce76180ac85a830 100644 (file)
@@ -2694,14 +2694,14 @@ instead of directly driving JTAG.
 The remote_bitbang driver is useful for debugging software running on
 processors which are being simulated.
 
-@deffn {Config Command} {remote_bitbang_port} number
+@deffn {Config Command} {remote_bitbang port} number
 Specifies the TCP port of the remote process to connect to or 0 to use UNIX
 sockets instead of TCP.
 @end deffn
 
-@deffn {Config Command} {remote_bitbang_host} hostname
+@deffn {Config Command} {remote_bitbang host} hostname
 Specifies the hostname of the remote process to connect to using TCP, or the
-name of the UNIX socket to use if remote_bitbang_port is 0.
+name of the UNIX socket to use if remote_bitbang port is 0.
 @end deffn
 
 For example, to connect remotely via TCP to the host foobar you might have
@@ -2709,8 +2709,8 @@ something like:
 
 @example
 adapter driver remote_bitbang
-remote_bitbang_port 3335
-remote_bitbang_host foobar
+remote_bitbang port 3335
+remote_bitbang host foobar
 @end example
 
 To connect to another process running locally via UNIX sockets with socket
@@ -2718,8 +2718,8 @@ named mysocket:
 
 @example
 adapter driver remote_bitbang
-remote_bitbang_port 0
-remote_bitbang_host mysocket
+remote_bitbang port 0
+remote_bitbang host mysocket
 @end example
 @end deffn
 
index 6d1f48bc3188a341231c532588749a1e063150ee..ce1a065445c795db5bd9c552834dc01e2ecae29f 100644 (file)
@@ -340,9 +340,9 @@ COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_host_command)
        return ERROR_COMMAND_SYNTAX_ERROR;
 }
 
-static const struct command_registration remote_bitbang_command_handlers[] = {
+static const struct command_registration remote_bitbang_subcommand_handlers[] = {
        {
-               .name = "remote_bitbang_port",
+               .name = "port",
                .handler = remote_bitbang_handle_remote_bitbang_port_command,
                .mode = COMMAND_CONFIG,
                .help = "Set the port to use to connect to the remote jtag.\n"
@@ -350,7 +350,7 @@ static const struct command_registration remote_bitbang_command_handlers[] = {
                .usage = "port_number",
        },
        {
-               .name = "remote_bitbang_host",
+               .name = "host",
                .handler = remote_bitbang_handle_remote_bitbang_host_command,
                .mode = COMMAND_CONFIG,
                .help = "Set the host to use to connect to the remote jtag.\n"
@@ -360,6 +360,17 @@ static const struct command_registration remote_bitbang_command_handlers[] = {
        COMMAND_REGISTRATION_DONE,
 };
 
+static const struct command_registration remote_bitbang_command_handlers[] = {
+       {
+               .name = "remote_bitbang",
+               .mode = COMMAND_ANY,
+               .help = "perform remote_bitbang management",
+               .chain = remote_bitbang_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 static int remote_bitbang_execute_queue(void)
 {
        /* safety: the send buffer must be empty, no leftover characters from
index f2e4ec35342d490e8f8765256d666cb85328d1ed..02a3626f4823c31803fd7e13f313afadbfcce1ac 100644 (file)
@@ -261,6 +261,18 @@ proc ftdi_tdo_sample_edge args {
        eval ftdi tdo_sample_edge $args
 }
 
+lappend _telnet_autocomplete_skip remote_bitbang_host
+proc remote_bitbang_host args {
+       echo "DEPRECATED! use 'remote_bitbang host' not 'remote_bitbang_host'"
+       eval remote_bitbang host $args
+}
+
+lappend _telnet_autocomplete_skip remote_bitbang_port
+proc remote_bitbang_port args {
+       echo "DEPRECATED! use 'remote_bitbang port' not 'remote_bitbang_port'"
+       eval remote_bitbang port $args
+}
+
 lappend _telnet_autocomplete_skip openjtag_device_desc
 proc openjtag_device_desc args {
        echo "DEPRECATED! use 'openjtag device_desc' not 'openjtag_device_desc'"

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)