|
From: openocd-gerrit <ope...@us...> - 2026-05-08 17:09:38
|
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 ea528c7198207be6a89852ab50e2988f2f133e5c (commit)
from cd8cf385eab0e7388bd043f37484d8b1adffc2e2 (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 ea528c7198207be6a89852ab50e2988f2f133e5c
Author: Marc Schink <de...@za...>
Date: Sun Apr 26 10:30:52 2026 +0200
adapter/usb-blaster: Delegate USB VID/PID parsing to adapter core
Use the USB VID/PIDs provided by the adapter core instead of parsing
them in the driver code.
Keep the legacy 'usb_blaster vid_pid' command for backwards compatibility,
but mark it as deprecated.
Change-Id: I3f16e50100c9ce80fa5d06884631fb4575fce465
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9598
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 06bda892a..aee1e4c5e 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -2996,22 +2996,25 @@ remote_bitbang host mysocket
@deffn {Interface Driver} {usb_blaster}
USB JTAG/USB-Blaster compatibles over one of the userspace libraries
-for FTDI chips. These interfaces have several commands, used to
-configure the driver before initializing the JTAG scan chain:
+for FTDI chips.
-@deffn {Config Command} {usb_blaster vid_pid} vid pid
-The vendor ID and product ID of the FTDI FT245 device. If not specified,
-default values are used.
-Currently, only one @var{vid}, @var{pid} pair may be given, e.g. for
-Altera USB-Blaster (default):
+Use @command{adapter usb vid_pid} to specify the vendor and product ID of the
+FT245 device. If not specified, default values are used.
+
+For example, Altera USB-Blaster (default):
@example
-usb_blaster vid_pid 0x09FB 0x6001
+adapter usb vid_pid 0x09FB 0x6001
@end example
The following VID/PID is for Kolja Waschk's USB JTAG:
@example
-usb_blaster vid_pid 0x16C0 0x06AD
+adapter usb vid_pid 0x16C0 0x06AD
@end example
-@end deffn
+
+Note that the second VID/PID pair passed to @command{adapter usb vid_pid} is
+used to detect uninitialized devices.
+
+This driver has several commands, used for configuration before initializing the
+JTAG scan chain:
@deffn {Command} {usb_blaster pin} (@option{pin6}|@option{pin8}) (@option{0}|@option{1}|@option{s}|@option{t})
Sets the state or function of the unused GPIO pins on USB-Blasters
diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c
index 81344664e..b95273277 100644
--- a/src/jtag/drivers/usb_blaster/usb_blaster.c
+++ b/src/jtag/drivers/usb_blaster/usb_blaster.c
@@ -63,6 +63,7 @@
#endif
/* project specific includes */
+#include <jtag/adapter.h>
#include <jtag/interface.h>
#include <jtag/commands.h>
#include <helper/time_support.h>
@@ -825,9 +826,9 @@ static int ublast_execute_queue(struct jtag_command *cmd_queue)
*/
static int ublast_init(void)
{
- int ret, i;
+ int ret;
- for (i = 0; lowlevel_drivers_map[i].name; i++) {
+ for (unsigned int i = 0; lowlevel_drivers_map[i].name; i++) {
if (info.lowlevel_name) {
if (!strcmp(lowlevel_drivers_map[i].name, info.lowlevel_name)) {
info.drv = lowlevel_drivers_map[i].drv_register();
@@ -853,6 +854,24 @@ static int ublast_init(void)
return ERROR_JTAG_DEVICE_ERROR;
}
+ unsigned int num_vid_pid_pairs = 0;
+
+ for (unsigned int i = 0; adapter_usb_get_vids()[i]; i++)
+ num_vid_pid_pairs++;
+
+ if (num_vid_pid_pairs > 0) {
+ info.ublast_vid = adapter_usb_get_vids()[0];
+ info.ublast_pid = adapter_usb_get_pids()[0];
+ }
+
+ if (num_vid_pid_pairs > 1) {
+ info.ublast_vid_uninit = adapter_usb_get_vids()[1];
+ info.ublast_pid_uninit = adapter_usb_get_pids()[1];
+ }
+
+ if (num_vid_pid_pairs > 2)
+ LOG_WARNING("ignoring extra IDs in adapter usb vid_pid (maximum is 2 pairs)");
+
/*
* Register the lowlevel driver
*/
@@ -893,31 +912,6 @@ static int ublast_quit(void)
return info.drv->close(info.drv);
}
-COMMAND_HANDLER(ublast_handle_vid_pid_command)
-{
- if (CMD_ARGC > 4) {
- LOG_WARNING("ignoring extra IDs in ublast_vid_pid "
- "(maximum is 2 pairs)");
- CMD_ARGC = 4;
- }
-
- if (CMD_ARGC >= 2) {
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], info.ublast_vid);
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], info.ublast_pid);
- } else {
- LOG_WARNING("incomplete ublast_vid_pid configuration");
- }
-
- if (CMD_ARGC == 4) {
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[2], info.ublast_vid_uninit);
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[3], info.ublast_pid_uninit);
- } else {
- LOG_WARNING("incomplete ublast_vid_pid configuration");
- }
-
- return ERROR_OK;
-}
-
COMMAND_HANDLER(ublast_handle_pin_command)
{
uint8_t out_value;
@@ -1006,15 +1000,6 @@ COMMAND_HANDLER(ublast_firmware_command)
static const struct command_registration ublast_subcommand_handlers[] = {
- {
- .name = "vid_pid",
- .handler = ublast_handle_vid_pid_command,
- .mode = COMMAND_CONFIG,
- .help = "the vendor ID and product ID of the USB-Blaster and "
- "vendor ID and product ID of the uninitialized device "
- "for USB-Blaster II",
- .usage = "vid pid vid_uninit pid_uninit",
- },
{
.name = "lowlevel_driver",
.handler = ublast_handle_lowlevel_drv_command,
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
index 730f4d262..995a289b0 100644
--- a/src/jtag/startup.tcl
+++ b/src/jtag/startup.tcl
@@ -823,8 +823,14 @@ proc usb_blaster_device_desc args {
lappend _telnet_autocomplete_skip usb_blaster_vid_pid
proc usb_blaster_vid_pid args {
- echo "DEPRECATED! use 'usb_blaster vid_pid' not 'usb_blaster_vid_pid'"
- eval usb_blaster vid_pid $args
+ echo "DEPRECATED! use 'adapter usb vid_pid' not 'usb_blaster_vid_pid'"
+ eval adapter usb vid_pid $args
+}
+
+lappend _telnet_autocomplete_skip "usb_blaster vid_pid"
+proc "usb_blaster vid_pid" args {
+ echo "DEPRECATED! use 'adapter usb vid_pid' not 'usb_blaster vid_pid'"
+ eval adapter usb vid_pid $args
}
lappend _telnet_autocomplete_skip usb_blaster_lowlevel_driver
diff --git a/tcl/board/altera_sockit.cfg b/tcl/board/altera_sockit.cfg
index bbd87d646..3df6f8742 100644
--- a/tcl/board/altera_sockit.cfg
+++ b/tcl/board/altera_sockit.cfg
@@ -14,7 +14,7 @@ adapter driver usb_blaster
source [find target/altera_fpgasoc.cfg]
# If the USB Blaster II were supported, these settings would be needed
-#usb_blaster vid_pid 0x09fb 0x6810
+#adapter usb vid_pid 0x09fb 0x6810
#usb_blaster device_desc "USB-Blaster II"
adapter speed 100
diff --git a/tcl/interface/altera-usb-blaster.cfg b/tcl/interface/altera-usb-blaster.cfg
index cc6057b51..c9a56b268 100644
--- a/tcl/interface/altera-usb-blaster.cfg
+++ b/tcl/interface/altera-usb-blaster.cfg
@@ -9,5 +9,5 @@
adapter driver usb_blaster
usb_blaster lowlevel_driver ftdi
# These are already the defaults.
-# usb_blaster vid_pid 0x09FB 0x6001
+# adapter usb vid_pid 0x09FB 0x6001
# usb_blaster device_desc "USB-Blaster"
diff --git a/tcl/interface/altera-usb-blaster2.cfg b/tcl/interface/altera-usb-blaster2.cfg
index 93f9809b0..95927676b 100644
--- a/tcl/interface/altera-usb-blaster2.cfg
+++ b/tcl/interface/altera-usb-blaster2.cfg
@@ -5,6 +5,6 @@
#
adapter driver usb_blaster
-usb_blaster vid_pid 0x09fb 0x6010 0x09fb 0x6810
+adapter usb vid_pid 0x09fb 0x6010 0x09fb 0x6810
usb_blaster lowlevel_driver ublast2
usb_blaster firmware /path/to/quartus/blaster_6810.hex
diff --git a/tcl/interface/usb-jtag.cfg b/tcl/interface/usb-jtag.cfg
index 039c748b3..c7f3d60c2 100644
--- a/tcl/interface/usb-jtag.cfg
+++ b/tcl/interface/usb-jtag.cfg
@@ -32,7 +32,7 @@
# driver but ixo-usb-jtag requires the ftdi driver.
adapter driver usb_blaster
-usb_blaster vid_pid 0x16C0 0x06AD
+adapter usb vid_pid 0x16C0 0x06AD
usb_blaster device_desc "Van Ooijen Technische Informatica"
# ixo-usb-jtag is only compatible with the ublast1 protocol implemented via the
# ftdi modes, using ublast2 will cause openocd to hang.
-----------------------------------------------------------------------
Summary of changes:
doc/openocd.texi | 23 ++++++------
src/jtag/drivers/usb_blaster/usb_blaster.c | 57 +++++++++++-------------------
src/jtag/startup.tcl | 10 ++++--
tcl/board/altera_sockit.cfg | 2 +-
tcl/interface/altera-usb-blaster.cfg | 2 +-
tcl/interface/altera-usb-blaster2.cfg | 2 +-
tcl/interface/usb-jtag.cfg | 2 +-
7 files changed, 46 insertions(+), 52 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|