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 <nlshipp@yahoo.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8100 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user