aboutsummaryrefslogtreecommitdiff
path: root/tcl/interface
AgeCommit message (Collapse)AuthorFilesLines
2023-07-19tcl/interface: add Espressif builtin usb_jtag config file.Erhan Kurubas1-0/+9
This config file enables communication over USB-JTAG with ESP32-C3, ESP32-S3, ESP32-H2 and ESP32-C6 chips Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: Iceea26972588d8c4919d1f3248684ece48ca9121 Reviewed-on: https://review.openocd.org/c/openocd/+/7748 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-05-04Merge commit '228fe7300c7df7aa05ba2c0bc19edde6d0156401' into from_upstreamTim Newsome2-19/+2
Conflicts: doc/openocd.texi src/jtag/aice/aice_pipe.c src/jtag/aice/aice_usb.c src/rtos/FreeRTOS.c src/rtos/hwthread.c src/rtos/rtos_standard_stackings.c src/target/riscv/riscv.c Change-Id: I0c6228c499d60274325be895fbcd8007ed1699bc
2023-03-16Merge commit '1293ddd65713d6551775b67169387622ada477c1' into from_upstreamTim Newsome127-59/+374
This includes https://sourceforge.net/p/openocd/mailman/message/37710818/, which should fix #814. Conflicts: .travis.yml contrib/loaders/flash/stm32/stm32f1x.S contrib/loaders/flash/stm32/stm32f2x.S doc/openocd.texi src/rtos/FreeRTOS.c src/server/gdb_server.c src/target/riscv/riscv-013.c src/target/riscv/riscv.c src/target/riscv/riscv.h src/target/riscv/riscv_semihosting.c tcl/target/esp_common.cfg tcl/target/gd32vf103.cfg tools/scripts/checkpatch.pl Change-Id: I1986c13298ca0dafbe3aecaf1b0b35626525e4eb
2023-02-28Merge commit 'd1b882f2c014258be5397067e45848fa5465b78b' into from_upstreamTim Newsome4-0/+105
Conflicts: doc/openocd.texi src/target/riscv/riscv-013.c src/target/riscv/riscv.c Change-Id: I8cd557a10c3d5beeaed05ecc05d4c325a9ee7e70
2023-01-15nds32: drop it, together with aice adapter driverAntonio Borneo1-17/+0
The target nds32 and its companion adapter aice have not received any real improvement since 2013. It has been hard to keep them aligned during the evolution of OpenOCD code, with no way for maintainers to really check if they are still working. No real documentation is present for them in OpenOCD. The nds32 code triggers ~50 errors/warnings with scan-build. The arch nds32 has been dropped from Linux kernel v5.18-rc1. For all the reasons above, this code has been deprecated with commit 2e5df83de7f2 ("nds32: deprecate it, together with aice adapter driver") and tagged to be dropped before v0.13.0. Let it r.i.p. in OpenOCD git history. While there, drop from checkpatch list the camelcase symbols that where only used in this code. Change-Id: Ide52a217f2228e9da2f1cc5036c48f3536f26952 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7382 Tested-by: jenkins
2022-11-15tcl/interface: fix raspberrypi2-native.cfg speed coefficientTomas Vanek1-2/+2
The speed coefficient for Raspberry Pi 2 was probably calibrated for a scaled down clock frequency. To prevent JTAG/SWD overclocking, use the value corresponding to the 'official' maximum CPU clock. Change-Id: Iaff58b092198dce6d6552c9d31d6a3ba4aaaa2d5 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/7305 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
2022-10-05Fix Digilent JTAG-HS2 cJTAG configuration scriptmrv961-5/+3
Signed-off-by: mrv96 <mrv96@users.noreply.github.com>
2022-09-19Add Digilent JTAG-HS2 cJTAG configurationmrv961-0/+19
Signed-off-by: mrv96 <mrv96@users.noreply.github.com>
2022-09-13drivers/bcm2835gpio: Migrate to adapter gpio commandsSteve Marple3-15/+27
Use the new "adapter gpio" commands to configure the GPIOs used by the bcm2835gpio driver. The driver supports only 1 chip (gpiochip0). The reset function now honours the srst_open_drain and trst_open_drain options. Signed-off-by: Steve Marple <stevemarple@googlemail.com> Change-Id: I5b6c68b16362000cf5141a83394549d2bf3af108 Reviewed-on: https://review.openocd.org/c/openocd/+/7123 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13tcl/interface: replace last deprecated commandsAntonio Borneo4-16/+16
Still some config file uses deprecated commands. Replace them with the new commands. Change-Id: I6ccbfb832e0ad2012e9af160bd2d92ad104af2bb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7181 Tested-by: jenkins
2022-08-20Generic Xtensa target config filesIan Thompson1-0/+11
- Add new Xtensa TCL board files - Add new Xtensa KC705 on-board FTDI interface - Add new generic Xtensa and VDebug Xtensa target files Signed-off-by: Ian Thompson <ianst@cadence.com> Change-Id: I4acb15c83d1b7b8e6063833ce829530cb22a795e Reviewed-on: https://review.openocd.org/c/openocd/+/7083 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-08-20tcl/interface: add linuxgpiod cfg for Aspeed AST2600Jae Hyun Yoo1-0/+25
Add linuxgpiod cfg for Aspeed AST2600 for a case if JTAG master needs to be implemented using linuxgpiod intead of hardware JTAG master mode. These AST2600 GPIOs will be mapped to JTAG/SWD signals. +-----------+-------------+-------------+ | signal | GPIO name | gpio offset | +-----------+-------------+-------------+ | TCK/SWCLK | GPIOI2 | 66 | | TMS/SWDIO | GPIOI3 | 67 | | TDI | GPIOI1 | 65 | | TDO | GPIOI4 | 68 | | nTRST | GPIOI0 | 64 | +-----------+-------------+-------------+ Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com> Change-Id: I19278402b0895be12d38c0ecea8fdbc56fd491b8 Reviewed-on: https://review.openocd.org/c/openocd/+/7112 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2022-08-15drivers/linuxgpiod: Migrate to adapter gpio commandsSteve Marple1-6/+9
Use the new "adapter gpio" commands to configure the GPIOs used by the linuxgpiod driver. Adds support for drive mode and resistor pull options on all signals. Change-Id: Ic90cb4f06db82435294228b6793330107a9f3606 Signed-off-by: Steve Marple <stevemarple@googlemail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7048 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-08-15drivers/am335xgpio: Migrate to adapter gpio commandsSteve Marple2-14/+26
Use the new "adapter gpio" commands to configure the GPIOs used by the am335xgpio driver. The AM335x has 4 GPIO 'chips' (chip number 0-3 inclusive), with each one providing 32 GPIOs (gpio_num 0-31 inclusive). Change-Id: I7c63c0e4763657ea51790c43fc40d32b7c3580bb Signed-off-by: Steve Marple <stevemarple@googlemail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6984 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-07-02jtag: add esp_usb_jtag driverErhan Kurubas1-0/+9
This driver is used with the ESP32 chips which has builtin USB-JTAG interface. e.g. with ESP32-C3, ESP32-S3 Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: If966268cb8d26f76540dd5440245a17ed0b72c61 Reviewed-on: https://review.openocd.org/c/openocd/+/6943 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2022-06-24tcl/interface: add SPDX tagAntonio Borneo115-0/+230
For historical reasons, no license information was added to the tcl files. This makes trivial adding the SPDX tag through script: fgrep -rL SPDX tcl/interface | while read a;do \ sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n }' $a;done With no specific license information from the author, let's extend the OpenOCD project license GPL-2.0-or-later to the files. Change-Id: I7bd6a628e9e153fc477cddf9b97087a39ec48aa7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7029 Tested-by: jenkins
2022-06-24tcl: move SPDX tag as first lineAntonio Borneo1-2/+2
The SPDX tag is aimed at machine handling and it's thus expected to be placed in the first line. Change-Id: I3992856eeb28b333c38d010ef286e22471ede263 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7026 Tested-by: jenkins
2022-06-24tcl: replace FSF boilerplate with SPDX tagAntonio Borneo1-14/+2
OpenOCD project is switching to SPDX tags. Replace the few FSF boilerplate in tcl folder. Change-Id: I15b146eb77cc491ed7355178f684f3e76fc763b4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7025 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2022-06-24tcl/interface/vdebug: add newline to file's last lineAntonio Borneo1-1/+1
Change-Id: I83d2477e8bc837aeac69bd5d08fdd923fd00a37c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7023 Tested-by: jenkins
2022-06-24target: add Espressif ESP32 basic supportErhan Kurubas1-0/+25
ESP32 is a dual core Xtensa SoC Not full featured yet. Some of the missing functionality: -Semihosting -Flash breakpoints -Flash loader -Apptrace -FreeRTOS Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I76fb184aa38ab9f4e30290c038b5ff8850060750 Reviewed-on: https://review.openocd.org/c/openocd/+/6989 Tested-by: jenkins Reviewed-by: Ian Thompson <ianst@cadence.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-06-04target: add Espressif ESP32-S2 basic supportErhan Kurubas1-0/+29
ESP32-S2 is a single core Xtensa chip. Not full featured yet. Some of the missing functionality: -Semihosting -Flash breakpoints -Flash loader -Apptrace -FreeRTOS Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I2fb32978e801af5aa21616c581691406ad7cd6bb Reviewed-on: https://review.openocd.org/c/openocd/+/6940 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Ian Thompson <ianst@cadence.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2022-05-14tcl/interface/ftdi: Add config for Tigard boardThomas Hebb1-0/+19
Tigard[1] is an FT2232H-based development tool designed for ease of use with many different protocols and targets. It includes a JTAG header wired to channel B, with labeled pins for the four required signals as well as nTRST and nSRST, which are connected through an output buffer to BDBUS4 and BDBUS5 respectively. Add an interface config for Tigard. I wrote it by referencing the Tigard schematic and tested it by debugging a couple of RISC-V development boards. [1] https://github.com/tigard-tools/tigard Signed-off-by: Thomas Hebb <tommyhebb@gmail.com> Change-Id: I34df9f72538ba1e40ad53b568c9cdca96ae4b082 Reviewed-on: https://review.openocd.org/c/openocd/+/6952 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-05-14drivers/am335xgpio: Add AM335x driver for bitbang support on BeagleBonesSteve Marple2-0/+57
Change-Id: Iac1c9f3d380e2474c8b77407c89c2aad96fbf2ea Signed-off-by: Steve Marple <stevemarple@googlemail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6941 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-03-03From upstream (#684)Tim Newsome1-0/+33
* flash/nor/atsame5: add LAN9255 devices Support Microchip LAN9255 devices with embedded SAME53J MCU. Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Change-Id: Ia811c593bf7cf73e588d32873c68eb67c6fafad7 Reviewed-on: https://review.openocd.org/c/openocd/+/6811 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> * tcl/board: Add EVB-LAN9255 config Config for EVB-LAN9255, tested using Atmel-ICE debugger on J10 connector. Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Change-Id: I8bcf779e9363499a98aa0b7d10819c53da6a19e7 Reviewed-on: https://review.openocd.org/c/openocd/+/6812 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * aarch64: support for aarch32 ARM_MODE_UND Fix: unrecognized psr mode: 0x1b cannot read system control register in this mode: (UNRECOGNIZED : 0x1b) Change-Id: I4dc3e72f90d57e52c0fe63cb59a7529a398757b3 Signed-off-by: Julien Massot <julien.massot@iot.bzh> Change-Id: Ifa5d21ae97492fde9e8c79ee7d99d8a2a871b1b5 Reviewed-on: https://review.openocd.org/c/openocd/+/6808 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Combine register lists of smp targets. This is helpful when you want to pretend to gdb that your heterogeneous multicore system is homogeneous, because gdb cannot handle heterogeneous systems. This won't always works, but works fine if e.g. one of the cores has an FPU while the other does not. (Specifically, HiFive Unleashed has 1 core with no FPU, plus 4 cores with an FPU.) Signed-off-by: Tim Newsome <tim@sifive.com> Change-Id: I05ff4c28646778fbc00327bc510be064bfe6c9f0 Reviewed-on: https://review.openocd.org/c/openocd/+/6362 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * semihosting: use open mode flags from GDB, not from sys/stat.h Values defined in sys/stat.h are not guaranteed to match the constants defined by the GDB remote protocol, which are defined in https://sourceware.org/gdb/onlinedocs/gdb/Open-Flags.html#Open-Flags. On my local system (Manjaro 21.2.1 x86_64), for example, O_TRUNC is defined as 0x40, whereas GDB requires it to be 0x400, causing all "w" file open modes to misbehave. This patch has been tested with STM32F446. Change-Id: Ifb2c740fd689e71d6f1a4bde1edaecd76fdca910 Signed-off-by: Pavel Kirienko <pavel.kirienko@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6804 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * semihosting: User defined operation, Tcl command exec on host Enabling a portion (0x100 - 0x107) of the user defined semihosting operation number range (0x100 - 0x1FF) to be processed with the help of the existing target event mechanism, to implement a general-purpose Tcl interface for the target available on the host, via semihosting interface. Example usage: - The user configures a Tcl command as a callback for one of the newly defined events (semihosting-user-cmd-0x10X) in the configuration file. - The target can make a semihosting call with <opnum>, passing optional parameters for the call. If there is no callback registered to the user defined operation number, nothing happens. Example usage: Configure RTT automatically with the exact, linked control block location from target. Signed-off-by: Zoltán Dudás <zedudi@gmail.com> Change-Id: I10e1784b1fecd4e630d78df81cb44bf1aa2fc247 Reviewed-on: https://review.openocd.org/c/openocd/+/6748 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/smp: use a struct list_head to hold the smp targets Instead of reinventing a simply linked list, reuse the list helper for the list of targets in a smp cluster. Using the existing helper, that implements a double linked list, makes trivial going through the list in reverse order. Change-Id: Ib36ad2955f15cd2a601b0b9e36ca6d948b12d00f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6783 Tested-by: jenkins * helper/list: add list_for_each_entry_direction() Use a bool flag to specify if the list should be forward or backward iterated. Change-Id: Ied19d049f46cdcb7f50137d459cc7c02014526bc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6784 Tested-by: jenkins * target/riscv: revive 'riscv resume_order' This functionality was lost in [1], which was merged as commit 615709d14049 ("Upstream a whole host of RISC-V changes."). Now it works as expected again. Add convenience macro foreach_smp_target_direction(). Link: [1] https://github.com/riscv/riscv-openocd/pull/567 Change-Id: I1545fa6b45b8a07e27c8ff9dcdcfa2fc4f950cd1 Signed-off-by: Tim Newsome <tim@sifive.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6785 Tested-by: jenkins * doxygen: fix some function prototype description Change-Id: I49311a643ea73143839d2f6bde976cfd76f8c67f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6830 Tested-by: jenkins * Cadence virtual debug interface (vdebug) integration Change-Id: I1bc105b3addc3f34161c2356c482ff3011e3f2cc Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6097 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * gdb_server: Include thread name as XML attribute Explicitly providing a thread name in the "thread" element produces better thread visualizations in downstream tools like IDEs. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I102c14ddb8b87757fa474de8e3a3f6a1cfe10d98 Reviewed-on: https://review.openocd.org/c/openocd/+/6828 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Fix small memory leak. See https://github.com/riscv/riscv-openocd/pull/672 Change-Id: Ia11ab9bcf860f770ea64ad867102c74b898f6b66 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6831 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * server: remove remaining crust from dropped eCos code Commit 39650e2273bc ("ecosboard: delete bit-rotted eCos code") has removed eCos code but has left some empty function that was used during non-eCos build to replace eCos mutex. Drop the functions and the file that contain them. Change-Id: I31bc0237ea699c11bd70921660f960ee406ffa80 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6835 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> * rtos: threadx: Add hla_target support for ThreadX Tested with an AZ3166 dev board (which uses the STM32F412ZGT6) running the Azure RTOS ThreadX demonstration system. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I44c8f7701d9f1aaa872274166321cd7d34fb1855 Reviewed-on: https://review.openocd.org/c/openocd/+/6829 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * .gitmodules: switch away from repo.or.cz The host repo.or.cz is often offline, creating issues for cloning and building OpenOCD from scratch. Already 'jimtcl' developer has dropped repo.or.cz, triggering the OpenOCD commit 861e75f54efb ("jimtcl: switch to github"). Change also the link of the remaining submodules 'git2cl' and 'libjaylink' to their respective main repository. Change-Id: Ib513237427635359ce36a480a8f2060e2fb12ba4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6834 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> * flash/nor/stm32f2x: Fix erase of bank 2 sectors This commit corrects the erase function for stm32f2x when dealing with sectors in bank 2, for STM32F42x/43x devices with 1MB flash. On STM32F42x/43x with 1MB flash in dual bank configuration, the sector numbering is not consecutive. The last sector in bank 1 is number 7, and the first sector in bank 2 is number 12. The sector indices used by openocd, however, _are_ consecutive (0 to 15 in this case). The arguments "first" and "last" to stm32x_erase() are of this type, and so the logic surrounding sector numbers needed to be corrected. Since the two banks in dual bank mode have the same number of sectors, a sector index in bank 2 is larger than or equal to half the total number of sectors. Change-Id: I15260f8a86d9002769a1ae1c40ebdf62142dae18 Signed-off-by: Simon Johansson <ampleyfly@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6810 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * target/cortex_m: fix target_to_cm() helper The third parameter of container_of() should point to the same member as target->arch_info points to, struct arm. It worked just because struct arm is the first member in struct armv7m_common. If you move arm member from the first place, OpenOCD fails heavily. Change-Id: I0c0a5221490945563e17a0a34d99a603f1d6c2ff Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6749 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/armv7m,cortex_m: introduce checked arch_info cast routines target_to_armv7m() and target_to_cm() do not match the magic number so they are not suitable for use outside of target driver code. Add checked versions of pointer getters. Match the magic number to ensure the returned value points to struct of the correct type. Change-Id: If90ef7e969ef04f0f2103e0da29dcbe8e1ac1c0d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6750 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target/cortex_m: add Cortex-M part number getter The getter checks the magic numbers in arch_info to detect eventual type mismatch. Change-Id: I61134b05310a97ae9831517d0516c7b4240d35a5 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6751 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * flash/nor/stm32xx: fix segfault accessing Cortex-M part number Some of STM32 flash drivers read Cortex-M part number from cortex_m->core_info. In corner cases the core_info pointer was observed uninitialised even if target_was_examined() returned true. See also [1] Use the new and safe helper to get Cortex-M part number. While on it switch also target_to_cm()/target_to_armv7m() to the safe versions. This prevents a crash when the flash bank is misconfigured with non-Cortex-M target. Add missing checks for target_was_examined() to flash probes. [1] 6545: fix crash in case cortex_m->core_info is not set https://review.openocd.org/c/openocd/+/6545 Change-Id: If2471af74ebfe22f14442f48ae109b2e1bb5fa3b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Fixes: f5898bd93ff8 (flash/stm32fxx.c: do not read CPUID as this info is stored in cortex_m_common) Reviewed-on: https://review.openocd.org/c/openocd/+/6752 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> * cpld: altera-epm240: Add additional IDCODEs This adds some additional IDCODEs from the datasheet. It also adds support for customizing the tap name. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I7cda10b92c229b61836c12cd9ca410de358ede2e Reviewed-on: https://review.openocd.org/c/openocd/+/6846 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * cpld: altera-epm240: Increase adapter speed According to the datasheet, the minimum clock period with Vccio1 = 1.5V (the lowest voltage supported) is 143ns, or around 6MHz. Set the default adapter speed to 5 MHz. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I21cad33fa7f1e25e81f43b5d2214d1fa4ec924de Reviewed-on: https://review.openocd.org/c/openocd/+/6847 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target: Add support for ls1088a The LS1088A is an octo-core aarch64 processor from NXP in the layerscape family. The JTAG is undocumented, but I was able to figure things out from the output of `dap info`. This is the first in-tree example of using the hwthread rtos (as far as I know), so hopefully it can serve as an example to other developers. There are some ETMs, but I was unable to try them out because I got 'invalid command name "etm"' when trying to test things out. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I9b0791d27d8c41170a413a8d86431107a85feba2 Reviewed-on: https://review.openocd.org/c/openocd/+/6848 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * target: ls1088a: Add service processor Normally the service processor is not necessary for debugging. However, if you are using the hard-coded RCW or your boot source is otherwise corrupt, then the general purpose processors will never be released from hold-off. This will cause GDB to become confused if it tries to attach, since they will appear to be running arm32 processors. To deal with this, we can release the CPUs manually with the BRRL register. This register cannot be written to from the axi target, so we need to do it from the service processor target. This involves halting the service processor, modifying the register, and then resuming it again. We try and determine what state the service processor was in to avoid resuming it if it was already halted. The reset vector for the general purpose processors is determined by the boot logation pointer registers in the device configuration unit. Normally these are set using pre-boot initialization commands, but if they are not set then they default to 0. This will cause the CPU to almost immediately hit an illegal instruction. This is fine because we will almost certainly want to attach to the processor and load a program anyway. I considered adding this as an event handler for either gdb-attach or reset-init. However, this command shouldn't be necessary most of the time, and so I don't think we should run it automatically. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: I1b725292d8a11274d03af5313dc83678e10e944c Reviewed-on: https://review.openocd.org/c/openocd/+/6850 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * board: Add NXP LS1088ARDB This adds a board file for the NXP LS1088ARDB. This only covers the "primary" JTAG header J55, and not the PCIe header (J91). The only oddity is that the LS1088A and CPLD are muxed by adding/removing a jumper from J48. Unfortunately, it doesn't look like OpenOCD supports this CPLD beyond determining the irlen, so it's not very useful. Those who are interested in experimenting can define CWTAP to access the CPLD, but the default is to access the CPU. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Change-Id: Ia07436a534f86bd907aa5fe2a78a326a27855a24 Reviewed-on: https://review.openocd.org/c/openocd/+/6849 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * gdb_server: fix double free Commit 6541233aa78d ("Combine register lists of smp targets.") unconditionally assigns the output pointers of the function smp_reg_list_noread(), even if the function fails and returns error. This causes a double free from the caller, that has assigned NULL to the pointers to simplify the error handling. Use local variables in smp_reg_list_noread() and assign the output pointers only on success. Change-Id: Ic0fd2f26520566cf322f0190780e15637c01cfae Fixes: 6541233aa78d ("Combine register lists of smp targets.") Reported-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6852 Tested-by: jenkins Reviewed-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Reviewed-by: Tim Newsome <tim@sifive.com> * gdb_server: check target examined while combining reg list Commit 6541233aa78d ("Combine register lists of smp targets.") assumes that all the targets in the SMP cluster are already examined and unconditionally call target_get_gdb_reg_list_noread() that will in turn return error if the target is not examined yet. Skip targets not examined yet. Add an additional check in case the register list cannot be built, e.g. because no target in the SMP cluster is examined. This should never happen, but it's better to play safe. Change-Id: I8609815c3d5144790fb05a870cb0c931540aef8a Fixes: 6541233aa78d ("Combine register lists of smp targets.") Reported-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6853 Tested-by: jenkins Reviewed-by: Michele Bisogno <michele.bisogno.ct@renesas.com> Reviewed-by: Tim Newsome <tim@sifive.com> * flash/stm32l4x: fix maybe-uninitialized compiler error using gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 we get: error: ‘retval’ may be used uninitialized in this function fixes: 13cd75b6ecfd (flash/nor/stm32xx: fix segfault accessing Cortex-M part number) Change-Id: I897c40c5d2233f50a5385d251ebfa536023e5cf7 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6861 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> * Fix build. Change-Id: Ia60246246dd859d75659a43d1c59588dbb274d46 Signed-off-by: Tim Newsome <tim@sifive.com> Co-authored-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com> Co-authored-by: Julien Massot <julien.massot@iot.bzh> Co-authored-by: Pavel Kirienko <pavel.kirienko@gmail.com> Co-authored-by: Zoltán Dudás <zedudi@gmail.com> Co-authored-by: Antonio Borneo <borneo.antonio@gmail.com> Co-authored-by: Jacek Wuwer <jacekmw8@gmail.com> Co-authored-by: Ben McMorran <bemcmorr@microsoft.com> Co-authored-by: Simon Johansson <ampleyfly@gmail.com> Co-authored-by: Tomas Vanek <vanekt@fbl.cz> Co-authored-by: Sean Anderson <sean.anderson@seco.com> Co-authored-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2022-02-14Cadence virtual debug interface (vdebug) integrationJacek Wuwer1-0/+33
Change-Id: I1bc105b3addc3f34161c2356c482ff3011e3f2cc Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6097 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-12-14Handle changed `ftdi` syntax. (#670)Tim Newsome5-39/+39
Also rename ftdi_oscan1_mode command which only exists in our branch. Change-Id: Ie9b28f228b1fd984244edb8162d552104d28e462 Signed-off-by: Tim Newsome <tim@sifive.com>
2021-11-30Merge branch 'master' into from_upstreamTim Newsome9-9/+9
Merged 1ad6ed38b6da09b1d5d9e56d1344fced2dce12bc Conflicts: src/rtos/rtos_standard_stackings.c Change-Id: Ica8109135de0f9aa87455353a4538b161b844b04
2021-11-28jtag/hla, jtag/stlink: switch to command 'adapter serial'Antonio Borneo3-3/+3
The driver hla defines the command 'hla_serial' to specify the serial string of the adapter. The driver st-link defines the command 'st-link serial' to specify the serial string of the adapter. Remove and deprecate the driver commands and use 'adapter serial'. Change-Id: I9505c398a77125b1ebf4ba71da7baf4d663b75be Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6657 Tested-by: jenkins
2021-11-28jtag/jlink: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6656 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2021-11-28jtag/xds110: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6655 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-28jtag/kitprog: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6652 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2021-11-28jtag/ftdi: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6651 Tested-by: jenkins
2021-11-28jtag/cmsis_dap: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6649 Tested-by: jenkins
2021-11-28jtag/aice: switch to command 'adapter serial'Antonio Borneo1-1/+1
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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6648 Tested-by: jenkins
2021-10-05Merge branch 'master' into from_upstreamTim Newsome2-2/+2
Conflicts: src/jtag/drivers/remote_bitbang.c src/rtos/rtos_standard_stackings.c src/rtos/rtos_standard_stackings.h src/target/breakpoints.c src/target/riscv/riscv.c src/target/target.c Change-Id: Ia6fcba3d43be8ea31728f3bcc2be6cb7e3ccc5c5
2021-09-18stlink: Add PID for V3 device without MSDAndreas Sandberg2-2/+2
Add the 0x3754 PID used by some STLINK-V3 devices when MSD has been disabled. This PID has been observed on a Nucleo-G431RB board. Signed-off-by: Andreas Sandberg <andreas@sandberg.uk> Change-Id: Idb85874fa5a9dff5940bae7e95426a956693b976 Reviewed-on: https://review.openocd.org/c/openocd/+/6555 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-30Merge branch 'master' into from_upstreamTim Newsome101-495/+602
Conflicts: src/flash/nor/fespi.c src/jtag/drivers/ftdi.c src/rtos/FreeRTOS.c src/rtos/hwthread.c src/rtos/rtos.c src/rtos/rtos.h src/rtos/rtos_ecos_stackings.c src/rtos/rtos_embkernel_stackings.c src/rtos/rtos_standard_stackings.c src/rtos/rtos_standard_stackings.h src/rtos/rtos_ucos_iii_stackings.c src/server/gdb_server.c src/server/server.c src/target/riscv/riscv-013.c src/target/target.c src/target/target.h Change-Id: If0924a3e799260c33fae5feb85975b1273b45a0f
2021-08-25tcl: add lattice ECP5 family supportOleksij Rempel2-0/+30
Add support for ECP5 FPGA targets and board based on this chips: Radiona ULX3S and Lambdaconcept ECPIX-5 Change-Id: I932fc6e2458cda7d63ac21579acddea5b53410bc Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-on: https://review.openocd.org/c/openocd/+/6112 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2021-08-14tcl/interface: add Ashling Opella-LD FTDI config filesRanjith Chandran2-0/+39
Adding Ashling's FTDI based Debug adapter Opella-LD's JTAG and SWD config files Change-Id: Ie0e82e3b8326de37641901f5c825372cab31de58 Signed-off-by: ranjith.tc@ashling.com Reviewed-on: http://openocd.zylin.com/6379 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl: Adapt config files to new usb_blaster command syntaxMarc Schink3-9/+9
Change-Id: I4eb645f74ef31fc0b5882299b3487020aa142dd8 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6408 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface/buspirate: Adapt to new buspirate command syntaxMarc Schink1-5/+5
Change-Id: I1a82608532f043054abd22eb5b50ab5c5f58cee4 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6405 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface: Adapt config files to new sysfsgpio command syntaxMarc Schink1-4/+4
Change-Id: I8e8dee6e8869d2853a7a73c8d4dc8b4891fb0389 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6403 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface/dln-2-gpiod: Adapt to new linuxgpiod command syntaxMarc Schink1-6/+6
Change-Id: Ife1e52fe5da0e0374a606072f1faf7c598cf0e2b Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6401 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface/jtag_vpi: Adapt to new jtag_vpi command syntaxMarc Schink1-2/+2
Change-Id: I27eeab5e3dd554af00799104471ee8f30fbd0c51 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6399 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface: Adapt config files to new bcm2835gpio command syntaxMarc Schink2-14/+14
Change-Id: I2d649117aa8dbdf5484ace068785a1416efa3ecc Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6397 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface/jtag_dpi: Adapt to new jtag_dpi command syntaxMarc Schink1-2/+2
Change-Id: Icebf6f0a037f4ea9fb450581fcc599417bffc153 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6395 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface/openjtag: Adapt to new openjtag command syntaxMarc Schink1-1/+1
Change-Id: I3a9d649dd38a913b1ce6d4a2d506bbf44743d529 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6388 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-08-14tcl/interface: Adapt config files to new parport command syntaxMarc Schink4-7/+7
Change-Id: Iffe7a04c36c6ec680497081a99d55b8c69f8f079 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6386 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-07-31interface/jtag_hat: Add interface configuration for the JTAG HATMatthew Mets1-0/+38
This adds support for the Blinkinlabs JTAG Hat, a Raspberry Pi expansion board that provides JTAG and SWD connections via level- shifting buffers. Change-Id: I228bf6a18890b7c3d6679bbc63bfe39f726d8323 Signed-off-by: Matthew Mets <matt@blinkinlabs.com> Reviewed-on: http://openocd.zylin.com/6372 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2021-07-20tcl: Adapt config files to new ftdi command syntaxMarc Schink81-443/+443
The patch was created automatically using the following script: %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- (cat << EOF ftdi_device_desc ftdi device_desc ftdi_serial ftdi serial ftdi_channel ftdi channel ftdi_layout_init ftdi layout_init ftdi_layout_signal ftdi layout_signal ftdi_set_signal ftdi set_signal ftdi_get_signal ftdi get_signal ftdi_vid_pid ftdi vid_pid ftdi_tdo_sample_edge ftdi tdo_sample_edge EOF ) | while read a b; do sed -i "s/$a/$b/g" $(find tcl -type f -name "*.cfg" ) done %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- Change-Id: Iff781f37bb5511b7e15cbe6dcdf6d28e89fb174f Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6333 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>