This is an automated email from Gerrit.

"N S <nlsh...@yahoo.com>" just uploaded a new patch set to Gerrit, which you 
can find at https://review.openocd.org/c/openocd/+/8100

-- gerrit

commit 4ea322005f1e52dc38d2776560e50bbdb96c4259
Author: N S <nlsh...@yahoo.com>
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 <nlsh...@yahoo.com>

diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c
index dca27b0a64..2f44d64e9b 100644
--- a/src/jtag/drivers/openjtag.c
+++ b/src/jtag/drivers/openjtag.c
@@ -861,6 +861,23 @@ COMMAND_HANDLER(openjtag_handle_variant_command)
        return ERROR_OK;
 }
 
+COMMAND_HANDLER(openjtag_handle_vid_pid_command)
+{
+       if (CMD_ARGC > 2) {
+               LOG_WARNING("ignoring extra IDs in openjtag_vid_pid "
+                                       "(maximum is 1 pair)");
+               CMD_ARGC = 2;
+       }
+       if (CMD_ARGC == 2) {
+               COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], openjtag_vid);
+               COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], openjtag_pid);
+       } else {
+               LOG_WARNING("incomplete openjtag_vid_pid configuration");
+       }
+
+       return ERROR_OK;
+}
+
 static const struct command_registration openjtag_subcommand_handlers[] = {
        {
                .name = "device_desc",
@@ -876,6 +893,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
 };
 

-- 

Reply via email to