|
From: openocd-gerrit <ope...@us...> - 2026-05-17 20:56:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 6fc1cf08562f30bfb9dc8b9ac8cbe0a4594fdcec (commit)
from 3a7635f4472fd293d22c4d6973161270a7679090 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6fc1cf08562f30bfb9dc8b9ac8cbe0a4594fdcec
Author: Marc Schink <de...@za...>
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 <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9611
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index aa2c256eb..6538ff936 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -3647,11 +3647,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 bfa094bd6..86b27ac4a 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 2706c752f..78b8ac8e3 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 1602352db..3ba5c4472 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"
-----------------------------------------------------------------------
Summary of changes:
doc/openocd.texi | 5 -----
src/jtag/drivers/openjtag.c | 29 ++++++-----------------------
src/jtag/startup.tcl | 10 ++++++++--
tcl/interface/openjtag.cfg | 2 +-
4 files changed, 15 insertions(+), 31 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|