This is an automated email from Gerrit. "zapb <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9611
-- gerrit commit c59c3037932e897712126ba1d07564d7ade39fb1 Author: Marc Schink <[email protected]> Date: Mon Apr 27 08:32:19 2026 +0200 adapter/openjtag: Use adapter core USB product name handling Use the USB product name handling provided by the adapter core instead of having it in the driver code itself. Keep the legacy 'openjtag device_desc' command for backwards compatibility, but mark it as deprecated. Change-Id: I4973f37a9a3f9cc4e7fd439b64dee1a716d13bd8 Signed-off-by: Marc Schink <[email protected]> diff --git a/doc/openocd.texi b/doc/openocd.texi index 31c929c694..58cfa390cb 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3628,11 +3628,6 @@ Currently valid @var{variant} values include: (see @uref{http://www.cypress.com/?rID=82870}). @end itemize @end deffn - -@deffn {Config Command} {openjtag device_desc} string -The USB device description string of the adapter. -This value is only used with the standard variant. -@end deffn @end deffn diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index bfa094bd62..86b27ac4a1 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -78,8 +78,6 @@ enum openjtag_tap_state { static uint16_t openjtag_vids[] = {0x0403, 0}; static uint16_t openjtag_pids[] = {0x6001, 0}; -static char *openjtag_device_desc; - static struct ftdi_context ftdic; #define OPENJTAG_BUFFER_SIZE 504 @@ -378,11 +376,13 @@ static int openjtag_init_standard(void) { uint8_t latency_timer; + const char *usb_product_name = adapter_usb_get_product_name(); + /* Open by device description */ - if (!openjtag_device_desc) { - LOG_WARNING("no openjtag device description specified, " + if (!usb_product_name) { + LOG_WARNING("no openjtag USB product name specified, " "using default 'Open JTAG Project'"); - openjtag_device_desc = "Open JTAG Project"; + usb_product_name = "Open JTAG Project"; } if (ftdi_init(&ftdic) < 0) @@ -398,7 +398,7 @@ static int openjtag_init_standard(void) for (unsigned int i = 0; vids[i] != 0; i++) { /* context, vendor id, product id, description, serial id */ - if (ftdi_usb_open_desc(&ftdic, vids[i], pids[i], openjtag_device_desc, NULL) < 0) { + if (ftdi_usb_open_desc(&ftdic, vids[i], pids[i], usb_product_name, NULL) < 0) { LOG_ERROR("unable to open ftdi device: %s", ftdic.error_str); return ERROR_JTAG_INIT_FAILED; } @@ -850,16 +850,6 @@ static int openjtag_khz(int khz, int *jtag_speed) return ERROR_OK; } -COMMAND_HANDLER(openjtag_handle_device_desc_command) -{ - if (CMD_ARGC == 1) - openjtag_device_desc = strdup(CMD_ARGV[0]); - else - LOG_ERROR("require exactly one argument to " - "openjtag_device_desc <description>"); - return ERROR_OK; -} - COMMAND_HANDLER(openjtag_handle_variant_command) { if (CMD_ARGC == 1) { @@ -880,13 +870,6 @@ COMMAND_HANDLER(openjtag_handle_variant_command) } static const struct command_registration openjtag_subcommand_handlers[] = { - { - .name = "device_desc", - .handler = openjtag_handle_device_desc_command, - .mode = COMMAND_CONFIG, - .help = "set the USB device description of the OpenJTAG", - .usage = "description-string", - }, { .name = "variant", .handler = openjtag_handle_variant_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 2706c752fa..78b8ac8e35 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -354,10 +354,16 @@ proc remote_bitbang_port args { eval remote_bitbang port $args } +lappend _telnet_autocomplete_skip openjtag_device_desc +proc "openjtag device_desc" args { + echo "DEPRECATED! use 'adapter usb product_name' not 'openjtag device_desc'" + eval adapter usb product_name $args +} + lappend _telnet_autocomplete_skip openjtag_device_desc proc openjtag_device_desc args { - echo "DEPRECATED! use 'openjtag device_desc' not 'openjtag_device_desc'" - eval openjtag device_desc $args + echo "DEPRECATED! use 'adapter usb product_name' not 'openjtag_device_desc'" + eval adapter usb product_name $args } lappend _telnet_autocomplete_skip openjtag_variant diff --git a/tcl/interface/openjtag.cfg b/tcl/interface/openjtag.cfg index 1602352db8..3ba5c44722 100644 --- a/tcl/interface/openjtag.cfg +++ b/tcl/interface/openjtag.cfg @@ -7,4 +7,4 @@ # adapter driver openjtag -openjtag device_desc "Open JTAG Project" +adapter usb product_name "Open JTAG Project" --
