This is an automated email from Gerrit.

"zapb <d...@zapb.de>" just uploaded a new patch set to Gerrit, which you can 
find at https://review.openocd.org/c/openocd/+/8335

-- gerrit

commit 2e6a9f966b3ac8d9b069976c98a3c78148228fb2
Author: Marc Schink <d...@zapb.de>
Date:   Thu Nov 9 11:20:00 2023 +0100

    jtag/hla: Restructure commands
    
    Use a command group 'hla' with subcommands instead of individual
    commands with 'hla_' prefix.
    
    The old commands are still available to ensure backwards compatibility,
    but are marked as deprecated.
    
    Change-Id: I612e3cc080d308735932aea0f11001428eadc570
    Signed-off-by: Marc Schink <d...@zapb.de>

diff --git a/doc/openocd.texi b/doc/openocd.texi
index 8c9f3ff845..58fbe3db93 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -3199,19 +3199,19 @@ versions of firmware where serial number is reset after 
first use.  Suggest
 using ST firmware update utility to upgrade ST-LINK firmware even if current
 version reported is V2.J21.S4.
 
-@deffn {Config Command} {hla_device_desc} description
+@deffn {Config Command} {hla device_desc} description
 Currently Not Supported.
 @end deffn
 
-@deffn {Config Command} {hla_layout} 
(@option{stlink}|@option{icdi}|@option{nulink})
+@deffn {Config Command} {hla layout} 
(@option{stlink}|@option{icdi}|@option{nulink})
 Specifies the adapter layout to use.
 @end deffn
 
-@deffn {Config Command} {hla_vid_pid} [vid pid]+
+@deffn {Config Command} {hla vid_pid} [vid pid]+
 Pairs of vendor IDs and product IDs of the device.
 @end deffn
 
-@deffn {Config Command} {hla_stlink_backend} (usb | tcp [port])
+@deffn {Config Command} {hla stlink_backend} (usb | tcp [port])
 @emph{ST-Link only:} Choose between 'exclusive' USB communication (the default 
backend) or
 'shared' mode using ST-Link TCP server (the default port is 7184).
 
@@ -3220,7 +3220,7 @@ available from 
@url{https://www.st.com/en/development-tools/st-link-server.html,
 ST-LINK server software module}.
 @end deffn
 
-@deffn {Command} {hla_command} command
+@deffn {Command} {hla command} command
 Execute a custom adapter-specific command. The @var{command} string is
 passed as is to the underlying adapter layout handler.
 @end deffn
diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c
index 9c8d0fadea..28e5c6d53e 100644
--- a/src/jtag/hla/hla_interface.c
+++ b/src/jtag/hla/hla_interface.c
@@ -319,37 +319,37 @@ COMMAND_HANDLER(interface_handle_hla_command)
        return ERROR_OK;
 }
 
-static const struct command_registration hl_interface_command_handlers[] = {
+static const struct command_registration hl_interface_subcommand_handlers[] = {
        {
-        .name = "hla_device_desc",
+        .name = "device_desc",
         .handler = &hl_interface_handle_device_desc_command,
         .mode = COMMAND_CONFIG,
         .help = "set the device description of the adapter",
         .usage = "description_string",
         },
        {
-        .name = "hla_layout",
+        .name = "layout",
         .handler = &hl_interface_handle_layout_command,
         .mode = COMMAND_CONFIG,
         .help = "set the layout of the adapter",
         .usage = "layout_name",
         },
        {
-        .name = "hla_vid_pid",
+        .name = "vid_pid",
         .handler = &hl_interface_handle_vid_pid_command,
         .mode = COMMAND_CONFIG,
         .help = "the vendor and product ID of the adapter",
         .usage = "(vid pid)*",
         },
        {
-        .name = "hla_stlink_backend",
+        .name = "stlink_backend",
         .handler = &hl_interface_handle_stlink_backend_command,
         .mode = COMMAND_CONFIG,
         .help = "select which ST-Link backend to use",
         .usage = "usb | tcp [port]",
        },
         {
-        .name = "hla_command",
+        .name = "command",
         .handler = &interface_handle_hla_command,
         .mode = COMMAND_EXEC,
         .help = "execute a custom adapter-specific command",
@@ -358,6 +358,17 @@ static const struct command_registration 
hl_interface_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration hl_interface_command_handlers[] = {
+       {
+               .name = "hla",
+               .mode = COMMAND_ANY,
+               .help = "perform hla management",
+               .chain = hl_interface_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 struct adapter_driver hl_adapter_driver = {
        .name = "hla",
        .transports = hl_transports,
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
index 41db38e4ac..2d8ebf0410 100644
--- a/src/jtag/startup.tcl
+++ b/src/jtag/startup.tcl
@@ -1126,6 +1126,36 @@ proc "cmsis_dap_usb" {args} {
        eval cmsis-dap usb $args
 }
 
+lappend _telnet_autocomplete_skip "hla_layout"
+proc "hla_layout" {layout} {
+       echo "DEPRECATED! use 'hla layout', not 'hla_layout'"
+       eval hla layout $layout
+}
+
+lappend _telnet_autocomplete_skip "hla_device_desc"
+proc "hla_device_desc" {desc} {
+       echo "DEPRECATED! use 'hla device_desc', not 'hla_device_desc'"
+       eval hla device_desc $desc
+}
+
+lappend _telnet_autocomplete_skip "hla_vid_pid"
+proc "hla_vid_pid" {args} {
+       echo "DEPRECATED! use 'hla vid_pid', not 'hla_vid_pid'"
+       eval hla vid_pid $args
+}
+
+lappend _telnet_autocomplete_skip "hla_command"
+proc "hla_command" {command} {
+       echo "DEPRECATED! use 'hla command', not 'hla_command'"
+       eval hla command $command
+}
+
+lappend _telnet_autocomplete_skip "hla_stlink_backend"
+proc "hla_stlink_backend" {args} {
+       echo "DEPRECATED! use 'hla stlink_backend', not 'hla_stlink_backend'"
+       eval hla stlink_backend $args
+}
+
 lappend _telnet_autocomplete_skip "kitprog_init_acquire_psoc"
 proc "kitprog_init_acquire_psoc" {} {
        echo "DEPRECATED! use 'kitprog init_acquire_psoc', not 
'kitprog_init_acquire_psoc'"

-- 

Reply via email to