aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-05-15server: gdb_server: Add colon for target extended-remoteYasushi SHOJI1-1/+1
Both GDB commands "target remote" and "target extended-remote" require to have ":" right before port number. e.g. (gdb) target extended-remote :3333 Add ":" to the warning message so that users can copy & past it. Change-Id: Id6d8ec1e4dfd3c12cb7f3b314064f2c35fa7ab55 Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: http://openocd.zylin.com/6237 Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-15target/armv7m.h: [style] replace tab with space between variable type and nameTarek BOCHKATI1-1/+1
Change-Id: I9740c25857295a2a655d3046322a3f23f0ee7f78 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6230 Reviewed-by: Marc Schink <dev@zapb.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-11rtos: Add support for Zephyr RTOSEvgeniy Didin4-3/+800
With this patch, the Zephyr[1] RTOS is supported by OpenOCD. As usual with support for other RTOSes, Zephyr must be compiled with the DEBUG_THREAD_INFO option. This will generate some symbols with information needed in order to build the list of threads. The current implementation is limited to Zephyr running on ARM Cortex-M processors. This is the only ARM variant supported by Zephyr at the moment and is used on most of the officially supported boards. [1] https://www.zephyrproject.org/ Change-Id: I22afdbec91562f3a22cf5b88cd4ea3a7a59ba0b4 Signed-off-by: Evgeniy Didin <didin@synopsys.com> Signed-off-by: Leandro Pereira <leandro.pereira@intel.com> Signed-off-by: Daniel Glöckner <dg@emlix.com> Reviewed-on: http://openocd.zylin.com/4988 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-11cortex_m: add armv8m special registersTarek BOCHKATI3-13/+91
Change-Id: I1942f375a5f4282ad1fe4a2ff3b8f3cbc64d8f7f Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6016 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-11flash/nor/xcf: Do not use 'Yoda conditions'Marc Schink1-11/+11
Change-Id: I17308f5237338ce468e5b86289a0634429deaaa9 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6201 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-08Add IPDBG JtagHost functionality to OpenOCDDaniel Anselmi6-2/+890
IPDBG are utilities to debug IP-cores. It uses JTAG for transport to/from the FPGA. The different UIs use TCP/IP as transport. The JtagHost makes the bridge between these two. Comparable to the bridge between GDB and the in-circuit- debugging-unit of a micro controller. Change-Id: Ib1bc10dcbd4ea426e492bb7b2d85c1ed1b7a8d5a Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: http://openocd.zylin.com/5938 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-08coding-style: additional style for C codeAntonio Borneo1-4/+69
To improve readability and to push more uniform code style. Prefer 'if (false) {...}' for unused code so it get checked by the compiler. Define preferred indentation for 'switch' statement. Require balanced brackets in 'if/else'. Report the max line length. Report the formatting strings for stdint/inttypes types. Report the type 'target_addr_t'. Prefer 'unsigned int' to 'unsigned'. Change-Id: I0192a4ed298f6c6c432764fdd156cffd4b13fc89 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6203 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Marc Schink <dev@zapb.de>
2021-05-08Enable adapter "Bus Pirate" by default.R. Diez1-8/+11
The Bus Pirate is now listed in the "OpenOCD configuration summary" too. Change-Id: Ieb7bf9134af456ebe9803f3108a243204fb2a62d Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: http://openocd.zylin.com/5637 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-08target/riscv: Change 'authdata_read' outputMarc Schink1-1/+1
Use a constant output length and remove the line break to make the authentication data easier to parse. Change-Id: Iebbf1f171947ef89b0f360a2cb286a4ea15c6ba5 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6199 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tim Newsome <tim@sifive.com>
2021-05-08target/stm8: Make 'stm8_command_handlers' staticMarc Schink2-3/+1
Change-Id: I5237a8f2a1ecba9383672e37bd56f8ccd17598b6 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6200 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-08tcl: [3/3] prepare for jimtcl 0.81 'expr' syntax changeAntonio Borneo33-109/+109
Jimtcl commit 1843b79a03dd ("expr: TIP 526, only support a single arg") drops the support for multi-argument syntax for the TCL command 'expr'. Fix manually the remaining lines that don't match simple patterns and would require dedicated boring scripting. Remove the 'expr' command where appropriate. Change-Id: Ia75210c8447f88d38515addab4a836af9103096d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6161 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-08tcl: [2/3] prepare for jimtcl 0.81 'expr' syntax changeAntonio Borneo4-12/+12
Jimtcl commit 1843b79a03dd ("expr: TIP 526, only support a single arg") drops the support for multi-argument syntax for the TCL command 'expr'. Enclose within double quote the argument of 'expr' when there is the need to concatenate strings. Change-Id: Ic0ea990ed37337a7e6c3a99670583685b570b8b1 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6160 Tested-by: jenkins
2021-05-08tcl: [1/3] prepare for jimtcl 0.81 'expr' syntax changeAntonio Borneo61-1596/+1596
Jimtcl commit 1843b79a03dd ("expr: TIP 526, only support a single arg") drops the support for multi-argument syntax for the TCL command 'expr'. In the TCL scripts distributed with OpenOCD there are 1700+ lines that should be modified before switching to jimtcl 0.81. Apply the script below on every script in tcl folder. It fixes more than 92% of the lines %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- #!/usr/bin/perl -Wpi my $re_sym = qr{[a-z_][a-z0-9_]*}i; my $re_var = qr{(?:\$|\$::)$re_sym}; my $re_const = qr{0x[0-9a-f]+|[0-9]+|[0-9]*\.[0-9]*}i; my $re_item = qr{(?:~\s*)?(?:$re_var|$re_const)}; my $re_op = qr{<<|>>|[+\-*/&|]}; my $re_expr = qr{( (?:\(\s*(?:$re_item|(?-1))\s*\)|$re_item) \s*$re_op\s* (?:$re_item|(?-1)|\(\s*(?:$re_item|(?-1))\s*\)) )}x; # [expr [dict get $regsC100 SYM] + HEXNUM] s/\[expr (\[dict get $re_var $re_sym\s*\] \+ *$re_const)\]/\[expr \{$1\}\]/; # [ expr (EXPR) ] # [ expr EXPR ] # note: $re_expr captures '$3' s/\[(\s*expr\s*)\((\s*$re_expr\s*)\)(\s*)\]/\[$1\{$2\}$4\]/; s/\[(\s*expr\s*)($re_expr)(\s*)\]/\[$1\{$2\}$4\]/; %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- Change-Id: I0d6bddc6abf6dd29062f2b4e72b5a2b5080293b9 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6159 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-08startup.tcl: prepare for jimtcl 0.81 'expr' syntax changeAntonio Borneo2-4/+5
Jimtcl commit 1843b79a03dd ("expr: TIP 526, only support a single arg") drops the support for multi-argument syntax for the TCL command 'expr'. Modify the script startup.tcl compiled-in OpenOCD binary to comply with the new jimtcl. Change-Id: I520dcafacadaa289a815035f93f250447ca66ea0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6158 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-08telnet/auto-complete: hide deprecated and internal commandsAntonio Borneo4-0/+22
For both: - TCL proc that redirect deprecated commands to the new commands, - TCL proc used internally and not supposed to be exposed to user, add their name to the list of commands that should be hide by the telnet auto-complete. Change-Id: I05237c6a79334b7d2b151dfb129fb57b2f40bba6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6195 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2021-05-08telnet: allow hiding selected commands during auto-completionAntonio Borneo2-1/+18
We have TCL procedure and commands that we do not want to show in the list of auto-completion. E.g. TCL wrappers for deprecated commands, internal procedures that are not supposed to be exposed to user, or even commands that the user decides to hide. Create a TCL procedure to be called by telnet auto-complete code in place of the hard-coded TCL command. The procedure will run the same command and will filter-out the unwanted command names. Initialize the list of commands to be filtered-out with the name of the TCL procedure above, as it is considered as internal. Change-Id: I2d83bbf8194502368c589c85cccb617e69128c69 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6194 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2021-05-04cortex_m: use unsigned int for FPB and DWT quantifiersTarek BOCHKATI2-35/+32
related quantifiers are: - fp_num_lit - fp_num_code - dwt_num_comp - dwt_comp_available Change-Id: I07dec2d4aa21bc0e580be0d9fd0a6809f876c2a8 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6185 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-02cortex_m: implement hit_watchpoint functionTarek BOCHKATI1-0/+30
this change aims to provide a better gdb debugging experience, by making gdb understand what's really happening. before this change when hitting a watchpoint - openocd reports "T05" to gdb - gdb displays: Program received signal SIGTRAP, Trace/breakpoint trap. after the change - openocd reports "T05watch:20000000;" to gdb - gdb displays: Hardware watchpoint 1: *0x20000000 Old value = 16000000 New value = 170000000 ... Change-Id: Iac3a85eadd86663617889001dd04513a4211ced9 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6181 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-02tcl/board: add pico-debug supportPeter Lawrence6-0/+516
pico-debug is not a board; it is a virtual CMSIS-DAP adapter that runs on the same RP2040 also being debugged. This is possible due to pico-debug running on the normally-dormant second Cortex-M0+ core (Core1), providing debugging of the first core (Core0). As such, it could be used on a variety of RP2040-based boards. Since a flash driver is useful (if not essential), a flash driver is included. This driver code originated on RPi's bespoke OpenOCD fork; lipstick was added to this particular pig to make it more presentable on OpenOCD proper. no new Clang analyzer warnings Change-Id: I31f98b5ea1664f0adfbc184b57efba963acfb958 Signed-off-by: Peter Lawrence <majbthrd@gmail.com> Reviewed-on: http://openocd.zylin.com/6075 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-02flash/nor/stm32f1x: Add support for GD32F1x0/3x0asier702-5/+36
Nowadays, when it's difficult to buy STM32F030, the use of GD32F130 seems to be an interesting functional alternative. This is cortex-M3 and it works with the stm32f1x driver, but unfortunately not fully. The main difference is another offset of user option bits (like WDG_SW, nRST_STOP, nRST_STDBY) in option byte register (FLASH_OBR/FMC_OBSTAT 0x4002201C). Any use of functions like lock or unlock results in change default values of the those bits stored in flash. Thus broken microcontroller is malfunctioning, e.g. flash block programming is interrupted by unexpected active hardware watchog (after 0.4s). This patch is a simplified version of #4592 done by Dominik Peklo (http://openocd.zylin.com/#/c/4592/). GigaDevice GD32F1x0 & GD32F3x0 series devices share DEV_ID with STM32F101/2/3 medium-density line, however they use a REV_ID different from any STM32 device, so can be succesfully detected. Change-Id: I252cdf738d94983b70676a3497326f90c329e292 Signed-off-by: asier70Andrzej Sierżęga <asier70@gmail.com> Reviewed-on: http://openocd.zylin.com/6164 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01Cleanup of config/includes.Tim Newsome56-17/+81
Remove a use of AH_BOTTOM from configure.ac. This macro is used by autoheader to add '#include' of some include file to the end of config.h.in and then to config.h. OpenOCD can be built with a custom config.h, so it's preferable to move these '#include' statement directly in the C files that need them dropping this unneeded dependency. It also causes problems when I want to use the gnulib library (which comes with its own Makefile, and does not have the same include path as the top-level Makefile). So this change touches a lot of files, but is actually really simple. It does not affect functionality at all. Change-Id: I52c70bf15eb2edc1dd10e0fde23b2bcd4caec000 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/6171 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-01drivers/ftdi: drscan: Skip DR-PAUSE when endstate == IDLELuis de Arquer1-8/+23
Currently, all drscan commands will cycle through DR-PAUSE before reaching TAP-IDLE. This patch provides a different path on FTDI driver. This change is required for the ST On Chip Emulator (OnCE), to avoid re-enabling the OnCE tap after every DRSCAN. This is because the OnCE TAP (see ST Application Note AN4035) gets disabled if DR-PAUSE is entered before DR-UPDATE. With this commit, the current path: DR-SHIFT -> DR-EXIT1 -> DR-PAUSE -> DR-EXIT2 -> DR-UPDATE -> IDLE is changed to: DR-SHIFT -> DR-EXIT1 -> DR-UPDATE -> IDLE only if IDLE is the endstate (which is the driver default). Before this patch, once the SHIFT sequence is complete, the driver would normally move to the nearest stable state, which is DR-PAUSE, by clocking out a '10' binary sequence. Then it would follow the path provided by tap_get_tms_path() to reach endstate. It is done this way because tap_get_tms_path() only supports stable states. After this patch, the strategy is mostly the same, with the exception that, if TAP_IDLE is the endstate, a '110' binary sequence is output after completing the SHIFT sequence. This takes the TAP directly to IDLE, with no further action required. A scheme of the DR chain is shown below. A * character is used to mark the stable states. ---------------------------------------------------------------------- | | 0 v 1 0 0 1 0 1 1 | IDLE* -> SEL-DR -> CAPTURE -> SHIFT* -> EXIT1 -> PAUSE* -> EXIT2 -> UPDATE | ^ 1 | | ----------------------------- Change-Id: Ib413e5c4c0bbf75dae0b4672119bae4ef03d0258 Signed-off-by: Luis de Arquer <luis.dearquer@inertim.com> Reviewed-on: http://openocd.zylin.com/6123 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2021-05-01telnet: auto-completion of "registered" commandsTarek BOCHKATI1-25/+223
auto-completion behavior: - if there is only one matched command complete the user-command - else if multiple matches add the common part then in second step list all matched commands - sub-commands are handled in the same way - auto-completion restarts after these characters ';', '[', '{' Change-Id: I1b81dd19191a5785e68d0bb5cd244e01a4dd0587 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6095 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-01udev rules: add OSBDM deviceJiri Kastner1-0/+5
Change-Id: I7221a6b3fe6fcd4f17ea664c10fd32c645e21d7c Signed-off-by: Jiri Kastner <cz172638@gmail.com> Reviewed-on: http://openocd.zylin.com/6198 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-01jtag: simplify the calls to Jim_SetResultFormatted()Antonio Borneo2-11/+6
The documentation of Jim_SetResultFormatted() reports that the jim objects passed as arguments would be freed if have zero refcount. Remove the useless Jim_IncrRefCount()/Jim_DecrRefCount(). Remove the dangerous Jim_FreeNewObj() that should trigger a double free(). Not tested due to lack of aice adapter. While there, rename some CamelCase symbol. Change-Id: Ic56704c83d6391c38f6b0efa6566784d453bc0fb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6190 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/command: drop the TCL variable 'ocd_HOSTOS'Antonio Borneo2-62/+0
Commit 7a731eb63731 ("Added HostOS variable"), merged in 2009, adds a TCL global variable 'ocd_HostOS' that reports in a string the OS of the host. This was proposed as a workaround for jimtcl that didn't define the standard TCL variable 'tcl_platform(os)'. With commit 42f3fb7b7f46 ("Determine platform_tcl() settings with configure"), merged in 2010 and part of jimtcl 0.70 issued in early 2011, jimtcl provides the requires TCL standard variable 'tcl_platform(os)'. The variable 'ocd_HostOS' has never been used by any TCL script distributed with OpenOCD. Drop the TCL variable 'ocd_HostOS'. Change-Id: I27858de35cc9d30df97145ca1ccd24877be4af11 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6189 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/command: fix memory leak on malloc() failAntonio Borneo1-5/+9
If malloc() fails, the just allocated Jim_Obj will leaks. Move Jim_IncrRefCount() before the malloc() and deallocate the Jim object with Jim_DecrRefCount() on malloc() fail. While there, add the 'out of memory' log and fix the CamelCase name of the symbol tclOutput. Change-Id: Ic733db229d5aa5d477d758ea9cb88cd81d7542cd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6188 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/jim-nvp: remove unused function Jim_nvpInit()Antonio Borneo1-6/+0
The files jim-nvp.[ch] were originally inside jimtcl, then in 2011 they were dropped by jimtcl and integrated in OpenOCD. The initial purpose was to make them as an independent library, thus the presence of an 'init' function. Being now part of OpenOCD do not require the 'init' function anymore, that is still empty and unused, plus its name is in violation of the coding style. Drop the function Jim_nvpInit(). Change-Id: I429e10444c86a26dbdc22aa071315324dc5edc3e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6187 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/types: remove type '_Bool'Antonio Borneo1-7/+1
Accordingly to OpenOCD coding style, both typedef and Camelcase symbols are forbidden. The type '_Bool' is not used in the code, having 'bool' as preferred choice. Remove the definition of '_Bool' from 'types.h'. Change-Id: I8863f9836ccd9166e0c69fa5d75d6fef79ae7bfb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6186 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/replacements: remove unused typedef'sAntonio Borneo1-2/+0
The ELF typedef's 'Elf32_Sword' and 'Elf32_Hashelt' are not used within OpenOCD. Plus, being their name in CamelCase require extra effort to include them in the exceptions for checkpatch. Remove the unused typedef's. Change-Id: I18f039567edd5b24dbb41df5406c154f31022ae7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6178 Tested-by: jenkins Reviewed-by: Christian Hoff <christian.hoff@advantest.com>
2021-05-01target/image: report error if ELF file contains no loadable sectionsChristian Hoff1-2/+8
The existing code asserted in that case, which is not correct. This would allow the user to crash OpenOCD with a bad ELF file, which is not what we want. A proper error should be reported in that case and OpenOCD should not crash. Change-Id: Ied5a6a6fd4ee0fd163f3fe850d304a121ecbe33a Signed-off-by: Christian Hoff <christian.hoff@advantest.com> Reviewed-on: http://openocd.zylin.com/6172 Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-05-01target/image: allow loading of 64-bit ELF filesFlorian Meister4-59/+349
Change-Id: I9b88edacf5ffcc3c1caeab8c426693de0d92a695 Signed-off-by: Florian Meister <florian.meister@advantest.com> Signed-off-by: Christian Hoff <christian.hoff@advantest.com> Reviewed-on: http://openocd.zylin.com/5204 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Ooi, Cinly <cinly.ooi@intel.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01libusb: don't use typedef'sAntonio Borneo12-40/+40
Libusb defines both the struct and a typedef to the struct using the same struct name. It's then possible to use either 'struct x' and 'x'. E.g.: typedef struct libusb_device libusb_device; OpenOCD is not consistent and uses a mix of 'struct x' and 'x'. To make OpenOCD code uniform, stick at project's coding style and use 'struct x' in place of the typedef'd name. Change-Id: I901458b680e42830d3f371e47997157f91b7f675 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6165 Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li> Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01helper/command: fix build with jimtcl 0.79 or olderAntonio Borneo1-0/+4
Commit a7d68878e4ba ("helper/command: unregister commands through their full-name") introduces for the first time in OpenOCD the use of jimtcl API Jim_DeleteCommand(). The prototype of Jim_DeleteCommand() has changed with jimtcl 0.80 and the current code doesn't build with jimtcl 0.79 or older. This is an issue for those distributions, like Debian, that provide jimtcl as a separate package/library and have not switched yet to the new jimtcl version. Add a compile-time condition to cope with the jimtcl API change. Change-Id: Ic813ab7c0ebd3c8772f27775ba3912a47d5c275c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: a7d68878e4ba ("helper/command: unregister commands through their full-name") Reviewed-on: http://openocd.zylin.com/6191 Tested-by: jenkins
2021-04-30cortex_m: mark FPU register as non-existent instead of playing with num_regsTarek BOCHKATI2-15/+11
Change-Id: Iac7c5bfbb95c8d9a8c6d65104d138692a44eca78 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6015 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-04-30doc/openocd.texi: fix warningTarek BOCHKATI1-1/+1
fix the warning below by adding a '.' after xref in line 10184: ./doc/openocd.texi:10184: warning: `.' or `,' must follow @xref, not c Change-Id: Ibd976ae61cf6845e925b839321444dcb25a3c04a Reported-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6179 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-04-30doc/openocd.texi: fix warningTarek BOCHKATI1-1/+1
fix the warning below by adding a '.' after xref in line 4517: ../code/doc/openocd.texi:4517: warning: `.' or `,' must follow @xref, not ) Change-Id: I6e529c7e83c9f912e1dd899abf5f630c90b583d9 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6174 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-04-30target/armv7m: change FPv4_SP and FPv5_SP/DP identifiers to uppercaseTomas Vanek4-8/+8
Change-Id: Ia421a973e5fb4767715c9f95c91745f8ca1de1da Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/6177 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-04-25target/arm_adi_v5: move DP register definitions to one blockTomas Vanek1-8/+9
DP and MEM-AP definitions were mixed. Change-Id: I2f691b2274c01e9090c1e5160c6903d3207e35c2 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/6138 Tested-by: jenkins
2021-04-25target/adi_v5_swd: remove double space from swd_cmd() parametersTomas Vanek1-4/+4
Change-Id: I6b68868947010512c4de76e5d37142f067e27b06 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/6137 Tested-by: jenkins
2021-04-25drivers/cmsis-dap: add multidrop capabilityPeter Lawrence1-2/+65
Uses CMSIS-DAP v 1.2 or higher protocol command DAP_SWD_Sequence to write to DP TARGETSEL register. This write is not acknowledged by device so we cannot use standard DAP_Transfer Change-Id: Ib252d09570bcc2282be5f854e0ab9a0dfda06189 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/6117 Tested-by: jenkins Reviewed-by: Peter Lawrence <majbthrd@gmail.com>
2021-04-25target/arm_adi_v5: add JTAG_TO_DORMANT sequenceTomas Vanek1-0/+1
Change-Id: Ie9e32e42a84cf88bf779e691a67c114eef1bb457 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/6136 Tested-by: jenkins
2021-04-25tcl/at91/sam9_smc: fix syntax errorsAntonio Borneo1-16/+16
This file has been added to OpenOCD 0.5.0 in 2011, before gerrit gets in use, with commit ba71e8c521a7 ("at91: add chip register definition and generic init support"). The only procedure in the file has never been referenced in any other part of OpenOCD. This procedure has syntax errors while uses its argument 'cs' and several unmatched parenthesis, which clearly highlights that it has never been used so far. Gerrit does not report any patch aimed at fixing it. Even if the file seems unused and could be removed, let's fix it in the hope it could get used. While there, remove some useless parenthesis and format it using the new simplified syntax required by jimtcl 0.81. Change-Id: Ied26456262e7b99de37667a8ce418f4f12e237bd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: ba71e8c521a7 ("at91: add chip register definition and generic init support") Reviewed-on: http://openocd.zylin.com/6157 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2021-04-25board: imx53: fix l2 cache initializationAntonio Borneo3-3/+3
Both http://openocd.zylin.com/542/ and http://openocd.zylin.com/543/ introduce the same typo in the bitfield for initializing the l2 cache of imx53. One year later, http://openocd.zylin.com/1461/ copy-pastes the same typo. The comment above the code show that it's really an error and not the expected behaviour. Fix the typo replacing the incorrect comparison '<' with a left shift. Change-Id: I43725731a2228e28a676215f76936fa289d9395e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: e3b327343394 ("cfg: add imx53loco board config") Fixes: 108a458ab888 ("cfg: add icnova_imx53_sodimm board config") Fixes: e608ced33001 ("ftdi/board: Add support for DENX M53EVK") Reviewed-on: http://openocd.zylin.com/6156 Tested-by: jenkins Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2021-04-25doc: command 'ftdi_layout_signal' can run after configAntonio Borneo1-1/+1
The mode of command 'ftdi_layout_signal' is set to COMMAND_ANY in [1] and the command has no constraints that limits its use to the config phase only. But [2] documents it as '{Config Command}'. Update the documentation to report the correct mode '{Command}'. [1] commit f5e97b5e1b62 ("Add FTDI JTAG driver using MPSSE layer") [2] commit 76afadeb7b4e ("doc: Add documentation for the ftdi driver") Change-Id: I6b14aebb98e48f7080c585f3df881714bb188af0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6155 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2021-04-25doc: do not document commands that are already deprecatedAntonio Borneo1-13/+0
The command 'ftdi_location' is deprecated and a TCL procedure is in place to direct the user to the replacement command. There is no need to document the deprecated command. Remove 'ftdi_location' from the documentation. Change-Id: Ia431c6b0e7444d3f3288c088429bfb47089ff1b5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6154 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2021-04-25doc: annotate configuration commandsAntonio Borneo1-21/+20
Some command that is only valid during configuration is documented as generic command. Annotate them as {Config Command} in the documentation. Change-Id: Ifdbb6ec89b945e3d7adce94af379d94f511a64b6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6153 Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2021-04-25smp: move command deprecation to startup.tclAntonio Borneo2-34/+31
Commit 246782229f8f ("smp: replace commands smp_on/smp_off with "smp [on|off]"") deprecates some multi-word comments, when openocd was unable to properly handle mixes of multi-word commands and tcl procedures having a common initial word. This limitation is over, so move in startup.tcl the multi-word commands deprecation, making it easy to remove them after a grace period. Change-Id: Icb550d1fa7559b95692d2a1244880da6c90ec0b2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5677 Tested-by: jenkins
2021-04-24remote_bitbang: Add Windows supportYun Liu1-36/+19
Windows socket descriptor is not file descriptor, so when using remote_bitbang on Windows, it fails with "fdopen: failed to open write stream". This patch removes the file write stream, replaces it with socket write calls. Change-Id: Ifd7c8a4139a5ac51ecd2846835a7a947a90fe16c Signed-off-by: Yun Liu <liuyun.97@gmail.com> Reviewed-on: http://openocd.zylin.com/6096 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-04-24target/imx8qm: Initial supportLeonard Crestez1-0/+89
Chip is similar to imx8x series but has different cores at different addresses. Support for reduced versions is not yet available. Tested on imx8qm-mek board Change-Id: Ia34a80d561ab2849a570d8c375b936a45cbf45ca Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com> Reviewed-on: http://openocd.zylin.com/5042 Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>