Commit Graph

241 Commits

Author SHA1 Message Date
Antonio Borneo
1f5da25ed1 configure.ac: rename 'adapterTuple' as 'adapter_driver'
Commit ce3bf664c8 ("configure.ac: rename M4 macro 'adapter' to
prevent accidental conflicts") renames the macro as 'adapterTuple'
but since the macro name is printed in error messages, this
creates cryptic errors like:
	configure: error: header sys/mman.h is required
	for adapterTuple "Bitbanging on EP93xx-based SBCs".

Rename it as 'adapter_driver'. It keeps valid the purpose of the
former renaming, while keeping readable the error message.

Change-Id: Idd68270fbdf879153cd59f4cacf5036aa599b251
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: ce3bf664c8 ("configure.ac: rename M4 macro 'adapter' to prevent accidental conflicts")
Reviewed-on: https://review.openocd.org/c/openocd/+/9160
Tested-by: jenkins
2025-10-11 16:17:45 +00:00
Antonio Borneo
7c16c38eda configure.ac: add adapter dependency from sys/mman.h
The adapter's driver that require the header file sys/mman.h
should check for it and don't compile if it is not present.

Add the check for sys/mman.h in configure.ac and prevent the
build of the adapter's driver that depend on it.

Change-Id: If0a518069e8fef9b41a67b633ec20e2f142a8b14
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9159
Tested-by: jenkins
2025-10-11 16:17:22 +00:00
Marc Schink
39ed0b0bba adapter/parport: Deprecate direct I/O support
We deprecate direct I/O support in favor of ppdev for the following
reasons:

  - Linux supports ppdev since ~2.4 (released ~24 years ago) and it is
    enabled by default on major distros (Ubuntu, Fedora). So it is
    effectively ubiquitous
  - FreeBSD provides no direct I/O support, so ppdev (ppi) is the only
    viable option
  - Direct I/O requires root/elevated privileges which is inadvisable
  - Removing direct I/O reduces build and driver complexity and yields
    a smaller, easier-to-maintain codebase
  - Supporting only ppdev allows us to simplify the codebase by using
    device files (e.g., /dev/parport0) instead of numeric identifiers

Windows is the only rationale to keep direct I/O, but the user base
appears minimal to nonexistent and no active contributors can test the
Windows driver.

Change-Id: Ia6d5ed6e8c5faa2a9b4919ca97c5cf9033372a64
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9151
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-10-11 16:14:07 +00:00
EasyDevKits
5fa74d4ee8 jtag/ch347: Refine driver and configs for EasyDevKits adapters
This commit improves support for CH347-based JTAG adapters:

- configure.ac: removed "Mode3" restriction (CH347F does not require mode).
- configs: added board config for ESP32-WROVER-E WCH JTAG DevKit and
  ESP32-WROVER-E FTDI JTAG DevKit
- ch347 driver: removed `ch347 activity_led` command; activity LED
  is now controlled via the generic `adapter gpio led` command.
- doc/openocd.texi: updated documentation accordingly.

Change-Id: I5524290297adcc004e00af919181868d2b6303af
Signed-off-by: EasyDevKits <info@easydevkits.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9015
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-10-11 16:02:18 +00:00
Michael Heimpold
9e2a11c2f2 jtag: linuxgpiod: finalize emulation of libgpiod v2 API for older versions
This finalizes the work that has begun to emulate v2 API
for older libgpiod versions.

It also add the required autotools/pkg-config stuff to
detect the available libgpiod version.

Change-Id: I2c3a60ce607ed9601b01d22d5d9b8af953944941
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8226
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-09-27 14:56:26 +00:00
Michael Heimpold
82d0aac95b jtag: linuxgpiod: add macro HAVE_LIBGPIOD_V1
To prepare the support for libgpiod v2, add a macro to report the
old version v1 of the library.

Extracted part of 8226: jtag: linuxgpiod:
finalize emulation of libgpiod v2 API for older versions

Link: https://review.openocd.org/c/openocd/+/8226
Change-Id: Ib9c4e495b326770fabadbc752df8aa0a920b1831
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9118
Tested-by: jenkins
2025-09-27 14:54:59 +00:00
Brian Kuschak
fcff4b712c jtag/drivers/cmsis_dap: add new backend cmsis_dap_tcp
Create a new backend for cmsis_dap driver that allows CMSIS-DAP protocol
to run over TCP/IP instead of USB.

An example implementation of the firmware for an SWD programmer that
uses this cmsis_dap_tcp protocol can be found at the link below.
https://github.com/bkuschak/cmsis_dap_tcp_esp32

Using this cmsis_dap_tcp backend with the firmware above on an ESP32-C6
programmer and STM32F401RE target shows the following performance:
- loading 96KB image to RAM: 80 KB/sec
- dumping 96KB image from RAM: 72 KB/sec
- flashing 512KB image completes in about 13.5 seconds (including erase,
  program, and verify).

Change-Id: I6e3e45016bd16ef2259561b1046788f5536b0687
Signed-off-by: Brian Kuschak <bkuschak@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8973
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-09-01 07:46:39 +00:00
EasyDevKits
7d0e125896 jtag/drivers: Add support for CH347-based JTAG adapters
This adds general support for JTAG adapters based on the WCH CH347T and
CH347F chips.

The CH347T must be configured in mode 3 to provide both UART and JTAG
interfaces. The CH347F exposes UART and JTAG directly. Similar to FTDI
FT2232-based devices, the CH347T/F can be used for simultaneous UART and
JTAG communication.

The ch347 driver code is based on:
  https://github.com/WCHSoftGroup/ch347

Bug fixes and adjustments were made to align the code with OpenOCD style
and ensure compatibility. The driver was integrated into the OpenOCD
build system.

The USB packet format was identified using public GitHub sources and
documented here:
  https://www.easydevkits.com/wch-ch347-jtag-interface/

Change-Id: I5fca9dd015111e4410fea029611fdeedbb228fdb
Signed-off-by: EasyDevKits <info@easydevkits.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7937
Tested-by: jenkins
Reviewed-by: ZhiYuanNJ <871238103@qq.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-08-24 05:02:38 +00:00
R. Diez
6bc2c58596 configure.ac: Remove useless --enable-verbose-usb-io
_DEBUG_USB_IO_ was not actually used anywhere.
Its last user was the old ft2232 driver removed in Nov 2016
with commit cc2d4f015f
("Remove since long deprecated ft2232 driver").

Change-Id: I1a98db7c7b03a89cc9347c0a66ec2106d2168c3f
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/9002
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-08-02 13:11:08 +00:00
R. Diez
0d42f6a1b4 configure.ac: Turn parpoart-ppdev warning into an error.
Otherwise, it is easy to miss that configuration error.

Change-Id: I889d2c1cc0150f4d7f178daf4509f7943ebfd4de
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/9004
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-08-02 12:59:01 +00:00
R. Diez
bf8590ea65 configure.ac: show the parallel port adapter in the config summary
Use the same processing logic as most other enable/disable options.

Change-Id: I994963fdab32a09c191f2e29620c9540136f980c
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/9003
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-08-02 12:58:16 +00:00
R. Diez
7cbb3c3854 configure.ac: Replace $build_dmem with $enable_dmem
dmem uses now the standard option-handling logic,
which defines $enable_xxx instead of $build_xxx.

Change-Id: I810cf09241089b1dfbec0e2183e64f20050868be
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/9005
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-08-02 12:57:47 +00:00
Nicolas Derumigny
a192949095 jtag: drivers: xlnx-axi-xvc: Add support for Xilinx XVC over direct bus interface (AXI)
This change allow to use direct mapping of the JTAG interface using
Xilinx Virtual Cable (XVC) over AXI. This merges the existing XVC PCIe
code and the patch proposed by Jeremy Garff
(https://review.openocd.org/c/openocd/+/6594).

This is useful when using on a Zynq/ZynqMP/uBlaze host with direct
access to the debug bridge over AXI.  You can then use the debug bridge
Xilinx IP (AXIXVC) to debug a remote device.

Signed-off-by: Nicolas Derumigny <nicolas.derumigny@inria.fr>
Change-Id: I934591b489e30b400b87772b1437e6030440904c
Reviewed-on: https://review.openocd.org/c/openocd/+/8595
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-07-25 16:38:41 +00:00
Nicolas Derumigny
8cdf8cb995 driver: jtag: rename xlnx-pcie-xvc to xlnx-xvc
Rename xlnx-pcie-xvc.c to xlnx-xvc.c in provision for AXI support

Signed-off-by: Nicolas Derumigny <nicolas.derumigny@inria.fr>
Change-Id: I287fdcb8edf97f48c6f8614ac4c456f8ba197011
Reviewed-on: https://review.openocd.org/c/openocd/+/8980
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-07-25 16:38:28 +00:00
R. Diez
04d51723d0 configure.ac: show the dmem adapter in the config summary
Also enable this adapter by default (auto).

Change-Id: I61597c8572115f838ab0c92021163436eb7b0d59
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8971
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-29 07:43:11 +00:00
R. Diez
ce3bf664c8 configure.ac: rename M4 macro 'adapter' to prevent accidental conflicts
Also remove a comment about such a conflict which had been already noticed.

Change-Id: I6f301ccbd1261ea1c15c44a02d3f34f0cf5cb9f4
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8972
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-29 07:39:14 +00:00
R. Diez
9e4b6b90c9 configure.ac: show 5 ARM adapters in config summary
Adapters: bcm2835gpio, imx_gpio, am335xgpio, ep93xx and at91rm9200
Allow the user to enable them regardless of the target architecture.

Change-Id: I9fbc7cbefe770ea2e2239b95a3305fd29127fa85
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8892
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-21 07:35:54 +00:00
R. Diez
9a7c85b163 configure.ac: remove usage of obsolete Automake macro AM_PROG_CC_C_O
Macro AM_PROG_CC_C_O has been obsolete since Automake 1.14,
released in June 2013 (12 years ago).

It used to check whether the C compiler supports the -c and -o options,
but that is now included in AC_PROG_CC.

Increase the minimum required Automake version to 1.14 accordingly.

Also remove the "not a GNU package" comment,
which does not really make sense.

Change-Id: I987ba8686721c7f36fba81e100f1c3ddf77f636d
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8942
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-13 16:31:26 +00:00
Marc Schink
207ecaab33 adapter: Deprecate Gateworks GW16012 driver
The adapter is not available for years now. There is also no information
about this device from Gateworks. The poor hardware availability and the
lack of users prevents testing, maintenance and adaptations to future
changes.

Mark the adapter as deprecated as a first step to give potential users
the opportunity to upgrade the hardware until the next OpenOCD release.

Change-Id: I037325a6b018b26608733a36bef30db2785858f8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8651
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-06-13 16:26:53 +00:00
Marc Schink
88aec4b499 adapter: Deprecate Amontec JTAG Accelerator driver
The adapter is not available for years now and Amontec is not even a
company anymore. The poor hardware availability and the lack of users
prevents testing, maintenance and adaptations to future changes.

Mark the adapter as deprecated as a first step to give potential users
the opportunity to upgrade the hardware until the next OpenOCD release.

Change-Id: Idd9fb75588246bc39e12ea17a71435ed77f0f50b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8349
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-06-13 16:26:38 +00:00
Antonio Borneo
4732e40637 configure: hide build issue of amt_jtagaccel driver by disabling it
With commit d8a2f6dbcf ("configure.ac: show the Amontec
JTAG-Accelerator driver in the config summary") the driver
amt_jtagaccel is now build by default on Linux.
This highlights the dependency of some include files, dependency
that is not properly managed and that can cause build failure.

The driver is queued to be dropped soon, so there is no real
interest to fix the dependencies.

Change the default so the driver is not built if the user does not
require it at configure time.

Change-Id: Ifb74e2c802abda290efbf59ca4ce02048c94e6f8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8939
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
2025-06-07 10:23:57 +00:00
Antonio Borneo
1347b693a5 configure: fix for missing include files on Linux
By merging [1] and [2], the drivers 'xlnx-pcie-xvc' and 'linuxspidev'
are now build by default on Linux.
This highlights the dependency of some include files under subfolder
'linux' that are not installed by default in all Linux boxes.

Add the check in 'configure' for the presence of the include file
and conditionally enable the build of the driver.

Change-Id: Ie88645c3455ab07622f069a0cc7bf09d1a5a2c75
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] 7214c8be46 ("configure: show adapter Xilinx XVC/PCIe in the configuration summary")
Link: [2] 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8935
Tested-by: jenkins
2025-06-07 10:22:53 +00:00
Evgeniy Naydanov
1b2a2b8185 testing/tcl_commands: test target create, cget, configure
Introduce basic testing of error-handling in target configuration
related commands.

The tests can be run via `make check` when JTAG `dummy` adapter is
enabled.

Change-Id: Id0f382046dd70007d8e696d82d2396a7ccab7a33
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8644
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-05-09 12:12:56 +00:00
R. Diez
fdd76c899f configure.ac: show the sysfsgpio adapter in the config summary
Also enable this adapter by default (auto).

Change-Id: I43b9f1a1873b381d015114da57efc1d78e6e7780
Signed-off-by: R. Diez <rdiez-2006@rd10.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8834
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-05-01 15:32:35 +00:00
R. Diez
d8a2f6dbcf configure.ac: show the Amontec JTAG-Accelerator driver in the config summary
Also enable this driver by default (auto).

Change-Id: I7f592dd697c6ee150a81e151ff2333447cd9130d
Signed-off-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8835
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-05-01 15:32:20 +00:00
R. Diez
e45d66fd9a configure.ac: show the rshim adapter in the config summary
Also enable this adapter by default (auto).

Change-Id: Ic302041ecb9e88ca58b03f9675fa92fb3d558821
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8811
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-04-05 06:24:47 +00:00
R. Diez
9eb2426411 configure.ac: show the Remote Bitbang driver in the config summary
Also enable this driver by default (auto).

Change-Id: I112d6c8c0796d0dc464651feb1f7f81fa8b93910
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8817
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-04-05 06:24:26 +00:00
R. Diez
fdd0c2b1d3 configure.ac: show the JTAG DPI and VPI adapters in the config summary
Also enable these adapters by default (auto).

Change-Id: Icbbcd470eaf1d1bfb33900885776c1dbd0cccb5f
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8758
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-03-15 10:18:41 +00:00
Tomas Vanek
a168c63412 configure: better differentiate CMSIS-DAP versions
and keep them together in the configuration summary.

Change-Id: I5937393590ac72f1d499457e67763686a79cadee
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8765
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-03-01 15:15:53 +00:00
R. Diez
5e4ad24ba6 configure.ac: show vdebug in the config summary
Also enable this adapter by default (auto).

Change-Id: Id011168b93c4cdc602ab78eabfb9a64ca8d8a7df
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>

Reviewed-on: https://review.openocd.org/c/openocd/+/8601
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2025-02-16 16:28:34 +00:00
Marc Schink
77c904fd13 Deprecate jimtcl Git submodule
jimtcl was integrated as Git submodule for convenience and probably also
because packages were not widely available at the time. Today, jimtcl is
available in many popular package repositories [1] and the integration
as Git submodule adds unnecessary complexity to the OpenOCD build
process. For details, see the discussion on the mailing list in [2].

Disable the jimtcl Git submodule by default and announce it as
deprecated feature that will be removed in the next release. This gives
package maintainers time to adapt to the change and, if necessary,
build a package for jimtcl.

[1] https://repology.org/project/jimtcl/versions
[2] https://sourceforge.net/p/openocd/mailman/message/58786630/

Change-Id: I07930ac07f7d7a6317c08b21dc118f4f128b331c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8380
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-01-25 16:16:26 +00:00
Antonio Borneo
8038e2f754 configure: allow --enable-malloc-logging only with glibc
The feature for 'malloc-logging' uses functionalities that are
available only in GNU libc.

Detect in 'configure' if OpenOCD is being compiled with glibc.
Set the macro '_DEBUG_FREE_SPACE_' only in case of glibc.

Change-Id: I43e9b87c7ad47171cfe3e7c1e5f96f11e19f98d0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8592
Tested-by: jenkins
2025-01-25 10:36:28 +00:00
Antonio Borneo
ac18b8cd6a configure: make more robust the check for elf 64
The check if 'elf.h' defines the type 'Elf64_Ehdr' is currently
done through 'grep' on the file. While there is no false positive,
so far, such test could incorrectly find the text inside a comment
or in a block guarded by #if/#endif.

Use the autoconf macro AC_CHECK_TYPE() to detect if the type is
properly declared.

Change-Id: Ibb74db3d90ac6d1589b9dc1e5a7ae59e47945e78
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8591
Tested-by: jenkins
2025-01-25 10:36:11 +00:00
Richard Pasek
83e0293f7b Add Linux SPI device SWD adapter support
To alleviate the need to bitbang SWD, I've written a SWD SPI
implementation. This code is inspired by the work of luppy@appkaki.com
as shown at github.com/lupyuen/openocd-spi but with the desire to be
more generic. This implementation makes use of the more common 4 wire
SPI port using full duplex transfers to be able to capture the SWD ACK
bits when a SWD TX operation is in progress.

TEST:
  Connects successfully with the following combinations:
  Hosts:
    Raspberry Pi 4B
    Unnamed Qualcomm SoC with QUPv3 based SPI port
  Targets:
    Raspberry Pi 2040
    Nordic nRF52840
    NXP RT500

Change-Id: Ic2f38a1806085d527e6f999a3d15aea6f32d1019
Signed-off-by: Richard Pasek <rpasek@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8645
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-01-22 15:21:10 +00:00
Antonio Borneo
5233312ea5 configure: fix dependency of bitbang from dummy adapter
The commit bb2fc63357 ("configure.ac: enable the Dummy adapter
by default") breaks the building dependency between bitbang code
and dummy adapter.

Fix it.

Change-Id: I47587ef61d6b57b2547f6c2600d8404cad87f584
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Jonathan Forrest <jonyscathe@gmail.com>
Fixes: bb2fc63357 ("configure.ac: enable the Dummy adapter by default")
BugLink: https://sourceforge.net/p/openocd/tickets/446/
Reviewed-on: https://review.openocd.org/c/openocd/+/8682
Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
Tested-by: jenkins
Reviewed-by: Andy <andrewjohnshelley@gmail.com>
2025-01-02 14:15:02 +00:00
R. Diez
7f9d25d58a configure.ac: switch from $host to $host_os
Suggested during review https://review.openocd.org/c/openocd/+/8533
Only the OS part was being checked anyway.
The aim is to facilitate merging all $host_os checks in the future.

Change-Id: Idce1d5872cf19ef423429fa0c3b2ff7ee3945332
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8607
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:54:54 +00:00
R. Diez
bb2fc63357 configure.ac: enable the Dummy adapter by default
The Dummy adapter is useful when developing generic JimTcl code.
Besides, the distributed BUGS file states that you should
try to reproduce any crashes with the Dummy adapter, so
it does not make sense that it is not enabled by default.

Change-Id: I145de06de4d2c0011619b1b941200b63e200db23
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8608
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2024-12-22 09:54:35 +00:00
R. Diez
11f24fc2f2 configure.ac: improve validation of some --enable-xxx options
Catch an invalid option like "--enable-buspirate=rubbish".
Also mention all valid values in the help text for those options.

Change-Id: Ib0fb8904132d07cc5cde421aa816ca6971a08769
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8540
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-11-23 13:51:20 +00:00
R. Diez
2627f8ce6d configure.ac: show the linuxgpiod adapter in the configuration summary
List AC_ARG_ADAPTERS was missing a comma separating two of the elements.

Also verify that each adapter is set to either 'auto', 'yes' or 'no',
which should prevent such issues from going unnoticed in the future.

Change-Id: I0d407e03b1e5a3edc61d7dc93d5ffa70fe079b3c
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8534
Tested-by: jenkins
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:50:34 +00:00
R. Diez
9ff79fd61f enable the Bus Pirate adapter by default on most systems
Also convert the Bus Pirate to the common PROCESS_ADAPTERS logic.

Change-Id: Ifa8ebcee380c16d7e308ba7a75dbffdb74208285
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8533
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
2024-11-23 13:49:42 +00:00
Jan Matyas
d4a64e3f38 autoconf: Add support for code coverage
Add support for code coverage collection. This helps
developers to check if their test scenarios really exercised
all the OpenOCD functionality that they intended to test.

- Option --enable-gcov has been added to configure.ac
  which enables the coverage collection using Gcov. (Disabled
  by default.)

- The steps to collect and inspect the coverage have been
  described in HACKING file.

Change-Id: I259e401937a255e7ad7f155359a0b7787e4d0752
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8521
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-16 14:18:57 +00:00
R. Diez
7214c8be46 configure: show adapter Xilinx XVC/PCIe in the configuration summary
Adapter Xilinx XVC/PCIe was not appearing in the configuration summary
because of the wrong variable name: build_xlnx_pcie_xvc
instead of enable_xlnx_pcie_xvc.

Also build this adapter automatically on Linux.

Change-Id: I69ea92f550052b9ce55ce32597ac446a15a87388
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8312
Tested-by: jenkins
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-02 20:59:15 +00:00
Antonio Borneo
116e9553d1 openocd: build: allow more socket connections on Windows
Cross compiling OpenOCD for Windows forces the maximum number of
open files (including sockets) to 64. See in include file
psdk_inc/_fd_types.h:
	#ifndef FD_SETSIZE
	#define FD_SETSIZE 64
	#endif

This limit is far lower than the default value 1024 used by Linux.

In pull request #644 [1] in risc-v fork it's reported that:
- each socket server of OpenOCD (GDB, telnet, ...) uses one FD;
- each active connection to a socket server uses another FD;
- multi-core devices with 32 or more cores, each having a GDB
  connection, already saturates the 64 available FD at the 26th
  GDB connection.

The patch [2] proposed and merged in risc-v fork adds the compile
flag
	-DFD_SETSIZE=128
to all the host types. While this looks fine for Windows, it
reduces the default value for Linux and other OS.

Add the compile flag FD_SETSIZE only to cross compile for Windows.

Link: [1] https://github.com/riscv-collab/riscv-openocd/pull/644
Link: [2] https://github.com/riscv-collab/riscv-openocd/pull/644/commits/1bab4cfbc4f4
Change-Id: Ie43a792ac11a5e63e0407b68e3f270efea0c87be
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8503
Tested-by: jenkins
2024-10-05 15:51:58 +00:00
Marc Schink
a8a0b4c507 configure: Use pkg-config for jimtcl
The jimtcl project supports pkg-config, use it for a simpler
configuration of compiler and linker flags and to enforce the minimum
required package version.

Since the jimtcl pkg-config file is not available on all systems, use
AC_CHECK_HEADER() as fallback.

Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8383
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 15:59:07 +00:00
R. Diez
1fba7d53bb configure.ac: show the dummy adapter in the configuration summary
The dummy adapter now uses the same config logic as most adapters.
Its name has changed from "dummy port driver" to "Dummy Adapter".

Change-Id: Ic9ee617aab1f54215835d4d8db03f6637b797082
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7340
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-05-26 09:58:47 +00:00
Antonio Borneo
e035756b22 jtag: linuxgpiod: fix detection for line request bias
Commit 290eac04b9 ("drivers/linuxgpiod: Migrate to adapter gpio
commands") introduced an incorrect check to determine if the
library libgpiod declares the line request flags:
	GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE
	GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP
	GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN
The names above are declared by the library inside an enum, thus
cannot be used by the C preprocessor in a #ifdef.

Determine in configure if the version of libgpiod provides the
line request flags for "bias" and define a C macro.
Use the new macro in the driver code.

Change-Id: Iaa452230f4753fce4c6e9daa254299cedb7cab7f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 290eac04b9 ("drivers/linuxgpiod: Migrate to adapter gpio commands")
Reviewed-on: https://review.openocd.org/c/openocd/+/8186
Tested-by: jenkins
Reviewed-by: Michael Heimpold <michaheimpold@gmail.com>
2024-04-07 19:35:41 +00:00
Antonio Borneo
74e7fcb2dd configure: prevent build of linuxgpiod with libgpiod v2
The API in libgpiod v2 have changed, and current driver code for
linuxgpiod does not build anymore.

Prevent building the current driver linuxgpiod with the new
library.

Change-Id: Ie673db786dc50ae18a263d2c0a2b46b106866450
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8185
Reviewed-by: Michael Heimpold <michaheimpold@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-04-07 19:35:02 +00:00
Manuel Wick
0f70c6c325 remote_bitbang: Add SWD support
This adds new command characters to make SWD work with the new split
jtag and swd operations of bitbang.

The command characters are as follows:
    O - SWDIO drive 1
    o - SWDIO drive 0
    c - SWDIO read request
    d - SWD write 0 0
    e - SWD write 0 1
    f - SWD write 1 0
    g - SWD write 1 1

Documentation has been updated accordingly. The new commands will be
used by an adapted version of the jtag-openocd applet of the "Glasgow
Debug Tool" (https://github.com/glasgowEmbedded/Glasgow). It has been
tested against an stm32f103 and an at91samd21 target.

contrib/remote/bitbang/remote_bitbang_sysfsgpio.c has also been adapted
to support SWD via the new command set. Some limited testing has been
done using a Raspberry Pi 2 with an stm32f103 and an at91samd21 target
attached.

Change-Id: I8e998a2cb36905142cb16e534483094cd99e8fa7
Signed-off-by: Manuel Wick <manuel@matronix.de>
Signed-off-by: David Ryskalczyk <david.rysk@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6044
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-12-03 06:22:54 +00:00
Nishanth Menon
29a57545f6 jtag/drivers: Add dmem driver
Direct memory driver support for CoreSight Access Port(AP).

Even though we emulate SWD (serial wire debug), we aren't actually
using swd. Instead, we are using a direct memory access to get to the
register set. This is similar in approach to other fast access native
drivers such as am335xgpio drivers.

Example operation on Texas Instrument's AM62x K3 SoC:

+-----------+
|  OpenOCD  |   SoC mem map
|    on     |--------------+
| Cortex-A53|              |
+-----------+              |
                           |
+-----------+        +-----v-----+
|Cortex-M4F |<───────|           |
+-----------+        |           |
                     |  DebugSS  |
+-----------+        |           |
|Cortex-M4F |<───────|           |
+-----------+        +-----------+

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jason Peck <jpeck@ti.com>
Change-Id: I8470cb15348863dd844b2c0e3f63a9063cb032c6
Reviewed-on: https://review.openocd.org/c/openocd/+/7088
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-08-26 11:42:28 +00:00
Ahmed BOUDJELIDA
94686eea6e jtag/drivers: Add new driver for ANGIE USB-JTAG Adapter
This is the driver code for NanoXplore's ANGIE USB-JTAG Adapter.
The driver is based on the openULINK project.

This driver communicate with ANGIE's firmware in order to establish
JTAG protocol to debug the target chip.

Since the ANGIE Adapter has a Spartan-6 FPGA in addition to the
FX2 microcontroller, the driver adds two functions, one to download
the firmware (embedded C) to the FX2, and the second to program
the FPGA with its bitstream.

Add ANGIE's configuration file to tcl/interface/
Add the device VID/PID to 60-openocd.rules file.
Add ANGIE to OpenOCD's documentation

Change-Id: Id17111c74073da01450d43d466e11b0cc086691f
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7702
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2023-08-12 16:44:17 +00:00