From: openocd-gerrit <ope...@us...> - 2024-02-11 23:04:50
|
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 3b5ef1726a4e5da657080d640e16f1f4d9dc6071 (commit) from 79f519bb633e0d37a9b9ce4b7a1dc16aa14014cd (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 3b5ef1726a4e5da657080d640e16f1f4d9dc6071 Author: N S <nl...@ya...> Date: Sun Jan 21 17:45:06 2024 -0800 jtag/drivers: Add vid_pid command to OpenJTAG Enable support for USB vid and pid combinations other than 0x0403/0x6001 on OpenJTAG adapters. Change-Id: Ibb5fb14a6f33abbc011dbf3179df20d79ed74a7a Signed-off-by: N S <nl...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8100 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index e4d4dc5d6..a4e7c6aaa 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3445,6 +3445,15 @@ Currently valid @var{variant} values include: The USB device description string of the adapter. This value is only used with the standard variant. @end deffn + +@deffn {Config Command} {openjtag vid_pid} vid pid +The USB vendor ID and product ID of the adapter. If not specified, default +0x0403:0x6001 is used. +This value is only used with the standard variant. +@example +openjtag vid_pid 0x403 0x6014 +@end example +@end deffn @end deffn diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index dca27b0a6..45064fe6a 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -861,6 +861,17 @@ COMMAND_HANDLER(openjtag_handle_variant_command) return ERROR_OK; } +COMMAND_HANDLER(openjtag_handle_vid_pid_command) +{ + if (CMD_ARGC != 2) + return ERROR_COMMAND_SYNTAX_ERROR; + + COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], openjtag_vid); + COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], openjtag_pid); + + return ERROR_OK; +} + static const struct command_registration openjtag_subcommand_handlers[] = { { .name = "device_desc", @@ -876,6 +887,13 @@ static const struct command_registration openjtag_subcommand_handlers[] = { .help = "set the OpenJTAG variant", .usage = "variant-string", }, + { + .name = "vid_pid", + .handler = openjtag_handle_vid_pid_command, + .mode = COMMAND_CONFIG, + .help = "USB VID and PID of the adapter", + .usage = "vid pid", + }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 9 +++++++++ src/jtag/drivers/openjtag.c | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) hooks/post-receive -- Main OpenOCD repository |