You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(37) |
Sep
|
Oct
|
Nov
|
Dec
|
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 11:01:24
|
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 ad18c1a47fb8f3eaae66a7314700a1f186391359 (commit) from 61a2f3284b984abee0ffd1166ecd79a0ea82976e (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 ad18c1a47fb8f3eaae66a7314700a1f186391359 Author: Antonio Borneo <bor...@gm...> Date: Fri Oct 8 11:53:56 2021 +0200 jtag/jlink: switch to command 'adapter serial' The driver jlink defines the command 'jlink serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Note: in former code the commands 'jlink serial' and 'jlink usb' were mutually exclusive; running one of them would invalidate the effect of a previous execution of the other. The new code gives priority to 'adapter serial', even if executed before 'jlink usb'. Change-Id: I920b0c136716f459b6fd6f7da8a01a7fa1ed389f Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6656 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 78451c71c..58e533f62 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r, ftdi, kitprog, presto, vsllink, xds110. +cmsis_dap, ft232r, ftdi, jlink, kitprog, presto, vsllink, xds110. The following adapters have their own command to specify the serial string: -hla, jlink, st-link. +hla, st-link. @end deffn @section Interface Drivers @@ -2848,12 +2848,6 @@ to the host. If not specified, USB addresses are not considered. Device selection via USB address is not always unambiguous. It is recommended to use the serial number instead, if possible. -As a configuration command, it can be used only before 'init'. -@end deffn -@deffn {Config Command} {jlink serial} <serial number> -Set the serial number of the interface, in case more than one adapter is -connected to the host. If not specified, serial numbers are not considered. - As a configuration command, it can be used only before 'init'. @end deffn @end deffn diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 0414ec710..fdf4ae778 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -669,6 +669,23 @@ static int jlink_init(void) return ERROR_JTAG_INIT_FAILED; } + const char *serial = adapter_get_required_serial(); + if (serial) { + ret = jaylink_parse_serial_number(serial, &serial_number); + if (ret == JAYLINK_ERR) { + LOG_ERROR("Invalid serial number: %s", serial); + jaylink_exit(jayctx); + return ERROR_JTAG_INIT_FAILED; + } + if (ret != JAYLINK_OK) { + LOG_ERROR("jaylink_parse_serial_number() failed: %s", jaylink_strerror(ret)); + jaylink_exit(jayctx); + return ERROR_JTAG_INIT_FAILED; + } + use_serial_number = true; + use_usb_address = false; + } + bool found_device; ret = jlink_open_device(JAYLINK_HIF_USB, &found_device); if (ret != ERROR_OK) @@ -979,38 +996,11 @@ COMMAND_HANDLER(jlink_usb_command) usb_address = tmp; - use_serial_number = false; use_usb_address = true; return ERROR_OK; } -COMMAND_HANDLER(jlink_serial_command) -{ - int ret; - - if (CMD_ARGC != 1) { - command_print(CMD, "Need exactly one argument for jlink serial"); - return ERROR_COMMAND_SYNTAX_ERROR; - } - - ret = jaylink_parse_serial_number(CMD_ARGV[0], &serial_number); - - if (ret == JAYLINK_ERR) { - command_print(CMD, "Invalid serial number: %s", CMD_ARGV[0]); - return ERROR_FAIL; - } else if (ret != JAYLINK_OK) { - command_print(CMD, "jaylink_parse_serial_number() failed: %s", - jaylink_strerror(ret)); - return ERROR_FAIL; - } - - use_serial_number = true; - use_usb_address = false; - - return ERROR_OK; -} - COMMAND_HANDLER(jlink_handle_hwstatus_command) { int ret; @@ -1932,13 +1922,6 @@ static const struct command_registration jlink_subcommand_handlers[] = { .help = "set the USB address of the device that should be used", .usage = "<0-3>" }, - { - .name = "serial", - .handler = &jlink_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the device that should be used", - .usage = "<serial number>" - }, { .name = "config", .handler = &jlink_handle_config_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index d6c3b85b4..199ca04d6 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -759,6 +759,12 @@ proc "ftdi serial" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip "jlink serial" +proc "jlink serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'jlink serial'" + eval adapter serial $args +} + lappend _telnet_autocomplete_skip kitprog_serial proc kitprog_serial args { echo "DEPRECATED! use 'adapter serial' not 'kitprog_serial'" diff --git a/tcl/interface/jlink.cfg b/tcl/interface/jlink.cfg index 51f420b7f..f9a18b05f 100644 --- a/tcl/interface/jlink.cfg +++ b/tcl/interface/jlink.cfg @@ -11,4 +11,4 @@ adapter driver jlink # # Example: Select J-Link with serial number 123456789 # -# jlink serial 123456789 +# adapter serial 123456789 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 10 ++-------- src/jtag/drivers/jlink.c | 51 ++++++++++++++++-------------------------------- src/jtag/startup.tcl | 6 ++++++ tcl/interface/jlink.cfg | 2 +- 4 files changed, 26 insertions(+), 43 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:59: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 61a2f3284b984abee0ffd1166ecd79a0ea82976e (commit) from 271e5416af975b52d4cd0e2ced65a4cbda9d041f (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 61a2f3284b984abee0ffd1166ecd79a0ea82976e Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 23:03:23 2021 +0200 jtag/xds110: switch to command 'adapter serial' The driver xds110 defines the command 'xds110 serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Note: the original command 'xds110 serial' used a complex and undocumented conversion of the serial number through multibyte string, wide-character string and C cast. The XDS110 I can access and the lsusb dumps available through Google don't show any exotic USB serial that require such conversion. The original developer doesn't remember any constraint that mandates such conversion (see comments in https://review.openocd.org/4322/). The conversion is removed by this patch. Change-Id: I38909918079b2c1797ad85ebec2fea1b33743606 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6655 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index c76fc076c..78451c71c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r, ftdi, kitprog, presto, vsllink. +cmsis_dap, ft232r, ftdi, kitprog, presto, vsllink, xds110. The following adapters have their own command to specify the serial string: -hla, jlink, st-link, xds110. +hla, jlink, st-link. @end deffn @section Interface Drivers @@ -3141,11 +3141,6 @@ LaunchPad evaluation boards. The XDS110 is also available as a stand-alone USB debug probe with the added capability to supply power to the target board. The following commands are supported by the XDS110 driver: -@deffn {Config Command} {xds110 serial} serial_string -Specifies the serial number of which XDS110 probe to use. Otherwise, the first -XDS110 found will be used. -@end deffn - @deffn {Config Command} {xds110 supply} voltage_in_millivolts Available only on the XDS110 stand-alone probe. Sets the voltage level of the XDS110 power supply. A value of 0 leaves the supply off. Otherwise, the supply diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index 243577d7c..c5249b296 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -20,15 +20,13 @@ #endif #include <transport/transport.h> +#include <jtag/adapter.h> #include <jtag/swd.h> #include <jtag/interface.h> #include <jtag/commands.h> #include <jtag/tcl.h> #include <libusb.h> -/* XDS110 USB serial number length */ -#define XDS110_SERIAL_LEN 8 - /* XDS110 stand-alone probe voltage supply limits */ #define XDS110_MIN_VOLTAGE 1800 #define XDS110_MAX_VOLTAGE 3600 @@ -238,8 +236,6 @@ struct xds110_info { /* TCK speed and delay count*/ uint32_t speed; uint32_t delay_count; - /* XDS110 serial number */ - char serial[XDS110_SERIAL_LEN + 1]; /* XDS110 voltage supply setting */ uint32_t voltage; /* XDS110 firmware and hardware version */ @@ -269,7 +265,6 @@ static struct xds110_info xds110 = { .is_ap_dirty = false, .speed = XDS110_DEFAULT_TCK_SPEED, .delay_count = 0, - .serial = {0}, .voltage = 0, .firmware = 0, .hardware = 0, @@ -371,7 +366,7 @@ static bool usb_connect(void) *data = '\0'; /* May be the requested device if serial number matches */ - if (xds110.serial[0] == 0) { + if (!adapter_get_required_serial()) { /* No serial number given; match first XDS110 found */ found = true; break; @@ -380,7 +375,7 @@ static bool usb_connect(void) result = libusb_get_string_descriptor_ascii(dev, desc.iSerialNumber, data, max_data); if (result > 0 && - strcmp((char *)data, (char *)xds110.serial) == 0) { + strcmp((char *)data, adapter_get_required_serial()) == 0) { found = true; break; } @@ -1395,8 +1390,8 @@ static void xds110_show_info(void) (((firmware >> 12) & 0xf) * 10) + ((firmware >> 8) & 0xf), (((firmware >> 4) & 0xf) * 10) + ((firmware >> 0) & 0xf)); LOG_INFO("XDS110: hardware version = 0x%04x", xds110.hardware); - if (xds110.serial[0] != 0) - LOG_INFO("XDS110: serial number = %s", xds110.serial); + if (adapter_get_required_serial()) + LOG_INFO("XDS110: serial number = %s", adapter_get_required_serial()); if (xds110.is_swd_mode) { LOG_INFO("XDS110: connected to target via SWD"); LOG_INFO("XDS110: SWCLK set to %" PRIu32 " kHz", xds110.speed); @@ -2024,34 +2019,6 @@ COMMAND_HANDLER(xds110_handle_info_command) return ERROR_OK; } -COMMAND_HANDLER(xds110_handle_serial_command) -{ - wchar_t serial[XDS110_SERIAL_LEN + 1]; - - xds110.serial[0] = 0; - - if (CMD_ARGC == 1) { - size_t len = mbstowcs(0, CMD_ARGV[0], 0); - if (len > XDS110_SERIAL_LEN) { - LOG_ERROR("XDS110: serial number is limited to %d characters", - XDS110_SERIAL_LEN); - return ERROR_FAIL; - } - if ((size_t)-1 == mbstowcs(serial, CMD_ARGV[0], len + 1)) { - LOG_ERROR("XDS110: unable to convert serial number"); - return ERROR_FAIL; - } - - for (uint32_t i = 0; i < len; i++) - xds110.serial[i] = (char)serial[i]; - - xds110.serial[len] = 0; - } else - return ERROR_COMMAND_SYNTAX_ERROR; - - return ERROR_OK; -} - COMMAND_HANDLER(xds110_handle_supply_voltage_command) { uint32_t voltage = 0; @@ -2082,13 +2049,6 @@ static const struct command_registration xds110_subcommand_handlers[] = { .help = "show XDS110 info", .usage = "", }, - { - .name = "serial", - .handler = &xds110_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the XDS110 probe serial number", - .usage = "serial_string", - }, { .name = "supply", .handler = &xds110_handle_supply_voltage_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 95fe55ca7..d6c3b85b4 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -187,8 +187,8 @@ proc ftdi_location args { lappend _telnet_autocomplete_skip xds110_serial proc xds110_serial args { - echo "DEPRECATED! use 'xds110 serial' not 'xds110_serial'" - eval xds110 serial $args + echo "DEPRECATED! use 'adapter serial' not 'xds110_serial'" + eval adapter serial $args } lappend _telnet_autocomplete_skip xds110_supply_voltage @@ -777,4 +777,10 @@ proc "vsllink usb_serial" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip "xds110 serial" +proc "xds110 serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'xds110 serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/xds110.cfg b/tcl/interface/xds110.cfg index 51f4e28d3..74122c3e6 100644 --- a/tcl/interface/xds110.cfg +++ b/tcl/interface/xds110.cfg @@ -9,4 +9,4 @@ adapter driver xds110 # Use serial number option to use a specific XDS110 # when more than one are connected to the host. -#xds110 serial 00000000 +# adapter serial 00000000 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 9 ++------- src/jtag/drivers/xds110.c | 50 +++++------------------------------------------ src/jtag/startup.tcl | 10 ++++++++-- tcl/interface/xds110.cfg | 2 +- 4 files changed, 16 insertions(+), 55 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:59:13
|
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 271e5416af975b52d4cd0e2ced65a4cbda9d041f (commit) via c41d9f61907464add62bf9d6647a1dcd6a77cc0e (commit) from d7b2313b5aec47e6a4a450fdf625644ca60d633d (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 271e5416af975b52d4cd0e2ced65a4cbda9d041f Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 22:39:45 2021 +0200 jtag/vsllink: switch to command 'adapter serial' The driver vsllink defines the command 'vsllink usb_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: Iadcc018b8aa8974ccd7156915b84e58270fad29d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6654 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 1e2524c7e..c76fc076c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r, ftdi, kitprog, presto. +cmsis_dap, ft232r, ftdi, kitprog, presto, vsllink. The following adapters have their own command to specify the serial string: -hla, jlink, st-link, vsllink, xds110. +hla, jlink, st-link, xds110. @end deffn @section Interface Drivers diff --git a/src/jtag/drivers/versaloon/versaloon.c b/src/jtag/drivers/versaloon/versaloon.c index b17c1d49b..7c2efefaa 100644 --- a/src/jtag/drivers/versaloon/versaloon.c +++ b/src/jtag/drivers/versaloon/versaloon.c @@ -87,7 +87,6 @@ struct versaloon_interface_t versaloon_interface = { .ep_out = VERSALOON_OUTP, .ep_in = VERSALOON_INP, .interface = VERSALOON_IFACE, - .serialstring = NULL, .buf_size = 256, } }; diff --git a/src/jtag/drivers/versaloon/versaloon.h b/src/jtag/drivers/versaloon/versaloon.h index 22e73fb35..e4aafb250 100644 --- a/src/jtag/drivers/versaloon/versaloon.h +++ b/src/jtag/drivers/versaloon/versaloon.h @@ -94,8 +94,6 @@ struct versaloon_usb_setting_t { uint8_t ep_out; uint8_t ep_in; uint8_t interface; - char *serialstring; - uint16_t buf_size; }; diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index 9cec2bea7..f59a7033e 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -499,21 +499,6 @@ COMMAND_HANDLER(vsllink_handle_usb_pid_command) return ERROR_OK; } -COMMAND_HANDLER(vsllink_handle_usb_serial_command) -{ - if (CMD_ARGC > 1) - return ERROR_COMMAND_SYNTAX_ERROR; - - free(versaloon_interface.usb_setting.serialstring); - - if (CMD_ARGC == 1) - versaloon_interface.usb_setting.serialstring = strdup(CMD_ARGV[0]); - else - versaloon_interface.usb_setting.serialstring = NULL; - - return ERROR_OK; -} - COMMAND_HANDLER(vsllink_handle_usb_bulkin_command) { if (CMD_ARGC != 1) @@ -786,14 +771,14 @@ static int vsllink_check_usb_strings( char desc_string[256]; int retval; - if (versaloon_interface.usb_setting.serialstring) { + if (adapter_get_required_serial()) { retval = libusb_get_string_descriptor_ascii(usb_device_handle, usb_desc->iSerialNumber, (unsigned char *)desc_string, sizeof(desc_string)); if (retval < 0) return ERROR_FAIL; - if (strncmp(desc_string, versaloon_interface.usb_setting.serialstring, + if (strncmp(desc_string, adapter_get_required_serial(), sizeof(desc_string))) return ERROR_FAIL; } @@ -903,13 +888,6 @@ static const struct command_registration vsllink_subcommand_handlers[] = { .help = "Set USB PID", .usage = "<pid>", }, - { - .name = "usb_serial", - .handler = &vsllink_handle_usb_serial_command, - .mode = COMMAND_CONFIG, - .help = "Set or disable check for USB serial", - .usage = "[<serial>]", - }, { .name = "usb_bulkin", .handler = &vsllink_handle_usb_bulkin_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index b8b866fbe..95fe55ca7 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -371,8 +371,8 @@ proc vsllink_usb_pid args { lappend _telnet_autocomplete_skip vsllink_usb_serial proc vsllink_usb_serial args { - echo "DEPRECATED! use 'vsllink usb_serial' not 'vsllink_usb_serial'" - eval vsllink usb_serial $args + echo "DEPRECATED! use 'adapter serial' not 'vsllink_usb_serial'" + eval adapter serial $args } lappend _telnet_autocomplete_skip vsllink_usb_bulkin @@ -771,4 +771,10 @@ proc "presto serial" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip "vsllink usb_serial" +proc "vsllink usb_serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'vsllink usb_serial'" + eval adapter serial $args +} + # END MIGRATION AIDS commit c41d9f61907464add62bf9d6647a1dcd6a77cc0e Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 22:35:12 2021 +0200 jtag/presto: switch to command 'adapter serial' The driver presto defines the command 'presto serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I1a69acce7d4910082d2029d5941ae84f9424314c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6653 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index c36047f07..1e2524c7e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r, ftdi, kitprog. +cmsis_dap, ft232r, ftdi, kitprog, presto. The following adapters have their own command to specify the serial string: -hla, jlink, presto, st-link, vsllink, xds110. +hla, jlink, st-link, vsllink, xds110. @end deffn @section Interface Drivers @@ -3010,9 +3010,6 @@ parport cable wiggler @deffn {Interface Driver} {presto} ASIX PRESTO USB JTAG programmer. -@deffn {Config Command} {presto serial} serial_string -Configures the USB serial number of the Presto device to use. -@end deffn @end deffn @deffn {Interface Driver} {rlink} diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index 61de42630..e938a3be3 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -29,6 +29,7 @@ #include "windows.h" #endif +#include <jtag/adapter.h> #include <jtag/interface.h> #include <helper/time_support.h> #include "bitq.h" @@ -132,7 +133,7 @@ static int presto_read(uint8_t *buf, uint32_t size) return ERROR_OK; } -static int presto_open_libftdi(char *req_serial) +static int presto_open_libftdi(const char *req_serial) { uint8_t presto_data; @@ -195,7 +196,7 @@ static int presto_open_libftdi(char *req_serial) return ERROR_OK; } -static int presto_open(char *req_serial) +static int presto_open(const char *req_serial) { presto->buff_out_pos = 0; presto->buff_in_pos = 0; @@ -506,43 +507,10 @@ static int presto_jtag_speed(int speed) return 0; } -static char *presto_serial; - -COMMAND_HANDLER(presto_handle_serial_command) -{ - if (CMD_ARGC == 1) { - free(presto_serial); - presto_serial = strdup(CMD_ARGV[0]); - } else - return ERROR_COMMAND_SYNTAX_ERROR; - - return ERROR_OK; -} - -static const struct command_registration presto_subcommand_handlers[] = { - { - .name = "serial", - .handler = presto_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "Configure USB serial number of Presto device.", - .usage = "serial_string", - }, - COMMAND_REGISTRATION_DONE -}; - -static const struct command_registration presto_command_handlers[] = { - { - .name = "presto", - .mode = COMMAND_ANY, - .help = "perform presto management", - .chain = presto_subcommand_handlers, - .usage = "", - }, - COMMAND_REGISTRATION_DONE -}; - static int presto_jtag_init(void) { + const char *presto_serial = adapter_get_required_serial(); + if (presto_open(presto_serial) != ERROR_OK) { presto_close(); if (presto_serial) @@ -562,10 +530,6 @@ static int presto_jtag_quit(void) bitq_cleanup(); presto_close(); LOG_INFO("PRESTO closed"); - - free(presto_serial); - presto_serial = NULL; - return ERROR_OK; } @@ -576,7 +540,6 @@ static struct jtag_interface presto_interface = { struct adapter_driver presto_adapter_driver = { .name = "presto", .transports = jtag_only, - .commands = presto_command_handlers, .init = presto_jtag_init, .quit = presto_jtag_quit, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 75b1bfbdf..b8b866fbe 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -765,4 +765,10 @@ proc kitprog_serial args { eval adapter serial $args } +lappend _telnet_autocomplete_skip "presto serial" +proc "presto serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'presto serial'" + eval adapter serial $args +} + # END MIGRATION AIDS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 7 ++--- src/jtag/drivers/presto.c | 47 ++++------------------------------ src/jtag/drivers/versaloon/versaloon.c | 1 - src/jtag/drivers/versaloon/versaloon.h | 2 -- src/jtag/drivers/vsllink.c | 26 ++----------------- src/jtag/startup.tcl | 16 ++++++++++-- 6 files changed, 23 insertions(+), 76 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:58:40
|
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 d7b2313b5aec47e6a4a450fdf625644ca60d633d (commit) from b1afd3dba4f046843d0c7c583c0b4ed56122d757 (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 d7b2313b5aec47e6a4a450fdf625644ca60d633d Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 22:31:27 2021 +0200 jtag/kitprog: switch to command 'adapter serial' The driver kitprog defines the command 'kitprog_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I844cb815af01137392b6d12e1b5972fc77ac092d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6652 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 5b9d65047..c36047f07 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r, ftdi. +cmsis_dap, ft232r, ftdi, kitprog. The following adapters have their own command to specify the serial string: -hla, jlink, kitprog, presto, st-link, vsllink, xds110. +hla, jlink, presto, st-link, vsllink, xds110. @end deffn @section Interface Drivers @@ -2896,11 +2896,6 @@ Indicate that a PSoC acquisition sequence needs to be run during adapter init. Please be aware that the acquisition sequence hard-resets the target. @end deffn -@deffn {Config Command} {kitprog_serial} serial -Select a KitProg device by its @var{serial}. If left unspecified, the first -device detected by OpenOCD will be used. -@end deffn - @deffn {Command} {kitprog acquire_psoc} Run a PSoC acquisition sequence immediately. Typically, this should not be used outside of the target-specific configuration scripts since it hard-resets the diff --git a/src/jtag/drivers/kitprog.c b/src/jtag/drivers/kitprog.c index 327bb572d..0c5ccc6a7 100644 --- a/src/jtag/drivers/kitprog.c +++ b/src/jtag/drivers/kitprog.c @@ -39,6 +39,7 @@ #include <hidapi.h> +#include <jtag/adapter.h> #include <jtag/interface.h> #include <jtag/swd.h> #include <jtag/commands.h> @@ -114,7 +115,6 @@ struct pending_transfer_result { void *buffer; }; -static char *kitprog_serial; static bool kitprog_init_acquire_psoc; static int pending_transfer_count, pending_queue_len; @@ -230,7 +230,6 @@ static int kitprog_quit(void) free(kitprog_handle->packet_buffer); free(kitprog_handle->serial); free(kitprog_handle); - free(kitprog_serial); free(pending_transfers); return ERROR_OK; @@ -272,7 +271,7 @@ static int kitprog_usb_open(void) const uint16_t vids[] = { VID, 0 }; const uint16_t pids[] = { PID, 0 }; - if (jtag_libusb_open(vids, pids, kitprog_serial, + if (jtag_libusb_open(vids, pids, adapter_get_required_serial(), &kitprog_handle->usb_handle, NULL) != ERROR_OK) { LOG_ERROR("Failed to open or find the device"); return ERROR_FAIL; @@ -851,22 +850,6 @@ COMMAND_HANDLER(kitprog_handle_acquire_psoc_command) return retval; } -COMMAND_HANDLER(kitprog_handle_serial_command) -{ - if (CMD_ARGC == 1) { - kitprog_serial = strdup(CMD_ARGV[0]); - if (!kitprog_serial) { - LOG_ERROR("Failed to allocate memory for the serial number"); - return ERROR_FAIL; - } - } else { - LOG_ERROR("expected exactly one argument to kitprog_serial <serial-number>"); - return ERROR_FAIL; - } - - return ERROR_OK; -} - COMMAND_HANDLER(kitprog_handle_init_acquire_psoc_command) { kitprog_init_acquire_psoc = true; @@ -900,13 +883,6 @@ static const struct command_registration kitprog_command_handlers[] = { .usage = "<cmd>", .chain = kitprog_subcommand_handlers, }, - { - .name = "kitprog_serial", - .handler = &kitprog_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the adapter", - .usage = "serial_string", - }, { .name = "kitprog_init_acquire_psoc", .handler = &kitprog_handle_init_acquire_psoc_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index b21ddc646..75b1bfbdf 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -759,4 +759,10 @@ proc "ftdi serial" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip kitprog_serial +proc kitprog_serial args { + echo "DEPRECATED! use 'adapter serial' not 'kitprog_serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/kitprog.cfg b/tcl/interface/kitprog.cfg index 29fce489b..933a05408 100644 --- a/tcl/interface/kitprog.cfg +++ b/tcl/interface/kitprog.cfg @@ -9,4 +9,4 @@ adapter driver kitprog # Optionally specify the serial number of the KitProg you want to use. -#kitprog_serial 1926402735485200 +# adapter serial 1926402735485200 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 9 ++------- src/jtag/drivers/kitprog.c | 28 ++-------------------------- src/jtag/startup.tcl | 6 ++++++ tcl/interface/kitprog.cfg | 2 +- 4 files changed, 11 insertions(+), 34 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:57:48
|
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 b1afd3dba4f046843d0c7c583c0b4ed56122d757 (commit) from 52b94977243b500b2f6c051710dc8d88fdab78a0 (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 b1afd3dba4f046843d0c7c583c0b4ed56122d757 Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 22:28:30 2021 +0200 jtag/ftdi: switch to command 'adapter serial' The driver ftdi defines the command 'ftdi serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: Ia5b1f325b9fab8f58b5ea70f8b807e50b148b939 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6651 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 2891f3519..5b9d65047 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap, ft232r. +cmsis_dap, ft232r, ftdi. The following adapters have their own command to specify the serial string: -ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. +hla, jlink, kitprog, presto, st-link, vsllink, xds110. @end deffn @section Interface Drivers @@ -2512,15 +2512,6 @@ of the adapter. If not specified, the device description is ignored during device selection. @end deffn -@deffn {Config Command} {ftdi serial} serial-number -Specifies the @var{serial-number} of the adapter to use, -in case the vendor provides unique IDs and more than one adapter -is connected to the host. -If not specified, serial numbers are not considered. -(Note that USB serial numbers can be arbitrary Unicode strings, -and are not restricted to containing only decimal digits.) -@end deffn - @deffn {Config Command} {ftdi channel} channel Selects the channel of the FTDI device to use for MPSSE operations. Most adapters use the default, channel 0, but there are exceptions. diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 8366774bc..7671cee5d 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -90,7 +90,6 @@ #define SWD_MODE (LSB_FIRST | POS_EDGE_IN | NEG_EDGE_OUT) static char *ftdi_device_desc; -static char *ftdi_serial; static uint8_t ftdi_channel; static uint8_t ftdi_jtag_mode = JTAG_MODE; @@ -672,7 +671,7 @@ static int ftdi_initialize(void) for (int i = 0; ftdi_vid[i] || ftdi_pid[i]; i++) { mpsse_ctx = mpsse_open(&ftdi_vid[i], &ftdi_pid[i], ftdi_device_desc, - ftdi_serial, adapter_usb_get_location(), ftdi_channel); + adapter_get_required_serial(), adapter_usb_get_location(), ftdi_channel); if (mpsse_ctx) break; } @@ -717,7 +716,6 @@ static int ftdi_quit(void) } free(ftdi_device_desc); - free(ftdi_serial); free(swd_cmd_queue); @@ -736,18 +734,6 @@ COMMAND_HANDLER(ftdi_handle_device_desc_command) return ERROR_OK; } -COMMAND_HANDLER(ftdi_handle_serial_command) -{ - if (CMD_ARGC == 1) { - free(ftdi_serial); - ftdi_serial = strdup(CMD_ARGV[0]); - } else { - return ERROR_COMMAND_SYNTAX_ERROR; - } - - return ERROR_OK; -} - COMMAND_HANDLER(ftdi_handle_channel_command) { if (CMD_ARGC == 1) @@ -955,13 +941,6 @@ static const struct command_registration ftdi_subcommand_handlers[] = { .help = "set the USB device description of the FTDI device", .usage = "description_string", }, - { - .name = "serial", - .handler = &ftdi_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the FTDI device", - .usage = "serial_string", - }, { .name = "channel", .handler = &ftdi_handle_channel_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index b5f4a0298..b21ddc646 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -215,8 +215,8 @@ proc ftdi_device_desc args { lappend _telnet_autocomplete_skip ftdi_serial proc ftdi_serial args { - echo "DEPRECATED! use 'ftdi serial' not 'ftdi_serial'" - eval ftdi serial $args + echo "DEPRECATED! use 'adapter serial' not 'ftdi_serial'" + eval adapter serial $args } lappend _telnet_autocomplete_skip ftdi_channel @@ -753,4 +753,10 @@ proc "ft232r serial_desc" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip "ftdi serial" +proc "ftdi serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'ftdi serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/ftdi/flossjtag.cfg b/tcl/interface/ftdi/flossjtag.cfg index 2e3cfca48..c1506a2e9 100644 --- a/tcl/interface/ftdi/flossjtag.cfg +++ b/tcl/interface/ftdi/flossjtag.cfg @@ -20,7 +20,7 @@ echo "so it could be marked as working or fixed." adapter driver ftdi ftdi vid_pid 0x0403 0x6010 ftdi device_desc "FLOSS-JTAG" -#ftdi serial "FJ000001" +# adapter serial "FJ000001" ftdi layout_init 0x0008 0x180b ftdi layout_signal nTRST -data 0x0010 -oe 0x0010 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 13 ++----------- src/jtag/drivers/ftdi.c | 23 +---------------------- src/jtag/startup.tcl | 10 ++++++++-- tcl/interface/ftdi/flossjtag.cfg | 2 +- 4 files changed, 12 insertions(+), 36 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:56:57
|
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 52b94977243b500b2f6c051710dc8d88fdab78a0 (commit) from 248161cbf47af9f7fc8c00b5efa79a1ff8e65848 (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 52b94977243b500b2f6c051710dc8d88fdab78a0 Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 22:25:27 2021 +0200 jtag/ft232r: switch to command 'adapter serial' The driver ft232r defines the command 'ft232r serial_desc' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I0bd909923a668420604fed3c9f6a260716b044c7 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6650 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 4ce6e0426..2891f3519 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2371,9 +2371,9 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -cmsis_dap. +cmsis_dap, ft232r. The following adapters have their own command to specify the serial string: -ft232r, ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. +ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. @end deffn @section Interface Drivers @@ -2641,12 +2641,6 @@ The vendor ID and product ID of the adapter. If not specified, default 0x0403:0x6001 is used. @end deffn -@deffn {Config Command} {ft232r serial_desc} @var{serial} -Specifies the @var{serial} of the adapter to use, in case the -vendor provides unique IDs and more than one adapter is connected to -the host. If not specified, serial numbers are not considered. -@end deffn - @deffn {Config Command} {ft232r jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} Set four JTAG GPIO numbers at once. If not specified, default 0 3 1 2 or TXD CTS RXD RTS is used. diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index 22c0fe5dd..fc3cdbae2 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -26,6 +26,7 @@ #endif /* project specific includes */ +#include <jtag/adapter.h> #include <jtag/interface.h> #include <jtag/commands.h> #include <helper/time_support.h> @@ -68,7 +69,6 @@ #define FT232R_BUF_SIZE_EXTRA 4096 -static char *ft232r_serial_desc; static uint16_t ft232r_vid = 0x0403; /* FTDI */ static uint16_t ft232r_pid = 0x6001; /* FT232R */ static struct libusb_device_handle *adapter; @@ -257,6 +257,7 @@ static int ft232r_init(void) { uint16_t avids[] = {ft232r_vid, 0}; uint16_t apids[] = {ft232r_pid, 0}; + const char *ft232r_serial_desc = adapter_get_required_serial(); if (jtag_libusb_open(avids, apids, ft232r_serial_desc, &adapter, NULL)) { LOG_ERROR("ft232r not found: vid=%04x, pid=%04x, serial=%s\n", ft232r_vid, ft232r_pid, (!ft232r_serial_desc) ? "[any]" : ft232r_serial_desc); @@ -395,16 +396,6 @@ static int ft232r_bit_name_to_number(const char *name) return -1; } -COMMAND_HANDLER(ft232r_handle_serial_desc_command) -{ - if (CMD_ARGC == 1) - ft232r_serial_desc = strdup(CMD_ARGV[0]); - else - LOG_ERROR("require exactly one argument to " - "ft232r_serial_desc <serial>"); - return ERROR_OK; -} - COMMAND_HANDLER(ft232r_handle_vid_pid_command) { if (CMD_ARGC > 2) { @@ -561,13 +552,6 @@ COMMAND_HANDLER(ft232r_handle_restore_serial_command) } static const struct command_registration ft232r_subcommand_handlers[] = { - { - .name = "serial_desc", - .handler = ft232r_handle_serial_desc_command, - .mode = COMMAND_CONFIG, - .help = "USB serial descriptor of the adapter", - .usage = "serial string", - }, { .name = "vid_pid", .handler = ft232r_handle_vid_pid_command, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 94030dbc5..b5f4a0298 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -677,8 +677,8 @@ proc usb_blaster_firmware args { lappend _telnet_autocomplete_skip ft232r_serial_desc proc ft232r_serial_desc args { - echo "DEPRECATED! use 'ft232r serial_desc' not 'ft232r_serial_desc'" - eval ft232r serial_desc $args + echo "DEPRECATED! use 'adapter serial_desc' not 'ft232r_serial_desc'" + eval adapter serial_desc $args } lappend _telnet_autocomplete_skip ft232r_vid_pid @@ -747,4 +747,10 @@ proc cmsis_dap_serial args { eval adapter serial $args } +lappend _telnet_autocomplete_skip "ft232r serial_desc" +proc "ft232r serial_desc" {args} { + echo "DEPRECATED! use 'adapter serial' not 'ft232r serial_desc'" + eval adapter serial $args +} + # END MIGRATION AIDS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 10 ++-------- src/jtag/drivers/ft232r.c | 20 ++------------------ src/jtag/startup.tcl | 10 ++++++++-- 3 files changed, 12 insertions(+), 28 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:56:25
|
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 248161cbf47af9f7fc8c00b5efa79a1ff8e65848 (commit) via a3b69dee622066d3a2b70c32775818d82b5ffb54 (commit) from 0343ae7cc734d8dfae17ff1ae9dbe834962f6da3 (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 248161cbf47af9f7fc8c00b5efa79a1ff8e65848 Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 19:42:54 2021 +0200 jtag/cmsis_dap: switch to command 'adapter serial' The driver cmsis_dap defines the command 'cmsis_dap_serial' to specify the serial string of the adapter. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I88e2d4de360a6c6f23529bb18494962a267250df Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6649 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 286943643..4ce6e0426 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2370,9 +2370,10 @@ This command is only available if your libusb1 is at least version 1.0.16. @deffn {Config Command} {adapter serial} serial_string Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. -No adapter uses this command, so far. +Only the following adapter drivers use the serial string from this command: +cmsis_dap. The following adapters have their own command to specify the serial string: -cmsis_dap, ft232r, ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. +ft232r, ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. @end deffn @section Interface Drivers @@ -2427,11 +2428,6 @@ cmsis_dap_vid_pid 0xc251 0xf001 0x0d28 0x0204 @end example @end deffn -@deffn {Config Command} {cmsis_dap_serial} [serial] -Specifies the @var{serial} of the CMSIS-DAP device to use. -If not specified, serial numbers are not considered. -@end deffn - @deffn {Config Command} {cmsis_dap_backend} [@option{auto}|@option{usb_bulk}|@option{hid}] Specifies how to communicate with the adapter: diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index c0898fc30..e7562d087 100644 --- a/src/jtag/drivers/cmsis_dap.c +++ b/src/jtag/drivers/cmsis_dap.c @@ -76,7 +76,6 @@ static const struct cmsis_dap_backend *const cmsis_dap_backends[] = { /* vid = pid = 0 marks the end of the list */ static uint16_t cmsis_dap_vid[MAX_USB_IDS + 1] = { 0 }; static uint16_t cmsis_dap_pid[MAX_USB_IDS + 1] = { 0 }; -static char *cmsis_dap_serial; static int cmsis_dap_backend = -1; static bool swd_mode; @@ -289,13 +288,13 @@ static int cmsis_dap_open(void) if (cmsis_dap_backend >= 0) { /* Use forced backend */ backend = cmsis_dap_backends[cmsis_dap_backend]; - if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, cmsis_dap_serial) != ERROR_OK) + if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial()) != ERROR_OK) backend = NULL; } else { /* Try all backends */ for (unsigned int i = 0; i < ARRAY_SIZE(cmsis_dap_backends); i++) { backend = cmsis_dap_backends[i]; - if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, cmsis_dap_serial) == ERROR_OK) + if (backend->open(dap, cmsis_dap_vid, cmsis_dap_pid, adapter_get_required_serial()) == ERROR_OK) break; else backend = NULL; @@ -325,8 +324,6 @@ static void cmsis_dap_close(struct cmsis_dap *dap) free(cmsis_dap_handle->packet_buffer); free(cmsis_dap_handle); cmsis_dap_handle = NULL; - free(cmsis_dap_serial); - cmsis_dap_serial = NULL; for (int i = 0; i < MAX_PENDING_REQUESTS; i++) { free(pending_fifo[i].transfers); @@ -2056,16 +2053,6 @@ COMMAND_HANDLER(cmsis_dap_handle_vid_pid_command) return ERROR_OK; } -COMMAND_HANDLER(cmsis_dap_handle_serial_command) -{ - if (CMD_ARGC == 1) - cmsis_dap_serial = strdup(CMD_ARGV[0]); - else - LOG_ERROR("expected exactly one argument to cmsis_dap_serial <serial-number>"); - - return ERROR_OK; -} - COMMAND_HANDLER(cmsis_dap_handle_backend_command) { if (CMD_ARGC == 1) { @@ -2122,13 +2109,6 @@ static const struct command_registration cmsis_dap_command_handlers[] = { .help = "the vendor ID and product ID of the CMSIS-DAP device", .usage = "(vid pid)*", }, - { - .name = "cmsis_dap_serial", - .handler = &cmsis_dap_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the adapter", - .usage = "serial_string", - }, { .name = "cmsis_dap_backend", .handler = &cmsis_dap_handle_backend_command, diff --git a/src/jtag/drivers/cmsis_dap.h b/src/jtag/drivers/cmsis_dap.h index f6d9df21b..7c64d492c 100644 --- a/src/jtag/drivers/cmsis_dap.h +++ b/src/jtag/drivers/cmsis_dap.h @@ -24,7 +24,7 @@ struct cmsis_dap { struct cmsis_dap_backend { const char *name; - int (*open)(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], char *serial); + int (*open)(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial); void (*close)(struct cmsis_dap *dap); int (*read)(struct cmsis_dap *dap, int timeout_ms); int (*write)(struct cmsis_dap *dap, int len, int timeout_ms); diff --git a/src/jtag/drivers/cmsis_dap_usb_bulk.c b/src/jtag/drivers/cmsis_dap_usb_bulk.c index 26c6784f9..819596b21 100644 --- a/src/jtag/drivers/cmsis_dap_usb_bulk.c +++ b/src/jtag/drivers/cmsis_dap_usb_bulk.c @@ -55,7 +55,7 @@ static int cmsis_dap_usb_interface = -1; static void cmsis_dap_usb_close(struct cmsis_dap *dap); static int cmsis_dap_usb_alloc(struct cmsis_dap *dap, unsigned int pkt_sz); -static int cmsis_dap_usb_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], char *serial) +static int cmsis_dap_usb_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial) { int err; struct libusb_context *ctx; diff --git a/src/jtag/drivers/cmsis_dap_usb_hid.c b/src/jtag/drivers/cmsis_dap_usb_hid.c index 5bb8ee8b1..912ba3972 100644 --- a/src/jtag/drivers/cmsis_dap_usb_hid.c +++ b/src/jtag/drivers/cmsis_dap_usb_hid.c @@ -48,7 +48,7 @@ struct cmsis_dap_backend_data { static void cmsis_dap_hid_close(struct cmsis_dap *dap); static int cmsis_dap_hid_alloc(struct cmsis_dap *dap, unsigned int pkt_sz); -static int cmsis_dap_hid_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], char *serial) +static int cmsis_dap_hid_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial) { hid_device *dev = NULL; int i; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index b6c185ef2..94030dbc5 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -741,4 +741,10 @@ proc "aice serial" {args} { eval adapter serial $args } +lappend _telnet_autocomplete_skip cmsis_dap_serial +proc cmsis_dap_serial args { + echo "DEPRECATED! use 'adapter serial' not 'cmsis_dap_serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/cmsis-dap.cfg b/tcl/interface/cmsis-dap.cfg index 887d2d713..1bc91a527 100644 --- a/tcl/interface/cmsis-dap.cfg +++ b/tcl/interface/cmsis-dap.cfg @@ -7,4 +7,4 @@ adapter driver cmsis-dap # Optionally specify the serial number of CMSIS-DAP usb device. -#cmsis_dap_serial 02200201E6661E601B98E3B9 +# adapter serial 02200201E6661E601B98E3B9 commit a3b69dee622066d3a2b70c32775818d82b5ffb54 Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 19:34:27 2021 +0200 jtag/aice: switch to command 'adapter serial' The driver aice defines the command 'aice serial' to specify the serial string of the adapter, but actually does not use this value in the code. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I892e0a4e1b41a7a87adf54a5736abf7419f32979 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6648 Tested-by: jenkins diff --git a/src/jtag/aice/aice_interface.c b/src/jtag/aice/aice_interface.c index c7556c018..cb126c6b1 100644 --- a/src/jtag/aice/aice_interface.c +++ b/src/jtag/aice/aice_interface.c @@ -20,6 +20,7 @@ #include "config.h" #endif +#include <jtag/adapter.h> #include <jtag/interface.h> #include <jtag/commands.h> #include <transport/transport.h> @@ -269,7 +270,7 @@ COMMAND_HANDLER(aice_handle_aice_info_command) LOG_DEBUG("aice_handle_aice_info_command"); command_print(CMD, "Description: %s", param.device_desc); - command_print(CMD, "Serial number: %s", param.serial); + command_print(CMD, "Serial number: %s", adapter_get_required_serial()); if (strncmp(aice_port->name, "aice_pipe", 9) == 0) command_print(CMD, "Adapter: %s", param.adapter_name); @@ -308,18 +309,6 @@ COMMAND_HANDLER(aice_handle_aice_desc_command) return ERROR_OK; } -COMMAND_HANDLER(aice_handle_aice_serial_command) -{ - LOG_DEBUG("aice_handle_aice_serial_command"); - - if (CMD_ARGC == 1) - param.serial = strdup(CMD_ARGV[0]); - else - LOG_ERROR("expected exactly one argument to aice serial <serial-number>"); - - return ERROR_OK; -} - COMMAND_HANDLER(aice_handle_aice_vid_pid_command) { LOG_DEBUG("aice_handle_aice_vid_pid_command"); @@ -438,13 +427,6 @@ static const struct command_registration aice_subcommand_handlers[] = { .help = "set the aice device description", .usage = "[description string]", }, - { - .name = "serial", - .handler = &aice_handle_aice_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the AICE device", - .usage = "[serial string]", - }, { .name = "vid_pid", .handler = &aice_handle_aice_vid_pid_command, diff --git a/src/jtag/aice/aice_port.h b/src/jtag/aice/aice_port.h index d3d6a1a2c..159368888 100644 --- a/src/jtag/aice/aice_port.h +++ b/src/jtag/aice/aice_port.h @@ -107,8 +107,6 @@ struct aice_port_param_s { /** */ const char *device_desc; /** */ - const char *serial; - /** */ uint16_t vid; /** */ uint16_t pid; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index d5b2ae221..b6c185ef2 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -735,4 +735,10 @@ proc ft232r_restore_serial args { eval ft232r restore_serial $args } +lappend _telnet_autocomplete_skip "aice serial" +proc "aice serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'aice serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/nds32-aice.cfg b/tcl/interface/nds32-aice.cfg index 3b21025b5..fcc33ec28 100644 --- a/tcl/interface/nds32-aice.cfg +++ b/tcl/interface/nds32-aice.cfg @@ -6,7 +6,7 @@ adapter driver aice aice desc "Andes AICE adapter" -aice serial "C001-42163" +# adapter serial "C001-42163" aice vid_pid 0x1CFC 0x0000 aice port aice_usb reset_config trst_and_srst ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 10 +++------- src/jtag/aice/aice_interface.c | 22 ++-------------------- src/jtag/aice/aice_port.h | 2 -- src/jtag/drivers/cmsis_dap.c | 24 ++---------------------- src/jtag/drivers/cmsis_dap.h | 2 +- src/jtag/drivers/cmsis_dap_usb_bulk.c | 2 +- src/jtag/drivers/cmsis_dap_usb_hid.c | 2 +- src/jtag/startup.tcl | 12 ++++++++++++ tcl/interface/cmsis-dap.cfg | 2 +- tcl/interface/nds32-aice.cfg | 2 +- 10 files changed, 24 insertions(+), 56 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-28 10:50:54
|
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 0343ae7cc734d8dfae17ff1ae9dbe834962f6da3 (commit) from f66a16c4a06fde23ae25f39c92990aa049c3c970 (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 0343ae7cc734d8dfae17ff1ae9dbe834962f6da3 Author: Antonio Borneo <bor...@gm...> Date: Thu Oct 7 19:27:31 2021 +0200 jtag/adapter: add command 'adapter serial' Several adapter define their own command to specify the USB serial number or serial string to be used during USB search. Define a general command 'adapter serial' to be proposed as replacement of the driver specific ones. No driver is changed so far to use it. Change-Id: I7631687a4163ccc63a9bdf3ad1fcb300fc483d3a Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6647 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 0ab4b36ac..286943643 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2367,6 +2367,14 @@ The USB bus topology can be queried with the command @emph{lsusb -t} or @emph{dm This command is only available if your libusb1 is at least version 1.0.16. @end deffn +@deffn {Config Command} {adapter serial} serial_string +Specifies the @var{serial_string} of the adapter to use. +If this command is not specified, serial strings are not checked. +No adapter uses this command, so far. +The following adapters have their own command to specify the serial string: +cmsis_dap, ft232r, ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110. +@end deffn + @section Interface Drivers Each of the interface drivers listed here must be explicitly diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 65874590d..14452d42f 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -42,6 +42,7 @@ enum adapter_clk_mode { static struct { bool adapter_initialized; char *usb_location; + char *serial; enum adapter_clk_mode clock_mode; int speed_khz; int rclk_fallback_speed_khz; @@ -120,6 +121,7 @@ int adapter_quit(void) LOG_ERROR("failed: %d", result); } + free(adapter_config.serial); free(adapter_config.usb_location); struct jtag_tap *t = jtag_all_taps(); @@ -223,6 +225,11 @@ int adapter_get_speed_readable(int *khz) return adapter_driver->speed_div(speed_var, khz); } +const char *adapter_get_required_serial(void) +{ + return adapter_config.serial; +} + /* * 1 char: bus * 2 * 7 chars: max 7 ports @@ -659,6 +666,16 @@ COMMAND_HANDLER(handle_adapter_speed_command) return retval; } +COMMAND_HANDLER(handle_adapter_serial_command) +{ + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; + + free(adapter_config.serial); + adapter_config.serial = strdup(CMD_ARGV[0]); + return ERROR_OK; +} + COMMAND_HANDLER(handle_adapter_reset_de_assert) { enum values { @@ -806,6 +823,13 @@ static const struct command_registration adapter_command_handlers[] = { "With or without argument, display current setting.", .usage = "[khz]", }, + { + .name = "serial", + .handler = handle_adapter_serial_command, + .mode = COMMAND_CONFIG, + .help = "Set the serial number of the adapter", + .usage = "serial_string", + }, { .name = "list", .handler = handle_adapter_list_command, diff --git a/src/jtag/adapter.h b/src/jtag/adapter.h index 8b73c0c9e..300769c22 100644 --- a/src/jtag/adapter.h +++ b/src/jtag/adapter.h @@ -55,4 +55,7 @@ int adapter_config_rclk(unsigned int fallback_speed_khz); /** Retrieves the clock speed of the adapter in kHz. */ unsigned int adapter_get_speed_khz(void); +/** Retrieves the serial number set with command 'adapter serial' */ +const char *adapter_get_required_serial(void); + #endif /* OPENOCD_JTAG_ADAPTER_H */ ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 8 ++++++++ src/jtag/adapter.c | 24 ++++++++++++++++++++++++ src/jtag/adapter.h | 3 +++ 3 files changed, 35 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-25 09:47:55
|
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 f66a16c4a06fde23ae25f39c92990aa049c3c970 (commit) from 4626af440122272a6c18ad293edc81d3051d83ec (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 f66a16c4a06fde23ae25f39c92990aa049c3c970 Author: Tomas Vanek <va...@fb...> Date: Mon Nov 22 13:50:01 2021 +0100 target/hla_target: set cortex_m->common_magic hla_target uses the same struct cortex_m_common as the standard cortex_m target. Unlike the cortex_m target hla missed setting of common_magic. Set commont_magic to help pointer verification. Add convenience tests is_cortex_m_or_hla() and is_cortex_m_with_dap_access() Use proper test in cortex_m_verify_pointer() - this code relied on unset common_magic on hla target before the change. Change-Id: I4dae79f056c3d73adf524e26aa8ef2d3a57b471e Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6741 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 721cf0a24..649ee32f2 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2589,7 +2589,7 @@ static int cortex_m_target_create(struct target *target, Jim_Interp *interp) static int cortex_m_verify_pointer(struct command_invocation *cmd, struct cortex_m_common *cm) { - if (cm->common_magic != CORTEX_M_COMMON_MAGIC) { + if (!is_cortex_m_with_dap_access(cm)) { command_print(cmd, "target is not a Cortex-M"); return ERROR_TARGET_INVALID; } diff --git a/src/target/cortex_m.h b/src/target/cortex_m.h index 57ef1e7e8..c2f836a35 100644 --- a/src/target/cortex_m.h +++ b/src/target/cortex_m.h @@ -254,6 +254,19 @@ target_to_cm(struct target *target) struct cortex_m_common, armv7m); } +static inline bool is_cortex_m_or_hla(const struct cortex_m_common *cortex_m) +{ + return cortex_m->common_magic == CORTEX_M_COMMON_MAGIC; +} + +static inline bool is_cortex_m_with_dap_access(const struct cortex_m_common *cortex_m) +{ + if (!is_cortex_m_or_hla(cortex_m)) + return false; + + return !cortex_m->armv7m.is_hla_target; +} + int cortex_m_examine(struct target *target); int cortex_m_set_breakpoint(struct target *target, struct breakpoint *breakpoint); int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoint); diff --git a/src/target/hla_target.c b/src/target/hla_target.c index a0f2d7608..3e359b950 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -214,6 +214,8 @@ static int adapter_target_create(struct target *target, return ERROR_FAIL; } + cortex_m->common_magic = CORTEX_M_COMMON_MAGIC; + adapter_init_arch_info(target, cortex_m, target->tap); return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.c | 2 +- src/target/cortex_m.h | 13 +++++++++++++ src/target/hla_target.c | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:07: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 4626af440122272a6c18ad293edc81d3051d83ec (commit) from 55159ea2e523989a8edcc930a4f01192131bb9d4 (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 4626af440122272a6c18ad293edc81d3051d83ec Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 12:29:49 2021 +0100 doc: fix typos in commands definition Change-Id: Ie07260f229c6bd227bae0bf3dd97d29bf84c72ec Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6725 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 9ff2e2e52..0ab4b36ac 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2833,7 +2833,7 @@ Reset the current configuration. @deffn {Command} {jlink config write} Write the current configuration to the internal persistent storage. @end deffn -@deffn {Command} {jlink emucom write <channel> <data>} +@deffn {Command} {jlink emucom write} <channel> <data> Write data to an EMUCOM channel. The data needs to be encoded as hexadecimal pairs. @@ -2843,7 +2843,7 @@ the EMUCOM channel 0x10: > jlink emucom write 0x10 aa0b23 @end example @end deffn -@deffn {Command} {jlink emucom read <channel> <length>} +@deffn {Command} {jlink emucom read} <channel> <length> Read data from an EMUCOM channel. The read data is encoded as hexadecimal pairs. @@ -7206,7 +7206,7 @@ as per the following example. flash bank $_FLASHNAME stm32f2x 0x1FFF7800 0 0 0 $_TARGETNAME @end example -@deffn {Command} {stm32f2x otp } num (@option{enable}|@option{disable}|@option{show}) +@deffn {Command} {stm32f2x otp} num (@option{enable}|@option{disable}|@option{show}) Enables or disables OTP write commands for bank @var{num}. The @var{num} parameter is a value shown by @command{flash banks}. @end deffn @@ -7643,7 +7643,7 @@ Some tms470-specific commands are defined: Saves programming keys in a register, to enable flash erase and write commands. @end deffn -@deffn {Command} {tms470 osc_mhz} clock_mhz +@deffn {Command} {tms470 osc_megahertz} clock_mhz Reports the clock speed, which is used to calculate timings. @end deffn @@ -8678,7 +8678,7 @@ If the control block location is not known, OpenOCD starts searching for it. Stop RTT. @end deffn -@deffn {Command} {rtt polling_interval [interval]} +@deffn {Command} {rtt polling_interval} [interval] Display the polling interval. If @var{interval} is provided, set the polling interval. The polling interval determines (in milliseconds) how often the up-channels are @@ -9026,7 +9026,7 @@ Enable (@option{on}) or disable (@option{off}) the CTI. Displays a register dump of the CTI. @end deffn -@deffn {Command} {$cti_name write } @var{reg_name} @var{value} +@deffn {Command} {$cti_name write} @var{reg_name} @var{value} Write @var{value} to the CTI register with the symbolic name @var{reg_name}. @end deffn @@ -9533,7 +9533,7 @@ cores @emph{except the ARM1176} use the same six bits. display information about target caches @end deffn -@deffn {Command} {cortex_a dacrfixup [@option{on}|@option{off}]} +@deffn {Command} {cortex_a dacrfixup} [@option{on}|@option{off}] Work around issues with software breakpoints when the program text is mapped read-only by the operating system. This option sets the CP15 DACR to "all-manager" to bypass MMU permission checks on memory access. @@ -9571,12 +9571,12 @@ possible (4096) entries are printed. @subsection ARMv7-R specific commands @cindex Cortex-R -@deffn {Command} {cortex_r dbginit} +@deffn {Command} {cortex_r4 dbginit} Initialize core debug Enables debug by unlocking the Software Lock and clearing sticky powerdown indications @end deffn -@deffn {Command} {cortex_r maskisr} [@option{on}|@option{off}] +@deffn {Command} {cortex_r4 maskisr} [@option{on}|@option{off}] Selects whether interrupts will be processed when single stepping @end deffn ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:07:14
|
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 55159ea2e523989a8edcc930a4f01192131bb9d4 (commit) via 563a5f5d7837ebfa9421885f56380d34e11822c4 (commit) from cb97a4e82171dcf81fce8d012554b99344787836 (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 55159ea2e523989a8edcc930a4f01192131bb9d4 Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 11:45:15 2021 +0100 doc: remove non-existing command readgroup The documentation included it in commit 4e79b48e2c7e ("Add new target type: OpenRISC"), but the command was never added. Remove it! Change-Id: Ice5fa1ee4086b5f5ceb942c3ce68bc9bbd75d19b Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 4e79b48e2c7e ("Add new target type: OpenRISC") Reviewed-on: https://review.openocd.org/c/openocd/+/6723 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 33e1c0d99..9ff2e2e52 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -10139,14 +10139,6 @@ included in the generated target descriptor file. addreg rtest 0x1234 org.gnu.gdb.or1k.group0 system @end example - -@end deffn -@deffn {Command} {readgroup} (@option{group}) -Display all registers in @emph{group}. - -@emph{group} can be "system", - "dmmu", "immu", "dcache", "icache", "mac", "debug", "perf", "power", "pic", - "timer" or any new group created with addreg command. @end deffn @section RISC-V Architecture commit 563a5f5d7837ebfa9421885f56380d34e11822c4 Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 11:30:08 2021 +0100 doc: remove non-existing command swd wcr The commands has been dropped in commit 150b7d26f213 ("arm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2.") but the documentation still keeps it. Remove it! Change-Id: I4e88f481d943f064d919f8065562052244122bf0 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 150b7d26f213 ("arm_adi_v5: Update DP (Debug Port) registers defined in ADIv5.2.") Reviewed-on: https://review.openocd.org/c/openocd/+/6722 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 40a3f2791..33e1c0d99 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3471,11 +3471,6 @@ Declares a single DAP which uses SWD transport. Parameters are currently the same as "jtag newtap" but this is expected to change. @end deffn -@deffn {Command} {swd wcr trn prescale} -Updates TRN (turnaround delay) and prescaling.fields of the -Wire Control Register (WCR). -No parameters: displays current settings. -@end deffn @subsection SPI Transport @cindex SPI ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 13 ------------- 1 file changed, 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:06:01
|
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 cb97a4e82171dcf81fce8d012554b99344787836 (commit) from cbfd0b9aad5e7693fffb5c88098712070b0efc71 (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 cb97a4e82171dcf81fce8d012554b99344787836 Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 11:15:42 2021 +0100 doc: remove non-existing command riscv set_scratch_ram The command was proposed in http://review.openocd.org/#/c/4578/2 and dropped in favor on existing work area commands. Nevertheless the command landed in documentation. Remove it! Change-Id: I6e18124256f29be15d8593c07d96f61d19e983f8 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: a51ab8ddf63a ("Add RISC-V support.") Reviewed-on: https://review.openocd.org/c/openocd/+/6721 Tested-by: jenkins Reviewed-by: Jan Matyas <ma...@co...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 85dc432da..40a3f2791 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -10199,11 +10199,6 @@ Set the maximum time to wait for a hart to come out of reset after reset is deasserted. @end deffn -@deffn {Command} {riscv set_scratch_ram} none|[address] -Set the address of 16 bytes of scratch RAM the debugger can use, or 'none'. -This is used to access 64-bit floating point registers on 32-bit targets. -@end deffn - @deffn {Command} {riscv set_prefer_sba} on|off When on, prefer to use System Bus Access to access memory. When off (default), prefer to use the Program Buffer to access memory. ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 5 ----- 1 file changed, 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:05:21
|
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 cbfd0b9aad5e7693fffb5c88098712070b0efc71 (commit) from facbb481b806275208baca30debfd66d54bc4f9b (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 cbfd0b9aad5e7693fffb5c88098712070b0efc71 Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 00:27:47 2021 +0100 flash/psoc6: initialize usage field The missing initialization triggers a run-time error message: Error: BUG: command 'psoc6 reset_halt' does not have the '.usage' field filled out Change-Id: I975e4ba99bd939aa924a9d62b1ab76b2ab5bf193 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6720 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index d3a4b3702..198dff5c8 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -1015,7 +1015,7 @@ static const struct command_registration psoc6_exec_command_handlers[] = { .name = "reset_halt", .handler = psoc6_handle_reset_halt, .mode = COMMAND_EXEC, - .usage = NULL, + .usage = "", .help = "Tries to simulate broken Vector Catch", }, COMMAND_REGISTRATION_DONE ----------------------------------------------------------------------- Summary of changes: src/flash/nor/psoc6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:04:54
|
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 facbb481b806275208baca30debfd66d54bc4f9b (commit) via 43ea974555de9a5bd9870a18f9f8423f1c476ea5 (commit) from b46cb18c91372bf32c0a946ce739884e4e42497c (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 facbb481b806275208baca30debfd66d54bc4f9b Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 18 00:25:37 2021 +0100 flash/rp2040: don't initialize to NULL fields in struct When a struct is initialized, missing fields are already filled with zero or NULL. This change simplifies scripts to compare documentation and registered commands. Change-Id: I96fbdfa98bbb1f2b5e2a9532faf5a15cb5bc28dd Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6719 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/rp2040.c b/src/flash/nor/rp2040.c index 5b4c16bb9..fb34172d2 100644 --- a/src/flash/nor/rp2040.c +++ b/src/flash/nor/rp2040.c @@ -441,7 +441,6 @@ FLASH_BANK_COMMAND_HANDLER(rp2040_flash_bank_command) struct flash_driver rp2040_flash = { .name = "rp2040_flash", - .commands = NULL, .flash_bank_command = rp2040_flash_bank_command, .erase = rp2040_flash_erase, .write = rp2040_flash_write, commit 43ea974555de9a5bd9870a18f9f8423f1c476ea5 Author: Antonio Borneo <bor...@gm...> Date: Wed Nov 17 22:44:21 2021 +0100 openocd: declare struct command_registration in a single line To simplify scripts to compare documentation and registered commands. Change-Id: I3bed5ba80ea8be1fd615697e80d66b42d7b45fd1 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6718 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/aice/aice_transport.c b/src/jtag/aice/aice_transport.c index c0088f5a4..2f2542e53 100644 --- a/src/jtag/aice/aice_transport.c +++ b/src/jtag/aice/aice_transport.c @@ -284,8 +284,7 @@ static int jim_aice_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } /* */ -static const struct command_registration -aice_transport_jtag_subcommand_handlers[] = { +static const struct command_registration aice_transport_jtag_subcommand_handlers[] = { { .name = "init", .mode = COMMAND_ANY, diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index 684a52cb9..58dfe4b63 100644 --- a/src/jtag/hla/hla_transport.c +++ b/src/jtag/hla/hla_transport.c @@ -45,8 +45,7 @@ COMMAND_HANDLER(hl_transport_reset_command) return hl_interface_init_reset(); } -static const struct command_registration -hl_swd_transport_subcommand_handlers[] = { +static const struct command_registration hl_swd_transport_subcommand_handlers[] = { { .name = "newdap", .mode = COMMAND_CONFIG, @@ -67,8 +66,7 @@ static const struct command_registration hl_swd_transport_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const struct command_registration -hl_transport_jtag_subcommand_handlers[] = { +static const struct command_registration hl_transport_jtag_subcommand_handlers[] = { { .name = "newtap", .mode = COMMAND_CONFIG, ----------------------------------------------------------------------- Summary of changes: src/flash/nor/rp2040.c | 1 - src/jtag/aice/aice_transport.c | 3 +-- src/jtag/hla/hla_transport.c | 6 ++---- 3 files changed, 3 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:04:28
|
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 b46cb18c91372bf32c0a946ce739884e4e42497c (commit) from b5d1b719e5a4a248d99921ebfd1298dcb473d1c1 (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 b46cb18c91372bf32c0a946ce739884e4e42497c Author: Antonio Borneo <bor...@gm...> Date: Wed Nov 17 22:15:20 2021 +0100 openocd: use unique name for struct command_registration Just to avoid name clash when comparing documentation with registered commands through scripts. Change-Id: I8832545d8d9236ea5dabe6e73732f51e5246caff Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6717 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index 6744779e9..90cee6412 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -1545,7 +1545,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) return retval; } -static const struct command_registration stm32x_exec_command_handlers[] = { +static const struct command_registration stm32f1x_exec_command_handlers[] = { { .name = "lock", .handler = stm32x_handle_lock_command, @@ -1593,20 +1593,20 @@ static const struct command_registration stm32x_exec_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const struct command_registration stm32x_command_handlers[] = { +static const struct command_registration stm32f1x_command_handlers[] = { { .name = "stm32f1x", .mode = COMMAND_ANY, .help = "stm32f1x flash command group", .usage = "", - .chain = stm32x_exec_command_handlers, + .chain = stm32f1x_exec_command_handlers, }, COMMAND_REGISTRATION_DONE }; const struct flash_driver stm32f1x_flash = { .name = "stm32f1x", - .commands = stm32x_command_handlers, + .commands = stm32f1x_command_handlers, .flash_bank_command = stm32x_flash_bank_command, .erase = stm32x_erase, .protect = stm32x_protect, diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index e80928ddf..d3e7d709c 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -1747,7 +1747,7 @@ COMMAND_HANDLER(stm32x_handle_otp_command) return retval; } -static const struct command_registration stm32x_exec_command_handlers[] = { +static const struct command_registration stm32f2x_exec_command_handlers[] = { { .name = "lock", .handler = stm32x_handle_lock_command, @@ -1800,20 +1800,20 @@ static const struct command_registration stm32x_exec_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const struct command_registration stm32x_command_handlers[] = { +static const struct command_registration stm32f2x_command_handlers[] = { { .name = "stm32f2x", .mode = COMMAND_ANY, .help = "stm32f2x flash command group", .usage = "", - .chain = stm32x_exec_command_handlers, + .chain = stm32f2x_exec_command_handlers, }, COMMAND_REGISTRATION_DONE }; const struct flash_driver stm32f2x_flash = { .name = "stm32f2x", - .commands = stm32x_command_handlers, + .commands = stm32f2x_command_handlers, .flash_bank_command = stm32x_flash_bank_command, .erase = stm32x_erase, .protect = stm32x_protect, diff --git a/src/flash/nor/stm32h7x.c b/src/flash/nor/stm32h7x.c index a3e304351..d3f17b2b1 100644 --- a/src/flash/nor/stm32h7x.c +++ b/src/flash/nor/stm32h7x.c @@ -1151,7 +1151,7 @@ COMMAND_HANDLER(stm32x_handle_option_write_command) return stm32x_modify_option(bank, reg_offset, value, mask); } -static const struct command_registration stm32x_exec_command_handlers[] = { +static const struct command_registration stm32h7x_exec_command_handlers[] = { { .name = "lock", .handler = stm32x_handle_lock_command, @@ -1190,20 +1190,20 @@ static const struct command_registration stm32x_exec_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const struct command_registration stm32x_command_handlers[] = { +static const struct command_registration stm32h7x_command_handlers[] = { { .name = "stm32h7x", .mode = COMMAND_ANY, .help = "stm32h7x flash command group", .usage = "", - .chain = stm32x_exec_command_handlers, + .chain = stm32h7x_exec_command_handlers, }, COMMAND_REGISTRATION_DONE }; const struct flash_driver stm32h7x_flash = { .name = "stm32h7x", - .commands = stm32x_command_handlers, + .commands = stm32h7x_command_handlers, .flash_bank_command = stm32x_flash_bank_command, .erase = stm32x_erase, .protect = stm32x_protect, diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 4728ce3bf..2dba45d0b 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -349,7 +349,7 @@ static int dap_create(struct jim_getopt_info *goi) goto err; } - struct command_registration dap_commands[] = { + struct command_registration dap_create_commands[] = { { .name = cp, .mode = COMMAND_ANY, @@ -362,9 +362,9 @@ static int dap_create(struct jim_getopt_info *goi) /* don't expose the instance commands when using hla */ if (transport_is_hla()) - dap_commands[0].chain = NULL; + dap_create_commands[0].chain = NULL; - e = register_commands_with_data(cmd_ctx, NULL, dap_commands, dap); + e = register_commands_with_data(cmd_ctx, NULL, dap_create_commands, dap); if (e != ERROR_OK) { e = JIM_ERR; goto err; diff --git a/src/target/hla_target.c b/src/target/hla_target.c index c67c9cc89..a0f2d7608 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -621,7 +621,7 @@ static int adapter_write_memory(struct target *target, target_addr_t address, return adapter->layout->api->write_mem(adapter->handle, address, size, count, buffer); } -static const struct command_registration adapter_command_handlers[] = { +static const struct command_registration hla_command_handlers[] = { { .chain = arm_command_handlers, }, @@ -647,7 +647,7 @@ struct target_type hla_target = { .target_create = adapter_target_create, .target_jim_configure = adiv5_jim_configure, .examine = cortex_m_examine, - .commands = adapter_command_handlers, + .commands = hla_command_handlers, .poll = adapter_poll, .arch_state = armv7m_arch_state, ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32f1x.c | 8 ++++---- src/flash/nor/stm32f2x.c | 8 ++++---- src/flash/nor/stm32h7x.c | 8 ++++---- src/target/arm_dap.c | 6 +++--- src/target/hla_target.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-23 11:04:04
|
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 b5d1b719e5a4a248d99921ebfd1298dcb473d1c1 (commit) from 8d9379c9bab8defe1ddb875352b432567d94f65b (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 b5d1b719e5a4a248d99921ebfd1298dcb473d1c1 Author: Antonio Borneo <bor...@gm...> Date: Tue Nov 9 00:04:52 2021 +0100 openocd: use single line for register_commands*() Do not split in multiple lines the calls to register_commands*(). No change in code behaviour, just make it easy to grep in the code and identify the commands that can be registered. This would help detecting undocumented commands. Change-Id: Id654e107cdabf7ee31fc3d227c1d2a59acc5669e Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6716 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index 6707314cc..b796fb7ce 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -528,8 +528,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name, } if (controller->commands) { - retval = register_commands(CMD_CTX, NULL, - controller->commands); + retval = register_commands(CMD_CTX, NULL, controller->commands); if (retval != ERROR_OK) return retval; } diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 228e76fd0..b24191348 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -1284,8 +1284,7 @@ COMMAND_HANDLER(handle_flash_bank_command) /* register flash specific commands */ if (driver->commands) { - int retval = register_commands(CMD_CTX, NULL, - driver->commands); + int retval = register_commands(CMD_CTX, NULL, driver->commands); if (retval != ERROR_OK) { LOG_ERROR("couldn't register '%s' commands", driver_name); diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index c30019c17..65874590d 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -367,8 +367,7 @@ COMMAND_HANDLER(handle_adapter_driver_command) continue; if (adapter_drivers[i]->commands) { - retval = register_commands(CMD_CTX, NULL, - adapter_drivers[i]->commands); + retval = register_commands(CMD_CTX, NULL, adapter_drivers[i]->commands); if (retval != ERROR_OK) return retval; } diff --git a/src/jtag/aice/aice_transport.c b/src/jtag/aice/aice_transport.c index 3e9d94219..c0088f5a4 100644 --- a/src/jtag/aice/aice_transport.c +++ b/src/jtag/aice/aice_transport.c @@ -387,8 +387,7 @@ static const struct command_registration aice_transport_command_handlers[] = { /* */ static int aice_transport_register_commands(struct command_context *cmd_ctx) { - return register_commands(cmd_ctx, NULL, - aice_transport_command_handlers); + return register_commands(cmd_ctx, NULL, aice_transport_command_handlers); } /* */ diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index d925b174a..684a52cb9 100644 --- a/src/jtag/hla/hla_transport.c +++ b/src/jtag/hla/hla_transport.c @@ -196,15 +196,13 @@ static int hl_jtag_transport_select(struct command_context *cmd_ctx) * That works with only C code ... no Tcl glue required. */ - return register_commands(cmd_ctx, NULL, - hl_jtag_transport_command_handlers); + return register_commands(cmd_ctx, NULL, hl_jtag_transport_command_handlers); } static int hl_swd_transport_select(struct command_context *cmd_ctx) { LOG_DEBUG("hl_swd_transport_select"); - return register_commands(cmd_ctx, NULL, - hl_swd_transport_command_handlers); + return register_commands(cmd_ctx, NULL, hl_swd_transport_command_handlers); } static struct transport hl_swd_transport = { diff --git a/src/pld/pld.c b/src/pld/pld.c index d0f85d74b..fe21f6c85 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -67,8 +67,7 @@ COMMAND_HANDLER(handle_pld_device_command) /* register pld specific commands */ int retval; if (pld_drivers[i]->commands) { - retval = register_commands(CMD_CTX, NULL, - pld_drivers[i]->commands); + retval = register_commands(CMD_CTX, NULL, pld_drivers[i]->commands); if (retval != ERROR_OK) { LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]); return ERROR_FAIL; diff --git a/src/target/etm.c b/src/target/etm.c index e8bd20fef..119c0df5d 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1416,8 +1416,7 @@ COMMAND_HANDLER(handle_etm_config_command) for (i = 0; etm_capture_drivers[i]; i++) { if (strcmp(CMD_ARGV[4], etm_capture_drivers[i]->name) == 0) { - int retval = register_commands(CMD_CTX, NULL, - etm_capture_drivers[i]->commands); + int retval = register_commands(CMD_CTX, NULL, etm_capture_drivers[i]->commands); if (retval != ERROR_OK) { free(etm_ctx); return retval; ----------------------------------------------------------------------- Summary of changes: src/flash/nand/tcl.c | 3 +-- src/flash/nor/tcl.c | 3 +-- src/jtag/adapter.c | 3 +-- src/jtag/aice/aice_transport.c | 3 +-- src/jtag/hla/hla_transport.c | 6 ++---- src/pld/pld.c | 3 +-- src/target/etm.c | 3 +-- 7 files changed, 8 insertions(+), 16 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:48:55
|
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 8d9379c9bab8defe1ddb875352b432567d94f65b (commit) from d2033997871f8561d1406550c12508461f63de48 (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 8d9379c9bab8defe1ddb875352b432567d94f65b Author: Tomas Vanek <va...@fb...> Date: Tue Apr 6 22:30:52 2021 +0200 target/arm_dap: check SWD DAP configuration Raise error if * more than one plain SWD DAPs are defined * plain and multidrop DAPs are mixed * two multidrop DAPs have the same TARGETSEL value Inspired by Graham Sanderson's http://review.openocd.org/4935 Change-Id: I7279744464f5cc6477e50695c596be9c5e5507bf Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6142 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index bde1dfb5e..4728ce3bf 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -251,6 +251,52 @@ static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap return JIM_OK; } +static int dap_check_config(struct adiv5_dap *dap) +{ + if (transport_is_jtag() || transport_is_dapdirect_jtag() || transport_is_hla()) + return ERROR_OK; + + struct arm_dap_object *obj; + bool new_multidrop = dap_is_multidrop(dap); + bool had_multidrop = new_multidrop; + uint32_t targetsel = dap->multidrop_targetsel; + unsigned int non_multidrop_count = had_multidrop ? 0 : 1; + + list_for_each_entry(obj, &all_dap, lh) { + struct adiv5_dap *dap_it = &obj->dap; + + if (transport_is_swd()) { + if (dap_is_multidrop(dap_it)) { + had_multidrop = true; + if (new_multidrop && dap_it->multidrop_targetsel == targetsel) { + uint32_t dp_id = targetsel & DP_TARGETSEL_DPID_MASK; + uint32_t instance_id = targetsel >> DP_TARGETSEL_INSTANCEID_SHIFT; + LOG_ERROR("%s and %s have the same multidrop selectors -dp-id 0x%08" + PRIx32 " and -instance-id 0x%" PRIx32, + obj->name, adiv5_dap_name(dap), + dp_id, instance_id); + return ERROR_FAIL; + } + } else { + non_multidrop_count++; + } + } else if (transport_is_dapdirect_swd()) { + non_multidrop_count++; + } + } + + if (non_multidrop_count > 1) { + LOG_ERROR("Two or more SWD non multidrop DAPs are not supported"); + return ERROR_FAIL; + } + if (had_multidrop && non_multidrop_count) { + LOG_ERROR("Mixing of SWD multidrop DAPs and non multidrop DAPs is not supported"); + return ERROR_FAIL; + } + + return ERROR_OK; +} + static int dap_create(struct jim_getopt_info *goi) { struct command_context *cmd_ctx; @@ -297,6 +343,12 @@ static int dap_create(struct jim_getopt_info *goi) goto err; } + e = dap_check_config(&dap->dap); + if (e != ERROR_OK) { + e = JIM_ERR; + goto err; + } + struct command_registration dap_commands[] = { { .name = cp, ----------------------------------------------------------------------- Summary of changes: src/target/arm_dap.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:48:19
|
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 d2033997871f8561d1406550c12508461f63de48 (commit) from b973a76d8663dec254084d0d86d93762a2873805 (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 d2033997871f8561d1406550c12508461f63de48 Author: Tomas Vanek <va...@fb...> Date: Tue Apr 6 15:04:31 2021 +0200 target/adi_v5_swd: add support for SWD multidrop Based on Graham Sanderson's http://review.openocd.org/4935 Unlike Graham Sanderson's version this patch does not add any multidrop specific queuing. Multidrop SWD is handled mostly by the same code as single SWD, just a selection sequence is prepended to a SWD operation as needed. This is a minimal working implementation without checking for configuration errors (mixing multidrop and non multidrop DPs, multiple use of the same selection id etc...). Multidrop switching likely demands changes in the adapter code. Change-Id: I99a5742c209b49c0483e800f6105cb5e59a897d9 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6141 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index 6e403e8b2..c23cee157 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -56,8 +56,9 @@ /* for debug, set do_sync to true to force synchronous transfers */ static bool do_sync; +static struct adiv5_dap *swd_multidrop_selected_dap; + -static int swd_run(struct adiv5_dap *dap); static int swd_queue_dp_write_inner(struct adiv5_dap *dap, unsigned int reg, uint32_t data); @@ -176,46 +177,154 @@ static int swd_queue_dp_write_inner(struct adiv5_dap *dap, unsigned int reg, return check_sync(dap); } -static int swd_connect(struct adiv5_dap *dap) + +static int swd_multidrop_select_inner(struct adiv5_dap *dap, uint32_t *dpidr_ptr, + uint32_t *dlpidr_ptr, bool clear_sticky) { - const struct swd_driver *swd = adiv5_dap_swd_driver(dap); - uint32_t dpidr = 0xdeadbeef; - int status; + int retval; + uint32_t dpidr, dlpidr; - /* FIXME validate transport config ... is the - * configured DAP present (check IDCODE)? - * Is *only* one DAP configured? - * - * MUST READ DPIDR - */ + assert(dap_is_multidrop(dap)); - /* Check if we should reset srst already when connecting, but not if reconnecting. */ - if (!dap->do_reconnect) { - enum reset_types jtag_reset_config = jtag_get_reset_config(); + swd_send_sequence(dap, LINE_RESET); - if (jtag_reset_config & RESET_CNCT_UNDER_SRST) { - if (jtag_reset_config & RESET_SRST_NO_GATING) - adapter_assert_reset(); - else - LOG_WARNING("\'srst_nogate\' reset_config option is required"); + retval = swd_queue_dp_write_inner(dap, DP_TARGETSEL, dap->multidrop_targetsel); + if (retval != ERROR_OK) + return retval; + + retval = swd_queue_dp_read_inner(dap, DP_DPIDR, &dpidr); + if (retval != ERROR_OK) + return retval; + + if (clear_sticky) { + /* Clear all sticky errors (including ORUN) */ + swd_clear_sticky_errors(dap); + } else { + /* Ideally just clear ORUN flag which is set by reset */ + retval = swd_queue_dp_write_inner(dap, DP_ABORT, ORUNERRCLR); + if (retval != ERROR_OK) + return retval; + } + + retval = swd_queue_dp_read_inner(dap, DP_DLPIDR, &dlpidr); + if (retval != ERROR_OK) + return retval; + + retval = swd_run_inner(dap); + if (retval != ERROR_OK) + return retval; + + if ((dpidr & DP_DPIDR_VERSION_MASK) < (2UL << DP_DPIDR_VERSION_SHIFT)) { + LOG_INFO("Read DPIDR 0x%08" PRIx32 + " has version < 2. A non multidrop capable device connected?", + dpidr); + return ERROR_FAIL; + } + + /* TODO: check TARGETID if DLIPDR is same for more than one DP */ + uint32_t expected_dlpidr = DP_DLPIDR_PROTVSN | + (dap->multidrop_targetsel & DP_TARGETSEL_INSTANCEID_MASK); + if (dlpidr != expected_dlpidr) { + LOG_INFO("Read incorrect DLPIDR 0x%08" PRIx32 + " (possibly CTRL/STAT value)", + dlpidr); + return ERROR_FAIL; + } + + LOG_DEBUG_IO("Selected DP_TARGETSEL 0x%08" PRIx32, dap->multidrop_targetsel); + swd_multidrop_selected_dap = dap; + + if (dpidr_ptr) + *dpidr_ptr = dpidr; + + if (dlpidr_ptr) + *dlpidr_ptr = dlpidr; + + return retval; +} + +static int swd_multidrop_select(struct adiv5_dap *dap) +{ + if (!dap_is_multidrop(dap)) + return ERROR_OK; + + if (swd_multidrop_selected_dap == dap) + return ERROR_OK; + + int retval = ERROR_OK; + for (unsigned int retry = 0; ; retry++) { + bool clear_sticky = retry > 0; + + retval = swd_multidrop_select_inner(dap, NULL, NULL, clear_sticky); + if (retval == ERROR_OK) + break; + + swd_multidrop_selected_dap = NULL; + if (retry > 3) { + LOG_ERROR("Failed to select multidrop %s", adiv5_dap_name(dap)); + return retval; } + + LOG_DEBUG("Failed to select multidrop %s, retrying...", + adiv5_dap_name(dap)); } + return retval; +} +static int swd_connect_multidrop(struct adiv5_dap *dap) +{ + int retval; + uint32_t dpidr = 0xdeadbeef; + uint32_t dlpidr = 0xdeadbeef; int64_t timeout = timeval_ms() + 500; do { - /* Note, debugport_init() does setup too */ - swd->switch_seq(JTAG_TO_SWD); + swd_send_sequence(dap, JTAG_TO_DORMANT); + swd_send_sequence(dap, DORMANT_TO_SWD); /* Clear link state, including the SELECT cache. */ dap->do_reconnect = false; dap_invalidate_cache(dap); + swd_multidrop_selected_dap = NULL; - status = swd_queue_dp_read_inner(dap, DP_DPIDR, &dpidr); - if (status == ERROR_OK) { - status = swd_run_inner(dap); - if (status == ERROR_OK) + retval = swd_multidrop_select_inner(dap, &dpidr, &dlpidr, true); + if (retval == ERROR_OK) + break; + + alive_sleep(1); + + } while (timeval_ms() < timeout); + + if (retval != ERROR_OK) { + swd_multidrop_selected_dap = NULL; + LOG_ERROR("Failed to connect multidrop %s", adiv5_dap_name(dap)); + return retval; + } + + LOG_INFO("SWD DPIDR 0x%08" PRIx32 ", DLPIDR 0x%08" PRIx32, + dpidr, dlpidr); + + return retval; +} + +static int swd_connect_single(struct adiv5_dap *dap) +{ + int retval; + uint32_t dpidr = 0xdeadbeef; + int64_t timeout = timeval_ms() + 500; + + do { + swd_send_sequence(dap, JTAG_TO_SWD); + + /* Clear link state, including the SELECT cache. */ + dap->do_reconnect = false; + dap_invalidate_cache(dap); + + retval = swd_queue_dp_read_inner(dap, DP_DPIDR, &dpidr); + if (retval == ERROR_OK) { + retval = swd_run_inner(dap); + if (retval == ERROR_OK) break; } @@ -223,12 +332,12 @@ static int swd_connect(struct adiv5_dap *dap) } while (timeval_ms() < timeout); - if (status != ERROR_OK) { + if (retval != ERROR_OK) { LOG_ERROR("Error connecting DP: cannot read IDR"); - return status; + return retval; } - LOG_INFO("SWD DPIDR %#8.8" PRIx32, dpidr); + LOG_INFO("SWD DPIDR 0x%08" PRIx32, dpidr); do { dap->do_reconnect = false; @@ -236,14 +345,42 @@ static int swd_connect(struct adiv5_dap *dap) /* force clear all sticky faults */ swd_clear_sticky_errors(dap); - status = swd_run_inner(dap); - if (status != ERROR_WAIT) + retval = swd_run_inner(dap); + if (retval != ERROR_WAIT) break; alive_sleep(10); } while (timeval_ms() < timeout); + return retval; +} + +static int swd_connect(struct adiv5_dap *dap) +{ + int status; + + /* FIXME validate transport config ... is the + * configured DAP present (check IDCODE)? + */ + + /* Check if we should reset srst already when connecting, but not if reconnecting. */ + if (!dap->do_reconnect) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); + + if (jtag_reset_config & RESET_CNCT_UNDER_SRST) { + if (jtag_reset_config & RESET_SRST_NO_GATING) + adapter_assert_reset(); + else + LOG_WARNING("\'srst_nogate\' reset_config option is required"); + } + } + + if (dap_is_multidrop(dap)) + status = swd_connect_multidrop(dap); + else + status = swd_connect_single(dap); + /* IHI 0031E B4.3.2: * "A WAIT response must not be issued to the ... * ... writes to the ABORT register" @@ -257,9 +394,11 @@ static int swd_connect(struct adiv5_dap *dap) dap->do_reconnect = false; - swd->write_reg(swd_cmd(false, false, DP_ABORT), - DAPABORT | STKCMPCLR | STKERRCLR | WDERRCLR | ORUNERRCLR, 0); - status = swd_run_inner(dap); + status = swd_queue_dp_write_inner(dap, DP_ABORT, + DAPABORT | STKCMPCLR | STKERRCLR | WDERRCLR | ORUNERRCLR); + + if (status == ERROR_OK) + status = swd_run_inner(dap); } if (status == ERROR_OK) @@ -281,6 +420,14 @@ static int swd_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) const struct swd_driver *swd = adiv5_dap_swd_driver(dap); assert(swd); + /* TODO: Send DAPABORT in swd_multidrop_select_inner() + * in the case the multidrop dap is not selected? + * swd_queue_ap_abort() is not currently used anyway... + */ + int retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + swd->write_reg(swd_cmd(false, false, DP_ABORT), DAPABORT | STKCMPCLR | STKERRCLR | WDERRCLR | ORUNERRCLR, 0); return check_sync(dap); @@ -293,6 +440,10 @@ static int swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, if (retval != ERROR_OK) return retval; + retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + return swd_queue_dp_read_inner(dap, reg, data); } @@ -306,6 +457,10 @@ static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, if (retval != ERROR_OK) return retval; + retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + return swd_queue_dp_write_inner(dap, reg, data); } @@ -340,6 +495,10 @@ static int swd_queue_ap_read(struct adiv5_ap *ap, unsigned reg, if (retval != ERROR_OK) return retval; + retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + retval = swd_queue_ap_bankselect(ap, reg); if (retval != ERROR_OK) return retval; @@ -361,7 +520,12 @@ static int swd_queue_ap_write(struct adiv5_ap *ap, unsigned reg, if (retval != ERROR_OK) return retval; + retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + swd_finish_read(dap); + retval = swd_queue_ap_bankselect(ap, reg); if (retval != ERROR_OK) return retval; @@ -374,7 +538,12 @@ static int swd_queue_ap_write(struct adiv5_ap *ap, unsigned reg, /** Executes all queued DAP operations. */ static int swd_run(struct adiv5_dap *dap) { + int retval = swd_multidrop_select(dap); + if (retval != ERROR_OK) + return retval; + swd_finish_read(dap); + return swd_run_inner(dap); } @@ -382,9 +551,27 @@ static int swd_run(struct adiv5_dap *dap) static void swd_quit(struct adiv5_dap *dap) { const struct swd_driver *swd = adiv5_dap_swd_driver(dap); + static bool done; + + /* There is no difference if the sequence is sent at the last + * or the first swd_quit() call, send it just once */ + if (done) + return; + + done = true; + if (dap_is_multidrop(dap)) { + swd->switch_seq(SWD_TO_DORMANT); + /* Revisit! + * Leaving DPs in dormant state was tested and offers some safety + * against DPs mismatch in case of unintentional use of non-multidrop SWD. + * To put SWJ-DPs to power-on state issue + * swd->switch_seq(DORMANT_TO_JTAG); + */ + } else { + swd->switch_seq(SWD_TO_JTAG); + } - swd->switch_seq(SWD_TO_JTAG); - /* flush the queue before exit */ + /* flush the queue to shift out the sequence before exit */ swd->run(); } diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 1c96dc87a..758cfa096 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -65,6 +65,10 @@ #define DLCR_TO_TRN(dlcr) ((uint32_t)(1 + ((3 & (dlcr)) >> 8))) /* 1..4 clocks */ +/* Fields of DP_DPIDR register */ +#define DP_DPIDR_VERSION_SHIFT 12 +#define DP_DPIDR_VERSION_MASK (0xFUL << DP_DPIDR_VERSION_SHIFT) + /* Fields of the DP's AP ABORT register */ #define DAPABORT (1UL << 0) #define STKCMPCLR (1UL << 1) /* SWD-only */ @@ -89,6 +93,8 @@ #define CSYSPWRUPREQ (1UL << 30) #define CSYSPWRUPACK (1UL << 31) +#define DP_DLPIDR_PROTVSN 1u + #define DP_SELECT_APSEL 0xFF000000 #define DP_SELECT_APBANK 0x000000F0 #define DP_SELECT_DPBANK 0x0000000F ----------------------------------------------------------------------- Summary of changes: src/target/adi_v5_swd.c | 257 +++++++++++++++++++++++++++++++++++++++++------- src/target/arm_adi_v5.h | 6 ++ 2 files changed, 228 insertions(+), 35 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:47:41
|
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 b973a76d8663dec254084d0d86d93762a2873805 (commit) from bb78fa10c77411bbdf665c17eac954b7741f2040 (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 b973a76d8663dec254084d0d86d93762a2873805 Author: Tomas Vanek <va...@fb...> Date: Tue Apr 6 13:59:14 2021 +0200 target/arm_adi_v5,arm_dap: introduce multidrop_targetsel and its configuration Add multidrop_targetsel to struct adiv5_dap. Add option -dp-id and -instance-id to dap create command. Add convenience function dap_is_multidrop() Change-Id: Ibb93abb5f50b3665c320a10c1497421035762134 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6140 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index a6da1675e..85dc432da 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -4404,6 +4404,20 @@ A DAP may also provide optional @var{configparams}: register during initial examination and when checking the sticky error bit. This bit is normally checked after setting the CSYSPWRUPREQ bit, but some devices do not set the ack bit until sometime later. + +@item @code{-dp-id} @var{number} +@*Debug port identification number for SWD DPv2 multidrop. +The @var{number} is written to bits 0..27 of DP TARGETSEL during DP selection. +To find the id number of a single connected device read DP TARGETID: +@code{device.dap dpreg 0x24} +Use bits 0..27 of TARGETID. + +@item @code{-instance-id} @var{number} +@*Instance identification number for SWD DPv2 multidrop. +The @var{number} is written to bits 28..31 of DP TARGETSEL during DP selection. +To find the instance number of a single connected device read DP DLPIDR: +@code{device.dap dpreg 0x34} +The instance number is in bits 28..31 of DLPIDR value. @end itemize @end deffn diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index fa0a78a7e..1c96dc87a 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -97,6 +97,11 @@ #define DP_APSEL_MAX (255) #define DP_APSEL_INVALID (-1) +#define DP_TARGETSEL_INVALID 0xFFFFFFFFU +#define DP_TARGETSEL_DPID_MASK 0x0FFFFFFFU +#define DP_TARGETSEL_INSTANCEID_MASK 0xF0000000U +#define DP_TARGETSEL_INSTANCEID_SHIFT 28 + /* MEM-AP register addresses */ #define MEM_AP_REG_CSW 0x00 @@ -324,6 +329,13 @@ struct adiv5_dap { /** Flag saying whether to ignore the syspwrupack flag in DAP. Some devices * do not set this bit until later in the bringup sequence */ bool ignore_syspwrupack; + + /** Value to select DP in SWD multidrop mode or DP_TARGETSEL_INVALID */ + uint32_t multidrop_targetsel; + /** TPARTNO and TDESIGNER fields of multidrop_targetsel have been configured */ + bool multidrop_dp_id_valid; + /** TINSTANCE field of multidrop_targetsel has been configured */ + bool multidrop_instance_id_valid; }; /** @@ -610,6 +622,12 @@ static inline struct adiv5_ap *dap_ap(struct adiv5_dap *dap, uint8_t ap_num) return &dap->ap[ap_num]; } +/** Check if SWD multidrop configuration is valid */ +static inline bool dap_is_multidrop(struct adiv5_dap *dap) +{ + return dap->multidrop_dp_id_valid && dap->multidrop_instance_id_valid; +} + /* Lookup CoreSight component */ int dap_lookup_cs_component(struct adiv5_ap *ap, target_addr_t dbgbase, uint8_t type, target_addr_t *addr, int32_t *idx); diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 0eb55a9cb..bde1dfb5e 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -155,11 +155,15 @@ int dap_cleanup_all(void) enum dap_cfg_param { CFG_CHAIN_POSITION, CFG_IGNORE_SYSPWRUPACK, + CFG_DP_ID, + CFG_INSTANCE_ID, }; static const struct jim_nvp nvp_config_opts[] = { - { .name = "-chain-position", .value = CFG_CHAIN_POSITION }, + { .name = "-chain-position", .value = CFG_CHAIN_POSITION }, { .name = "-ignore-syspwrupack", .value = CFG_IGNORE_SYSPWRUPACK }, + { .name = "-dp-id", .value = CFG_DP_ID }, + { .name = "-instance-id", .value = CFG_INSTANCE_ID }, { .name = NULL, .value = -1 } }; @@ -197,6 +201,48 @@ static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap case CFG_IGNORE_SYSPWRUPACK: dap->dap.ignore_syspwrupack = true; break; + case CFG_DP_ID: { + jim_wide w; + e = jim_getopt_wide(goi, &w); + if (e != JIM_OK) { + Jim_SetResultFormatted(goi->interp, + "create %s: bad parameter %s", + dap->name, n->name); + return JIM_ERR; + } + if (w < 0 || w > DP_TARGETSEL_DPID_MASK) { + Jim_SetResultFormatted(goi->interp, + "create %s: %s out of range", + dap->name, n->name); + return JIM_ERR; + } + dap->dap.multidrop_targetsel = + (dap->dap.multidrop_targetsel & DP_TARGETSEL_INSTANCEID_MASK) + | (w & DP_TARGETSEL_DPID_MASK); + dap->dap.multidrop_dp_id_valid = true; + break; + } + case CFG_INSTANCE_ID: { + jim_wide w; + e = jim_getopt_wide(goi, &w); + if (e != JIM_OK) { + Jim_SetResultFormatted(goi->interp, + "create %s: bad parameter %s", + dap->name, n->name); + return JIM_ERR; + } + if (w < 0 || w > 15) { + Jim_SetResultFormatted(goi->interp, + "create %s: %s out of range", + dap->name, n->name); + return JIM_ERR; + } + dap->dap.multidrop_targetsel = + (dap->dap.multidrop_targetsel & DP_TARGETSEL_DPID_MASK) + | ((w << DP_TARGETSEL_INSTANCEID_SHIFT) & DP_TARGETSEL_INSTANCEID_MASK); + dap->dap.multidrop_instance_id_valid = true; + break; + } default: break; } ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 14 ++++++++++++++ src/target/arm_adi_v5.h | 18 ++++++++++++++++++ src/target/arm_dap.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:46:19
|
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 bb78fa10c77411bbdf665c17eac954b7741f2040 (commit) from 81afe6e3fdb1253659d7d5a1be9f4f444c2c18d5 (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 bb78fa10c77411bbdf665c17eac954b7741f2040 Author: Tomas Vanek <va...@fb...> Date: Mon Nov 15 15:32:39 2021 +0100 target/arm_dap: clean up dap_configure code dap_configure() contained first time init related tasks, as the call to dap_init_instance() and the check for configured tap. Move all first time init related stuff to dap_create() to make dap_configure() usable in eventual stand-alone 'dap configure' command. Change-Id: Ia86eadb4e960ce54e8581630d01af75720d2318d Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6702 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Matthias Welwarsky <mat...@we...> diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 18e77b50f..0eb55a9cb 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -165,11 +165,10 @@ static const struct jim_nvp nvp_config_opts[] = { static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap) { - struct jtag_tap *tap = NULL; struct jim_nvp *n; int e; - /* parse config or cget options ... */ + /* parse config ... */ while (goi->argc > 0) { Jim_SetEmptyResult(goi->interp); @@ -184,11 +183,14 @@ static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap e = jim_getopt_obj(goi, &o_t); if (e != JIM_OK) return e; + + struct jtag_tap *tap; tap = jtag_tap_by_jim_obj(goi->interp, o_t); if (!tap) { Jim_SetResultString(goi->interp, "-chain-position is invalid", -1); return JIM_ERR; } + dap->dap.tap = tap; /* loop for more */ break; } @@ -200,14 +202,6 @@ static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap } } - if (!tap) { - Jim_SetResultString(goi->interp, "-chain-position required when creating DAP", -1); - return JIM_ERR; - } - - dap_instance_init(&dap->dap); - dap->dap.tap = tap; - return JIM_OK; } @@ -242,15 +236,21 @@ static int dap_create(struct jim_getopt_info *goi) if (!dap) return JIM_ERR; - e = dap_configure(goi, dap); - if (e != JIM_OK) { - free(dap); - return e; - } + dap_instance_init(&dap->dap); cp = Jim_GetString(new_cmd, NULL); dap->name = strdup(cp); + e = dap_configure(goi, dap); + if (e != JIM_OK) + goto err; + + if (!dap->dap.tap) { + Jim_SetResultString(goi->interp, "-chain-position required when creating DAP", -1); + e = JIM_ERR; + goto err; + } + struct command_registration dap_commands[] = { { .name = cp, @@ -268,14 +268,18 @@ static int dap_create(struct jim_getopt_info *goi) e = register_commands_with_data(cmd_ctx, NULL, dap_commands, dap); if (e != ERROR_OK) { - free(dap->name); - free(dap); - return JIM_ERR; + e = JIM_ERR; + goto err; } list_add_tail(&dap->lh, &all_dap); return JIM_OK; + +err: + free(dap->name); + free(dap); + return e; } static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ----------------------------------------------------------------------- Summary of changes: src/target/arm_dap.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:46:02
|
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 81afe6e3fdb1253659d7d5a1be9f4f444c2c18d5 (commit) from 9dd39a33e6dbd9d95b5bcfde4b41c498841a27a1 (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 81afe6e3fdb1253659d7d5a1be9f4f444c2c18d5 Author: Tomas Vanek <va...@fb...> Date: Mon Apr 5 05:57:46 2021 +0200 target/adi_v5_swd: introduce swd_queue_dp_read/write_inner() This is a preparatory change for swd multidrop, mostly refactoring. Split swd_queue_dp_read/write() to inner and outer parts. Use the inner parts in swd_queue_dp_bankselect(), swd_connect() they do not need to check reconnect. Use the outer parts exclusively in swd_dap_ops. Rearrange the code to reduce forward declarations. Change-Id: I47b7f0cb037e0032a267463f06ba02123ba96fe7 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6139 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index 5e4fd2222..6e403e8b2 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -56,6 +56,20 @@ /* for debug, set do_sync to true to force synchronous transfers */ static bool do_sync; + +static int swd_run(struct adiv5_dap *dap); +static int swd_queue_dp_write_inner(struct adiv5_dap *dap, unsigned int reg, + uint32_t data); + + +static int swd_send_sequence(struct adiv5_dap *dap, enum swd_special_seq seq) +{ + const struct swd_driver *swd = adiv5_dap_swd_driver(dap); + assert(swd); + + return swd->switch_seq(seq); +} + static void swd_finish_read(struct adiv5_dap *dap) { const struct swd_driver *swd = adiv5_dap_swd_driver(dap); @@ -65,11 +79,6 @@ static void swd_finish_read(struct adiv5_dap *dap) } } -static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, - uint32_t data); -static int swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, - uint32_t *data); - static void swd_clear_sticky_errors(struct adiv5_dap *dap) { const struct swd_driver *swd = adiv5_dap_swd_driver(dap); @@ -94,6 +103,79 @@ static int swd_run_inner(struct adiv5_dap *dap) return retval; } +static inline int check_sync(struct adiv5_dap *dap) +{ + return do_sync ? swd_run_inner(dap) : ERROR_OK; +} + +/** Select the DP register bank matching bits 7:4 of reg. */ +static int swd_queue_dp_bankselect(struct adiv5_dap *dap, unsigned int reg) +{ + /* Only register address 4 is banked. */ + if ((reg & 0xf) != 4) + return ERROR_OK; + + uint32_t select_dp_bank = (reg & 0x000000F0) >> 4; + uint32_t sel = select_dp_bank + | (dap->select & (DP_SELECT_APSEL | DP_SELECT_APBANK)); + + if (sel == dap->select) + return ERROR_OK; + + dap->select = sel; + + int retval = swd_queue_dp_write_inner(dap, DP_SELECT, sel); + if (retval != ERROR_OK) + dap->select = DP_SELECT_INVALID; + + return retval; +} + +static int swd_queue_dp_read_inner(struct adiv5_dap *dap, unsigned int reg, + uint32_t *data) +{ + const struct swd_driver *swd = adiv5_dap_swd_driver(dap); + assert(swd); + + int retval = swd_queue_dp_bankselect(dap, reg); + if (retval != ERROR_OK) + return retval; + + swd->read_reg(swd_cmd(true, false, reg), data, 0); + + return check_sync(dap); +} + +static int swd_queue_dp_write_inner(struct adiv5_dap *dap, unsigned int reg, + uint32_t data) +{ + int retval; + const struct swd_driver *swd = adiv5_dap_swd_driver(dap); + assert(swd); + + swd_finish_read(dap); + + if (reg == DP_SELECT) { + dap->select = data & (DP_SELECT_APSEL | DP_SELECT_APBANK | DP_SELECT_DPBANK); + + swd->write_reg(swd_cmd(false, false, reg), data, 0); + + retval = check_sync(dap); + if (retval != ERROR_OK) + dap->select = DP_SELECT_INVALID; + + return retval; + } + + retval = swd_queue_dp_bankselect(dap, reg); + if (retval != ERROR_OK) + return retval; + + swd->write_reg(swd_cmd(false, false, reg), data, 0); + + return check_sync(dap); +} + static int swd_connect(struct adiv5_dap *dap) { const struct swd_driver *swd = adiv5_dap_swd_driver(dap); @@ -130,7 +212,7 @@ static int swd_connect(struct adiv5_dap *dap) dap->do_reconnect = false; dap_invalidate_cache(dap); - status = swd_queue_dp_read(dap, DP_DPIDR, &dpidr); + status = swd_queue_dp_read_inner(dap, DP_DPIDR, &dpidr); if (status == ERROR_OK) { status = swd_run_inner(dap); if (status == ERROR_OK) @@ -186,19 +268,6 @@ static int swd_connect(struct adiv5_dap *dap) return status; } -static int swd_send_sequence(struct adiv5_dap *dap, enum swd_special_seq seq) -{ - const struct swd_driver *swd = adiv5_dap_swd_driver(dap); - assert(swd); - - return swd->switch_seq(seq); -} - -static inline int check_sync(struct adiv5_dap *dap) -{ - return do_sync ? swd_run_inner(dap) : ERROR_OK; -} - static int swd_check_reconnect(struct adiv5_dap *dap) { if (dap->do_reconnect) @@ -212,51 +281,19 @@ static int swd_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) const struct swd_driver *swd = adiv5_dap_swd_driver(dap); assert(swd); - swd->write_reg(swd_cmd(false, false, DP_ABORT), + swd->write_reg(swd_cmd(false, false, DP_ABORT), DAPABORT | STKCMPCLR | STKERRCLR | WDERRCLR | ORUNERRCLR, 0); return check_sync(dap); } -/** Select the DP register bank matching bits 7:4 of reg. */ -static int swd_queue_dp_bankselect(struct adiv5_dap *dap, unsigned reg) -{ - /* Only register address 4 is banked. */ - if ((reg & 0xf) != 4) - return ERROR_OK; - - uint32_t select_dp_bank = (reg & 0x000000F0) >> 4; - uint32_t sel = select_dp_bank - | (dap->select & (DP_SELECT_APSEL | DP_SELECT_APBANK)); - - if (sel == dap->select) - return ERROR_OK; - - dap->select = sel; - - int retval = swd_queue_dp_write(dap, DP_SELECT, sel); - if (retval != ERROR_OK) - dap->select = DP_SELECT_INVALID; - - return retval; -} - static int swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data) { - const struct swd_driver *swd = adiv5_dap_swd_driver(dap); - assert(swd); - int retval = swd_check_reconnect(dap); if (retval != ERROR_OK) return retval; - retval = swd_queue_dp_bankselect(dap, reg); - if (retval != ERROR_OK) - return retval; - - swd->read_reg(swd_cmd(true, false, reg), data, 0); - - return check_sync(dap); + return swd_queue_dp_read_inner(dap, reg, data); } static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, @@ -269,26 +306,7 @@ static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, if (retval != ERROR_OK) return retval; - swd_finish_read(dap); - if (reg == DP_SELECT) { - dap->select = data & (DP_SELECT_APSEL | DP_SELECT_APBANK | DP_SELECT_DPBANK); - - swd->write_reg(swd_cmd(false, false, reg), data, 0); - - retval = check_sync(dap); - if (retval != ERROR_OK) - dap->select = DP_SELECT_INVALID; - - return retval; - } - - retval = swd_queue_dp_bankselect(dap, reg); - if (retval != ERROR_OK) - return retval; - - swd->write_reg(swd_cmd(false, false, reg), data, 0); - - return check_sync(dap); + return swd_queue_dp_write_inner(dap, reg, data); } /** Select the AP register bank matching bits 7:4 of reg. */ @@ -304,7 +322,7 @@ static int swd_queue_ap_bankselect(struct adiv5_ap *ap, unsigned reg) dap->select = sel; - int retval = swd_queue_dp_write(dap, DP_SELECT, sel); + int retval = swd_queue_dp_write_inner(dap, DP_SELECT, sel); if (retval != ERROR_OK) dap->select = DP_SELECT_INVALID; ----------------------------------------------------------------------- Summary of changes: src/target/adi_v5_swd.c | 166 +++++++++++++++++++++++++++--------------------- 1 file changed, 92 insertions(+), 74 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:45:33
|
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 9dd39a33e6dbd9d95b5bcfde4b41c498841a27a1 (commit) via d569b9bd68c9ffb4ee464eb5a40cf2839663965b (commit) from 872682345af6e26af145c76d5a4373b16d815b7e (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 9dd39a33e6dbd9d95b5bcfde4b41c498841a27a1 Author: Tomas Vanek <va...@fb...> Date: Fri Nov 12 15:28:30 2021 +0100 drivers/bitbang: add support for SWD multidrop Ignore ack received after DP_TARGETSEL write to prevent false error. This change also fixes a bug: Received ACK FAULT or JUNK value were incorrectly stored to queued_retval and later used as bitbang_swd_run_queue() error return. Use LOG_ERROR for parity mismatch. Change-Id: I5ff1f658f221af78d8bbec8416a7a0fc64ba2550 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6700 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c index d202a0596..898d6d3df 100644 --- a/src/jtag/drivers/bitbang.c +++ b/src/jtag/drivers/bitbang.c @@ -492,38 +492,30 @@ static void bitbang_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay uint32_t data = buf_get_u32(trn_ack_data_parity_trn, 1 + 3, 32); int parity = buf_get_u32(trn_ack_data_parity_trn, 1 + 3 + 32, 1); - LOG_DEBUG("%s %s %s reg %X = %08"PRIx32, + LOG_DEBUG("%s %s read reg %X = %08"PRIx32, ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK", cmd & SWD_CMD_APNDP ? "AP" : "DP", - cmd & SWD_CMD_RNW ? "read" : "write", (cmd & SWD_CMD_A32) >> 1, data); - switch (ack) { - case SWD_ACK_OK: - if (parity != parity_u32(data)) { - LOG_DEBUG("Wrong parity detected"); - queued_retval = ERROR_FAIL; - return; - } - if (value) - *value = data; - if (cmd & SWD_CMD_APNDP) - bitbang_swd_exchange(true, NULL, 0, ap_delay_clk); - return; - case SWD_ACK_WAIT: - LOG_DEBUG("SWD_ACK_WAIT"); + if (ack == SWD_ACK_WAIT) { swd_clear_sticky_errors(); - break; - case SWD_ACK_FAULT: - LOG_DEBUG("SWD_ACK_FAULT"); - queued_retval = ack; + continue; + } else if (ack != SWD_ACK_OK) { + queued_retval = swd_ack_to_error_code(ack); return; - default: - LOG_DEBUG("No valid acknowledge: ack=%d", ack); - queued_retval = ack; + } + + if (parity != parity_u32(data)) { + LOG_ERROR("Wrong parity detected"); + queued_retval = ERROR_FAIL; return; } + if (value) + *value = data; + if (cmd & SWD_CMD_APNDP) + bitbang_swd_exchange(true, NULL, 0, ap_delay_clk); + return; } } @@ -537,6 +529,9 @@ static void bitbang_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay return; } + /* Devices do not reply to DP_TARGETSEL write cmd, ignore received ack */ + bool check_ack = swd_cmd_returns_ack(cmd); + for (;;) { uint8_t trn_ack_data_parity_trn[DIV_ROUND_UP(4 + 3 + 32 + 1 + 4, 8)]; buf_set_u32(trn_ack_data_parity_trn, 1 + 3 + 1, 32, value); @@ -551,31 +546,27 @@ static void bitbang_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay bitbang_swd_exchange(false, trn_ack_data_parity_trn, 1 + 3 + 1, 32 + 1); int ack = buf_get_u32(trn_ack_data_parity_trn, 1, 3); - LOG_DEBUG("%s %s %s reg %X = %08"PRIx32, + + LOG_DEBUG("%s%s %s write reg %X = %08"PRIx32, + check_ack ? "" : "ack ignored ", ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK", cmd & SWD_CMD_APNDP ? "AP" : "DP", - cmd & SWD_CMD_RNW ? "read" : "write", (cmd & SWD_CMD_A32) >> 1, buf_get_u32(trn_ack_data_parity_trn, 1 + 3 + 1, 32)); - switch (ack) { - case SWD_ACK_OK: - if (cmd & SWD_CMD_APNDP) - bitbang_swd_exchange(true, NULL, 0, ap_delay_clk); - return; - case SWD_ACK_WAIT: - LOG_DEBUG("SWD_ACK_WAIT"); - swd_clear_sticky_errors(); - break; - case SWD_ACK_FAULT: - LOG_DEBUG("SWD_ACK_FAULT"); - queued_retval = ack; - return; - default: - LOG_DEBUG("No valid acknowledge: ack=%d", ack); - queued_retval = ack; - return; + if (check_ack) { + if (ack == SWD_ACK_WAIT) { + swd_clear_sticky_errors(); + continue; + } else if (ack != SWD_ACK_OK) { + queued_retval = swd_ack_to_error_code(ack); + return; + } } + + if (cmd & SWD_CMD_APNDP) + bitbang_swd_exchange(true, NULL, 0, ap_delay_clk); + return; } } commit d569b9bd68c9ffb4ee464eb5a40cf2839663965b Author: Tomas Vanek <va...@fb...> Date: Fri Nov 12 14:14:32 2021 +0100 drivers/ftdi: add support for SWD multidrop Ignore ack received after DP_TARGETSEL write to prevent false error. Inspired by Graham Sanderson's http://review.openocd.org/4935 Change-Id: I04fd77cde3244de250743d8c8bfb93ed26379385 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6698 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index d03a4ca23..8366774bc 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -1121,7 +1121,11 @@ static int ftdi_swd_run_queue(void) for (size_t i = 0; i < swd_cmd_queue_length; i++) { int ack = buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn, 1, 3); - LOG_DEBUG_IO("%s %s %s reg %X = %08"PRIx32, + /* Devices do not reply to DP_TARGETSEL write cmd, ignore received ack */ + bool check_ack = swd_cmd_returns_ack(swd_cmd_queue[i].cmd); + + LOG_DEBUG_IO("%s%s %s %s reg %X = %08"PRIx32, + check_ack ? "" : "ack ignored ", ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK", swd_cmd_queue[i].cmd & SWD_CMD_APNDP ? "AP" : "DP", swd_cmd_queue[i].cmd & SWD_CMD_RNW ? "read" : "write", @@ -1129,8 +1133,8 @@ static int ftdi_swd_run_queue(void) buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn, 1 + 3 + (swd_cmd_queue[i].cmd & SWD_CMD_RNW ? 0 : 1), 32)); - if (ack != SWD_ACK_OK) { - queued_retval = ack == SWD_ACK_WAIT ? ERROR_WAIT : ERROR_FAIL; + if (ack != SWD_ACK_OK && check_ack) { + queued_retval = swd_ack_to_error_code(ack); goto skip; } else if (swd_cmd_queue[i].cmd & SWD_CMD_RNW) { ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/bitbang.c | 75 ++++++++++++++++++++-------------------------- src/jtag/drivers/ftdi.c | 10 +++++-- 2 files changed, 40 insertions(+), 45 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:45:05
|
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 872682345af6e26af145c76d5a4373b16d815b7e (commit) via 3eef83e4bd2b112b98d73f8b0947af93c193e0ef (commit) from 08dac883a14aab398922a4e61d55204d7cef644f (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 872682345af6e26af145c76d5a4373b16d815b7e Author: Tomas Vanek <va...@fb...> Date: Fri Nov 12 09:49:01 2021 +0100 drivers/swd: add support for SWD multidrop According to ARM IHI0031C+ chapter 2.3.11 "TARGETSEL, Target Selection register" multidrop capable DPv2 must not drive SWDIO line during the response phase of a write to TARGETSEL register. Introduce helper functions swd_cmd_returns_ack() and swd_ack_to_error_code() to centralize these tests from all drivers to one place. Introduce distinct error codes for SWD protocol. Partly inspired by Graham Sanderson's http://review.openocd.org/4935 Change-Id: Ie5f9edb22e066a933a534bf2b29e7e1d3087dad1 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6699 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/swd.h b/src/jtag/swd.h index fe28667c6..8a436d0c6 100644 --- a/src/jtag/swd.h +++ b/src/jtag/swd.h @@ -18,6 +18,7 @@ #ifndef OPENOCD_JTAG_SWD_H #define OPENOCD_JTAG_SWD_H +#include <helper/log.h> #include <target/arm_adi_v5.h> /* Bits in SWD command packets, written from host to target @@ -32,6 +33,12 @@ #define SWD_CMD_PARK (1 << 7) /* driven high by host */ /* followed by TRN, 3-bits of ACK, TRN */ +/* + * The SWD subsystem error codes + */ +#define ERROR_SWD_FAIL (-400) /** protocol or parity error */ +#define ERROR_SWD_FAULT (-401) /** device returned FAULT in ACK field */ + /** * Construct a "cmd" byte, in lSB bit order, which swd_driver.read_reg() * and swd_driver.write_reg() methods will use directly. @@ -53,6 +60,40 @@ static inline uint8_t swd_cmd(bool is_read, bool is_ap, uint8_t regnum) /* SWD_ACK_* bits are defined in <target/arm_adi_v5.h> */ +/** + * Test if we can rely on ACK returned by SWD command + * + * @param cmd Byte constructed by swd_cmd(), START, STOP and TRN are filtered off + * @returns true if ACK should be checked, false if should be ignored + */ +static inline bool swd_cmd_returns_ack(uint8_t cmd) +{ + uint8_t base_cmd = cmd & (SWD_CMD_APNDP | SWD_CMD_RNW | SWD_CMD_A32); + + /* DPv2 does not reply to DP_TARGETSEL write cmd */ + return base_cmd != swd_cmd(false, false, DP_TARGETSEL); +} + +/** + * Convert SWD ACK value returned from DP to OpenOCD error code + * + * @param ack + * @returns error code + */ +static inline int swd_ack_to_error_code(uint8_t ack) +{ + switch (ack) { + case SWD_ACK_OK: + return ERROR_OK; + case SWD_ACK_WAIT: + return ERROR_WAIT; + case SWD_ACK_FAULT: + return ERROR_SWD_FAULT; + default: + return ERROR_SWD_FAIL; + } +} + /* * The following sequences are updated to * ARM(tm) Debug Interface v5 Architecture Specification ARM IHI 0031E commit 3eef83e4bd2b112b98d73f8b0947af93c193e0ef Author: Tomas Vanek <va...@fb...> Date: Wed Nov 10 12:46:42 2021 +0100 target/arm_dap: fix memory leak in error path of dap_create() Change-Id: I91fa5910670161b62a76fc834b6394c5a6c05395 Suggested-by: Antonio Borneo <bor...@gm...> Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6685 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 94edfc09d..18e77b50f 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -267,8 +267,11 @@ static int dap_create(struct jim_getopt_info *goi) dap_commands[0].chain = NULL; e = register_commands_with_data(cmd_ctx, NULL, dap_commands, dap); - if (e != ERROR_OK) + if (e != ERROR_OK) { + free(dap->name); + free(dap); return JIM_ERR; + } list_add_tail(&dap->lh, &all_dap); ----------------------------------------------------------------------- Summary of changes: src/jtag/swd.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/target/arm_dap.c | 5 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:44:16
|
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 08dac883a14aab398922a4e61d55204d7cef644f (commit) from 46e39108400ef717d05c2cff66088f1b499a02a5 (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 08dac883a14aab398922a4e61d55204d7cef644f Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Nov 11 23:55:39 2021 +0100 jtag/hla_layout: add #include <target/arm_tpiu_swo.h> hla_layout.h uses explicitly tpiu_pin_protocol enum defined in arm_tpiu_swo.h. To make this header file consistent, add the missing include. Change-Id: Ibecc279da8d6859ced2b8377e812554c747d81bb Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6687 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/hla/hla_layout.h b/src/jtag/hla/hla_layout.h index a8088fe95..732fe1e6a 100644 --- a/src/jtag/hla/hla_layout.h +++ b/src/jtag/hla/hla_layout.h @@ -23,6 +23,7 @@ #define OPENOCD_JTAG_HLA_HLA_LAYOUT_H #include <target/armv7m_trace.h> +#include <target/arm_tpiu_swo.h> /** */ struct hl_interface_s; ----------------------------------------------------------------------- Summary of changes: src/jtag/hla/hla_layout.h | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:43:45
|
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 46e39108400ef717d05c2cff66088f1b499a02a5 (commit) from 8457a1be10d1463b40c020867ad4dc2513c93a4b (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 46e39108400ef717d05c2cff66088f1b499a02a5 Author: Jan Matyas <ma...@co...> Date: Thu Nov 11 16:35:18 2021 +0100 drivers/jtag_vpi: Added "jtag_vpi:" prefixes to log messages Added "jtag_vpi:" prefixes to log messages from the jtag_vpi driver. The intention is to make it clear what the messages relate to. Without the prefix, many of the log messages won't make much sense to the user. This change does not alter any functionality, just the printed text. Example: Before: Error: Can't connect to 127.0.0.1 : 5555 After: Error: jtag_vpi: Can't connect to 127.0.0.1 : 5555 Change-Id: I779c379f52722b094b200d08b25ab0f7280d2845 Signed-off-by: Jan Matyas <ma...@co...> Reviewed-on: https://review.openocd.org/c/openocd/+/6686 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index a0138f840..0fc688edf 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -159,7 +159,7 @@ retry_write: /* This means we could not send all data, which is most likely fatal for the jtag_vpi connection (the underlying TCP connection likely not usable anymore) */ - LOG_ERROR("Could not send all data through jtag_vpi connection."); + LOG_ERROR("jtag_vpi: Could not send all data through jtag_vpi connection."); exit(-1); } @@ -541,7 +541,7 @@ static int jtag_vpi_init(void) sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { - LOG_ERROR("Could not create socket"); + LOG_ERROR("jtag_vpi: Could not create client socket"); return ERROR_FAIL; } @@ -556,13 +556,13 @@ static int jtag_vpi_init(void) serv_addr.sin_addr.s_addr = inet_addr(server_address); if (serv_addr.sin_addr.s_addr == INADDR_NONE) { - LOG_ERROR("inet_addr error occurred"); + LOG_ERROR("jtag_vpi: inet_addr error occurred"); return ERROR_FAIL; } if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { close(sockfd); - LOG_ERROR("Can't connect to %s : %u", server_address, server_port); + LOG_ERROR("jtag_vpi: Can't connect to %s : %u", server_address, server_port); return ERROR_COMMAND_CLOSE_CONNECTION; } @@ -573,7 +573,7 @@ static int jtag_vpi_init(void) setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)); } - LOG_INFO("Connection to %s : %u succeed", server_address, server_port); + LOG_INFO("jtag_vpi: Connection to %s : %u successful", server_address, server_port); return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/jtag_vpi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |